var Layer='';
var iLayerMaxNum=1000;
var a;
document.onmouseup=me;
document.onmousemove=ms;
var b;
var c;
function Move(Object,event){
	Layer=Object.id;
	if(document.all){
		document.getElementById(Layer).setCapture();
		b=event.x-document.getElementById(Layer).style.pixelLeft;
		c=event.y-document.getElementById(Layer).style.pixelTop;
	}else if(window.captureEvents){
		window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
		b=event.layerX;
		c=event.layerY+100;
	};
	if(Layer!="Layer"+a){
		document.getElementById(Layer).style.zIndex=iLayerMaxNum;
		iLayerMaxNum=iLayerMaxNum+1;
	}
}
function ms(d){
	if(Layer!=''){
		if(document.all){
			document.getElementById(Layer).style.left=event.x-b;
			document.getElementById(Layer).style.top=event.y-c;
		}else if(window.captureEvents){
			document.getElementById(Layer).style.left=(d.clientX-b)+"px";
			document.getElementById(Layer).style.top=(d.clientY-c)+"px";
		}
	}
}
function me(d){
	if(Layer!=''){
		if(document.all){
			document.getElementById(Layer).releaseCapture();
			Layer='';
		}else if(window.captureEvents){
			window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
			Layer='';
		}
	}
}
function Close(n){
	var e='Layer'+n;
	document.getElementById(e).style.display='none';
	Hide();
}
function changeclass(n){
	var e='img'+n;
var a=document.getElementById(e);
 a.className='Detail';
 a.onmouseover=new function(){this.className='Detailda'}
 a.onmouseout=function(){this.className='Detail'}
}
function changeclass1(n){
var e='img'+n;
document.getElementById(e).className='Detailda';
}
function changeclass2(n){
var e='img'+n;
document.getElementById(e).className='Detail';
}
function changeclasswen(n){
	var e='wen'+n;
var a=document.getElementById(e);
 a.className='qu99url';
 a.onmouseover=function(){this.className='qu99urlda'}
 a.onmouseout=function(){this.className='qu99url'}
}
function Show(n){
	var e=document.getElementById('Layer'+n);
	if (e){
		e.style.zIndex =iLayerMaxNum+1;
		document.getElementById("mask").style.display = "block";
		document.getElementById("mask").style.zIndex = iLayerMaxNum;
		var size = getPageSize();
		document.getElementById("mask").style.width = size[0];
		document.getElementById("mask").style.height = size[1];	
	}else{
		alert("对不起，您搜索的字条不存在！");
		history.back(1);		
	}
}	
function Hide(){
	document.getElementById("mask").style.display = "none";
	iLayerMaxNum=iLayerMaxNum+2;
}
function getPageSize(){
	var de = document.documentElement;
	var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
	var h = window.innerHeight || self.innerHeight || document.body.clientHeight || (de&&de.clientHeight);
	arrayPageSize = new Array(w,h); 
	return arrayPageSize;
}
function check(obj){
if(document.form1.uname.value=="")
  {
   alert("请填写会员名！");
   document.form1.uname.focus();
   return false;
   }
if(!/^\s*[A-Za-z0-9_-]{3,15}\s*$/ig.test(form1.uname.value))
   {
   alert("会员名不能是汉字或特殊字符，不能小于3个字符！");
   document.form1.uname.focus();
   return false;
   }
if(!/^\s*[.A-Za-z0-9]{6,10}\s*$/ig.test(form1.upass1.value))
   {
   alert("密码须是数字或字母，长度为6-10个字符！");
   document.form1.upass1.focus();
   return false;
   }
if((document.form1.upass1.value)!=(document.form1.upass2.value))
   {
   alert("两次密码不同，请重新填写");
   document.form1.upass2.focus();
   return false;
   }
if(document.form1.email.value!="")
   {
if(!/^\s*([A-Za-z0-9_-]+(\.\w+)*@(\w+\.)+\w{2,3})\s*$/ig.test(form1.email.value))
{  
alert('电子邮箱格式不正确！');
document.form1.email.focus();
return  false
}
   }

if(document.form1.oicq.value!="")
   {
if(!/^\s*[.0-9]{4,15}\s*$/ig.test(form1.oicq.value))
   {
   alert("QQ号码输入错误！");
   document.form1.oicq.focus();
   return false;
   }
   }

if(document.form1.code.value=="")
   {
   alert("请填写验证码！");
   document.form1.code.focus();
   return false;
   }
return true;
}
function checkucenter(obj){
if(document.ucenterform.upass1.value!="")
{
if(!/^\s*[.A-Za-z0-9]{6,10}\s*$/ig.test(ucenterform.upass1.value))
   {
   alert("原密码输入错误,须是数字或字母,长度为6-10个字符!");
   document.ucenterform.upass1.focus();
   return false;
   }
if(document.ucenterform.upass2.value=="")
  {
   alert("新密码不能为空！");
   document.ucenterform.upass2.focus();
   return false;
   }
}
if(document.ucenterform.upass2.value!="")
{
if(!/^\s*[.A-Za-z0-9]{6,10}\s*$/ig.test(ucenterform.upass2.value))
   {
   alert("新密码输入错误,密码须是数字或字母,长度为6-10个字符!");
   document.ucenterform.upass2.focus();
   return false;
   }
if(document.ucenterform.upass1.value=="")
  {
   alert("原密码不能为空！");
   document.ucenterform.upass1.focus();
   return false;
   }
}
if(document.ucenterform.email.value=="")
   {
   alert("请填写电子邮箱！");
   document.ucenterform.email.focus();
   return false;
   }
if(!/^\s*([A-Za-z0-9_-]+(\.\w+)*@(\w+\.)+\w{2,3})\s*$/ig.test(ucenterform.email.value))
{ 
alert('电子邮箱格式不正确！');
document.ucenterform.email.focus();
return  false
}
if(document.ucenterform.oicq.value=="")
   {
   alert("请填写QQ号码！");
   document.ucenterform.oicq.focus();
   return false;
   }
if(!/^\s*[.0-9]{4,15}\s*$/ig.test(ucenterform.oicq.value))
   {
   alert("QQ号码输入错误！4位以上哦");
   document.ucenterform.oicq.focus();
   return false;
   }
if(document.ucenterform.code.value=="")
   {
   alert("请填写验证码！");
   document.ucenterform.code.focus();
   return false;
   }
return true;
}
function checklogo(){
                  var xmlhttp = createxmlhttprequest();   
				  //var xmlhttp = new XMLHttpRequest();
                  var pick=document.all.pick;
				  //alert(document.getElementById('pick'));  
                  xmlhttp.open('get','5uinc/Check.asp?type=logo&UserName='+pick.value);  
                  xmlhttp.onreadystatechange=function()
                  {   
                          if(xmlhttp.readyState==4)
                          {
                            
                                  if(xmlhttp.status==200)   
                                  {   
                                          if(xmlhttp.responseText=="0")
                                          {         
document.getElementById("logook").innerText='此站未提交图标'; 
document.getElementById("logook").style.color='red';   
document.getElementById("logoimg").style.display='none'; 
document.getElementById("logoimg").src='';  
                                          }   
                                          else   
                                          {   
document.getElementById("logook").innerText='此站参考图标:';
document.getElementById("logook").style.color='green'; 
document.getElementById("logoimg").style.display='block'; 
document.getElementById("logoimg").src='5uimages/icon/sitelogo/'+xmlhttp.responseText+'.gif'; 
document.getElementById("IconImg").src='5uimages/icon/sitelogo/'+xmlhttp.responseText+'.gif'; 
frmAdd.icon.value ='5uimages/icon/sitelogo/'+xmlhttp.responseText+'.gif'; 
                                          }   
                                  }   
                          }   
                  }   
                  xmlhttp.send(null);   
}

