var ht_host = '/';
var ht_layer;
var ht_iframe;
var ht_x;
var ht_y;
var h = '<div id="ht_layer" style="position:absolute;z-index:6000;background-color:#FFFFee;display:none;filter:Alpha(Opacity=96);"><table width="240" cellspacing="0" cellpadding="0" ';
  h += 'style="border-top:1px solid #7E98D6;border-left:1px solid #7E98D6;';
  h += 'border-right:1px solid #7E98D6;border-bottom:1px solid #7E98D6;';
  h += '"><tr><td>';
  h += '<div width="100%" style="cursor:move;background-color:#C8DAF3;border:0px;" onmouseover="ht_onmove=1;" onmouseout="ht_onmove=0;">' ;
  h += '<table width="100%"><tr><td align="left" width="95%" style="background-color:#C8DAF3;">';
  h += '<div style="color:#1A9100;font-size:14px;background-color:#C8DAF3;">成功在线会员登陆</div>';
  h += '</td>';
  h += '<td align="right" style="background-color:#C8DAF3;">';
  h += '<a href="javascript:htClose()" title="&#20851;&#38381;">';
  h += '<img src="'+ht_host+'img/close.gif" style="border:none;display:inline;" align="absmiddle">';
  h += '</a>';
  h += '</td></tr></table>';
  h += '</div>';  
  h += '<table border="0" cellspacing="4" cellpadding="3" width="100%" align="center" onmouseover="ht_onlayer=1;" onmouseout="ht_onlayer=0;">';
  h += '<tr><td><fieldset color="#00c0ff"><div id="mylogin">';      
  h += '<table border="0" cellspacing="3" cellpadding="3" width="100%" align="center"><FORM METHOD=POST ACTION="/" name="askloginpost">';
  h += '<tr align="left"><td width="100%" style="font-size:12px">用户名：<INPUT TYPE="text" onfocus="showinfonull(\'showinfo\')" NAME="username" value="" size=20 style="font-size:12px;color:#7E98D6"></td></tr>';
  h += '<tr align="left"><td width="100%" height="20" style="font-size:12px">密&nbsp; 码：<INPUT onfocus="showinfonull(\'showinfo\')" TYPE="password" NAME="password" value="" size=21 style="font-size:12px;color:#7E98D6"></td></tr>';
  h+= '<tr align="left"><td align=center><INPUT TYPE="button" value="免费注册" onclick="gored()" style="font-size:12px">&nbsp;<INPUT TYPE="button" name="登陆" value="登陆" onclick="loginin()" style="font-size:12px"></td></tr>'
  h += '</FORM></table></div><div id="showinfo"></div></fieldset></td></tr></table>';
  h += '</td></tr></table></div>';
  document.write(h);
  ht_layer = document.getElementById('ht_layer');
  ht_iframe = document.getElementById('htFrame');
   function mmm()
   {
		if(window.event==null){
	    ht_x=(document.documentElement.scrollLeft+ document.body.scrollLeft+screen.width)/2-100;
		ht_y =(document.documentElement.scrollTop+document.body.scrollTop)/2+100;
		}else{
		ht_x=(window.event.clientX+document.documentElement.scrollLeft+ document.body.scrollLeft)-130;
		ht_y =(window.event.clientY+document.documentElement.scrollTop+document.body.scrollTop);
			if(ht_x<=1){ht_x=window.event.clientX+2};
			if((ht_y+200)>(document.body.scrollTop+document.body.scrollHeight)){ht_y=ht_y-200}
		}
	    ht_layer.style.left=ht_x;
	    ht_layer.style.top=ht_y;
	    ht_layer.style.display="block";
  }

  function showinfonull(id)
  {
	GetId(id).innerHTML='';
  }
  function htClose()
  {
  ht_layer.style.display="none";
  }
  function gored()
  {
  window.open('');
  }
  function loginin() {
	var u=loginform.U_LoginName.value;
	var p=loginform.U_LoginPass.value;
	var c='0';	//loginform.rancode.value;
	if (u=='') {
	 alert("提示:\n\t请输入你的用户名!用户名不能为空");
	 return false
	}
	if (p==''){
	 alert("提示:\n\t请输入你的密码!密码不能为空");
	 return false
	}
	if (c==''){
	 alert("提示:\n\t请输入验证码!验证码不能为空");
	 return false
	}
	SubmitLogin("submitlogin",u,p,c)
  }
 
