﻿
//用户电话格式焦点设置
function telfocus(value,var1)
{
    if(value.length == 3)
    {
        
        if(var1 == 1)
        {
            $("usphone2").focus();
            
        }
        if(var1 == 2)
        {
            $("usphone3").focus();
            
        }
    }   
}
function register()
{
    var name;
    var email;
    var reemail;
    var pass;
    var repass;
    var msn;
    var phone1;
    var phone2;
    var phone3;
    var phone;
    var usphone;
    var nousphone;
    var mobile;
    var workphone;
    var vmsn;
    
    name = $F("nametb").strip();
    email = $F("emailtb").strip();
    reemail = $F("reemailtb").strip();
    pass = $F("passtb").strip();
    repass = $F("repasstb").strip();
    msn = $F("msntb").strip();
    phone1 = $F("usphone1").strip();
    phone2 = $F("usphone2").strip();
    phone3 = $F("usphone3").strip();
    usphone = phone1 + "-" + phone2 + "-" + phone3;
    nousphone = $("nousphonetb").value.strip();
    mobile = $F("mobiletb").strip();
    workphone = $F("workphonetb").strip();

    if(name == "" || email == "" || reemail == "" || pass == "" || repass == "")
    {
        alert("Please Fill all *!");
        return;
    }
    
    if(usphone.length == 2 && nousphone == "")
    {
        alert("Please Fill all *!");
        return;
    }
    
    if(usphone.length == 12)
    {
        phone = usphone;
    }
    
    if(usphone.length > 2 &&  usphone.length < 12)
    {
        alert("Please check usphone!");
        return;
    }
    
    if(usphone.length == 2 && nousphone != "")
    {
        phone = nousphone;
    }
    
    if(email != reemail)
    {
        alert("Please check email!");
        return;
    }
    
    var res = /^[0-9a-zA-Z_\-\.]+@[0-9a-zA-Z_\-]+(\.[0-9a-zA-Z_\-]+)*$/;  
    var re = new RegExp(res);
    if(!re.test(email))
    {
        alert("Please check email");
        return;
    } 
    
    if(pass != repass)
    {
        alert("Please check password");
        return;
    }
    
    $("regnext").style.display = "none";

     if($("Img1") != null)
    {
         $("Img1").style.display = "";
    }
    
    var xmlStr = "<loginfo>";
    xmlStr += "<name>" + escape(name) + "</name>";
    xmlStr += "<email>" + escape(email) + "</email>";
    xmlStr += "<pass>" + escape(pass) + "</pass>";
    xmlStr += "<msn>" + escape(msn) + "</msn>";
    xmlStr += "<phone>" + escape(phone) + "</phone>";
    xmlStr += "<mobile>" + escape(mobile) + "</mobile>";
    xmlStr += "<workphone>" + escape(workphone) + "</workphone>";
    xmlStr += "</loginfo>";
    
    var url = "ashx/customerReg.ashx";
    
    var myAjax = new Ajax.Request
                (   
                    url,   
                    {
                        method: "post", 
                        postBody: xmlStr, 
                        onComplete: registerDo
                    }   
                );  
}

function registerDo(xmlhttp)
{
    var result = xmlhttp.responseText;
    
    if(result == "success")
    {
        $("div1").style.display = "none";
        $("div2").style.display = "";
    }
    else
    {
        alert(result);
        $("regnext").style.display = "";
        $("Img1").style.display = "none";
    }
}

//查找密码

function findpass()
{
    var email = $F("femailtb").strip();
    
    if(email == "")
    {
        alert("Please fill Email!");
        return;
    }
    var res = /^[0-9a-zA-Z_\-\.]+@[0-9a-zA-Z_\-]+(\.[0-9a-zA-Z_\-]+)*$/;  
    var re = new RegExp(res);
    if(!re.test(email))
    {
        alert("Please check email");
        return;
    } 
    
    var xmlStr = "<loginfo>";
    xmlStr += "<email>" + escape(email) + "</email>";
    xmlStr += "</loginfo>";
    
    var url = "ashx/password.ashx";
    
    var myAjax = new Ajax.Request
                (   
                    url,   
                    {
                        method: "post", 
                        postBody: xmlStr, 
                        onComplete: findpassDo
                    }   
                );  
}

