var http_request;
function createXMLHttpRequest()
{
    //开始初始化XMLHttpRequest对象
    if(window.XMLHttpRequest){//Mozilla浏览器
     http_request=new XMLHttpRequest();
     if(http_request.overrideMimeType){//设置MIME类别
       http_request.overrideMimeType("text/xml");
     }
    }
    else if(window.ActiveXObject){//IE浏览器
     try{
      http_request=new ActiveXObject("Msxml2.XMLHttp");
     }catch(e){
      try{
      http_request=new ActiveXobject("Microsoft.XMLHttp");
      }catch(e){}
     }
    }
//    if(!http_request){//异常，创建对象实例失败
//     window.alert("创建XMLHttp对象失败！");
//     return false;
//    }
}
function send_request(url){//初始化，指定处理函数，发送请求的函数
	createXMLHttpRequest()
    var request_type="POST";
	http_request.onreadystatechange=processrequest;
    //确定发送请求方式，URL，及是否同步执行下段代码
	if(window.XMLHttpRequest)
	{
		request_type="GET";
	}
    http_request.open(request_type,url,true);
    http_request.setRequestHeader("Cache-Control","no-cache");  
    //http_request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
   //this.HttpObj.send(this.PostData);   
    http_request.send(null);
  }
  //处理返回信息的函数
function processrequest(){
   if(http_request.readyState==4){//判断对象状态
     if(http_request.status==200){//信息已成功返回，开始处理信息
      //document.getElementById(reobj).innerHTML=http_request.responseText;
      set_innerHTML(reobj,http_request.responseText);
      //alert(http_request.responseText);
     }
     else{//页面不正常
      alert("您所请求的页面不正常！");
     }
   }
  }
function dopage(obj,url){
   http_request=false;
   document.getElementById(obj).innerHTML="正在读取数据...";
   send_request(url);
   reobj=obj;

   }
function GoUrl()
			{

				
				if(document.getElementById('itdor_key').value.replace(/(^\s*)|(\s*$)/g, '')!='')
				{
					this.location='?key='+document.getElementById('itdor_key').value+'&TypeID='+'&rnd='+Math.random();
				}
			}
			
function GoReUrl()
			{
				if(document.getElementById('itdor_keys').value.replace(/(^\s*)|(\s*$)/g, '')!='')
				{
					this.location='?key='+document.getElementById('itdor_keys').value+'&TypeID='+'&rnd='+Math.random();
				}
			}
			
function ReSeoUrl()
			{
				if(document.getElementById('itdor_keys').value.replace(/(^\s*)|(\s*$)/g, '')!='')
				{
					this.location='?key='+document.getElementById('itdor_key').value+' '+document.getElementById('itdor_keys').value+'&TypeID='+'&rnd='+Math.random();
				}
			}
			
function GoSeo()
			{
				var obj=document.getElementById('Seo1_keyword');
				var obj_t=document.getElementById('Seo1_pic_type');
				var obj_value=obj_t.options[obj_t.selectedIndex].value;
				//window.alert(obj.value+obj_value);
				if(obj.value!='')
				{
					window.open('/Pic_Seo.aspx?key='+obj.value+'&TypeID='+obj_value,'Window_Seo','')
				}

			}		
			
function URL_Request(strName)
		{
   var strHref = document.location.toString();
   var intPos = strHref.indexOf("?");
   var strRight = strHref.substr(intPos + 1);//==========获取到右边的参数部分
   var arrTmp = strRight.split("&");//=============以&分割成数组
   for(var i = 0; i < arrTmp.length; i++ ) //===========循环数组
   {
     var dIntPos = arrTmp[i].indexOf("=");
     var paraName= arrTmp[i].substr(0,dIntPos);
     var paraData= arrTmp[i].substr(dIntPos+1);
    
     if(paraName.toUpperCase() == strName.toUpperCase()) 
     {
        return paraData;
      }
   }
   return "";
		}


var wd=URL_Request('key');
var s=URL_Request('TypeID');
var rnd=URL_Request('rnd')
if(wd!="")
{
	//alert(s);
	dopage('Seo_Result_Left','Pic_Seo_innerHTML.ASPX?p=1&wd='+wd+'&s='+s+'&rand='+rnd);
}

