var old_bg="";
function inStyle(obj)
{
    old_bg=obj.style.background;
	if(!old_bg)old_bg=obj.getAttribute("bgcolor");
	obj.style.background="#F3F9FF";
}
function outStyle(obj)
{
    obj.style.background=old_bg;
}
function headInStyle(obj){
	old_bg=obj.style.background;
	if(!old_bg)old_bg=obj.getAttribute("bgcolor");
	obj.style.background="#C9DFFE";
	obj.style.border="1 solid #999999";
	obj.style.cursor = 'hand';
}
function headOutStyle(obj)
{
    obj.style.background=old_bg;
	obj.style.border="0";
	obj.style.cursor = 'hand';
}

function IconInStyle(obj){
	icon_old_bg=obj.style.background;
	if(!icon_old_bg)icon_old_bg=obj.getAttribute("bgcolor");
	//obj.style.background="#C9DFFE";
	obj.style.border="1 solid #999999";
}
function IconOutStyle(obj)
{
    //obj.style.background=old_bg;
	obj.style.border="0";
}

function selectAll(form,obj,targetName){
    for(i=0;i<form.length;i++){
	   if(form[i].name.indexOf(targetName)!=-1)  {
		   if(obj.checked) form[i].checked=true;
		   else form[i].checked=false;
	   } 
    }
}

function IfNumber(iV) //每次输入都要检查是否合法的数字
{
	var newPar=/^(-|\+)?\d+$/;
	aa=iV+String.fromCharCode(event.keyCode)+'0';
	event.returnValue =newPar.test(aa);
}

function CheckWhois(form){
   if(/^[0-9a-z\-]{2,30}$/.test(form.pre_domain.value)==false){
      alert('请正确输入您想注册的域名');
	  form.pre_domain.focus();
	  return false;
   }
}

function Trim(input){
   input = input.replace(/^ {1,}/g,"");
   input = input.replace(/ {1,}$/g,"");
   return input;
}

function IsEmail(email){
   var regx = /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
   return regx.test(email);
}

function IsDomain(domain){
   var regx = /^[0-9a-z\.]+[0-9a-z\-0-9a-z]+[\.]+[0-9a-z]+[\.]{0,1}[0-9a-z]{0,3}$/;
   return regx.test(domain);
}

function IsTel(tel){
   var regx = /^[0-9]{3,4}\-[0-9]{6,8}(\-[0-9]{1,6}){0,1}$/;
   return regx.test(tel);
}

function IsFax(fax){
   var regx = /^[0-9]{3,4}\-[0-9]{6,8}$/;
   return regx.test(fax);
}

var nowObj;

function showDiv(divid) 
{
   if(nowObj==divid)return;
   if (document.layers) {
	   document.layers[divid].visibility="show";
   }else{ 
	   document.getElementById(divid).style.display="";
	   if(nowObj)
	   document.getElementById(nowObj).style.display="none";
   }
   nowObj=divid;
}

function hideDiv(divid) 
{
   if (document.layers) document.layers[divid].visibility="hide";
   else document.getElementById(divid).style.display="none";
   nowObj="";
}


function menuFix() { 
	var mm = document.getElementById("menu").getElementsByTagName("li");
	for (i=0; i<mm.length; i++) {
		mm[i].onmouseover=function(){this.className+=" hot";}
		mm[i].onmouseout=function(){this.className=this.className.replace(" hot", "");}
	}
} 
window.onload=menuFix; 
