

function goToPage(pageIndex)
{
//alert(typeid);
      send_requestxw('returnmidright.aspx?pageIndex='+pageIndex+'&typeid='+typeid+'&tmp'+Math.random());
}
 
function goToPageimg(pageIndex)
{
      send_request('returnmidrightimg.aspx?pageIndex='+pageIndex+'&typeid='+typeid+'&tmp'+Math.random());
}

function goToNextPage(){
      try{  
            send_request('returnmidright.aspx?pageIndex='+(parseInt(pageIndex)+1)+'&typeid='+typeid+'&tmp'+Math.random());
            return false;
      }
      catch(e){
            return true;
      }
}

function goToPrevPage(){
            send_request('returnmidright.aspx?pageIndex='+(parseInt(pageIndex)-1)+'&typeid='+typeid+'&tmp'+Math.random());
}






// 1.创建XMLHttpRequest对象

function CreateHTTPObject()

{

    var xmlhttp;

    

    try

    {

        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");

    }

    catch (e)

    {

        try

        {

            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

        }

        catch (e)

        { 

            xmlhttp = false;

        }

    }

 

    return xmlhttp;

}

// 2.浏览器 -> 服务器  (提交请求信息)

function send_requestxw(url)

{

    var xmlhttp = CreateHTTPObject();

    //alert(url);

    if (!xmlhttp)

    {

        return; //无法创建 xmlhttp 对象

    }
    //alert("dddddddd");
    //Ajax 提交   
    xmlhttp.open("GET", url, true);

    xmlhttp.onreadystatechange = function () { OnReadyStateChngxw(xmlhttp); };

    xmlhttp.send(null);

}

// 3.服务器 -> 浏览器  (正确时返回数据) 
var whats="";
function waitThenDoIt()
{

var whatss=whats;
	  try{
	
			  if (document.getElementById("myPH")==null)
			  { 
			  //alert("ffff");
				setTimeout("waitThenDoIt()",2);
			  }
			  else
			  {
						   document.getElementById("myPH").innerHTML=whats;
						   document.getElementById("info").style.display="none";     
			  }

	   } 
	 catch (ex) 
	 { 
	  }
}
function OnReadyStateChngxw(xmlhttp)

{

        if(xmlhttp.readyState==4)

        {

        //判断对象状态

                if(xmlhttp.status==200)

                {
                 //alert(xmlhttp.responseText);
                //信息已经成功返回，开始处理信息
                whats=xmlhttp.responseText;
                  waitThenDoIt();
                 //alert(xmlhttp.responseText);
             //var animal_array = xmlhttp.responseText.split("$$weijinquan$$");

                   //document.getElementById("myPH2").innerHTML=animal_array[1];

                }

                else

                {

                //页面不正常

                alert("您所请求的页面有异常");

                }

        }
        else
        {
        //document.getElementById("myPH").innerHTML="<img src='../../Images/0012.gif'/>";
                //document.getElementById("info").style.display="";
        }

}
