function SetFlash(sectiontype,oDN,tDN ){
	document.write('<span id="topnr">');
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"');
	document.write('WIDTH="'+oDN+'" HEIGHT="'+tDN+'" id="top" ALIGN="">');
	document.write('<PARAM NAME=movie VALUE="'+sectiontype+'">');
	document.write('<PARAM NAME=quality VALUE=high>');
	document.write('<PARAM NAME=wmode VALUE=transparent> ');
	document.write('<PARAM NAME=bgcolor VALUE=#CCCCCC>');
	document.write('<EMBED src="'+sectiontype+'" quality=high wmode=transparent bgcolor=#CCCCCC  WIDTH="'+oDN+'" HEIGHT="'+tDN+'" NAME="top" ALIGN=""TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
	document.write('</OBJECT>');
	document.write('</span>');
	//top1.innerHTML=topnr.innerHTML; 
	//topnr.innerHTML=""; 
}

function ResizeImage(F,D,G){
	if(F!=null){imageObject=F}
	var E=imageObject.readyState;
	if(E!="complete"){
	setTimeout("ResizeImage(null,"+D+","+G+")",50);
	return 
	}
	var B=new Image();B.src=imageObject.src;
	var A=B.width;
	var C=B.height;
	if(A>D||C>G){
		a=A/D;b=C/G;
		if(b>a){a=b}
		A=A/a;C=C/a
	}
	if(A>0&&C>0){imageObject.width=A;imageObject.height=C}
}

function PageShow(cp,pages,pNum,cNum,kw){
	//公共分页部分cp页次，pages总页数,pNum每页条数,cNum总条数,kw关健字
	var currentpage=cp;
	var Pcount=pages;
	currentpage=Math.floor(currentpage);
	document.write ('页次：<b>'+currentpage+'</b>/<b>'+Pcount+'</b>页 ');
	document.write ('每页<b>'+pNum+'</b> 共有<b>'+cNum+'</b>条 ');
	document.write ('分页：');
	var endpage;
	if (currentpage>4)
	{
		document.write ('<a href="?kw='+kw+'&page=1">[1]</a> ...');
	}
	if (Pcount>currentpage+3)
	{
		endpage=currentpage+3;
	}else{
		endpage=Pcount;
	}
	for (i=currentpage-3;i<endpage+1 ;i++ )
	{
		i=Math.floor(i);
		if (i>0)
		{
			if (i>currentpage || i<currentpage)
			{
				document.write (' <a href="?page='+i+'&kw='+kw+'">['+i+']</a>')
			}
			else{
				document.write (' <font color="#FF0000">['+i+']</font>');
			}
		}
	}
	if (currentpage+3 < Pcount)
	{
		document.write ('... <a href="?page='+Pcount+'&kw='+kw+'">['+Pcount+']</a>');
	}
	document.write ('</font>');
}

function fTrim(str){
 str=str.replace(/(^\s*)|(\s*$$)/g, "");
 return str;
}

var _search = function(){
	var kw = fTrim($("#kw").val()).replace(">","").replace("<","").replace("'","");
	if(kw!="" && kw.length>0 && kw!="请输入关健词"){
		document.skw.action = "search.php";
		$("#skw").submit();
	}else{
		$("#kw").select();
	}
}

function isEntry(e){
	if(e.keyCode==13) {
		_search();
	};
}
