/* 仿PHP trim 函数 */
function trim(string) {
	if (string==null) return "";
	if (typeof(string)=='object'&&(''+string=='null'||''+string=='undefined')) return '';
	if (typeof(string)!="string") string=""+string;
	return string.replace(/^\s+|\s+$/g,"");
}
/* 搜索检查 */
function jCheckSearcher(theform, language) {
    var _msg;
    if (language=="chinese")
        _msg="提示：请输入搜索关键字后再进行查询。";
    else if (language=="en")
        _msg="Tips: you must input the keyword field.";
    else
        return false;
	if (!trim(theform.swhere.value)) {
		alert(_msg);
		theform.swhere.focus();
		return false;
	}
	if (!trim(theform.keywords.value)) {
		alert(_msg);
		theform.keywords.focus();
		return false;
	}
}
/* 弹出窗口 */
function jOpenWindow(url, oWidth, oHeight, oResizable) {
	if (!oWidth)
		oWidth = 550;
	else
		oWidth= oWidth + 38;
	if (!oHeight)
		oHeight = 420;
	if (!oResizable)
		oResizable = "no";
	window.open(url, 'opWindow', 'width='+oWidth+', height='+oHeight+', resizable='+oResizable+', scrollbars=yes, top=0');
}

/* 鼠标经过图片JS */
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function InsteadPic_Menu(Pid,Purl) {
	Pid.src=Purl;
}
function Turnit(ss) {
	if (document.all(ss).style.display=="none") 
		document.all(ss).style.display="block";
	else
		document.all(ss).style.display="none";
}

function showDiv(ss) {
	if (ss=="newsDiv") 
	{
		document.all("newsDiv").style.display="block";
		document.all("stockDiv").style.display="none";
		document.all("newsBg").background="images/home_news_title_bg_1a.gif";
		document.all("stockBg").background="images/home_news_title_bg_2b.gif";

	}
	else
	{
		document.all("newsDiv").style.display="none";
		document.all("stockDiv").style.display="block";
		document.all("newsBg").background="images/home_news_title_bg_2b.gif";
		document.all("stockBg").background="images/home_news_title_bg_1a.gif";

	}
}


/* 页面装载程序 */
document.writeln("<script language=\"VBScript\">");
document.writeln("Dim mtlBar, mtlLine, mtlSP");
document.writeln("mtlBar = 0");
document.writeln("mtlLine = \"*\"");
document.writeln("mtlSP = 100");
document.writeln("Function Window_onLoad()");
document.writeln("mtlBar = 95");
document.writeln("mtlSP = 10");
document.writeln("End Function");
document.writeln("Function Count()");
document.writeln("If mtlBar < 100 Then");
document.writeln("mtlBar = mtlBar + 1");
document.writeln("Window.Status = \"Start loading: \" & mtlBar & \"%\" & \" \" & String(mtlBar, mtlLine)");
document.writeln("setTimeout \"Count()\", mtlSP");
document.writeln("Else");
document.writeln("Window.Status = \"\"");  // document.writeln("Window.Status = \"页面载入状态：完成！\"");
document.writeln("Document.Body.Style.Display = \"\"");
document.writeln("End If");
document.writeln("End Function");
document.writeln("Call Count()");
document.writeln("<\/script>");
document.writeln("")


window.onload=flashstyle;
function flashstyle() {
	var obj=document.body.getElementsByTagName("input");
	for (var i=0;i<obj.length;i++) {
		switch (obj[i].type) {
			case "text" :
			case "password" :
			case "file" :
				//obj[i].style.backgroundColor="#1A8DD8";
				obj[i].style.border="solid 1px #6699CC";
				obj[i].style.padding="1px 2px 1px 2px";
				obj[i].onmouseover=function(){this.style.borderColor="#00CCFF";}
				obj[i].onmouseout=function(){this.style.borderColor="#6699CC";}
				obj[i].onfocus=function(){this.style.borderColor="#2DD411";}
			break;
			case "submit" :
			case "reset" :
			case "button" :
				obj[i].style.cursor="pointer";
				obj[i].style.fontWeight="bold";
				obj[i].style.padding="2px";
				//obj[i].style.letterSpacing="2em";
				obj[i].style.backgroundColor="#1A58A4";
				obj[i].style.color="#FFFFFF";
				obj[i].style.border="solid 1px #FFF";
				obj[i].onmouseover=function(){this.style.borderColor="#F5FE04";}
				obj[i].onmouseout=function(){this.style.borderColor="#FFF";}
				obj[i].style.filter="progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#1A83E0,EndColorStr=#2599FF)";
			break;
			case "checkbox" :
			case "radio" :
				obj[i].onfocus=function(){this.blur()}
			break;
		}
	}

	var obj=document.body.getElementsByTagName("textarea");
	for (var i=0;i<obj.length;i++)
	{
		obj[i].style.border="solid 1px #6699CC";
		obj[i].style.padding="1px 2px 1px 2px";
		obj[i].onmouseover=function(){this.style.borderColor="#00CCFF";}
		obj[i].onmouseout=function(){this.style.borderColor="#6699CC";}
		obj[i].onfocus=function(){this.style.borderColor="#2DD411";}
	}
}


/* 弹出窗口显示图片 */
function jShowPhoto(photo_url) {
	if (!photo_url)
		photo_url = "no";
	url = "show_photo.php#" + photo_url;
	window.open(url, 'viewpic', 'width=600, height=400, resizable=no, scrollbars=no, top=0');
}


/* -------------------------------------------------------------------------------------------------- */

/*** Include Functions ***/


/* 页面顶部 */
function jT() {
	reval  = "";
	reval += "<table width=\"1004\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
	reval += "  <tr>";
	reval += "    <td height=\"4\" bgcolor=\"#193642\"></td>";
	reval += "  </tr>";
	reval += "  <tr>";
	reval += "    <td><table width=\"100%\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
	reval += "      <tr>";
	reval += "        <td width=40></td><td height=\"70\"><a href=\"../index.asp\">";
	reval += "        <object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=170 height=57>";
	reval += "          <param name=movie value=flash/logo.swf>";
	reval += "          <param name=quality value=high>";
	reval += "          <embed src=flash/logo.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=170 height=57></embed>";
	reval += "        </object>";
	reval += "        </a></td>";
	reval += "        <td width=\"250\"><table width=\"80%\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"topLinks\">";
	reval += "          <tr align=\"left\">";
	reval += "            <td><img src=\"images/arrow1.gif\" align=\"absmiddle\" /> <a href=\"../index.asp\">会员登陆</a></td>";
	reval += "            <td><img src=\"images/arrow1.gif\" align=\"absmiddle\" /> <a href=\"link.asp\">网站地图</a></td>";
	reval += "            <td><img src=\"images/arrow1.gif\" align=\"absmiddle\" /> <A href=\"index.asp\" name=\"StranLink\" class=\"btcss\">繁体版</A></a> </td>";
	reval += "          </tr>";
	reval += "        </table></td>";
	reval += "      </tr>";
	reval += "    </table></td>";
	reval += "  </tr>";
	reval += "</table>";

    document.write(reval);
}


