Charset = "gb2312";
var xmlHttp = createXmlHttpRequest(); 

function createXmlHttpRequest() 
{ 
var xmlhttp = null; 
try 
{ 
xmlhttp = XMLHttpRequest(); 
} 
catch(e1) 
{ 
try 
{ 
xmlhttp = new ActiveXObject("MSXML2.XMLHTTP"); 
} 
catch(e2) 
{ 
try 
{ 
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
} 
catch(e3) 
{ 
xmlhttp = false; 
alert("使用当前浏览器将不能正常访问本站!\n请换用其他浏览器，如：IE、360安全浏览器、腾讯TT、遨游、世界之窗!"); 
window.close();
} 
} 
} 

return xmlhttp; 
} 

function change_key() 
{ 
if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0) 
{ 
var str = document.getElementById("keyword").value; 
xmlHttp.open("get","/qsearch.asp?key=" + str ,true); 
xmlHttp.onreadystatechange = handSearchRequest;  
xmlHttp.send(null); 
} 
} 

function handSearchRequest() 
{ 
if (xmlHttp.readyState == 4) 
{ 
var div = document.getElementById("search_suggest"); 
div.innerHTML = ""; 
div.style.display="inline";
var str = xmlHttp.responseText.split("|"); 

for (var i=0; i<str.length; i++) 
{ 
var suggest ='<div onmouseover="javascript:suggestOver(this);"'; 
suggest +='onmouseout="javascript:suggestOut(this);"'; 
suggest +='onclick="javascript:setSearch(this.innerHTML);"'; 
suggest +='class="suggest_link">' + str[i] +'</div>'; 
div.innerHTML += suggest; 
} 
div.innerHTML += '<div style="color:#ff0000;cursor:hand;margin-right:8px;" align="right" onclick=document.getElementById("search_suggest").style.display="none">close</div>';
 
if (xmlHttp.responseText=="no"){
div.style.display="none";
	}

} 
} 

function setSearch(div_value) 
{ 
document.getElementById("keyword").value = div_value; 
document.getElementById("search_suggest").style.display ="none"; 
form1.submit();
} 

function suggestOver(div_value) 
{ 
div_value.className ='suggest_link_over'; 
} 


function suggestOut(div_value) 
{ 
div_value.className ='suggest_link'; 
} 





//下面得代码是获取最新买家的

    function createXMLHttp() {   
            var xmlHttp2 = false;   
            try{   
                xmlHttp2 = new ActiveXObject("Msxml2.XMLHTTP");   
            }catch (e){   
                try{   
                    xmlHttp2 = new ActiveXObject("Microsoft.XMLHTTP");   
                }catch(E){   
                    xmlHttp2 = false;   
                }   
            }   
            if(!xmlHttp2 && typeof XMLHttpRequest!='undefined'){   
                xmlHttp2 = new XMLHttpRequest();   
            }   
            return xmlHttp2;   
     }   
      function callServer1(pid) {   
	document.getElementById('buyhistory').innerHTML = "<div align='center' style='margin:8px;height:610'><img src='/happy/loading.gif' border='0' /></div>";
        var xmlHttp2 = createXmlHttpRequest();   
        var url = "/buyhistory.asp?id=" + pid;
        xmlHttp2.open("GET",url,true);   
        xmlHttp2.onreadystatechange = function(){   
            if(xmlHttp2.readyState == 4 && xmlHttp2.status == 200){   
                document.getElementById('buyhistory').innerHTML = xmlHttp2.responseText; 
           }      
        }   
        xmlHttp2.send(null); 
    }  

      function callServer2(pid,pageurl) {   
        document.getElementById('buyhistory').innerHTML = "<div align='center' style='margin:8px;height:610'><img src='/happy/loading.gif' border='0' /></div>"; 
        var xmlHttp2 = createXMLHttp();   
        var url = pageurl + "&id=" + pid;
        xmlHttp2.open("GET",url,true);   
        xmlHttp2.onreadystatechange = function(){   
            if(xmlHttp2.readyState == 4 && xmlHttp2.status == 200){   
                document.getElementById('buyhistory').innerHTML = xmlHttp2.responseText; 
           }      
        }   
        xmlHttp2.send(null);    
    }  
//下面是获取如何购买商品的
      function howtobuypro(id) {
	document.getElementById('howtobuypro').innerHTML = "<div align='center' style='margin:8px;height:800px'><img src='/happy/loading.gif' border='0' /></div>";
        var xmlHttp2 = createXmlHttpRequest();   
        var url = "/gethowtobuypro.asp?lct=" + id;
        xmlHttp2.open("GET",url,true);   
        xmlHttp2.onreadystatechange = function(){   
            if(xmlHttp2.readyState == 4 && xmlHttp2.status == 200){   
                document.getElementById('howtobuypro').innerHTML = xmlHttp2.responseText; 
           }      
        }   
        xmlHttp2.send(null);    
    }  

