﻿var logdivstring,regdivstring;
var globaluid=0;
var globaluname="";
function CheckNumber(v)
{
	if (v.match(/^\d*$/))
		return true;
	else
		return false;
}

function EmailCheck(v)
{
	if (v.match(/^[\w]{1}[\w\.\-_]*@[\w]{1}[\w\-_\.]*\.[\w]{2,4}$/))
		return true;
	else
		return false;
}

function UserNameCheck(v)
{
	if (checkStrLen(v)<4 || checkStrLen(v)>15)
		return false;
	else
		return true;
}

function PasswordCheck(v)
{
	if (checkStrLen(v)<6 || checkStrLen(v)>16)
		return false;
	else
		return true;
}

function MobileCheck(v)
{
	if (v.match(/^\d{11}$/)==null)
		return false;
		
	var start=v.substring(0,3);
	if (start=="130" || start=="131" || start=="132" || start=="133" || start=="134" || start=="135" || start=="136" || start=="137" || start=="138" || start=="139" || start=="150" || start=="151" || start=="152" || start=="153" || start=="155" || start=="156" || start=="157" || start=="158" || start=="159" || start=="180" || start=="185" || start=="186" || start=="187" || start=="188" || start=="189")
	{
		return true;
	}
	else
		return false;
}

function DnsCheck(v)
{
	
	//if (v.match(/^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}$/)==null)
	if (v.match(/^([a-zA-Z0-9][a-zA-Z0-9\-]{2,13}[a-zA-Z0-9])$/)==null)
		return false;
	
}

function UrlCheck(v)
{
	if (v.length<11)
	return false;
	var start=v.substring(0,7);
	if (start.toUpperCase()!="HTTP://")
	return false;
	
}



//判断字符串的长度，汉字长度为2
function checkStrLen(str){
 //var str;
 var Num = 0;
 for (var i=0;i<str.length;i++){
  //str = value.substring(i,i+1);
  //if (str<="~")  //判断是否双字节
  if (str.charCodeAt(i)<=255)
   Num+=1;
  else
   Num+=2;
 }
 return Num;
}


function checkChinese(str)
{
 for (var i=0;i<str.length;i++)
 {  
  
  if (str.charCodeAt(i)<=255)
   {   	
   	return false;
   }
 }
 return true;
}

function YHMCheck(str)
{
	var checkstr="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
	for (var i=0;i<str.length;i++)
	{
		if (checkstr.indexOf(str.substr(i,1))==-1)
		{
			return false;
		}
	}
	return true;
}

function readCookie(name){
	var cookieValue = "";
	var s_search = name + "=";
	if(document.cookie.length > 0){
		offset = document.cookie.indexOf(s_search);
		if (offset != -1){
			offset += s_search.length;
			end = document.cookie.indexOf(";", offset);
			if (end == -1) end = document.cookie.length;
			cookieValue = unescape(document.cookie.substring(offset, end))
		}
	}
	return cookieValue;
}

function writeCookie(name, value, hours){
  var expire = "";
  if(hours != null)  {
    expire = new Date((new Date()).getTime() + hours * 3600000);
    expire = "; expires=" + expire.toGMTString();
  }
  document.cookie = name + "=" + escape(value) + expire ;
}

function sethyday()
{
var y=document.getElementById("hyyear").value;
var m=document.getElementById("hymonth").value;
var d=document.getElementById("hyday").value;
var rd=0;
if (m==1 || m==3 || m==5 || m==7 || m==8 || m==10 || m==12)
rd=31;
if (m==4 || m==6 || m==9 || m==11)
rd=30;
if (m==2)
	if (y % 4==0)
	rd=29;
	else
	rd=28;


	var dlen=document.getElementById("hyday").options.length;
	
	if (dlen!=rd)
	{
		if (dlen<rd)
			for (var i=dlen+1;i<=rd;i++)
			{
				document.getElementById("hyday").add(new Option(i+"日",i));
			}
		else
			for (var i=dlen;i>rd;i--)
			{
				
				document.getElementById("hyday").removeChild(document.getElementById("hyday").options[i-1]);
			}		
	}
}

