var ajax = new Array();

function getMovieList(sel)
{
	var movie = sel.options[sel.selectedIndex].value;
	document.getElementById('movie').options.length = 0;	// Empty select box
	if(movie.length>0){
		var index = ajax.length;
		ajax[index] = new sack();

		ajax[index].requestFile = 'getmovies.php?movie='+movie;	// Specifying which file to get 
		ajax[index].onCompletion = function(){ createMovies(index) };	// Specify function that will be executed after file has been found
		ajax[index].runAJAX();		// Execute AJAX function
	}
}

function createMovies(index)
{
	var obj = document.getElementById('movie');
	eval(ajax[index].response);	// Executing the response from Ajax as Javascript code
			
}

function getCountryList(sel)
{
	var country = sel.options[sel.selectedIndex].value;
	document.getElementById('country').options.length = 0;	// Empty select box
	if(country.length>0){
		var index = ajax.length;
		ajax[index] = new sack();

		ajax[index].requestFile = 'getmovies.php?country='+country;	// Specifying which file to get 
		ajax[index].onCompletion = function(){ createCountry(index) };	// Specify function that will be executed after file has been found
		ajax[index].runAJAX();		// Execute AJAX function
	}
}

function createCountry(index)
{
	var obj = document.getElementById('country');
	eval(ajax[index].response);	// Executing the response from Ajax as Javascript code
			
}

function getCityList(sel)
{
	var city = sel.options[sel.selectedIndex].value;
	document.getElementById('cinema_city').options.length = 0;	// Empty select box
	if(city.length>0){
		var index = ajax.length;
		ajax[index] = new sack();

		ajax[index].requestFile = 'getmovies.php?city='+city;	// 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('cinema_city');
	eval(ajax[index].response);	// Executing the response from Ajax as Javascript code
			
}