function opencat(cat)
{
	if(cat.style.display=="none"){
		cat.style.display="";
	} else {
		cat.style.display="none"; 
	}
}
function ajax(url)
	{
		var xml=new ActiveXObject("Microsoft.XmlHttp");
		xml.open("get",url,false);
		xml.send();
		return xml.responseText;
	}
function ajaxRequest(strUrl) 
	{ 
		var xmlHttp; 
		if(window.ActiveXObject){
			 xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		   }else if(window.XMLHttpRequest){
			 xmlHttp = new XMLHttpRequest();
		   }
		if(!xmlHttp){
			responsetext="...";
		}else{
			var responsetext ="" ; 
			xmlHttp.open("POST", strUrl, false); 
			xmlHttp.onreadystatechange=function(){
				responsetext=getXmlHttpState(xmlHttp)
			};
			xmlHttp.send(); 
		}
		return responsetext; 
	} 

function getXmlHttpState(theXmlHttp){
	   
	   var theState="";
	   if(theXmlHttp.readyState == 0){
		 theState = "正在初始化";
		 //alert(theXmlHttp.readyState);
	   }
	   if(theXmlHttp.readyState == 1){
		 theState = "正在准备发送请求";
		 //alert(theXmlHttp.readyState);
	   }
	   if(theXmlHttp.readyState == 2){
		 theState = "正在发送请求";
		 //alert(theXmlHttp.readyState);
	   }
	   if(theXmlHttp.readyState == 3){
		 theState = "正在接收数据";
		 //alert(theXmlHttp.readyState);
	   }
	   if(theXmlHttp.readyState == 4){
			//alert(theXmlHttp.readyState);
			if(theXmlHttp.status==200){
				theState=theXmlHttp.ResponseText;
			}else{
				theState="页面不存在";
				theState=theXmlHttp.ResponseText;
			}
	   }
	   //alert(theXmlHttp.readyState);
	   return theState;
} 

function iframeAutoFit()
   {
      try
      {
         if(window!=parent)
         {
          var a = parent.document.getElementsByTagName("IFRAME");
            for(var i=0; i<a.length; i++) //author:meizz
            {
               if(a[i].contentWindow==window)
               {
                   var h = document.body.scrollHeight;
                   if(document.all) {h += 4;}
                   if(window.opera) {h += 1;}
                   a[i].style.height = h;
               }
            }
         }
      }
      catch (ex)
      {
         alert("脚本无法跨域操作！");
      }
   }

function check_Input(theType,theForm,theName,theInfo,theNotice){
	
if(theType=="Input"){
		var Str=eval("document."+theForm+"."+theName).value;	
		if(Str==""){	
			document.getElementById(theInfo).innerHTML="<font color=#ff0000>"+theNotice+"</font>";
			eval("document."+theForm+"."+theName).focus();
			return false;
		}else{
			document.getElementById(theInfo).innerHTML="<font color=#99999>√</font>";
			return true;
		}
	}
else if(theType=="Email"){
		var Email=eval("document."+theForm+"."+theName).value;			
		var rm = /^[0-9a-zA-Z\-\.\_]+@[0-9a-zA-Z\-]+\.[0-9a-zA-Z\-\.]+$/;
		if(Email=="")
		{			
			document.getElementById(theInfo).innerHTML="<font color=#ff0000>邮箱不能为空！</font>";
			eval("document."+theForm+"."+theName).focus();
			return false;
		}
		else if(!Email.match(rm))
		{	
			document.getElementById(theInfo).innerHTML="<font color=#ff0000>邮箱格式有错！</font>";
			eval("document."+theForm+"."+theName).focus();
			return false;
		}else
			{
			document.getElementById(theInfo).innerHTML="<font color=#99999>√</font>";
			return true;
			}			
	}

}
function Password_check(theForm,thePassword,thePassword_2,thePassword_info,thePassword_2_info){	
	var UserPassword=eval("document."+theForm+"."+thePassword).value;	
	var UserPassword_2=eval("document."+theForm+"."+thePassword_2).value;
	if(UserPassword==""){				
		document.getElementById(thePassword_info).innerHTML="<font color=#ff0000>密码不能为空！</font>";
		eval("document."+theForm+"."+thePassword).focus();
		return false;
	}
	else if( UserPassword.length < 6){
		document.getElementById(thePassword_info).innerHTML="<font color=#ff0000>不能少于6位！</font>";
		eval("document."+theForm+"."+thePassword).focus();
		return false;
	}
	else{
		if (UserPassword_2 != UserPassword){
			document.getElementById(thePassword_2_info).innerHTML="<font color=#ff0000>两次输入密码不一致！</font>";
			document.getElementById(thePassword_info).innerHTML="<font color=#ff0000>两次输入密码不一致！</font>";
			eval("document."+theForm+"."+thePassword).focus();
			return false;
		}else{
			document.getElementById(thePassword_info).innerHTML="√";
			document.getElementById(thePassword_2_info).innerHTML="√";
			return true;
		}	
	}		
}

function initObj(){
   /*var msgw,msgh,bordercolor;
   msgw=400;//提示窗口的宽度
   msgh=100;//提示窗口的高度
   titleheight=25 //提示窗口标题高度
   bordercolor="#336699";//提示窗口的边框颜色
   titlecolor="#99CCFF";//提示窗口的标题颜色

   var sWidth,sHeight;
   //sWidth=document.body.offsetWidth-20;//浏览器工作区域内页面宽度
   //sHeight=screen.height-200;//屏幕高度（垂直分辨率）
   //sHeight=document.body.offsetHeight-5;//工作区高度

   //背景层（大小与窗口有效区域相同，即当弹出对话框时，背景显示为放射状透明灰色）
   var bgObj=document.createElement("div");//创建一个div对象（背景层）
   //定义div属性，即相当于
   //<div id="bgDiv" style="position:absolute; top:0; background-color:#777; filter:progid:DXImagesTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75); opacity:0.6; left:0; width:918px; height:768px; z-index:10000;"></div>
   bgObj.setAttribute('id','bgDiv');
   bgObj.style.position="absolute";
   bgObj.style.top="0";
   bgObj.style.background="#ffffff";
   bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=80,finishOpacity=75";
   bgObj.style.opacity="0.6";
   bgObj.style.left="0";
   bgObj.style.width="100%";
   bgObj.style.height=document.body.clientHeight;
   bgObj.style.zIndex = "5000";
   document.body.appendChild(bgObj);
   window.document.getElementById("bgDiv").style.display="none";*/
}
function addObj(){
	document.all("bgDiv").style.display="";
	}
function removeObj(){
	document.all("bgDiv").style.display="none";
}
function openBlockDiv(theUrl,theWidth,theHeight){
	if(window.document.getElementById("the_block_div").style.display=="none"){
		window.document.getElementById("the_block_div").style.display="";
		window.document.getElementById("theBlockDivframe").src=theUrl;
		if(theWidth!=""){
			window.document.getElementById("the_block_div_bg").style.width=theWidth;

		}
		if(theHeight!=""){
			window.document.getElementById("the_block_div_bg").style.height=theHeight;
		}
		addObj();
		//window.top.location="#top";
	} else {
		window.document.getElementById("the_block_div").style.display="none";
		removeObj();
	}
}
function closeBlockDiv(){
	window.document.getElementById("the_block_div").style.display="none";
	removeObj();
}
						