//Validation

function areaResponse(txt){

	//alert("Return:"+txt);
	var div_area = document.getElementById('div_area');
	
	if(txt.length >0){
		arrArea = txt.split("*");
		city = arrArea[0];
		state = arrArea[1];	
		//alert(city+"\n"+state);
		document.NewCarForm.city.value = city;
		document.NewCarForm.state.value = state;
		//div_area.style.display = 'none';		
		
	}
	else {	
		
		div_area.style.display = 'block';
		document.NewCarForm.city.value = '';
		document.NewCarForm.state.value = '';		
	
	}
	if(document.NewCarForm.zip.value >0){
		document.NewCarForm.city.disabled = false;
		document.NewCarForm.state.disabled = false;
	}
	
	
}
function getArea(){
	
	if(document.getElementById('zip')){
		var zipValue = document.NewCarForm.zip.value;		
		var currentURL = window.location;
		//alert ( currentURL.protocol ); // Displays 'http'
		//alert ( currentURL.hostname ); // Displays 'www.example.com'
		var xdomain = currentURL.protocol + '//' + currentURL.hostname + '/form/getArea?zip='+zipValue;	
		GetZipArea(xdomain, areaResponse);
	}

}

