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 SetFlash(sectiontype,oDN,tDN ){
document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" WIDTH='+oDN+' HEIGHT='+tDN+' align="center" id="Company">');
document.write('<PARAM NAME=movie VALUE='+sectiontype+'>');
document.write('<param name=wmode value=transparent>');
document.write('<PARAM NAME=quality VALUE=high>');
document.write('<PARAM NAME=allowScriptAccess VALUE=sameDomain>');
document.write('<EMBED src='+sectiontype+' quality=high bgcolor=#FFFFFF WIDTH='+oDN+' HEIGHT='+tDN+' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
document.write('</EMBED>');
document.write('</OBJECT>');
}

function PageShow(cp,pages,pNum,cNum,kw){
//公共分页部分cp页次，pages总页数,pNum每页条数,cNum总条数,kw关健字
var currentpage=cp;
var Pcount=pages;
currentpage=Math.floor(currentpage);
Pcount=Math.floor(Pcount);
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 CheckEmpty(Field, FieldTitle)
{
	if (Field.value == "")
	{
		alert("请在\"" + FieldTitle + "\"一栏中输入内容.");
		Field.focus();
		return false;
	}
		
	return true;
}
	
function CheckInteger(Field, FieldTitle)
{
	if (Field.value != "")
	{
		for (i = 0; i < Field.value.length; i++)
		{
			ch = Field.value.charAt(i);
				
			if (ch < '0' || ch > '9') {
				alert("\"" + FieldTitle + "\"中只能输入数字.");
				Field.focus();
				return	false;
			}
		}
	}
	
	return true;
}

function openScript(url, width, height){
	var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=no' );
}

function strlength(str)
{
	var l=str.length;
	var teststr="???";
	var t=l;
	if (teststr.length==3){
	for(i=0;i<l;i++){
			thischar=str.charCodeAt(i);	
			if(thischar>255){
			t=t+1;}
		}
	}
	return t;

}

function setUploadFrame(val,xmlid) {
var aa;
var domains="";
if(val==1){
	aa=document.s1.suffix;	
}else if(val==2){
	aa=document.s2.suffix;
}
for(var i=0;i<aa.length;i++) { 
		if(aa[i].checked){
			//alert(aa[i].value); 
			domains +=aa[i].value+",";
		}
}
//alert(domains);
	var frame;
	if(val==1){
	frame = "<iframe src='GetDomain.asp?DomainName="+document.s1.DomainName.value+"&suffix="+domains+"' frameborder='0' scrolling='no' "
			   +" id='DomSearch_iframe' name='DomSearch_iframe' allowTransparency='true' width='468' height='218'>"
			   +"	</iframe>";
	}else if(val==2){
	frame = "<iframe src='GetDomain.asp?DomainName="+document.s2.DomainName.value+"&suffix="+domains+"' frameborder='0' scrolling='no' "
			   +" id='DomSearch_iframe' name='DomSearch_iframe' allowTransparency='true' width='468' height='218'>"
			   +"	</iframe>";	
	}
	document.getElementById("DomSearch").innerHTML = frame;
	defaultStatus ='查询中。。。';
}

function IMicon(s,t){
		if(s!=""){
		switch (t) {
		   case "qq" :
		   		document.write( "<a target=blank href=tencent://message/?uin="+s+"&Site=网客中国&Menu=yes><img border=0 SRC=http://wpa.qq.com/pa?p=1:"+s+":4 alt=点击这里用QQ和我联系  height=16 ></a>");
				return
		   case "msn" :
		   		document.write( "<a href=msnim:chat?contact="+s+"><img src=/images/msn.gif border=0 alt=点击这里用MSN和我联系 /></a>" );
		   		return
		   case "skype" :
		   		document.write("<a href=skype:"+s+"?call onclick=\"return skypeCheck();\"><img src=/images/skype.gif style=\"border: none;\" alt=点击这里用Skype和我联系 /></a>");
		   		return
		}
		}
}
function showEmail(s,d,t){
	if(t==1){
		document.write("<a href='mailto:"+s+"@"+d+"' style='font:12 bold Arial,Verdana,tahoma;color:blue;'>"+s+"</a> ");
	}else{
		document.write("<a href='mailto:"+s+"@"+d+"' style='font:12 bold Arial,Verdana,tahoma;color:blue;'>"+s+"@"+d+"</a> ");
	}
}
function numbersonly(myfield, e, dec){
    var key;
    var keychar;
    if (window.event)
       key = window.event.keyCode;
    else if (e)
       key = e.which;
    else
       return true;
       keychar = String.fromCharCode(key);
        // control keys
    if ((key==null) || (key==0) || (key==8) ||(key==9) || (key==13) || (key==27) ) return true;
        // numbers
    else if ((("0123456789").indexOf(keychar) > -1))
       return true;
       // decimal point jump
     else if (dec && (keychar == "."))
     {
          myfield.form.elements[dec].focus();
          return false;
     }
    else return false;
}
function certIDonly(myfield, e, dec){
    var key;
    var keychar;
    if (window.event)
       key = window.event.keyCode;
    else if (e)
       key = e.which;
    else
       return true;
       keychar = String.fromCharCode(key);
        // control keys
    if ((key==null) || (key==0) || (key==8) ||(key==9) || (key==13) || (key==27) ) return true;
        // numbers
    else if ((("0123456789Xx").indexOf(keychar) > -1))
       return true;
       // decimal point jump
     else if (dec && (keychar == "."))
     {
          myfield.form.elements[dec].focus();
          return false;
     }
    else return false;
}

function trim(str)
	{
		str=str.toString();
		var i=0;
		var j=str.length-1;
		trimstr="";	
		for (i=0;i<=j;i++)
		{
			if(str.substr(i,1)!=" ")
			trimstr=trimstr+str.substr(i,1);
		}
		return trimstr;
}
function login_iBoxCheck() 
{
		var strURL,val,id
		id = "loginDivStr";
	   if(trim(login_iBox.userid.value) =="")
	   {
                alert ("请输入您的用户名称!");
				login_iBox.userid.value = "";
                login_iBox.userid.focus();
                return false;
        }
      
      if (trim(login_iBox.userpwd.value) == "") {
                alert ("请输入您的密码!");
                login_iBox.userpwd.focus();
                return false;
        }
      if (trim(login_iBox.regjm1.value) == "" || isNaN(login_iBox.regjm1.value)) {
                alert ("请输入验证码!");
				login_iBox.regjm1.value = "";
                login_iBox.regjm1.focus();
                return false;
        }
		strURL = "/member/UserLogon1.asp";
		val = "action=CheckLogin&userid="+login_iBox.userid.value+"&userpwd="+login_iBox.userpwd.value+"&comeurl=&regjm="+login_iBox.regjm.value+"&regjm1="+login_iBox.regjm1.value;
		postServer(strURL,val,id);
		setTimeout("LoginBox.Close();",5000);
}
function EnterKey(event){
    // if(event.keyCode==13){
		 //LoginBox.Show();
		 document.getElementById("LoginSendImg").click();
       // return false;
     //}
}