var selectedId;
$j(document).ready(function(){
	selectedId = $j('input#selectedId').val();
	
	$j('select#flightCountry').change(function(){
		var countryId = $j(this).val();
		
		$j.post('/ajax/searchCountryCity.php',{
			'selectedId'	: selectedId,
			'countryId'		: countryId,
			'type'			: "'e', 'f'"
		},function(data){
			$j('span#flightDestinations select').html(data);
		},'html');
	});
	
	$j('select#hotelCountry').change(function(){
		var countryId = $j(this).val();
		
		$j.post('/ajax/searchCountryCity.php',{
			'selectedId'	: selectedId,
			'countryId'		: countryId,
			'type'			: "'e', 'h'"
		},function(data){
			$j('select#hotels-city').html(data);
		},'html');
	});
	
	$j('select#packageCountry').change(function(){
		var countryId = $j(this).val();
		
		$j.post('/ajax/searchCountryCity.php',{
			'selectedId'	: selectedId,
			'countryId'		: countryId,
			'type'			: "'e', 'p'"
		},function(data){
			$j('span#packageDestinations select').html(data);
		},'html');
	});
	
	$j('select#villaCountry').change(function(){
		var countryId = $j(this).val();
		
		$j.post('/ajax/searchCountryCity.php',{
			'selectedId'	: selectedId,
			'countryId'		: countryId,
			'type'			: "'e', 'h'"
		},function(data){
			$j('select#villa-city').html(data);
		},'html');
	});
	if( $j('select#flightCountry').val() )
	{
		$j.post('/ajax/searchCountryCity.php',{
			'selectedId'	: selectedId,
			'countryId'		: $j('select#flightCountry').val(),
			'type'			: "'e', 'f'"
		},function(data){
			$j('span#flightDestinations select').html(data);
		},'html');
	}
	if( $j('select#hotelCountry').val() )
    {
		$j.post('/ajax/searchCountryCity.php',{
			'selectedId'	: selectedId,
			'countryId'		: $j('select#hotelCountry').val(),
			'type'			: "'e', 'h'"
		},function(data){
			$j('select#hotels-city').html(data);
		},'html');
	}
    if( $j('select#packageCountry').val() )
    {
		$j.post('/ajax/searchCountryCity.php',{
			'selectedId'	: selectedId,
			'countryId'		: $j('select#packageCountry').val(),
			'type'			: "'e', 'p'"
		},function(data){
			$j('span#packageDestinations select').html(data);
		},'html');
	}
});
