﻿ var xmlHttpReq;   
//创建XMLHTTP对象     
function createXMLHttpRequest()
{     
    if(window.ActiveXObject)
    {    // IE，//如果浏览器支持window.ActiveXObject对象  
        xmlHttpReq = new ActiveXObject("MSXML2.XMLHTTP.3.0");     
        var MSXML = ['MSXML2.XMLHTTP.5.0', 'MSXML2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP', 'Microsoft.XMLHTTP'];  
        try 
        {  
            xmlHttpReq= new ActiveXObject("Msxml2.XMLHTTP");  
        }   
        catch (e)
        {  
            try
            {  
                xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");  
            }   
            catch (e) {}  
        }
    }
    else if(window.XMLHttpRequest)
    {    // Mozilla, Safari, ...  
        xmlHttpReq = new XMLHttpRequest();     
    }     
}   


function getXmlSend(PageIndex)
{  
    y_count = PageIndex;
    createXMLHttpRequest();  
    var url="ShowCasePage.aspx?PageIndex="+PageIndex;
    xmlHttpReq.open("GET",url,true);  
    
    //xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=UTF-8');   
    xmlHttpReq.onreadystatechange = showResult;  //异步调用showResult方法  
    xmlHttpReq.send(null); // 开始发起浏览请求, Mozilla 必须加 null  
    var y_PageShowCase=document.getElementById("y_PageShowCase"); 
    var anodelist=y_PageShowCase.getElementsByTagName("a"); 
    var PreID= parseInt(PageIndex)-parseInt(1);
    var NextID =parseInt(PageIndex)+parseInt(1);
    anodelist[0].href="javascript:getXmlSend("+PreID+")";
    anodelist[1].href="javascript:getXmlSend("+NextID+")";
    
}  

function showResult()
{      
    if(xmlHttpReq.readyState == 4)
    {        
        if(xmlHttpReq.status == 200)
        {  
            var y_ShowCase=document.getElementById("y_ShowCase");
            if(xmlHttpReq.responseText.length>0)
            {                	
                y_ShowCase.innerHTML=xmlHttpReq.responseText;
            }
        }  
    }               
}