logdivstring="<div class=\"logcon\"><div class=\"close\" onclick=\"closeLayer()\"><img border=\"0\" src=\"images/close.gif\" /></div><div class=\"title\">登录</div><div class=\"logname\"><ul><li class=\"txt\">电子邮箱</li><li><input type=\"text\" name=\"email\" id=\"email\" /></li></ul></div><div class=\"logpwd\"><ul><li class=\"txt\">登录密码</li><li><input type=\"password\" name=\"loginpwd\" id=\"loginpwd\" /></li><li class=\"getpwd\"><span onclick='getpwdfun()'>忘记密码</span></li></ul></div><div class=\"logcook\"><ul><li>登录有效期</li><li class=\"selcook\"><input type=\"radio\" value=\"365\" name=\"dlyxq\" id=\"dlyxq\"  />1年&nbsp;<input type=\"radio\"  name=\"dlyxq\" id=\"dlyxq\" value=\"30\" checked=\"checked\"/>1月&nbsp;<input type=\"radio\"  name=\"dlyxq\" id=\"dlyxq\" value=\"1\" />1天&nbsp;<input type=\"radio\"  name=\"dlyxq\" id=\"dlyxq\" value=\"0\" />无</li></ul></div><div class=\"but\" onClick=\"divlogin()\">登 录</div><div class=\"bottom\"><div class=\"swblog\" onclick=\"sinawblog()\"></div><div class=\"qwblog\" onclick=\"qqwblog()\"></div><div class=\"rlink\"><span class=\"hand\" onclick=\"freereg()\">免费注册</span>&nbsp;&nbsp;|&nbsp;&nbsp;<a href=\"lxwm.asp\" target=\"_blank\">在线反馈</a></div></div></div>";
regdivstring="<div class=\"regcon\"><div class=\"close\" onclick=\"closeLayer()\"><img border=\"0\" src=\"images/close.gif\" /></div><div class=\"title\">注册</div><div class=\"regdiv\"><ul><li class=\"txt\">注册邮箱</li><li><input type=\"text\" name=\"regemail\" id=\"regemail\" class=\"inputtxt\" maxlength=\"100\"  onblur=\"NowCheck(1)\">&nbsp;<span id=\"emailright\"></span><span id=\"emailerr\"></span></li></ul></div><div class=\"regdiv\"><ul><li class=\"txt\">设置密码</li><li><input type=\"password\" name=\"regloginpwd\" id=\"regloginpwd\" class=\"inputtxt\" maxlength=\"25\" ></li></ul></div><div class=\"regdiv\"><ul><li class=\"txt\">确认密码</li><li><input type=\"password\" name=\"regloginpwd2\" id=\"regloginpwd2\" class=\"inputtxt\" maxlength=\"25\"></li></ul></div><div class=\"but\" onClick=\"divregister()\">注 册</div><div class=\"bottom\"><div class=\"swblog\" onclick=\"sinawblog()\"></div><div class=\"qwblog\" onclick=\"qqwblog()\"></div><div class=\"rlink\"><span class=\"hand\" onclick=\"gologin()\">直接登录</span>&nbsp;&nbsp;|&nbsp;&nbsp;<a href=\"lxwm.asp\" target=\"_blank\">在线反馈</a></div></div></div>";

