
//updated 25/08/05 - now shows noframe info


function replace_brackets(str){
	rep1=/</gi;
	replaceIt=str.replace(rep1, "&lt;");
	rep2=/>/gi;
	replaceIt=replaceIt.replace(rep2, "&gt;");
	return replaceIt;	
	
	}
	
	function get_noframes (){
	var tagnf=document.getElementsByTagName('noframes');nf=0;
	 
	 if (tagnf.length==false) {
	 noframe=frame1;
	  return noframe;
	 }
	 
	 else {
	 for(nf=0;nf<tagnf.length;nf++){
	  noframe=tagnf[nf].outerHTML;
	  noframe=replace_brackets(noframe);
	  return noframe;
	 }
	}
	}
	

function getf(){ 
var zappa=0,fzappa=0,izappa=0,tagn=new Array('frame','iframe'),stuff='';noframe='';
if (typeof(testvar) == "undefined"){

 setTimeout ('getf()', 500);
}

else { try {
  
  
  stuff+='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xml:lang="'+doclang+'" lang="'+doclang+'" xmlns="http://www.w3.org/1999/xhtml"><head><title>'+frame2+'</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body  style="font:normal 1em arial;"><span style="font-size:.8em"><a href="javascript:window.close();">'+docp2+'</a></span></div><hr /><h1>'+frame3+'</h1><ul>';

//length of tag array
  for(nino=0;nino<tagn.length;nino++)
  { //for1
    
    
	tagf=document.getElementsByTagName(tagn[nino]);

for(ippo=0;ippo<tagf.length;ippo++){   //for2
     
	
          stuff+='<li><span style=\'color:black;font:small bold;font-family:arial;\'>'+tagf[ippo].tagName+'-'+(ippo+1)+'</li><ul>';
		  if (tagf[ippo].attributes.name.specified==true){
		  stuff+='<li>名稱="'+tagf[ippo].name+'"</li>'
		  }
		  else {
		  stuff+='<li>名稱 <strong>'+frame4+'</strong></li>'
		  }
if (tagf[ippo].tagName=='IFRAME'&&tagf[ippo].attributes.longDesc.specified==true){
stuff+='<li>長描述="<a href=\"'+tagf[ippo].longDesc+'\">'+tagf[ippo].longDesc+'"</a></li>'
}
if (tagf[ippo].tagName=='IFRAME'&&tagf[ippo].attributes.longDesc.specified!=true){
stuff+='<li>長描述 <strong>'+frame4+'</strong></li>'
}
        
		  if (tagf[ippo].title!=0){
		  
		 var pooter= ((tagf[ippo].attributes.title.value!='')?tagf[ippo].title:'<strong style=\"color:red\">'+frame5+'</strong>');
		  
		  stuff+='<li>標題="'+pooter+'"</li>'
		  
		  }
		  else {
		  stuff+='<li>標題 <strong style=\"color:red\">'+frame4+'</strong></li>'
		  }
		 stuff+= '<li>來源="<a href=\"'+tagf[ippo].contentWindow.location+'\">'+tagf[ippo].contentWindow.location+'</a>"</span></li></ul></li>';


          zappa=zappa+1;
		  
		//alert(zappa);
		} //for2
    
	
	
	}
       
	  
	

 

	if(zappa==0)
{
 alert(frame6);
 }
else
{
    stuff+='</ul>';
	


	
    var lw=window.open('','lw','location=yes,menubar=yes,scrollbars=yes,status=1,resizable=1,left=20,top=20');
	
	try{
		lw.document.open();}
		catch(e) {
		if (lw){
		alert(errortxt5);
lw.close();
return;
		}
		else{
		alert(errortxt1);
return;
}
} 


	
get_noframes ();
noframe='<hr /><h2>NOFRAME</h2><p>有個 NOFRAMES 組件, 如果你想檢視此 NOFRAME 組件的內容, 請在 Opera 選項中選擇 顯示偏好 來停用頁框. 你可能需要再重新載入頁面來使此設定生效.</p>';  

//alert(noframe);

lw.document.write(stuff);
lw.document.write(noframe);
lw.document.write('</body></html>');
lw.document.title=frame7 +lw.opener.location;
lw.document.close();
 } } 
 catch(e){alert(errortxt5+"\n "+e.description)}
 
} 
}  
//} //f
getf();

