function change(str){
   return document.getElementById(str);
	
}
function getTagName(id,name){
   return change(id).getElementsByTagName(name);
}
function over(num,id,args){
   for(i=1;i<=args;i++){
      if(i!=num){
           change(id+i).className="hid";
      }else {
           change(id+i).className="show";
      }
   }
}

function Nav_Over(tid,tnode,cid,cnode,num){
	o=getTagName(tid,tnode);
	e=getTagName(cid,cnode);
   for(i=0;i<=e.length-1;i++){	
	  if(i==num){
			e[i].className="show";	
			o[i].className="active";
	  }else{
			e[i].className="hid";
			o[i].className="";
	  }
   }
}

function PrintSWF(file,w,h) { 
   if(w=="") w="100%";
	if(h=="") h="100%";
	document.writeln("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=6,0,0,0\" name=\"16\" width=\""+ w +"\" height=\""+ h +"\" align=\"middle\" id=\"16\">");
	document.writeln("            <param name=\"allowScriptAccess\" value=\"sameDomain\" \/>");
	document.writeln("            <param name=\"allowFullScreen\" value=\"true\" \/>");
	document.writeln("            <param name=\"movie\" value=\""+ file +"\" \/>");
	document.writeln("            <param name=\"wmode\" value=\"transparent\" \/>");
	document.writeln("            <param name=\"quality\" value=\"high\" \/>");
	document.writeln("            <param name=\"bgcolor\" value=\"#ffffff\" \/>");
	document.writeln("            <embed src=\""+ file +"\" quality=\"high\" bgcolor=\"#ffffff\" width=\""+ w +"\" height=\""+ h +"\" name=\"16\" align=\"middle\" allowScriptAccess=\"sameDomain\" wmode=\"transparent\" allowFullScreen=\"false\" type=\"application\/x-shockwave-flash\" pluginspage=\"http:\/\/www.macromedia.com\/go\/getflashplayer\" \/>");
	document.writeln("         <\/object>");
}

function sub_form1(){
  var arr = document.myform1.P_id.value;
  window.location.href="/category/"+ arr + ".html";
}
function setSelect(id){
  obj=document.getElementById("P_id");
  for(i=0;i<=obj.length;i++){
    if(obj.options[i].value.split("|")[0]==id){
	  obj.options[i].selected=true;
	}
  }
}

function CheckImageSize(Article_Content_ID) {
	var MAX_Width = 610;	//最大图片宽度	
	var imgs = document.getElementById(Article_Content_ID).getElementsByTagName("img");
	for ( var i = 0,len = imgs.length;i<len;i++ ){
		if( parseInt(imgs[i].width,10) > MAX_Width ){
			var iw = parseInt(imgs[i].width,10) ;
			var ih = parseInt(imgs[i].height,10) ;
			imgs[i].style.width = MAX_Width +"px";
			imgs[i].style.height =  parseInt( ih * MAX_Width / iw ) + "px";
		}
	}
}

function GetDocumentHight(){
	var bodyHeight=document.documentElement.clientHeight-5;
	//if(bodyHeight>629){
	   document.writeln("<style>");
		document.writeln("#Container { height:"+ bodyHeight +"px; }");
		document.writeln("</style>");
	//}
}

function linkclick(pos){
  if(change(pos).style.display=='none'){
	  change(pos).style.display='block';
     change(pos).style.bottom=70;
  }else {
	  change(pos).style.display='none';
  }
  return false;
}

function drop_mouseout(pos){
	var posSel=change(pos).style.display;
	if(posSel=="block"){
		timer = setTimeout("drop_hide('"+pos+"')", 500);
	}
}
function drop_hide(pos){
	change(pos).style.display="none";
}
function drop_mouseover(pos){
	try{window.clearTimeout(timer);}catch(e){}
}
function search_show(pos,href,url){
    change(pos).style.display="none";
    change("listslected").innerHTML=href.innerHTML;
	 window.open(url);
	 try{window.clearTimeout(timer);}catch(e){}
	 return false;
}

function openlist(id1,id2,name){
   for(t=0;t<getTagName(id1,name).length;t++){
     getTagName(id1,name)[t].className="hid";
   }
	if(change(id2).className=="hid"){
	   change(id2).className="show";
	}else{
	   change(id2).className="hid";
	}
}
function getURL(url){
   if(url==""){
	   return "";
	}else{
	   url=url.replace("http://",""); //去http://
		n=url.indexOf("/");
		url=url.substring(0,n); //提取主机名
		return url
	}
}