var logdivstring2="<div class=\"logcon\"><div class=\"close\" onclick=\"closeBotmLayer()\"><img border=\"0\" src=\"images/close.gif\" /></div><div class=\"title\">登录</div><div class=\"logname\"><ul><li class=\"txt\">电子邮箱</li><li><input type=\"text\" name=\"email\" id=\"email\" /></li></ul></div><div class=\"logpwd\"><ul><li class=\"txt\">登录密码</li><li><input type=\"password\" name=\"loginpwd\" id=\"loginpwd\" /></li><li class=\"getpwd\"><span onclick='getpwdfun2()'>忘记密码</span></li></ul></div><div class=\"logcook\"><ul><li>登录有效期</li><li class=\"selcook\"><input type=\"radio\" value=\"365\" name=\"dlyxq\" id=\"dlyxq\"  />1年&nbsp;<input type=\"radio\"  name=\"dlyxq\" id=\"dlyxq\" value=\"30\" checked=\"checked\"/>1月&nbsp;<input type=\"radio\"  name=\"dlyxq\" id=\"dlyxq\" value=\"1\" />1天&nbsp;<input type=\"radio\"  name=\"dlyxq\" id=\"dlyxq\" value=\"0\" />无</li></ul></div><div class=\"but\" onClick=\"divlogin2()\">登 录</div><div class=\"bottom\"><div class=\"swblog\" onclick=\"sinawblog()\"></div><div class=\"qwblog\" onclick=\"qqwblog()\"></div><div class=\"rlink\"><span  class=\"hand\"  onclick=\"freereg2()\">免费注册</span>&nbsp;&nbsp;|&nbsp;&nbsp;<a href=\"lxwm.asp\" target=\"_blank\">在线反馈</a></div></div></div>";
var regdivstring2="<div class=\"regcon\"><div class=\"close\" onclick=\"closeBotmLayer()\"><img border=\"0\"  src=\"images/close.gif\" /></div><div class=\"title\">注册</div><div class=\"regdiv\"><ul><li class=\"txt\">注册邮箱</li><li><input type=\"text\" name=\"regemail\" id=\"regemail\" class=\"inputtxt\" maxlength=\"100\"  onblur=\"NowCheck2(1)\">&nbsp;<span id=\"emailright\"></span><span id=\"emailerr\"></span></li></ul></div><div class=\"regdiv\"><ul><li class=\"txt\">设置密码</li><li><input type=\"password\" name=\"regloginpwd\" id=\"regloginpwd\" class=\"inputtxt\" maxlength=\"25\" ></li></ul></div><div class=\"regdiv\"><ul><li class=\"txt\">确认密码</li><li><input type=\"password\" name=\"regloginpwd2\" id=\"regloginpwd2\" class=\"inputtxt\" maxlength=\"25\"></li></ul></div><div class=\"but\" onClick=\"divregister2()\">注 册</div><div class=\"bottom\"><div class=\"swblog\" onclick=\"sinawblog()\"></div><div class=\"qwblog\" onclick=\"qqwblog()\"></div><div class=\"rlink\"><span  class=\"hand\"  onclick=\"gologin2()\">直接登录</span>&nbsp;&nbsp;|&nbsp;&nbsp;<a href=\"lxwm.asp\" target=\"_blank\">在线反馈</a></div></div></div>";

var getpwdstring="<div class=\"logcon\"><div class=\"close\" onclick=\"closeLayer()\"><img border=\"0\" src=\"images/close.gif\" /></div><div class=\"title\">找回密码</div><div class=\"getpwdin\"><ul><li class=\"txt\">注册邮箱</li><li><input type=\"text\" name=\"getemail\" id=\"getemail\" /></li></ul></div><div class=\"but2\" onClick=\"getpwdsend()\">发送密码至邮箱</div><div class=\"bottom\"><div class=\"rlink\"><span class=\"hand\" onclick=\"freereg()\">注册</span>&nbsp;&nbsp;|&nbsp;&nbsp;<span onclick=\"gologin()\">登录</span></span></div></div>";
var getpwdstring2="<div class=\"logcon\"><div class=\"close\" onclick=\"closeBotmLayer()\"><img border=\"0\" src=\"images/close.gif\" /></div><div class=\"title\">找回密码</div><div class=\"getpwdin\"><ul><li class=\"txt\">注册邮箱</li><li><input type=\"text\" name=\"getemail\" id=\"getemail\" /></li></ul></div><div class=\"but2\" onClick=\"getpwdsend()\">发送密码至邮箱</div><div class=\"bottom\"><div class=\"rlink\"><span class=\"hand\" onclick=\"freereg2()\">注册</span>&nbsp;&nbsp;|&nbsp;&nbsp;<span onclick=\"gologin2()\">登录</span></span></div></div>";