function check2(){
if(document.form1.uname.value=="")
{
alert("请填写会员名！");
document.form1.uname.focus();
return false;
}
if(!/^\s*[A-Za-z0-9_-]{3,15}\s*$/ig.test(form1.uname.value))
   {
   alert("会员名不能是汉字或特殊字符，不能小于3个或多于15个字符！");
   document.form1.uname.focus();
   return false;
   }
//window.showModalDialog('?u='+document.form1.uname.value+'&i=reg&ii=cn');
                  var   xmlhttp=createxmlhttprequest();   
				  if(window.ActiveXObject){
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}else{
xmlhttp = new XMLHttpRequest();
}

                  var username=document.all.uname;
                  xmlhttp.open('get','/5uinc/Check.asp?type=reg&UserName='+username.value);  
                  xmlhttp.onreadystatechange=function()   
                  {   
                          if(xmlhttp.readyState==4)   
                          {   
                            
                                  //if(xmlhttp.status==200)   
                                  //{   
                                          if(xmlhttp.responseText=="1")   
                                          {         
                                                  document.getElementById("IsOkUserName").innerText='账号已存在';  
												  document.getElementById("IsOkUserName").style.color='red';  
                                          }   
                                          else   
                                          {   
                                                  document.getElementById("IsOkUserName").innerText='账号未注册'; 
												  document.getElementById("IsOkUserName").style.color='green';    
                                          }   
                                  //}   
                          }   
                  }   
                  xmlhttp.send(null);   
}

          function   createxmlhttprequest()   
          {   
                  var   xmlhttp=false;   
                  try   
                  {   
                          xmlhttp=new   ActiveXObject('Msxm12.XMLHTTP');   
                  }   
                  catch(e)   
                  {   
                          try   
                          {   
                                  xmlhttp=new   ActiveXObject('Microsoft.XMLHTTP');   
                          }   
                          catch(e)   
                          {   
                                  try   
                                  {   
                                          xmlhttp=new   XmlHttpRequest();   
                                  }   
                                  catch(e)   
                                  {   
                                  }   
                          }   
                    }   
                  return   xmlhttp;   
          } 
