function refreshAuthCode(){
   var r_date = new Date();
   //var r_date = Math.floor(Math.random()*10+1);
   //document.getElementById("authCodeName").value = r_date;
   //document.loginform.loginAuthCode.src = "http://srv.js.ct10000.com/default.pr_automata.forward.do?onlyNumber=true&r="+ r_date;
   ///document.loginform.loginAuthCode.src = "http://srv.js.ct10000.com/cswlogin/page/imagecode.jsp?onlyNumber=true&r=" + r_date;
   //document.loginform.loginAuthCode.src = "/common/portal/codeimg.jsp?authCodeName=" + r_date;
   //document.loginform.loginAuthCode.src = "http://srv.js.ct10000.com/cswlogin/page/imagecode.jsp?onlyNumber=true&r=" + r_date;
   document.login_form.verify.src = "/incs/loginverify.asp?r=" + r_date;
   document.login_form.verify.style.display ="inline";
   document.getElementById("verify").value="";
   
}
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 Check(theObj){
	if (theObj.searchedDomainName.value=="")
	{
		alert("请输入域名！");
		theObj.searchedDomainName.focus();
		return false;
	}
	theObj.Submit.disabled ="true";
}
function showMaxImage(MaxImage)
{//根据鼠标位置显示对象,参数ev为event
	var ObjX,ObjX1,ObjY,ObjY1;//对象的位置(x,y)
	var mouseWidth=20;//对象的(x)水平位置距离鼠标的宽度
	var mouseHeight=20;//对象的(y)垂直位置距离鼠标的高度
	var mouseX;//鼠标的x坐标
	var mouseY;//鼠标的y坐标
	var scrollTop = 0;//网页被卷去的高
	var dialog_height=450;//对话框的高度
	var dialog_width=520;//对话框的宽度	
    var scrollTop = document.documentElement.scrollTop||document.body.scrollTop;
	var scrollLeft = document.documentElement.scrollLeft||document.body.scrollLeft;
	var clientHeight = document.documentElement.clientHeight||document.body.clientHeight;
	var clientWidth = document.documentElement.clientWidth||document.body.clientWidth;	
	
	var obj = document.getElementById("maxImage_dialog");//对话框对象	

	var event = getEvent();
	if(event.pageX || event.pageY)
	{//firefox鼠标的位置
		mouseX = event.pageX;
		mouseY = event.pageY;
	}
	else
	{//IE鼠标的位置				
		mouseX = event.clientX + scrollLeft- document.body.clientLeft;
		mouseY = event.clientY + scrollTop - document.body.clientTop;		
	}
	
	ObjX = mouseX;
	ObjY = mouseY;	
	
	var height2 = scrollTop+clientHeight-ObjY;
	width1 = ObjX+dialog_width;
	if(height2<dialog_height && width1>clientWidth)
	{
		ObjY = ObjY-dialog_height;
		if(ObjY<scrollTop) ObjY = scrollTop;
		ObjX = ObjX-dialog_width-mouseWidth;
	}
	else if(height2<dialog_height)
	{
		ObjY = ObjY-dialog_height;
		if(ObjY<scrollTop) ObjY = scrollTop;
		ObjX = ObjX+mouseWidth;
	}
	else if(width1>clientWidth)
	{		
		ObjX = ObjX-dialog_width;
		height2 = height2+mouseHeight;
		if(height2<dialog_height)
			ObjY = ObjY+(dialog_height-height2);
		else
			ObjY = ObjY+mouseHeight;
	}
	else
		ObjY = ObjY+mouseHeight;

	obj.style.left = ObjX + 'px';
	obj.style.top = ObjY + 'px';	
	
	if(MaxImage!="") obj.innerHTML="<img src=\""+MaxImage+"\" onload=\"DrawImage(this,520,450)\">";
	obj.style.display='';//显示或隐藏对象
}

function hideMaxImage()
{
	document.getElementById("maxImage_dialog").style.display='none';
}
function DrawImage(ImgD,ImgWidth,ImgHeight)
{//按比例缩小图片
	var flag=false;
	var image=new Image();
	image.src=ImgD.src;
	if(image.width>0 && image.height>0 && ImgWidth>0 && ImgHeight>0)
	{
		flag=true;
		if(image.width/image.height>= ImgWidth/ImgHeight)
		{
			if(image.width>ImgWidth)
			{ 
				ImgD.width=ImgWidth;
				ImgD.height=(image.height*ImgWidth)/image.width;
			}
			else
			{
				ImgD.width=image.width; 
				ImgD.height=image.height;
			}
		}
		else
		{
			if(image.height>ImgHeight)
			{ 
				ImgD.height=ImgHeight;
				ImgD.width=(image.width*ImgHeight)/image.height; 
			}
			else
			{
				ImgD.width=image.width; 
				ImgD.height=image.height;
			}
		}
	}
}
function getEvent() //获取event对象,同时兼容ie和ff的写法 
{  
	if(document.all)  return window.event;    
	func=getEvent.caller;        
	while(func!=null){  
		var arg0=func.arguments[0]; 
		if(arg0) 
		{ 
		  if((arg0.constructor==Event || arg0.constructor ==MouseEvent) || (typeof(arg0)=="object" && arg0.preventDefault && arg0.stopPropagation)) 
		  {  
		  return arg0; 
		  } 
		} 
		func=func.caller; 
	} 
	return null; 
}