var yonghumingalert="<div class='alertlayer'><div class='close'><div class='txt'>提示</div><div class='img'><img border='0' onclick='closeLayer()' src='images/close.gif' /></div></div><div class='con'><ul><li class='img'><img src='images/alert-no.gif' /></li><li class='txt'><p>请先到<a href='myconfig.asp'>我的设置</a>中激活主页</p></li></ul></div></div>";
var globallogtype=0; //0底部检查　1顶部登录　2点击商城
var globalgourl="";
var xmlHttp2;
try
{
	xmlHttp2 = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
	try
	{
		xmlHttp2= new ActiveXObject("Microsoft.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			xmlHttp2 = new XMLHttpRequest();
		}
		catch(e) {}
	}
}

function botmurlcheck()
{
	
	if (document.getElementById("botmurl").value=="")
	{
		document.getElementById("botmurl").value="请输入商品网址！";
		return false;
	}
	if (UrlCheck(document.getElementById("botmurl").value)==false)
	{
		document.getElementById("botmurl").value="请输入正确的商品网址！";
		return false;
	}
	
	var url = "botmurlcheck.asp?purl="+escape(document.getElementById("botmurl").value);
	xmlHttp2.open("GET", url, true);
	xmlHttp2.onreadystatechange=botmurlcheckshow;
	xmlHttp2.send(null);
}

function deltxt(obj)
{
	if (obj.value=="请输入商品网址！" || obj.value=="请输入正确的商品网址！" || obj.value=="输入购物网址进行购物，奖励换千种礼品...")
	obj.value="";
}

function botmurlcheckshow()
{
	if (xmlHttp2.readyState == 4) {
			var response = xmlHttp2.responseText;
			try{
			openBotmLayer(response);
			}catch(exception){}
		}	
}