function findpassDo(xmlhttp)
{
    var result = xmlhttp.responseText;
    
    if(result == "0")
    {
        $("div1").style.display = "";
        $("div2").style.display = "";
        $("div3").style.display = "none";
    }
    
    if(result == "yes")
    {
        $("div1").style.display = "none";
        $("div2").style.display = "none";
        $("div3").style.display = "";
    }
    
    if(result == "no")
    {
        $("div1").style.display = "";
        $("div2").style.display = "none";
        $("div3").style.display = "none";
        
        alert("Send Eamil failed,please try again!");
    }
}

//用户登录
function cuslogin()
{
    var email = $F("logemailtb").strip();
    var pass = $F("logpasstb");
    
    if(email == "" || pass == "")
    {
        alert("Please fill all!");
        return;
    }
    
    var res = /^[0-9a-zA-Z_\-\.]+@[0-9a-zA-Z_\-]+(\.[0-9a-zA-Z_\-]+)*$/;  
    var re = new RegExp(res);
    if(!re.test(email))
    {
        alert("Please check email");
        return;
    } 
    
    var xmlStr = "<loginfo>";
    xmlStr += "<email>" + escape(email) + "</email>";
    xmlStr += "<pass>" + escape(pass) + "</pass>";
    xmlStr += "</loginfo>";
    
    var url = "ashx/login.ashx";
    
    var myAjax = new Ajax.Request
                                (   
                                    url,   
                                    {
                                        method: "post", 
                                        postBody: xmlStr, 
                                        onComplete: cusLoginDo
                                    }   
                                );  
}

function cusLoginDo(xmlhttp)
{
    var result = xmlhttp.responseText;
    
    if(result == "")
    {
        alert("Email or password is not true,please check!");
        return;
    }
    
    setCookie("customerinfo", result, 1);
    readcustomercookielog();
    getSuggCount();
    checklogin();
}

//read customerinfo cookie
function readcustomercookielog()
{
    var result = getCookie("customerinfo");
    var arr;
    
    if(result != null && result != "")
    {
        arr = result.split("|||");
        
        if(arr.length == 11)
        {
            $("spname").innerHTML = arr[2];
            $("spvip").innerHTML = arr[7];
            upoints();
            $("logtb1").style.display = "none";
            $("logtb2").style.display = "";
        }
    }
}
//用户登出
function cuslogout()
{
    document.location = "index.html";
    setCookie("customerinfo", "", -1);
    $("logtb1").style.display = "";
    $("logtb2").style.display = "none";
    $("logemailtb").value = "";
    $("logpasstb").value = ""; 
}
function cs2()
{
    form1.reset();
}

// 预载入用户信息

function userinfoload()
{
    var result = getCookie("customerinfo");
    var arr;
   
    
    if(result != null && result != "")
    {
        arr = result.split("|||");
        if(arr.length == 11)
        {
            $("mfullname").value = arr[2];
            $("memail").innerHTML = arr[1];
            $("mmsn").value = arr[9];
            
            var arr2 = arr[3].split("-");
            if(arr2.length == 3)
            {
                $("usphone1").value = arr2[0];
                $("usphone2").value = arr2[1];
                $("usphone3").value = arr2[2];
            }
            $("nousphonetb").value = arr[4];
            $("mmobile").value = arr[4];
            $("mworkphone").value = arr[5];
        }
        $("div1").style.display = "none";
        $("div2").style.display = "";
    }
    else
    {
       $("div1").style.display = "";
        $("div2").style.display = "none";
    }
}

//预载页面信息 Gold
function goldoad()
{
    var result = getCookie("customerinfo");
    var arr;
    
    if(result != null && result != "")
    {
        arr = result.split("|||");
        
        if(arr.length == 11)
        {
            $("fullname").value = arr[2];
            $("youremail").value = arr[1];
            
            var arr2 = arr[3].split("-");
            if(arr2.length == 3)
            {
                $("usphone1").value = arr2[0];
                $("usphone2").value = arr2[1];
                $("usphone3").value = arr2[2];
            }
            
            $("nonus").value = arr[4];
            
        }
    }
}
//预载页面信息 POWER
function powerload()
{
    var result = getCookie("customerinfo");
    var arr;
    
    if(result != null && result != "")
    {
        arr = result.split("|||");
        
        if(arr.length == 11)
        {
            $("fullnametb").value = arr[2];
            $("emailtb").value = arr[1];
            
            var arr2 = arr[3].split("-");
            if(arr2.length == 3)
            {
                $("usphone1").value = arr2[0];
                $("usphone2").value = arr2[1];
                $("usphone3").value = arr2[2];
            }
            
            $("nonus").value = arr[4];
            
        }
    }
}
// 修改用户信息