function CreateXMLHttpRequest()
{
	if (window.ActiveXObject)
	{
		xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");		//new ActiveXObject("Microsoft.XMLHTTP");
	}
	else
	{
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");		//new XMLHttpRequest();
	}
}

function SubmitLogin(id,u,p,c)
{
	CreateXMLHttpRequest();
	if(xmlHttp)
	{
		
		xmlHttp.open('POST',ht_host+'userlogin.asp',true);//?rancode='+c
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		var SendData='U_LoginName='+escape(u)+'&U_LoginPass='+escape(p)+'&rndcode='+c;
		xmlHttp.send(SendData);
		xmlHttp.onreadystatechange=function()
		{
		   if(xmlHttp.readyState==4)
		   {
			 if(xmlHttp.status==200)
			 {
			   if (xmlHttp.responseText=='Error')
			   {
				 GetId(id).innerHTML="<li style=line-height:60px;text-align:center;color:blue;cursor:hand; onclick=SubmitLogin('submitlogin','','','');>点此重新登录</li>";
				 window.alert('对不起，用户名或密码有误!');
				 //window.location.reload();
			   }else{
				GetId(id).innerHTML = xmlHttp.responseText;
				xmlHttp.abort();
				xmlHttp	= null;	
				}
			 }
			 else
			 {
				GetId(id).innerHTML='出错：' + xmlHttp.statusText;
				xmlHttp.abort();
				xmlHttp	= null;	
			 }
		   }
		   else
		   {
				GetId(id).innerHTML="正在提交数据...";
		   }
	  	}
		
	 }
	 else
	 {
	 	GetId(id).innerHTML='抱歉，您的浏览器不支持XMLHttpRequest，请使用IE6以上版本！';
	 }
}
function showarticle(uid,p)
{
	CreateXMLHttpRequest();
	if(xmlHttp)
	{
		xmlHttp.open('POST',ht_host+'info.php',true);
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlHttp.send();
		xmlHttp.onreadystatechange=function()
		{
		   if(xmlHttp.readyState==4)
		   {
			 if(xmlHttp.status==200)
			 {
				GetId(uid).innerHTML = xmlHttp.responseText;	
				//xmlHttp.abort();
				//xmlHttp	= null;	
			 }
			 else
			 {
				GetId(uid).innerHTML='出错：' + xmlHttp.statusText;
				//xmlHttp.abort();
				//xmlHttp	= null;	
			 }
		   }
		   else
		   {
				GetId(uid).innerHTML='正在提交数据...';
		   }
	  	}
	 }
	 else
	 {
	 	GetId(uid).innerHTML='抱歉，您的浏览器不支持XMLHttpRequest，请使用IE6以上版本！';
	 }
}
function expert(uid,p)
{
	CreateXMLHttpRequest();
	if(xmlHttp)
	{
		xmlHttp.open('GET',ht_host+'iask/exp_js.asp',true);
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlHttp.send();
		xmlHttp.onreadystatechange=function()
		{
		   if(xmlHttp.readyState==4)
		   {
			 if(xmlHttp.status==200)
			 {
				GetId(uid).innerHTML = xmlHttp.responseText;	
				//xmlHttp.abort();
				//xmlHttp	= null;	
			 }
			 else
			 {
				GetId(uid).innerHTML='出错：' + xmlHttp.statusText;
				//xmlHttp.abort();
				//xmlHttp	= null;	
			 }
		   }
		   else
		   {
				GetId(uid).innerHTML='正在提交数据...';
		   }
	  	}
	 }
	 else
	 {
	 	GetId(uid).innerHTML='抱歉，您的浏览器不支持XMLHttpRequest，请使用IE6以上版本！';
	 }
}
function GetId(id)
{
	return document.getElementById(id);
} 

