var xmlHttp;

function createXMLHttpRequest(){
    if(window.ActiveXObject)
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    else if(window.XMLHttpRequest)
        xmlHttp = new XMLHttpRequest();
}

function startRequest(columnId){
    createXMLHttpRequest();
    xmlHttp.onreadystatechange = handleStateChange;
    xmlHttp.open("GET","showPopWindow.do?columnId="+columnId+"&"+(new Date()),true) ;
    xmlHttp.send(null);
}

function handleStateChange(){
    if(xmlHttp.readyState == 4){
        if(xmlHttp.status == 200){
            listPopWindow();
        }
    }
}

function listPopWindow(){
    var xmlDoc = xmlHttp.responseXml;
    var popWindowList = xmlDoc.getElementsByTagName("popwindow");

    if(popWindowList!=null){
        for(var i=0;i<popWindowList.length;i++){
            var pop = popWindowList[i];
            var id = pop.getElementsByTagName("pwId")[0].firstChild.nodeValue;
            var title = pop.getElementsByTagName("pwTitle")[0].firstChild.nodeValue;
            var height = pop.getElementsByTagName("pwHeight")[0].firstChild.nodeValue;
            var width = pop.getElementsByTagName("pwWidth")[0].firstChild.nodeValue;
            popWindow(id,title,height,width);
        }
     }
}

