	function getXMLHTTP() { //fuction to return the xml http object
		var xmlhttp=false;	
		try{
			xmlhttp=new XMLHttpRequest();
		}
		catch(e)	{		
			try{			
				xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e){
				try{
				xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch(e1){
					xmlhttp=false;
				}
			}
		}
		 	
		return xmlhttp;
    }	
	
	function getState(countryId) {	
		var strURL="findmake.php?country="+countryId;
		var req = getXMLHTTP();
		
		if (req) {			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {						
						document.getElementById('statediv').innerHTML=req.responseText;						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			
			req.send(null);
		}		
	}
	function getCity(countryId,stateId) {
		alert("Praveen");
		var strURL="findmodel.php?country="+countryId+"&state="+stateId;
		
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {						
						document.getElementById('citydiv').innerHTML=req.responseText;						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}
				
	}
	
	
	function ajxSelMake(typeName) {
		
		
		var strURL="get_make.php?type="+typeName;
		var req = getXMLHTTP();
		
		if (req) {			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {						
						document.getElementById('div_make').innerHTML=req.responseText;						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			
			req.send(null);
		}		
	}
	
	function getModel(typeId,makeName) {
		if(makeName=="others")
		{
			var strURL="get_make_others.php?type="+typeId+"&make="+makeName;
		
			var req = getXMLHTTP();
		
			if (req) {
			
				req.onreadystatechange = function() {
					if (req.readyState == 4) {
						// only if "OK"
						if (req.status == 200) {						
							document.getElementById('div_make_others').innerHTML=req.responseText;
							document.getElementById('div_model').innerHTML="<input type='text' id='model_others' name='model_others' >"
						} else {
							alert("There was a problem while using XMLHTTP:\n" + req.statusText);
						}
						//getModelOthers()
					}				
				}			
				req.open("GET", strURL, true);
				req.send(null);
			}
		}
		
		else{
			document.getElementById('div_make_others').innerHTML="";
			var strURL="get_model.php?type="+typeId+"&make="+makeName;
			var req = getXMLHTTP();
		
			if (req) {
			
				req.onreadystatechange = function() {
					if (req.readyState == 4) {
						// only if "OK"
						if (req.status == 200) {
							
							document.getElementById('div_model').innerHTML=req.responseText;
						} else {
							alert("There was a problem while using XMLHTTP:\n" + req.statusText);
						}
					}				
				}			
				req.open("GET", strURL, true);
				req.send(null);
			}
		}
	}
	
	
	
	function ajxSelPackage(listName)
	{
		var strURL="get_package.php?list="+listName;
		
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {						
						document.getElementById('div_package').innerHTML=req.responseText;						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}
	}
	 
	 
	 function getModelOthers(modelName)
	 {
		 
		 if(modelName=="others")
		 {
			 
			 
			 var strURL="get_model_others.php?model="+modelName;
		
			var req = getXMLHTTP();
		
			if (req) {
			
				req.onreadystatechange = function() {
					if (req.readyState == 4) {
					// only if "OK"
						if (req.status == 200) {						
						document.getElementById('div_model_others').innerHTML=req.responseText;						
						} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
						}
					}				
				}			
				req.open("GET", strURL, true);
				req.send(null);
			}
			 
		 }
		 else{
		 	document.getElementById('div_model_others').innerHTML="";	
		 }
	 }
	
	
	function getBrowseButton(packageName,typeName)
	{
		var strURL="get_browse_button.php?packageName="+packageName+"&typeName="+typeName;;
		
		var req = getXMLHTTP();
		
		if (req) {
			
		req.onreadystatechange = function() {
			if (req.readyState == 4) {
				// only if "OK"
				if (req.status == 200) {						
					document.getElementById('div_browse_button').innerHTML=req.responseText;						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}
	}