function openBotmLayer(showc)
	 {
		var arrayPageSize   = getPageSize2();//调用getPageSize()函数
		var arrayPageScroll = getPageScroll2();//调用getPageScroll()函数
		document.getElementById("botmurlcheckdiv").innerHTML=showc;
		document.getElementById("botmurlcheckdiv").style.position = "absolute";		
		document.getElementById("botmurlcheckdiv").style.zIndex = 99;
		
		document.getElementById("botmurlcheckbackdiv").style.position = "absolute";
		document.getElementById("botmurlcheckbackdiv").style.width = "100%";
		document.getElementById("botmurlcheckbackdiv").style.height = (arrayPageSize[1] + 35 + 'px');
		document.getElementById("botmurlcheckbackdiv").style.zIndex = 98;
		document.getElementById("botmurlcheckbackdiv").style.top = 0;
		document.getElementById("botmurlcheckbackdiv").style.left = 0;
		document.getElementById("botmurlcheckbackdiv").style.filter = "alpha(opacity=50)";
		document.getElementById("botmurlcheckbackdiv").style.opacity = 0.5;
		document.getElementById("botmurlcheckbackdiv").style.background = "#CCCCCC";
		document.getElementById("botmurlcheckbackdiv").style.display = "";
		document.getElementById("botmurlcheckdiv").style.display = "";
		document.getElementById("botmurlcheckdiv").style.top = arrayPageScroll[1] + (arrayPageSize[3] - document.getElementById("botmurlcheckdiv").offsetHeight) / 2-50 + 'px';
		document.getElementById("botmurlcheckdiv").style.left = (arrayPageSize[0] - document.getElementById("botmurlcheckdiv").offsetWidth) / 2 -30 + 'px';
	}
	
     //获取滚动条的高度
     function getPageScroll2()
	 {
      var yScroll;
      if (self.pageYOffset)
	  {
       yScroll = self.pageYOffset;
      }
	  else if (document.documentElement && document.documentElement.scrollTop)
	  {
       yScroll = document.documentElement.scrollTop;
      }
	   else if (document.body)
	  {
       yScroll = document.body.scrollTop;
      }

      arrayPageScroll = new Array('',yScroll);
      return arrayPageScroll;
     }

     //获取页面实际大小

     function getPageSize2()
	 {
      var xScroll,yScroll;
      if (window.innerHeight && window.scrollMaxY)
	  {
       xScroll = document.body.scrollWidth;
       yScroll = window.innerHeight + window.scrollMaxY;
      }
	  else if (document.body.scrollHeight > document.body.offsetHeight)
	  {
       sScroll = document.body.scrollWidth;
       yScroll = document.body.scrollHeight;
      }
	  else
	  {
       xScroll = document.body.offsetWidth;
       yScroll = document.body.offsetHeight;
      }

      var windowWidth,windowHeight;
      //var pageHeight,pageWidth;
      if (self.innerHeight)
	  {
       windowWidth = self.innerWidth;
       windowHeight = self.innerHeight;
      }
	  else if (document.documentElement && document.documentElement.clientHeight)
	  {
       windowWidth = document.documentElement.clientWidth;
       windowHeight = document.documentElement.clientHeight;
      }
	  else if (document.body)
	  {
       windowWidth = document.body.clientWidth;
       windowHeight = document.body.clientHeight;
      }

      var pageWidth,pageHeight;
      if(yScroll < windowHeight)
	  {
       pageHeight = windowHeight;
      }
	  else
	  {
       pageHeight = yScroll;
      }
      if(xScroll < windowWidth)
	  {
       pageWidth = windowWidth;
      }
	  else
	  {
	   pageWidth = xScroll;
      }
      arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
      return arrayPageSize;
     }

     //关闭弹出层
     function closeBotmLayer()
	 {
      document.getElementById("botmurlcheckbackdiv").style.display = "none";
      document.getElementById("botmurlcheckdiv").style.display = "none";
	  document.getElementById("botmurlcheckdiv").innerHTML="";
	  globallogtype=0;
	  globalgourl="";
      return false;
     }
	 
	function getDivCon2()
	{
		if (xmlHttp2.readyState == 4) {
			var response = xmlHttp2.responseText;
			try{			
					
			 if (response.indexOf("headshowname")>0)
			 {
				document.getElementById("botmurlcheckdiv").innerHTML=response;
				
				if (globalgourl!="")
				{				
					
					if (document.getElementById("e_name").value!="")
						if (globalgourl=="myindex")
							location.href=document.getElementById("e_name").value;
						else
							location.href=globalgourl;
					else
						if (globalgourl=="mycontribution.asp")
							location.href=globalgourl;
						else
							location.href="myconfig.asp";
					return false;
				}				
				
				globaluid=document.getElementById("e_id").value;
				globaluname=document.getElementById("e_name").value;
				if (globallogtype==0)
				botmurlcheck();
				if (globallogtype==2)
				{				
				gowebpage();
				}
				if (globallogtype==100)
				{				
					 guanzhuf();
				}
				
				
				
				showHeadContent();
				
				closeBotmLayer();
				
				
			 }
			 else
			 {
				document.getElementById("botmurlcheckdiv").innerHTML=response;
			 }
			}catch(exception){}
		}	
	}


	function divlogin2()
	{
	try
	{		
		if (document.getElementById("email").value=="")
		{
			alert("请输入电子邮箱名!");
			document.getElementById("email").focus();
			return false;
		}
		
		if (document.getElementById("loginpwd").value=="")
		{
			alert("请输入登录密码!");
			document.getElementById("loginpwd").focus();
			return false;
		}
		if (EmailCheck(document.getElementById("email").value)==false)
		{
			alert("邮箱格式不正确！");
			document.getElementById("email").focus();
			return false;
		}
		
		var url = "divdaren.asp?naction=log&ltype=1&email=" +encodeURI(escape(document.getElementById("email").value))+"&loginpwd="+encodeURI(escape(document.getElementById("loginpwd").value))+"&dlyxq="+document.getElementById("dlyxq").value;
		//window.open(url);
		//return false;
		xmlHttp2.open("GET", url, true);
		xmlHttp2.onreadystatechange = getDivCon2;
		xmlHttp2.send(null);	
		
	}
	catch(exception){}
	}



	function divregister2()
	{
	try
	{
		if (document.getElementById("regemail").value=="")
			{
				alert("请输入电子邮箱名!");
				document.getElementById("regemail").focus();
				return false;
			}		
			
			if (document.getElementById("regloginpwd").value=="")
			{
				alert("请输入登录密码!");
				document.getElementById("regloginpwd").focus();
				return false;
			}
			if (document.getElementById("regloginpwd2").value=="")
			{
				alert("请输入确认密码!");
				document.getElementById("regloginpwd2").focus();
				return false;
			}
			if (document.getElementById("regloginpwd2").value!=document.getElementById("regloginpwd").value)
			{
				alert("二密码不一致!");
				document.getElementById("regloginpwd2").focus();
				return false;
			}
			
			if (document.getElementById("emailright").innerHTML=="")
			{
				alert("电子邮箱格式不正确或者已经注册过!");
				document.getElementById("regemail").focus();
				return false;
			}
			
		
		
		var url = "divdaren.asp?naction=reg&ltype=1&regemail=" +encodeURI(escape(document.getElementById("regemail").value))+"&regloginpwd="+encodeURI(escape(document.getElementById("regloginpwd").value));
		
		xmlHttp2.open("GET", url, true);
		xmlHttp2.onreadystatechange = getDivCon2;
		xmlHttp2.send(null);	
		
	}
	catch(exception){}
	}



	function NowCheck2(type)
	{
		if (type==1)
		{
			if (document.getElementById("regemail").value=="")
				return false;
			if (EmailCheck(document.getElementById("regemail").value)==false)
			{
				alert("请输入有效的Email！");
				document.getElementById("regemail").focus();
				return false;
			}
			
		}
		
		if (type==2)
		{
			if (document.getElementById("regusername").value=="")
				return false;
			if (UserNameCheck(document.getElementById("regusername").value)==false)
			{
				alert("请输入有效的用户名！");
				document.getElementById("regusername").focus();
				return false;
			}
		}
		
		if (type==3)
		{
			if (document.getElementById("mobile").value=="")
				return false;
			if (MobileCheck(document.getElementById("mobile").value)==false)
			{
				alert("请输入有效的手机号！");
				document.getElementById("mobile").focus();
				return false;
			}
		}
		var url = "checkuser.asp?checktype="+type+"&email="+encodeURI(escape(document.getElementById("regemail").value));
		xmlHttp2.open("GET", url, true);
		xmlHttp2.onreadystatechange = showCon2;
		xmlHttp2.send(null);	
	}
	
	function showCon2()
	{
		if (xmlHttp2.readyState == 4) {
		var response = xmlHttp2.responseText;
		try{			
			if (response==1)
			{
				document.getElementById("emailright").innerHTML="<img src='images/alert-suc.gif' />";
				document.getElementById("emailerr").innerHTML="";
			}
			if (response==2)
			{
				document.getElementById("emailright").innerHTML="";
				document.getElementById("emailerr").innerHTML="<img src='images/alert-err.gif' /><font color='red'>该邮箱已经注册过！</font><br/>";
			}
			if (response==3)
			{
				document.getElementById("usernameright").innerHTML="<img src='images/alert-suc.gif' />";
				document.getElementById("usernameerr").innerHTML="";
			}
			if (response==4)
			{
				document.getElementById("usernameright").innerHTML="";
				document.getElementById("usernameerr").innerHTML="<img src='images/alert-err.gif' /><font color='red'>该用户名已经存在！</font><br/>";
			}
			if (response==5)
			{
				document.getElementById("mobileright").innerHTML="<img src='images/alert-suc.gif' />";
				document.getElementById("mobileerr").innerHTML="";
			}
			if (response==6)
			{
				document.getElementById("mobileright").innerHTML="";
				document.getElementById("mobileerr").innerHTML="<img src='images/alert-err.gif' /><font color='red'>该手机号已经存在！</font><br/>";
			}
		}catch(exception){}
	}	
	}

