﻿var wword;
function ajaxFunction(aurl,ttt)
 {
 var wword;
 var xmlHttp;
 try
    {
   // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
 catch (e)
    {

  // Internet Explorer
   try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
   catch (e)
      {

      try
         {
         xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
         }
      catch (e)
         {
         alert("您的浏览器不支持AJAX！");
         return false;
         }
      }
    }
	
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
				
			if (ttt=='cccc')
			{
				document.getElementById("linshiword").innerHTML=xmlHttp.responseText;
			}
				else
			{
				
			//document.getElementById("wword").innerHTML=xmlHttp.responseText;
			document.cookie="wword="+xmlHttp.responseText+"";
				//获取cookie字符串
					var strCookie=document.cookie;
					//将多cookie切割为多个名/值对
					var arrCookie=strCookie.split("; ");
					for(var i=0;i<arrCookie.length;i++){
					var arr=arrCookie[i].split("=");
					//找到名称为userId的cookie，并返回它的值
					if("wword"==arr[0]){
						   wword=arr[1];

					}
					}
				
				
			}
        }
      }
    xmlHttp.open("GET",aurl,true);
    xmlHttp.send(null);
	
	
 }
 

var ceshiwordx;
ceshiwordx=0;
function ceshiword(word)
{
	//if (word==''||word=='undefined'||word=='null')
	//{}
	//else
	//{ceshiwordx='1';clearTimeout(timer);}
	if (ceshiwordx>0)
		{
			ajaxFunction('show_wdd.asp?id='+wword+'','bbbb');
			clearTimeout(timer);
		}
	else
	{ceshiwordx++;}

	
}
	ajaxFunction('show_wd.asp?id='+cc+'','aaa');
	
				var strCookie=document.cookie;
				//将多cookie切割为多个名/值对
				var arrCookie=strCookie.split("; ");
				for(var i=0;i<arrCookie.length;i++){
				var arr=arrCookie[i].split("=");
				//找到名称为userId的cookie，并返回它的值
				if("wword"==arr[0]){
					   wword=arr[1];
					   //alert(wword);
					   	timer=setTimeout("ceshiword(wword)", 300);

						//alert('您搜索的商品没找到，我们为你提供了类似的商品');


				}
				}

			  strCookie=document.cookie;
				//将多cookie切割为多个名/值对
				arrCookie=strCookie.split("; ");
				for(var ii=0;ii<arrCookie.length;ii++){
				var arr=arrCookie[ii].split("=");
				//找到名称为userId的cookie，并返回它的值
				if("wword"==arr[0]){
					   wword=arr[1];
					   //alert(wword);
					   ajaxFunction('show_wd_api.asp?wword='+wword+'','cccc');
				}
				}



//aa="sss"
//function sousuo(wdd){