function usermodify()
{
   var result = getCookie("customerinfo");
   var arr,useremail;
   arr = result.split("|||");
   useremail = arr[1];
   if($F("mfullname") == "")
   {
       alert("Please input name!");
       return;
   }
   
   if($F("usphone1") + $F("usphone2") + $F("usphone3") == "" && $F("nousphonetb") == "")
   {
       alert("Please fill telephone!");
       return;
   }
   
//   var res = /^[0-9a-zA-Z_\-\.]+@[0-9a-zA-Z_\-]+(\.[0-9a-zA-Z_\-]+)*$/;  
//   var re = new RegExp(res);
//   if(!re.test($F("mmsn")))
//   {
//       alert("Please check MSN!");
//       return;
//   } 
   vusphone = $F("usphone1") + "-" + $F("usphone2") + "-" + $F("usphone3");
    if(vusphone == "--")
    {
        vusphone = "";
    }
    
     var umobile = $("nousphonetb").value;
                    var xmlStr = "<loginfo>";
                    xmlStr += "<useremail>" + escape(useremail) + "</useremail>";
                    xmlStr += "<fullname>" + escape($F("mfullname")) + "</fullname>";
                    xmlStr += "<usphone>" + escape(vusphone) + "</usphone>";
                    xmlStr += "<nousphone>" + escape(umobile) + "</nousphone>";
                    xmlStr += "<msn>" + escape($F("mmsn")) + "</msn>";
                    xmlStr += "<workphone>" + escape($F("mworkphone")) + "</workphone>";
                    xmlStr += "</loginfo>";
                    
                    var url = "ashx/modifyuserinfo.ashx";
                    
                    var myAjax = new Ajax.Request
                                (   
                                    url,   
                                    {
                                        method: "post", 
                                        postBody: xmlStr, 
                                        onComplete: modifyuserinfoDo
                                    }   
                                    
                                 );  
}

function modifyuserinfoDo(xmlhttp)
{
    var result = xmlhttp.responseText; 
    
    if(result == "" || result == "errpass" || result == "no")
    {
        alert("Email or password is not true,please check!");
        return;
    }
    else
    {
        alert("Modify Password OK");
        cuslogout()
        return;
    }
}

// 修改用户密码预载入

function modifypasswordload()
{
   var result = getCookie("customerinfo");
   var arr;
   if(result != null && result != "")
     {
        $("div1").style.display = "none";
        $("div2").style.display = "";
     }
     else
     {
        $("div1").style.display = "";
        $("div2").style.display = "none";
     }
}

// 修改用户密码

function modifypassword()
{

   var result = getCookie("customerinfo");
   var arr,useremail;
   if(result != null && result != "")
    {
       arr = result.split("|||");
       useremail = arr[1];
       
       if( $F("newpass") == "" ||  $F("rnewpass") =="" ||  $F("oldpass") =="")
            {
                alert("Please input Password!");
            }
            else
            {
              if( $F("newpass") !=  $F("rnewpass"))
                {
                    alert("New Password and Repeat New Password must be the same!");
                }
                else
                {
                    var xmlStr = "<loginfo>";
                    xmlStr += "<useremail>" + escape(useremail) + "</useremail>";
                    xmlStr += "<oldpass>" + escape($F("oldpass")) + "</oldpass>";
                    xmlStr += "<newpass>" + escape($F("newpass")) + "</newpass>";
                    xmlStr += "</loginfo>";
                    
                    var url = "ashx/modifypassword.ashx";
                    
                    var myAjax = new Ajax.Request
                                (   
                                    url,   
                                    {
                                        method: "post", 
                                        postBody: xmlStr, 
                                        onComplete: modifypasswordDo
                                    }   
                                );  
                }
            }
   
     }
     else
     {
        $("div1").style.display = "";
        $("div2").style.display = "none";
     }
}

function  modifypasswordDo(xmlhttp)
{
    var result = xmlhttp.responseText;
    
    if(result == "" || result == "errpass" || result == "no")
    {
        alert("Email or password is not true,please check!");
        return;
    }
    else
    {
        alert("Modify Password OK");
        return;
    }
}