//下面是获取宅急送配送区域的
      function getsendinfo() {   
	document.getElementById('peisonginfo').innerHTML = "<div align='center' style='margin:8px;'><img src='/happy/loading.gif' border='0' /></div>";
        var xmlHttp2 = createXmlHttpRequest();   
        var url = "/getsendinfo.asp";
        xmlHttp2.open("GET",url,true);   
        xmlHttp2.onreadystatechange = function(){   
            if(xmlHttp2.readyState == 4 && xmlHttp2.status == 200){   
                document.getElementById('peisonginfo').innerHTML = xmlHttp2.responseText; 
           }      
        }   
        xmlHttp2.send(null);    
    }  
      function ProvinceChanage() {   
	document.getElementById('cityspan').innerHTML = "loadding...";
        var xmlHttp2 = createXmlHttpRequest();   
        var url = "/getsendinfo.asp?type=1&Province="+document.getElementById('Province').value;
        xmlHttp2.open("GET",url,true);   
        xmlHttp2.onreadystatechange = function(){   
            if(xmlHttp2.readyState == 4 && xmlHttp2.status == 200){   
                document.getElementById('cityspan').innerHTML = xmlHttp2.responseText; 
           }      
        }   
        xmlHttp2.send(null);    
    } 
      function cityChanage() {   
	document.getElementById('areaspan').innerHTML = "loadding...";
        var xmlHttp2 = createXmlHttpRequest();   
        var url = "/getsendinfo.asp?type=2&city="+document.getElementById('city').value;
        xmlHttp2.open("GET",url,true);   
        xmlHttp2.onreadystatechange = function(){   
            if(xmlHttp2.readyState == 4 && xmlHttp2.status == 200){   
                document.getElementById('areaspan').innerHTML = xmlHttp2.responseText; 
           }      
        }   
        xmlHttp2.send(null);    
    } 
      function getplaceinfo() {
	document.getElementById('detailcontent').innerHTML = "<div style='margin-top:12px;margin-left:50px'><img src='/happy/loading.gif' border='0' /></div>";
	if (document.getElementById('Province').value=="") {document.getElementById('detailcontent').innerHTML = "<div style='margin-top:12px;margin-left:50px'><img src='/happy/notice.gif' border='0' /></div>";return false;}
	if (document.getElementById('city').value=="") {document.getElementById('detailcontent').innerHTML = "<div style='margin-top:12px;margin-left:50px'><img src='/happy/notice.gif' border='0' /></div>";return false;}
        var xmlHttp2 = createXmlHttpRequest();   
        var url = "/getsendinfo.asp?type=3&Province="+document.getElementById('Province').value+"&city="+document.getElementById('city').value+"&area="+document.getElementById('area').value;
        xmlHttp2.open("GET",url,true);   
        xmlHttp2.onreadystatechange = function(){   
            if(xmlHttp2.readyState == 4 && xmlHttp2.status == 200){   
                document.getElementById('detailcontent').innerHTML = xmlHttp2.responseText; 
           }      
        }   
        xmlHttp2.send(null);    
    } 

//下面代码是获取最快配送时间的
      function getsendtime() {   
        document.getElementById('getsendtime').innerHTML = "loadding..."; 
        var xmlHttpgst = createXMLHttp();   
        var url = "/getsendtime.asp";
        xmlHttpgst.open("GET",url,true);   
        xmlHttpgst.onreadystatechange = function(){   
            if(xmlHttpgst.readyState == 4 && xmlHttpgst.status == 200){   
                document.getElementById('getsendtime').innerHTML = xmlHttpgst.responseText; 
           }      
        }   
        xmlHttpgst.send(null);  
    }  


//下面代码是OA系统获取登陆详情的
      function getlogintime() {   
        document.getElementById('weidengluriqi').innerHTML = "loadding..."; 
        var xmlHttpgst = createXMLHttp();   
        var url = "http://www.mysunny.tv/oa/getlogintime.asp";
        xmlHttpgst.open("GET",url,true);   
        xmlHttpgst.onreadystatechange = function(){   
            if(xmlHttpgst.readyState == 4 && xmlHttpgst.status == 200){   
                document.getElementById('weidengluriqi').innerHTML = xmlHttpgst.responseText; 
           }      
        }   
        xmlHttpgst.send(null); 
    } 

