function makeRequest(url) {
    http_request = false;
    if (window.XMLHttpRequest) { // Mozilla, Safari,...
        http_request = new XMLHttpRequest();
        if (http_request.overrideMimeType) {
            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) {
        alert('Giving up :( Cannot create an XMLHTTP instance');
        return false;
    }
    http_request.onreadystatechange = alertContents;
    http_request.open('GET', url, true);
    http_request.send(null);    
}

function alertContents() {
    if (http_request.readyState == 4) {
        if (http_request.status == 200) {
            return parseMessages(http_request.responseXML);
        } else {
            alert('There was a problem with the request.');
        }
    }
}

function parseMessages(responseXML) {
	var noticeData = responseXML.getElementsByTagName("noticedata")[0];
    selobj = document.selectOption.planMenu;
    var isHaveValue = false;
    
    for(i=0;i<selobj.length;i++)
    	selobj.options[i] = null;
    
    selobj.options[0]=new Option("Select Your Plan", "#");
    
    for (loop = 0; loop < noticeData.childNodes.length; loop++)
    {
        var notice = noticeData.childNodes[loop];
        
        if( notice.nodeName == "login" )
        {
        	var id = notice.getElementsByTagName("path")[0];
	        var description = notice.getElementsByTagName("description")[0];
	        selobj.options[loop+1*1]=new Option(description.childNodes[0].nodeValue, id.childNodes[0].nodeValue);
	        isHaveValue = true;
	    }
	    else
	    {
	    	if( !isHaveValue )
	    	{
		    	selobj.style.setAttribute("display", "none");
				document.getElementById('btn_login').style.setAttribute("visibility", "hidden");
				document.getElementById('loginMsg').style.setAttribute("visibility", "visible");
				var errorMsg = notice.getElementsByTagName("message")[0];
		        document.getElementById('loginMsg').innerHTML = errorMsg.childNodes[0].nodeValue;
		    }
		}
    }
}