function loadSuggstion()
{ 
     var result = getCookie("customerinfo");
     var arr,useremail;
     if(result!=null)
     {
         arr = result.split("|||");
         useremail = arr[1];
        if(useremail==undefined || useremail=="")
        {
             alert("please login in");
            return;
        }
        
         var url = "ashx/setmesscount.ashx?uid=" + escape(arr[0])+"&Page=compl";
             
          var myAjax = new Ajax.Request
                                   (
                                        url,
                                        {
                                           method: "get",
                                           onComplete: dd
                                        }
                                    );
                                    
        
           url = "ashx/MessageOfRep.ashx?uid=" + escape(useremail)+"&type=1";
             
           myAjax = new Ajax.Request
                                   (
                                        url,
                                        {
                                           method: "get",
                                           onComplete: bindSuggstion
                                        }
                                    );
   }
  
}

function dd(){}

function bindSuggstion(xmlhttp)
{
     var xml = xmlhttp.responseXML;
    
    if(xmlhttp.responseText != "<NewDataSet />")
    {
         var pricelist = xml.getElementsByTagName("Table");
  

         for(var i = 0; i < pricelist.length; i++)
         {
         
                 var isSuggestion=pricelist[i].getElementsByTagName("content")[0]; 
                 var isReply=pricelist[i].getElementsByTagName("Reply")[0];
                 var isReplyTime=pricelist[i].getElementsByTagName("ReplyTime")[0];
                 var issTime=pricelist[i].getElementsByTagName("stime")[0];
                if(isSuggestion != null && isReply != null &&  isReplyTime!=null && issTime!=null)
                {
                     var Suggestionis=pricelist[i].getElementsByTagName("content")[0].childNodes[0];
                     var Replyis=pricelist[i].getElementsByTagName("Reply")[0].childNodes[0];
                     var ReplyTimeis=pricelist[i].getElementsByTagName("ReplyTime")[0].childNodes[0];
                     var sTimeis=pricelist[i].getElementsByTagName("stime")[0].childNodes[0];
                     if(Suggestionis != null && Replyis != null &&  ReplyTimeis!=null && sTimeis!=null)
                     {
                          var Suggestion =pricelist[i].getElementsByTagName("content")[0].childNodes[0].nodeValue;
                          var Reply =pricelist[i].getElementsByTagName("Reply")[0].childNodes[0].nodeValue;
                          var ReplyTime  = pricelist[i].getElementsByTagName("ReplyTime")[0].childNodes[0].nodeValue;
                          var sTime=pricelist[i].getElementsByTagName("stime")[0].childNodes[0].nodeValue;
                                                  
                           if(i%2==0)
                           {
                                var row = document.createElement("tr");  
                                var cell = document.createElement("td");
                                cell.setAttribute("width", "40"); 
                                cell.valign = "top";
                                cell.setAttribute("className", "pt7 pl18");
                                cell.setAttribute("class", "pt7 pl5");  
                                cell.innerHTML ="<div class='fl suborder'><img src='images/smile1.jpg' width='29' height='32' /></div>";
                                row.appendChild(cell); 
                                
                                var  sugg=Suggestion.split("---");
                                
                                cell = document.createElement("td");
                                cell.setAttribute("width", "354");   
                                cell.innerHTML ="<div class='fwb newp1 fwb'>"+sugg[0]+"</div><div class='lh18 c_w'>"+sugg[1]+"</div> <div class='suc_d lh18'>"+sTime+"</div>";
                                row.appendChild(cell);
                                $("messgaeofrep").appendChild(row);
                            
                                row = document.createElement("tr");  
                                cell = document.createElement("td");
                                cell.setAttribute("width", "40"); 
                                cell.setAttribute("className", "pt7 pl18 pb15");
                                cell.setAttribute("class", "pt7 pl5 pb15");  
                                cell.innerHTML ="<div class='fl suborder'><img src='images/smile2.jpg' width='29' height='32' /></div>";
                                row.appendChild(cell); 
                                
                                cell = document.createElement("td");
                                cell.setAttribute("width", "354");   
                                cell.setAttribute("className", "newp1 pb15");
                                cell.setAttribute("class", "newp1 pb15");  
                                cell.innerHTML ="<div class='lh18 c_w fwb'>"+Reply+"</div> <div class='suc_d lh18'>"+ReplyTime+"</div>";
                                row.appendChild(cell);
                                $("messgaeofrep").appendChild(row);
                            }else
                            {
                             
                                var row = document.createElement("tr");  
                                var cell = document.createElement("td");
                                
                                cell.colSpan=2;
                                cell.innerHTML ="<img src='images/A11_03.jpg' width='366' height='1' />";
                                row.appendChild(cell); 
                                $("messgaeofrep").appendChild(row);
                                
                                
                                row = document.createElement("tr");  
                                cell = document.createElement("td");
                                cell.setAttribute("width", "40"); 
                                cell.valign = "top";
                                cell.setAttribute("className", "pt7 pl18 suc_bg");
                                cell.setAttribute("class", "pt7 pl5 suc_bg");  
                                cell.innerHTML ="<div class='fl suborder'><img src='images/smile1.jpg' width='29' height='32' /></div>";
                                row.appendChild(cell); 
                                var  sugg=Suggestion.split("---");
                                cell = document.createElement("td");
                                cell.setAttribute("width", "354");  
                                cell.setAttribute("className","  suc_bg");
                                cell.setAttribute("class", "  suc_bg");
                                cell.innerHTML ="<div class='fwb newp1 fwb'>"+sugg[0]+"</div><div class='lh18 c_w'>"+sugg[1]+"</div> <div class='suc_d lh18'>"+sTime+"</div>";
                                row.appendChild(cell);
                                $("messgaeofrep").appendChild(row);
                            
                                row = document.createElement("tr");  
                                cell = document.createElement("td");
                                cell.setAttribute("height", "40"); 
                                cell.setAttribute("className", "pt7 pl18 suc_bg pb15");
                                cell.setAttribute("class", "pt7 pl5 suc_bg pb15");  
                                cell.innerHTML ="<div class='fl suborder'><img src='images/smile2.jpg' width='29' height='32' /></div>";
                                row.appendChild(cell); 
                                
                                cell = document.createElement("td");
                                cell.setAttribute("width", "354");   
                                cell.setAttribute("className", "newp1 suc_bg pb15 pt10");
                                cell.setAttribute("class", "newp1 suc_bg pb15 pt10");  
                                cell.innerHTML ="<div class='lh18 c_w fwb'>"+Reply+"</div> <div class='suc_d lh18'>"+ReplyTime+"</div>";
                                row.appendChild(cell);
                                
                                $("messgaeofrep").appendChild(row);
                                
                                row = document.createElement("tr");  
                                cell = document.createElement("td");
                                
                                cell.colSpan=2;
                                cell.innerHTML ="<img src='images/A11_03.jpg' width='366' height='1' />";
                                row.appendChild(cell); 
                                $("messgaeofrep").appendChild(row);
                                
                            }  
                     }
                }
         }
    }
}


