function prepareFlashMovies() {
	if ( !document.getElementById) return false;
	if ( !document.getElementsByTagName) return false;

	// Select xml file based on the current url
	var winLoc = window.location.href;
	winLoc = winLoc.toLowerCase();
	winLoc = winLoc.replace( /http:\/\/www.florida.co.uk\//, '' );
	var xmlFile = null;
	switch(winLoc) {
		/* Homepage BEGIN */
		case "":
			xmlFile = "/movies.xml";
			break;
		case "index.php":
			xmlFile = "/movies.xml";
			break;
		/* Homepage END */
		case "attraction-tickets/":
		case "attraction-tickets/index.php":
			xmlFile = "/attraction-tickets/swf/attractiontix.xml";
			break;
		case "villas/matrix.php":
			xmlFile = "/villas/finder.xml";
			break;
		case "golf/top-golf-courses-in-florida.php":
			xmlFile = "/golf/videos/top-golf-courses-in-florida.xml";
			break;			
		case "places/discovery-cove-orlando.php":
			xmlFile = "/places/videos/discovery-cove-orlando.xml";
			break;
		case "places/disneys-animal-kingdom.php":
			xmlFile = "/places/videos/disneys-animal-kingdom.xml";
			break;
		case "places/disneys-hollywood-studios.php":
			xmlFile = "/places/videos/disneys-hollywood-studios.xml";
			break;
		case "places/epcot-center.php":
			xmlFile = "/places/videos/epcot-center.xml";
			break;
		case "places/rest-of-walt-disney-world.php":
			xmlFile = "/places/videos/rest-of-walt-disney-world.xml";
			break;		
		case "places/gatorland.php":
			xmlFile = "/places/videos/gatorland.xml";
			break;
		case "places/islands-of-adventure.php":
			xmlFile = "/places/videos/islands-of-adventure.xml";
			break;
		case "places/magic-kingdom.php":
			xmlFile = "/places/videos/magic-kingdom.xml";
			break;
		case "places/seaworld-orlando.php":
			xmlFile = "/places/videos/seaworld-orlando.xml";
			break;
		case "places/universal-studios-orlando.php":
			xmlFile = "/places/videos/universal-studios-orlando.xml";
			break;
		case "videos/":
		case "videos/index.php":
			xmlFile = "/videos/videos/mainpage.xml";
			break;
		case "videos/buschgardens.php":
			xmlFile = "/videos/videos/buschgardens.xml";
			break;			
		case "videos/gatorland.php":
			xmlFile = "/videos/videos/gatorland.xml";
			break;
		case "videos/islandsofadventure.php":
			xmlFile = "/videos/videos/islandsofadventure.xml";
			break;
		case "videos/seaworld.php":
			xmlFile = "/videos/videos/seaworld.xml";
			break;
		case "videos/universalstudios.php":
			xmlFile = "/videos/videos/universalstudios.xml";
			break;
		case "webcams/":
		case "webcams/index.php":
			xmlFile = "/webcams/clocks.xml";
			break;	
		case "webcams/map.php":
			xmlFile = "/webcams/clocks.xml";
			break;
		default:
			return false;
	}

	// Send request and handle response from the server
	request = new ajaxObject();
	request.open( "GET", xmlFile, true );
	request.onreadystatechange = playFlash;
	request.send(null);
}

function playFlash() {
	if (request.readyState == 4) {
		if (request.status == 200) {
			var xmlDoc = request.responseXML;
			var movies = xmlDoc.getElementsByTagName("movie");
			for (var i=0; i<movies.length; i++) {
				if ( document.getElementById( movies[i].getAttribute('id') ) ) {
					var fObj = new FlashObject( movies[i].getAttribute('url'), movies[i].getAttribute('id'), movies[i].getAttribute('width'), movies[i].getAttribute('height'), movies[i].getAttribute('version'), movies[i].getAttribute('bgColour') );
					fObj.write( movies[i].getAttribute('id') );
				}
			}
		}
	}
}