﻿// JScript 文件
//在鼠标显示一个层，该层的内空为div2的内容 
function showTip(){ 
var div3 = document.getElementById('div3'); //将要弹出的层 
div3.style.display="block"; //div3初始状态是不可见的，设置可为可见 
//window.event代表事件状态，如事件发生的元素，键盘状态，鼠标位置和鼠标按钮状. 
//clientX是鼠标指针位置相对于窗口客户区域的 x 坐标，其中客户区域不包括窗口自身的控件和滚动条。 
div3.style.left=event.clientX-180; //鼠标目前在X轴上的位置，加10是为了向右边移动10个px方便看到内容 
div3.style.top=event.clientY+1; 
div3.style.position="absolute"; //必须指定这个属性，否则div3层无法跟着鼠标动 
var div2 =document.getElementById('div2'); 
div3.innerHTML=div2.innerHTML; 
} 
//关闭层div3的显示 
function closeTip(){ 
var div3 = document.getElementById('div3'); 
div3.style.display="none"; 
} 

//控制层div2显示的开关 

function switchDIV(){
//var div2 =document.getElementById('<%=login_box.ClientID %>'); 
var div2 =document.getElementById("Top1_login_box"); 
if(div2.style.display=='block'){ 
div2.style.display='none'; 
} 
else{ 
div2.style.display='block'; 
} 
} 

var xmlhttp;
function createXmlhttp(){
    if(window.XMLHttpRequest){
        xmlhttp = new XMLHttpRequest();
            }
            else if(window.ActiveXObject){
            try{
            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
            }catch(e){
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
        }
    return xmlhttp;

}
function ClearSession()
{
    createXmlhttp();
    var url="WebService.asmx/ClearSession";
    xmlhttp.open("POST",url,true);
    xmlhttp.onreadystatechange=handleStateChange;
    xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
    xmlhttp.send();
}
function handleStateChange()
{
    if(xmlhttp.readyState==4)
    {
        if(xmlhttp.status==200)
        {
            //清空成功
            //alert(document.getElementById("Top1_d_login_after"));
            document.getElementById('<%=d_login_after.ClientID %>').style.display="none";
           document.getElementById('<%=d_login_before.ClientID %>').style.display="";
           document.getElementById('<%=login_box.ClientID %>').style.display="none";
            alert('退出成功');
        }
    }
}

  function openUrl2(obj)
  {
       // var optionCollection = document.getElementById("select_member").options;
        var uName=uesrN;//'<%=uesrN %>';
        var pasWrd=uesrPwd;//'<%=uesrPwd %>';
        if(obj=="1")
        {
          window.open("http://vip.hrcworldwide.com/confirmEmail.aspx?account="+uName+"&key="+pasWrd+"&tit=2","","","");
                    
        }else if(obj=="2")
        {
         window.open("http://vip.hrcworldwide.com/confirmEmail.aspx?account="+uName+"&key="+pasWrd+"&tit=4","","","");
            
        }
        /*for(i=0;i<optionCollection.length;i++)
        {
        if(optionCollection[i].selected)
         {
         var td_paydate = optionCollection[i].text;
           if(td_paydate=='个人中心')
           {
              window.open("http://vip.hrcworldwide.com/confirmEmail.aspx?account="+uName+"&key="+pasWrd+"&tit=2","","","");
                      break;
           }
           else if(td_paydate=='订单查询')
           {
               window.open("http://vip.hrcworldwide.com/confirmEmail.aspx?account="+uName+"&key="+pasWrd+"&tit=4","","","");
                       break;
           }else if(td_paydate=='退出')
           {
             ClearSession();
           }*/

        // }
        //}
  }
  
  function sendToVip()
  {
   // var email=document.getElementById('<%=txt_UserName.ClientID %>').value;
     var email=document.getElementById('Top1_txt_UserName').value;
    if(email=='')
    {
      alert('请输入你的账号！');
    }else
    {
       window.open("http://vip.hrcworldwide.com/member-reg-p.aspx?type=1&name="+email+"","","","");
    }
  }