function loadInformofnewactivities()
{
    var result = getCookie("customerinfo");
     var arr,useremail;
     
     if(result!=null)
     {
         arr = result.split("|||");
         useremail = arr[1];
        if(useremail==undefined || useremail=="")
        {
             alert("please login in");
            return;
        }
         var url = "ashx/setmesscount.ashx?uid=" + escape(arr[0])+"&Page=cusaward";
             
          var myAjax = new Ajax.Request
                                   (
                                        url,
                                        {
                                           method: "get",
                                           onComplete: dd
                                        }
                                    );
    }
}


function loadOASuggstion()
{ 
     var result = getCookie("customerinfo");
     var arr,useremail;
     if(result!=null)
     {
         arr = result.split("|||");
         useremail = arr[1];
        if(useremail==undefined || useremail=="")
        {
             alert("please login in");
            return;
        }
         var url = "ashx/setmesscount.ashx?uid=" + escape(arr[0])+"&Page=sugg";
             
          var myAjax = new Ajax.Request
                                   (
                                        url,
                                        {
                                           method: "get",
                                           onComplete: dd
                                        }
                                    );
        
        
           url = "ashx/MessageOfRep.ashx?uid=" + escape(useremail);
             
           myAjax = new Ajax.Request
                                   (
                                        url,
                                        {
                                           method: "get",
                                           onComplete: bindOASuggstion
                                        }
                                    );
     }                               
  
}

