// JavaScript Document
function $(id){
   return document.getElementById(id);
}
function getTagName(id,name){
   return $(id).getElementsByTagName(name);
}
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 openlist(id1,id2,name){
   for(t=0;t<getTagName(id1,name).length;t++){
     getTagName(id1,name)[t].className="hid";
   }
	if($(id2).className=="hid"){
	   $(id2).className="show";
	}else{
	   $(id2).className="hid";
	}
}

function checkmyform(e){
	var wd=e.wd.value.replace(/^\s*/,"");
	if(wd==""){
	   alert("请输入搜索关键词！");
		e.wd.focus();
		return false;
	}else{
	    var lx;
	    try{
		  lx=e.lx.value;
		}catch(o){
		  lx=0;
		}
		var Url="/s/" + escape(wd) + "-" + e.bid.value + "-" + lx + "-0-1/";
		window.location.href=Url;
	    return false;
	}
}

function imageplayer(swfname,focus_width,focus_height,text_height,sww_height,pics,links,texts){
  document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ sww_height +'">');
  document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="'+ swfname +'"><param name="quality" value="high"><param name="bgcolor" value="white">');
  document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
  document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
  document.write('<embed src="'+ swfname +'" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="white" quality="high" width="'+ focus_width +'" height="'+ sww_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" plugiMSpage="http://www.macromedia.com/go/getflashplayer" />');
  document.write('</object>');//-->
}
function CheckImageSize(Article_Content_ID) {
	var MAX_Width = 580;	//最大图片宽度	
	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";
		}
	}
}