function setFocus1(i,v,h,s){
	for(var x=1;x<=s;x++){
		if(x==i){	
			document.getElementById(v+x).style.display="block";
			document.getElementById(h+x).className="hiton";
		}
		else{
			document.getElementById(v+x).style.display="none";
			document.getElementById(h+x).className="hit";
		}
	}
}
function setFocus(i,v,h,s){
	for(var x=1;x<=s;x++){
		if(x==i){	
			document.getElementById(v+x).style.display="block";
			document.getElementById(h+x).className="hiton";
		}
		else{
			document.getElementById(v+x).style.display="none";
			document.getElementById(h+x).className="hit";
		}
	}
}
function setFocus2(v,c,s,i){
	for(var x=1;x<=s;x++){
		if(x==i){	
			document.getElementById(v+x).style.display="block";
			document.getElementById(c+x).className="t b_ b5";
		}
		else{
			document.getElementById(v+x).style.display="none";
			document.getElementById(c+x).className="t b_ b6";
		}
	}
}
//onmousewheel="return bbimg(this);
function bbimg(o)
{
  var zoom=parseInt(o.style.zoom, 10)||100;
  zoom+=event.wheelDelta/12;
  if (zoom>0) o.style.zoom=zoom+'%';
  return false;
}
function iAskLogin(u,p,c)
{
	CreateXMLHttpRequest();
	if(xmlHttp)
	{
		xmlHttp.open('POST',ht_host+'userlogin.asp',true);//?rancode='+c
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		var SendData='U_LoginName='+escape(u)+'&U_LoginPass='+escape(p)+'&rndcode='+c;
		xmlHttp.send(SendData);
		xmlHttp.onreadystatechange=function()
		{
		   if(xmlHttp.readyState==4)
		   {
			 if(xmlHttp.status==200)
			 {
			   if (xmlHttp.responseText=='Error')
			   {
				 GetId(id).innerHTML="<li style=line-height:60px;text-align:center;color:blue;cursor:hand; onclick=SubmitLogin('submitlogin','','','');>点此重新登录</li>";
				 window.alert('对不起，用户名或密码有误!');
				 //window.location.reload();
			   }else{
				//GetId(id).innerHTML = xmlHttp.responseText;
				xmlHttp.abort();
				xmlHttp	= null;	
				}
			 }
			 else
			 {
				GetId(id).innerHTML='出错：' + xmlHttp.statusText;
				xmlHttp.abort();
				xmlHttp	= null;	
			 }
		   }
		   else
		   {
				//GetId(id).innerHTML="正在提交数据...";
		   }
	  	}
		
	 }
	 else
	 {
	 	GetId(id).innerHTML='抱歉，您的浏览器不支持XMLHttpRequest，请使用IE6以上版本！';
	 }
}
function oBlogLogin(u,p,c)
{
	CreateXMLHttpRequest();
	if(xmlHttp)
	{
		xmlHttp.open('POST','/oblog/login.asp?chk=1',true);//?rancode='+c
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		var SendData='UserName='+escape(u)+'&Password='+escape(p)+'&CookieDate='+c;
		xmlHttp.send(SendData);
		xmlHttp.onreadystatechange=function()
		{
		   if(xmlHttp.readyState==4)
		   {
			 if(xmlHttp.status==200)
			 {
			   if (xmlHttp.responseText=='Error')
			   {
				 GetId(id).innerHTML="<li style=line-height:60px;text-align:center;color:blue;cursor:hand; onclick=SubmitLogin('submitlogin','','','');>点此重新登录</li>";
				 window.alert('对不起，用户名或密码有误!');
				 //window.location.reload();
			   }else{
				//GetId(id).innerHTML = xmlHttp.responseText;
				xmlHttp.abort();
				xmlHttp	= null;	
				}
			 }
			 else
			 {
				GetId(id).innerHTML='出错：' + xmlHttp.statusText;
				xmlHttp.abort();
				xmlHttp	= null;	
			 }
		   }
		   else
		   {
				//GetId(id).innerHTML="正在提交数据...";
		   }
	  	}
		
	 }
	 else
	 {
	 	GetId(id).innerHTML='抱歉，您的浏览器不支持XMLHttpRequest，请使用IE6以上版本！';
	 }
}
