// 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 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 createxmlHttprequest(){
	var xmlhttp;
	if(window.XMLHttpRequest){//Mozilla
		xmlhttp=new XMLHttpRequest();
	}else{
	    if(window.ActiveXObject){//IE 浏览器
	       try{
			     xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
	       }catch (e){
		        try{
					   xmlhttp=new ActiveXObject("Micrsost.XMLHTTP");
				}catch(e){
					   alert("您的浏览器不支持Ajax！");
						return false;
				}
	       }
		}
    }
	return xmlhttp;
}

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,Img_width) {
	if(Img_width==""){Img_width=730;}
	var MAX_Width = parseInt(Img_width);	//最大图片宽度	
	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";
		}
	}
}