function freereg2()
{
	document.getElementById("botmurlcheckdiv").innerHTML=regdivstring2;
}

function gologin2()
{
	document.getElementById("botmurlcheckdiv").innerHTML=logdivstring2;
}

function globallog(gourl)
{
	
	globallogtype=1;
	globalgourl=gourl;
	openBotmLayer(logdivstring2);
}

function globalreg()
{
	globallogtype=1;
	openBotmLayer(regdivstring2);
	
}

function showHeadContent()
{
	document.getElementById("globalheaddiv").innerHTML="<span class=\"c6\">您好，" + document.getElementById("headshowname").value + "！</span> | <span class=\"c6\"><a href=\"logout.asp\">退出</a>";
	if (globaluname!="")
		document.getElementById("headrightmenu").innerHTML="<ul><li><a href=\""+globaluname+"\" class=\"smenu\">我的首页</a></li><li><a href=\"myrecommend.asp\">我的推荐</a></li><li><a href=\"myhaveme.asp\">提到我的</a></li><li><a href=\"myfavorites.asp\">我的收藏</a></li><li><a href=\"mycontribution.asp\">我的贡献</a></li></ul>";
	else
		document.getElementById("headrightmenu").innerHTML="<ul><li><a href=\"myconfig.asp\" class=\"smenu\">我的首页</a></li><li><a href=\"myconfig.asp\">我的推荐</a></li><li><a href=\"myconfig.asp\">提到我的</a></li><li><a href=\"myconfig.asp\">我的收藏</a></li><li><a href=\"mycontribution.asp\">我的贡献</a></li></ul>";
	
	if (document.getElementById("userhdtopdiv"))
	{
		
		document.getElementById("userhdtopdiv").innerHTML=document.getElementById("userhddiv").value+document.getElementById("userhdtopdiv").innerHTML;
		var removediv=document.getElementById("userhdnolog");
		document.getElementById("userhdtopdiv").removeChild(removediv);
	}
	
}