function showpage(ob,Flag)
{
 if (Flag == 0)
 {
document.all['manage'].style.display = 'none';
document.all['ucontrol'].style.display = 'none';
document.all['ucenter'].style.display = 'none';
document.all['uset'].style.display = 'none';
document.all['usystem'].style.display = 'none';
document.all[ob].style.display = 'block';
  //show the window
 }
 else
 {
  document.all[ob].style.display = 'none';
  //hide the window
 }
}
function showlogin(Flag)
{
 if (Flag == 0)
 {
  document.all['login'].style.display = 'block';
  //show the window
 }
 else
 {
  document.all['login'].style.display = 'none';
  //hide the window
 }
}
function check3(obj){
if(document.form1.uname.value=="")
  {
   alert("请填写会员名！");
   document.form1.uname.focus();
   return false;
   }
if(!/^\s*[A-Za-z0-9_-]{3,15}\s*$/ig.test(form1.uname.value))
   {
   alert("会员名不能是汉字或特殊字符，不能小于3个字符！");
   document.form1.uname.focus();
   return false;
   }
if(!/^\s*[.A-Za-z0-9]{6,10}\s*$/ig.test(form1.upass.value))
   {
   alert("密码须是数字或字母，长度为6-10个字符！");
   document.form1.upass.focus();
   return false;
   }
if(document.form1.code.value=="")
   {
   alert("请填写验证码！");
   document.form1.code.focus();
   return false;
   }
return true;
}
function checkuset(obj){
if(document.usetform.ubg.value=="")
   {
   alert("请选择网站背景！");
   document.usetform.ubg.focus();
   return false;
   }
return true;
}