	var httpRequest; 
   
   /** 
    * This method is called when the author is selected 
    * It creates XMLHttpRequest object to communicate with the  
    * servlet  
    */ 
    function getDropDown(arg,ctrl) 
    {
        alert('bla1');
    	if(ctrl == 1){
    		showProgress('Model',155);
    	}
    	showProgress('Price',175);
        var url = 'GetDropDown?N='+arg+'&c='+ctrl+'&p='+document.forms.frontsearch.elements['priceIDOld'].value; 

        if (window.ActiveXObject) 
        { 
            httpRequest = new ActiveXObject("Microsoft.XMLHTTP"); 
        } 
        else if (window.XMLHttpRequest) 
        { 
            httpRequest = new XMLHttpRequest(); 
        } 
         
        httpRequest.open("GET", url, true); 
        httpRequest.onreadystatechange = function() {processRequest(ctrl,arg); } ; 
        httpRequest.send(null); 
   }
   
   function showProgress(name,width) { 
        alert('bla4');
		document.getElementById('dropValue'+name).innerHTML = '<img src="./imgs/ajaxinc/inc1.gif" alt="lading" style="position:absolute;top:2px;left:'+(width-90)/2+'px;">';
		document.getElementById('dropCounter'+name).innerHTML = '&nbsp;&nbsp;';
	} 
	function hideProgress(name) { 
	    alert('bla5');
		progressViewer = document.getElementById(name); 
		progressViewer.innerHTML = ""; 
	}
   
   
   /** 
    * This is the call back method 
    * If the call is completed when the readyState is 4 
    * and if the HTTP is successfull when the status is 200 
    * update the priceSection and if required model section DIVs 
    */ 
    function processRequest(ctrl,arg) 
    { 
        alert('bla2');
        if (httpRequest.readyState == 4) 
        { 
            if(httpRequest.status == 200) 
            {
                //get the XML send by the servlet 
                if(httpRequest.responseXML.getElementsByTagName("NoInfo")[0] != null){
                	window.location = 'browse.jsp?N='+arg;  //redirect to browse.jsp
                	return;
                }                
                
                var modelXML = null;
                if(ctrl == '1')
                	modelXML = httpRequest.responseXML.getElementsByTagName("ModelData")[0]; 
                var priceXML = httpRequest.responseXML.getElementsByTagName("PriceData")[0]; 
                //Update the HTML 
                updateHTML(modelXML,priceXML); 
            } 
            else 
            {
                alert("Error loading page\n"+ httpRequest.status +":"+ httpRequest.statusText); 
            } 
        } 
    } 
        
   /** 
    * This function parses the XML and updates the  
    * HTML DOM by creating a new text node 
    */ 
    function updateHTML(modelXML,priceXML) 
    {
        alert('bla3');
    	if(modelXML != null){
	        //The node valuse will give actual data 
	        
	        var modelText = modelXML.childNodes[0].nodeValue; 
	         
	        //Get the reference of the DIV in the HTML DOM by passing the ID 
	        var modelSection = document.getElementById("modelDiv"); 
	        modelSection.innerHTML = modelText;
	        setInnerWidth('Model',155);
        }
        
        //The node valuse will give actual data 
	    var priceText = priceXML.childNodes[0].nodeValue; 
	                       
	    //Get the reference of the DIV in the HTML DOM by passing the ID 
	    var priceSection = document.getElementById("priceDiv"); 

	    priceSection.innerHTML = priceText;
	    setInnerWidth('Price',175);

    }