<!--

function checkCarOnlyForm(sForm) {
	var sError = '';
	//if(sForm.country.value=='-' || sForm.country.value=='') {
	//	sError = sError + '\n- Country is not selected';
	//}
	if(document.getElementById('car_pickup').style.display=='') {
		if((document.getElementById('car_pickup').value=='-' || document.getElementById('car_pickup').value=='')){
			sError = sError + '\n- Pickup point is not selected';
		}
	}else {
		if((document.getElementById('car_pickupUSA').value=='-' || document.getElementById('car_pickupUSA').value=='')){
			sError = sError + '\n- Pickup point is not selected';
		}
	}	
	if(validateDate('startdate_dCar','startdate_mCar','startdate_yCar')<=2){
		sError += '\n- Pickup date is not valid.\n';
	}
	if(sError!='') {
		alert('The following errors occured:\n' + sError);
		return false;
	}else{
		sForm.action = '/includes/pleasewait.asp';
		return true;
	}
}

//Clear List
function clearListCar(listElem) {
	if(listElem!=0){
		while(listElem.options.length > 0) {
			listElem.options[0] = null;
			listElem.disabled="disabled"
		}
		while(listElem.hasChildNodes()) {
			listElem.removeChild(listElem.firstChild);
		}
		listElem.options[0] = new Option('- Loading pickup points -','-');
		listElem.options[1] = new Option('- Select a pickup point -','-');
	}
}

//On Change Event
function changePickupPoints(sCountry) {
	var idPickup = document.getElementById('idPickup');
	sURL = "/carhire/pickuppointsXML.asp?country=" + sCountry
	if(sURL!='') {
		clearListCar(idPickup);
		//if(confirm('Open ' + sURL)) {
		//	window.open(sURL);	
		//}
		setTimeout("loadCarhireXMLDoc('"+sURL+"')", 100);
	}else{
		alert('No url defined');	
	}
}

//XML Loader
function loadCarhireXMLDoc(url) {
    // branch for native XMLHttpRequest object
	var processChange = processCarhireChange
	
	if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
		req.onreadystatechange = processChange;
        req.open("GET", url, true);
        req.send(null);
    // branch for IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if (req) {
            req.onreadystatechange = processChange;
            req.open("GET", url, true);
            req.send();
        }
    }
}

function processCarhireChange() {	
	var idPickup = document.getElementById('idPickup');
	if (req.readyState == 4)
	{
		if (req.status == 200)
		{
			xmldoc = req.responseXML.documentElement;
			nodes = xmldoc.getElementsByTagName('pp');
			for(var i = 0; i < nodes.length; i++) {
				if (nodes.length != 0) {
					sId = nodes.item(i).attributes.getNamedItem("id").nodeValue;
					sName = nodes.item(i).childNodes.item(0).nodeValue;
					idPickup.options[idPickup.options.length] = new Option(sName, sId);
				}
			}
			idPickup.options[0] = null
			idPickup.disabled='';			
			if(nodes.length==1) {
				idPickup.options[1].selected = true;
			}
		}
		else
		{
			alert("There was a problem retrieving the XML data:\n" + req.statusText);
		}
	}
}
 -->