﻿// JScript 文件

function land()
{
    alert("请登录，再下单！");
}


var xmlHttpIsLogin;
var thegourl;
//创建xmlhttprequest对象
function CreateXmlHttpIslogin()
{
    var activeKey = new Array("MSXML2.XMLHTTP.5.0",
                              "MSXML2.XMLHTTP.4.0",
                              "MSXML2.XMLHTTP.3.0",
                              "MSXML2.XMLHTTP",
                              "Microsoft.XMLHTTP");
    if(window.ActiveXObject)
    {
    
         for(var i= 0;i < activeKey.length;i++)
         {
             try
             {
                xmlHttpIsLogin = new ActiveXObject(activeKey[i]);
                if(xmlHttpIsLogin != null)
                {
                     return xmlHttpIsLogin;
                }
             }
             catch(error)
             {
                        continue;
             }                
         }
         throw new Error("浏览器版本过低，请更新浏览器！");
             
     }
     else if(window.XMLHttpRequest)
     { 
          xmlHttpIsLogin = new XMLHttpRequest();                  
     }
}
        
 //控件事件所调用方法
function IsLoginCheck(goulr)
{  
      CreateXmlHttpIslogin();        
     var url = "AjaxHandler/IsLogin.ashx"; 
     thegourl = goulr;        
     xmlHttpIsLogin.onreadystatechange = handleStateIsLoginCheck;  
     xmlHttpIsLogin.open('POST',url,true); 
     xmlHttpIsLogin.send("");           
}

 //请求状态及响应       
function handleStateIsLoginCheck()
{
        
     if(xmlHttpIsLogin.readyState == 4)
     { 
        
           if(xmlHttpIsLogin.status == 200)
           { 
          
               var textDoc = xmlHttpIsLogin.responseText;
               if(textDoc == "ok")
               {
                   window.location = thegourl; 
               }
               else
               {
                   alert("请您先登录！");
               }
                            
           }
           else
           {
                alert(xmlHttpIsLogin.statusText);
           }
     }
     
}


function shoucang()
{ 
    if (document.all) 
    window.external.AddFavorite("http://www.dh517.com", "德和商务"); 
    else if (window.sidebar) 
    window.sidebar.addPanel("德和商务", "http://www.dh517.com", "");
}







///////////////////////找回密码、、、、
var xmlHttpfindpwd;

//创建xmlhttprequest对象
function CreateXmlHttpfindpwd()
{
    var activeKey = new Array("MSXML2.XMLHTTP.5.0",
                              "MSXML2.XMLHTTP.4.0",
                              "MSXML2.XMLHTTP.3.0",
                              "MSXML2.XMLHTTP",
                              "Microsoft.XMLHTTP");
    if(window.ActiveXObject)
    {
    
         for(var i= 0;i < activeKey.length;i++)
         {
             try
             {
                xmlHttpfindpwd = new ActiveXObject(activeKey[i]);
                if(xmlHttpfindpwd != null)
                {
                     return xmlHttpfindpwd;
                }
             }
             catch(error)
             {
                        continue;
             }                
         }
         throw new Error("浏览器版本过低，请更新浏览器！");
             
     }
     else if(window.XMLHttpRequest)
     { 
          xmlHttpfindpwd = new XMLHttpRequest();                  
     }
}
 
function findpwd()
{
    var findemail = document.getElementById('txtfindEmail').value;
    if( findemail == "")
    {
        alert("请填写您的用户名！");
        return false;
    }
    else if(findemail.length > 50 )
    {
        alert("用户名不要超过50位！请重新填写！");
        return false;
    }
    else
    {
         var uid = document.getElementById('txtfindEmail').value;
         CreateXmlHttpfindpwd();        
         var url = "AjaxHandler/FindPwd.ashx?uid="+uid;  
         xmlHttpfindpwd.onreadystatechange = handleStateFindPwd;  
         xmlHttpfindpwd.open('POST',url,true); 
         xmlHttpfindpwd.send("");         
    }
    
}       
 

 //请求状态及响应       
function handleStateFindPwd()
{
        
     if(xmlHttpfindpwd.readyState == 4)
     { 
        
           if(xmlHttpfindpwd.status == 200)
           { 
               
               var textDoc = xmlHttpfindpwd.responseText; 
               var testData = document.getElementById('findresult');   
               testData.innerHTML = textDoc;      
           }
           else
           {
                alert(xmlHttpfindpwd.statusText);
           }
     }
     
}

//老外在线交易
function isSuper(fid)
{
   
    $.ajax({
		type:"post",
		url:"Ajax.aspx",
		data:"ot=issuperlier&fid="+fid,
		
			success:function(ResponseText){
			
			    if(ResponseText != "")
			    {
			        alert(ResponseText);
			    }
			    else
			    {
			        location.href = "member-facetoface-online-"+fid+".html";
			    }
                //location.href = "member-facetofaceorder.html";
			},
			error:function(ResponseText)
			{
				alert(ResponseText);
			}
		});
}
//等待交易
function isAwait(fid)
{
   
    $.ajax({
		type:"post",
		url:"Ajax.aspx",
		data:"ot=issuperlier&fid="+fid,
		
			success:function(ResponseText){
			
			    if(ResponseText != "")
			    {
			        alert(ResponseText);
			    }
			    else
			    {
			        location.href = "member-facetoface-await-"+fid+".html";
			    }
                //location.href = "member-facetofaceorder.html";
			},
			error:function(ResponseText)
			{
				alert(ResponseText);
			}
		});
}


