var ajax = new Array();

function getCountryList(sel)
{
//alert("fetch_l");
	var countryCode = sel.options[sel.selectedIndex].value;

	document.getElementById('n_country').options.length = 0;	// Empty country select box
	document.getElementById('n_state').options.length = 0;      // Empty state select box
	document.getElementById('n_city').options.length = 0;       // Empty city select box
    document.getElementById('statelist').style.display="none";  // Hide  the state list box
    document.getElementById('citylist').style.display="none";   // Hide  the city list box

	if(countryCode<0)
		document.getElementById('countrylist').style.display="none"; // Hide  the state list box
	
	//if(countryCode.length>0){
	if(countryCode>0){

		var index = ajax.length;
		ajax[index] = new sack();
		ajax[index].requestFile = 'getLocation.php?countryCode='+countryCode;	// Specifying which file to get
		ajax[index].onCompletion = function(){ createCountries(index) };	// Specify function that will be executed after file has been found		
		ajax[index].runAJAX();		// Execute AJAX function
	}
}
function createCountries(index)

{
	var obj = document.getElementById('n_country');	
	
	eval(ajax[index].response);	// Executing the response from Ajax as Javascript code	
	
	// show the city list when 		
	var countrylist = document.getElementById('n_country').value;

	if(countrylist.length == '')
	  document.getElementById('countrylist').style.display="none";
	else
 	  {
		  document.getElementById('blanktr1').style.display="none";
	  document.getElementById('countrylist').style.display="";
alert("test")
	  }
}
function getStateList(state)
{
	var stateCode = state.options[state.selectedIndex].value;	
	document.getElementById('n_state').options.length = 0;   // Empty town select box
	document.getElementById('n_city').options.length = 0;   // Empty town select box
	document.getElementById('statelist').style.display="none"; // Hide  the state list box
	document.getElementById('citylist').style.display="none"; // Hide  the state list box
		
	if(stateCode>0){

		var index = ajax.length;
		ajax[index] = new sack();
		
	//alert(cityCode);
		ajax[index].requestFile = 'getLocation.php?stateCode='+stateCode;	// Specifying which file to get
		ajax[index].onCompletion = function(){ createStates(index) };	// Specify function that will be executed after file has been found
		ajax[index].runAJAX();		// Execute AJAX function
	}
}
function createStates(index)
{

	var obj = document.getElementById('n_state');
	eval(ajax[index].response);	// Executing the response from Ajax as Javascript code	
	
	// show the city list when 		
	var statelist = document.getElementById('n_state').value;
	
	if(statelist == '')
	  document.getElementById('statelist').style.display="none";
	else
	{
			document.getElementById('blanktr2').style.display="none";
	 document.getElementById('statelist').style.display="";
	}
}	
function getCityList(city)
{

	var cityCode = city.options[city.selectedIndex].value;	
	document.getElementById('n_city').options.length = 0;   // Empty town select box	
	document.getElementById('citylist').style.display="none"; // Hide  the state list box

	if(cityCode>0){

		var index = ajax.length;
		ajax[index] = new sack();
		
	//alert(cityCode);
		ajax[index].requestFile = 'getLocation.php?cityCode='+cityCode;	// Specifying which file to get
		ajax[index].onCompletion = function(){ createCities(index) };	// Specify function that will be executed after file has been found
		ajax[index].runAJAX();		// Execute AJAX function
	}
}
function createCities(index)
{

	var obj = document.getElementById('n_city');
	eval(ajax[index].response);	// Executing the response from Ajax as Javascript code	
	
	// show the city list when 		
	var citylist = document.getElementById('n_city').value;
	
	if(citylist == '')
	  document.getElementById('citylist').style.display="none";
	else
	{
	 document.getElementById('blanktr3').style.display="none";
	 document.getElementById('citylist').style.display="";
	}
}













//////////////////////////////////////////////////////////////////////////////////////////////////////////////









var ajax = new Array();

function getCountryListjob(sel)
{
//alert('hello');
	var countryCode = sel.options[sel.selectedIndex].value;

	document.getElementById('n_country1').options.length = 0;	// Empty city select box
	document.getElementById('n_state1').options.length = 0;   // Empty town select box
	document.getElementById('n_city1').options.length = 0;   // Empty town select box
    document.getElementById('statelistjob').style.display="none"; // Hide  the state list box
    document.getElementById('citylistjob').style.display="none"; // Hide  the state list box
	
	if(countryCode.length>0){
		var index = ajax.length;
		ajax[index] = new sack();
		ajax[index].requestFile = 'getLocation.php?countryCode='+countryCode;	// Specifying which file to get
		ajax[index].onCompletion = function(){ createCountriesjob(index) };	// Specify function that will be executed after file has been found		
		ajax[index].runAJAX();		// Execute AJAX function
	}
}
function createCountriesjob(index)
{
	var obj = document.getElementById('n_country1');	
	
	eval(ajax[index].response);	// Executing the response from Ajax as Javascript code	

	// show the city list when 		
	var countrylist = document.getElementById('n_country1').value;
	if(countrylist == '')
	  document.getElementById('countrylistjob').style.display="none";
	else
	  document.getElementById('countrylistjob').style.display="";
}
function getStateListjob(state)
{
	var stateCode = state.options[state.selectedIndex].value;	
	document.getElementById('n_state1').options.length = 0;   // Empty town select box
	document.getElementById('n_city1').options.length = 0;   // Empty town select box
	document.getElementById('citylistjob').style.display="none"; // Hide  the state list box
		
	if(stateCode.length>0){

		var index = ajax.length;
		ajax[index] = new sack();
		
	//alert(cityCode);
		ajax[index].requestFile = 'getLocation.php?stateCode='+stateCode;	// Specifying which file to get
		ajax[index].onCompletion = function(){ createStatesjob(index) };	// Specify function that will be executed after file has been found
		ajax[index].runAJAX();		// Execute AJAX function
	}
}
function createStatesjob(index)
{

	var obj = document.getElementById('n_state1');
	eval(ajax[index].response);	// Executing the response from Ajax as Javascript code	
	
	// show the city list when 		
	var statelist = document.getElementById('n_state1').value;
	
	if(statelist == '')
	  document.getElementById('statelistjob').style.display="none";
	else
	 document.getElementById('statelistjob').style.display="";
}	
function getCityListjob(city)
{

	var cityCode = city.options[city.selectedIndex].value;	
	document.getElementById('n_city1').options.length = 0;   // Empty town select box	

	if(cityCode.length>0){

		var index = ajax.length;
		ajax[index] = new sack();
		
	//alert(cityCode);
		ajax[index].requestFile = 'getLocation.php?cityCode='+cityCode;	// Specifying which file to get
		ajax[index].onCompletion = function(){ createCitiesjob(index) };	// Specify function that will be executed after file has been found
		ajax[index].runAJAX();		// Execute AJAX function
	}
}
function createCitiesjob(index)
{

	var obj = document.getElementById('n_city1');
	eval(ajax[index].response);	// Executing the response from Ajax as Javascript code	
	
	// show the city list when 		
	var citylist = document.getElementById('n_city1').value;
	
	if(citylist == '')
	  document.getElementById('citylistjob').style.display="none";
	else
	 document.getElementById('citylistjob').style.display="";
}