function bindOASuggstion(xmlhttp)
{
     var xml = xmlhttp.responseXML;
    
    if(xmlhttp.responseText != "<NewDataSet />")
    {
         var pricelist = xml.getElementsByTagName("Table");
   
 
         for(var i = 0; i < pricelist.length; i++)
         {
               if(pricelist[i].getElementsByTagName("Suggestion")[0] != null && pricelist[i].getElementsByTagName("sTime")[0] !=null)
               {
                   if(pricelist[i].getElementsByTagName("Suggestion")[0].childNodes[0] != null && pricelist[i].getElementsByTagName("sTime")[0].childNodes[0] !=null)
                   {
                   
                   
                   
                       var OASuggestion =pricelist[i].getElementsByTagName("Suggestion")[0].childNodes[0].nodeValue;
                       var ReplyTime= pricelist[i].getElementsByTagName("sTime")[0].childNodes[0].nodeValue;
                       ReplyTime=ReplyTime.substring(0,ReplyTime.indexOf('T')).replace("-","/").replace("-","/");
                      
                           if(i%2==1)
                           {
                                var row = document.createElement("tr");  
                                var cell = document.createElement("td");
                                cell.setAttribute("width", "40"); 
                                cell.valign = "top";
                                cell.setAttribute("className", "pt7 pl18");
                                cell.setAttribute("class", "pt7 pl5");  
                                cell.innerHTML ="<div class='fl suborder'><img src='images/xiao.jpg' width='29' height='32' /></div>";
                                row.appendChild(cell); 
                                
                             
                                
                                cell = document.createElement("td");
                                cell.setAttribute("width", "354");   
                                cell.innerHTML ="<div class='lh18 c_w'>"+OASuggestion+"</div> <div class='suc_d lh18'>"+ReplyTime+"</div>";
                                row.appendChild(cell);
                                $("messgaeofrep").appendChild(row);
                              
                            }else
                            {
                            
                                var row = document.createElement("tr");  
                                var cell = document.createElement("td");
                                
                                cell.colSpan=2;
                                cell.innerHTML ="<img src='images/A11_03.jpg' width='366' height='1' />";
                                row.appendChild(cell); 
                                $("messgaeofrep").appendChild(row);
                               
                               
                                row = document.createElement("tr");  
                                cell = document.createElement("td");
                                cell.setAttribute("width", "40"); 
                                cell.valign = "top";
                                cell.setAttribute("className", "pt7 pl18 suc_bg");
                                cell.setAttribute("class", "pt7 pl5 suc_bg");  
                                cell.innerHTML ="<div class='fl suborder'><img src='images/xiao.jpg' width='29' height='32' /></div>";
                                row.appendChild(cell); 
                                
                                cell = document.createElement("td");
                                cell.setAttribute("width", "354");  
                                cell.setAttribute("className","  suc_bg");
                                cell.setAttribute("class", "  suc_bg");
                                cell.innerHTML ="<div class='lh18 c_w'>"+OASuggestion+"</div> <div class='suc_d lh18'>"+ReplyTime+"</div>";
                                row.appendChild(cell);
                                $("messgaeofrep").appendChild(row);
                              
                                row = document.createElement("tr");  
                                cell = document.createElement("td");
                                
                                cell.colSpan=2;
                                cell.innerHTML ="<img src='images/A11_03.jpg' width='366' height='1' />";
                                row.appendChild(cell); 
                                $("messgaeofrep").appendChild(row);
                            }  
                   }
              }
         }
    }
}




/* FIFA */




function getNewSubmitForms(sid)
 {      
    var submitForm = document.createElement("form");

    document.body.appendChild(submitForm);

    submitForm.id=sid;                                

    submitForm.method = "POST";               

    submitForm.target="_blank";

    return submitForm;

}

function createNewFormElements(inputForm, elementName, elementValue)
{

     var newElement = document.createElement("input");
     newElement.setAttribute("name", elementName);
     newElement.setAttribute("type", "hidden");
     newElement.value = elementValue;

     inputForm.appendChild(newElement);

     return newElement;
}
function FIFA()
{
    var result = getCookie("customerinfo");
    if(result != null)
    {
         var arr = result.split("|||");
         var useremail = arr[1];
         var ps=arr[0];
         if(useremail==undefined || useremail=="")
         {
             alert("please login in");
             return;
         }
          window.location.href = "apply/index.html";
         
//        var submitForm = getNewSubmitForms("server");
//        createNewFormElements(submitForm, "useremail", useremail);
//        createNewFormElements(submitForm, "ps", ps);
//        submitForm.action= "apply/index.html";
//        submitForm.submit();
   }
}
