function getcityname(cvalue,cseldef)
{
	var citystyles = cvalue;
	var catid = document.getElementById( 'product' ).value;
	var currents = cseldef;

	var ajaxRequest;  // The variable that makes Ajax possible!
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}

	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var ajaxDisplay                                 =  ajaxRequest.responseText;

			document.getElementById( 'city' ).innerHTML  =  ajaxDisplay;

			$pcity = document.getElementById( 'city' ).value;
			if($pcity == '' ){
				 document.getElementById( 'area' ).value = '';
			}
		}
	}
	var path = document.getElementById( 'site_path' ).value;
	//var queryString = path + 'index.php?option=com_jwdintermediate&c=students&task=findcities&state='+citystyles+'&catid='+catid+'&currents='+currents;
	ajaxRequest.open("GET", queryString, true);
	ajaxRequest.send(null);
}
function getareaname(areaval,areadef)
{
	var area = areaval;
	var catid = document.getElementById( 'product' ).value;
	var currents = areadef;

	var ajaxRequest;  // The variable that makes Ajax possible!
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}

	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var ajaxDisplay                                 =  ajaxRequest.responseText;

			document.getElementById( 'area' ).innerHTML  =  ajaxDisplay;

		}
	}
	var path = document.getElementById( 'site_path' ).value;
	//var queryString = path + 'index.php?option=com_jwdintermediate&c=students&task=findareas&city='+area+'&catid='+catid+'&currents='+currents;
	ajaxRequest.open("GET", queryString, true);
	ajaxRequest.send(null);
}