function seefollow(type,uid)
{
	if (globaluid==0)
	{
		globallogtype=3;
		openBotmLayer(logdivstring2);
		return false;
	}
	if (type==1)
	location.href="following.asp?dlid="+uid;
	else
	location.href="follower.asp?dlid="+uid;
}

function getpwdfun()
{
	openLayer(getpwdstring);
}

function getpwdfun2()
{
	globallogtype=6;
	openBotmLayer(getpwdstring2);
}

function getpwdsend()
{
	if (document.getElementById("getemail").value=="")
	{
		alert("请输入电子邮箱名!");
		document.getElementById("getemail").focus();
		return false;
	}
	
	if (EmailCheck(document.getElementById("getemail").value)==false)
	{
		alert("邮箱格式不正确！");
		document.getElementById("getemail").focus();
		return false;
	}
		
	var url = "getpwd.asp?email=" +encodeURI(escape(document.getElementById("getemail").value));
	xmlHttp2.open("GET", url, true);
	xmlHttp2.onreadystatechange = getPwdCon;
	xmlHttp2.send(null);	
}

function getPwdCon()
{
	if (xmlHttp2.readyState == 4) {
		var response = xmlHttp2.responseText;
		try{			
			if (globallogtype==6)
			{
			document.getElementById("botmurlcheckdiv").innerHTML=response;
			setTimeout(closeBotmLayer,2000);
			}
			else
			{
			document.getElementById("logdiv").innerHTML=response;
			setTimeout(closeLayer,2000);
			}
			
			//globallog();
		}catch(exception){}
	}	
}

function sinawblog()
{
	location.href="sinawblog.asp";
}

function qqwblog()
{
	location.href="qqwblog.asp";
}

function sinawblog3()
{
	location.href="http://ssl.keyibu.com/sinawboauth.jsp?t="+encodeURI(escape(document.URL));
}

function qqwblog3()
{
	location.href="http://qsl.keyibu.com/qqwboauth.jsp?t="+encodeURI(escape(document.URL));
}
