function doCheckAll(state) {
	var I_Obj = document.all['item'];
	
	if (I_Obj.length > 0) {
		for (i=0;i<I_Obj.length;i++) {
			I_Obj[i].checked=state;
		}
	} else {
		I_Obj.checked=state;
	}
}

function textblur(obj,Vstr)
	{
	if( obj.value == "" )
	{
		obj.style.color = "#999";
		obj.value = Vstr;
	}
	else if (obj.style.color = "#999")
	obj.style.color = "#000"; 
	}

function textfocus(obj,Vstr)
	{
	obj.style.color = "#000";
	if( obj.value == Vstr )     
		obj.value = "";
	}

function check_email(email) { 
	invalid = ""; 
	
	if ( (email.indexOf("@") == -1) || (email.indexOf(".") == -1) ) 
	invalid += "\n\nEmail地址不合法。应当包含'@'和'.'；例如('.com')。请检查后再递交。"; 
	
	if (email.indexOf("your email here") > -1) 
	invalid += "\n\nEmail地址不合法，请检测您的Email地址，在域名内应当包含'@'和'.'；例如('.com')。"; 
	
	if (email.indexOf("\\") > -1) 
	invalid += "\n\nEmail地址不合法，含有非法字符(\\)。"; 
	
	if (email.indexOf("/") > -1) 
	invalid += "\n\nEmail地址不合法，含有非法字符(/)。"; 
	
	if (email.indexOf("'") > -1) 
	invalid += "\n\nEmail地址不合法，含有非法字符(')。"; 
	
	if (email.indexOf("!") > -1) 
	invalid += "\n\nEmail地址不合法，含有非法字符(!)。"; 
	
	if ( (email.indexOf(",") > -1) || (email.indexOf(";") > -1) ) 
	invalid += "\n\n只输入一个Email地址，不要含有分号和逗号。"; 
	
	if (email.indexOf("?subject") > -1) 
	invalid += "\n\n不要加入'?subject=...'。"; 

	if (invalid == "") { 
		return true; 
	} else {
		alert(invalid);
		return false; 
	} 
} 

//
function Ltrim(str) {
        var pattern = new RegExp("^[\\s]+","gi");
        return str.replace(pattern,"");
}
function Rtrim(str) {
        var pattern = new RegExp("[\\s]+$","gi");
        return str.replace(pattern,"");
}
function Trim(str) {
        return Rtrim(Ltrim(str));
}

function gotokxfz(cid)
	{window.location.href="kxfz.asp?cid="+cid;}

function gotosrhurl(fid,cid)
	{window.location.href="kxfz.asp?cid="+cid+"&fid="+fid;}
	

function gotourl(turl)
	{window.location.href=turl;}

function colload(cname)
{
if (window.document.all!=null)
	{
	window.document.all("spancolname").innerHTML=cname;
	
	}
}

	
function spanwebheight()
	{
	if(ifrmain.document.body.scrollHeight<450)
		{spanweb.style.height=450;}
	else
		{spanweb.style.height=ifrmain.document.body.scrollHeight+20;}
	}

function spanwebheightad()
	{
	if(ifFRM.document.body.scrollHeight<450)
		{spanweb.style.height=450;}
	else
		{spanweb.style.height=ifFRM.document.body.scrollHeight+20;}
	}
	
function pop(url){
        x=828;
        y=540;
        l=(screen.width/2)-(x/2);
        t=(screen.height/2)-(y/2);        s="scrollbars=yes,toolbar=no,location=no,status=no,menubar=no,resizable=yes";
s+=" width=" + x + ", height=" + y + ", left=" + l + ", top=" + t;
        MRV=window.open(url,"",s);
}

function pop600(url){
        x=620;
        y=520;
        l=(screen.width/2)-(x/2);
        t=(screen.height/2)-(y/2);        s="scrollbars=yes,toolbar=no,location=no,status=no,menubar=no,resizable=yes";
s+=" width=" + x + ", height=" + y + ", left=" + l + ", top=" + t;
        MRV=window.open(url,"",s);
}

function openpicwin(url) { 
	window.open (url, "Link file", "height=450, width=580,left=240,top=200, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,fullscreen=no, location=no, status=yes") 
	}
	
function frmSur_sub(loadpos)
{	
	if (loadpos != '')
	{
		newWindow = window.open(loadpos,"surveywin","toolbar,resizable,scrollbars,dependent,width=410,height=290,left=50,top=50");
		newWindow.focus();
	}
	else 
	{
		newWindow = window.open(loadpos,"surveywin","toolbar,resizable,scrollbars,dependent,width=410,height=290,left=50,top=50");
		newWindow.focus();
		document.frmSur.submit();
	}
	return false;
}

function frmsrhsub()
	{
	if(Trim(document.frmsrh.srhkey.value)=="" || document.frmsrh.srhkey.value == null || Trim(document.frmsrh.srhkey.value)=="请输入搜索关键字")
		{
		alert("请输入搜索关键字!");
		document.frmsrh.srhkey.focus();
		return false;
		}
	else
		{
		frmsrh.target="_blank";
		frmsrh.submit();
		}
	}

function fun_div(s)
	{
	
	var arr1=new Array();
	for(i=0;i<15;i++)
		{arr1[i]="divmenu"+(i+1);}
	
	for (i=0;i<15;i++)
		{ 
		if(arr1[i]==s)
			{MM_showHideLayers(s,'','show');}
		else 
			{
			MM_showHideLayers(arr1[i],'','hide');}
		}
	}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

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_showHideLayers() { //v6.0
 var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
   if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v;    
     }
}
