	// Use a variable to reference the embedded SWF.
	var flashVideoPlayer;
	
	/* When the HTML page loads (via the onLoad event of the <body> tag) we have it call the initialize() function. */
	function initialize() {
		/* Check if the browser is IE. If so, flashVideoPlayer is window.videoPlayer. Otherwise, it's window.document.videoPlayer. The videoPlayer is the id assigned to <object> and <embed> tags. */
		var ie = navigator.appName.indexOf("Microsoft") != -1;
		flashVideoPlayer = (ie) ? window['videoPlayer'] : document['videoPlayer'];
	}

	
	function updateVideoProgramming() {
		var comboBox = document.forms['videoForm'].programming;
		var video = comboBox.options[comboBox.selectedIndex].value;
		switch(comboBox.selectedIndex) {
		  case 5:   optionName = "CAPITAL D: Public art – who decides what is art?";break	
		  case 6:   optionName = "CAPITAL D: RTE - Choosing a restaurant in Dublin";break	  	  
		  case 7:   optionName = "CAPITAL D: RTE - Choosing a school for you child";break
		  case 8:   optionName = "CAPITAL D: RTE - Irish language alive and well In Dublin";break
		  case 9:   optionName = "CAPITAL D: RTE - On duty with - Airport Customs";break
		  case 10:   optionName = "CAPITAL D: RTE - On duty with - The Clampers";break
		  case 11:   optionName = "CAPITAL D: RTE - On duty with – Coastguard Helicopter Rescue";break
		  case 12:   optionName = "CAPITAL D: RTE - On duty with – Nurse<";break
		  case 13:   optionName = "CAPITAL D: RTE - On duty with – Model";break		    	 	
		  case 14:   optionName = "CAPITAL D: RTE - On duty with – Garda";break
		  case 18:   optionName = "NATIONWIDE: RTE - At home with - Ronnie Drew & Eleanor Shanley";break
		  case 19:   optionName = "NATIONWIDE: RTE - At home with - Pauline Mc Glynn";break
		  case 20:   optionName = "NATIONWIDE: RTE - At home with - Twink";break
		  case 21:   optionName = "NATIONWIDE: RTE - At home with - Brian Kennedy";break
		  case 25:   optionName = "Soda Entertainment TV - INTRO";break
		  case 26:   optionName = "Soda Entertainment TV – COLIN FARRELL";break
		  case 27:   optionName = "Jimmy Crumlin – Hollywood Actor";break
		  case 28:   optionName = "Behind The Scenes – Bud Rising";break
		  case 29:   optionName = "Essential LA - Extended Trailer";break
		  case 30:   optionName = "TV3 - The Social Insiders - Part 1";break
		  case 31:   optionName = "TV3 - The Social Insiders - Part 2";break
		  case 32:   optionName = "TV3 - The Social Insiders - Part 3";break
		  case 33:   optionName = "TV3 - The Social Insiders - Part 4";break
		  case 34:   optionName = "RTE - Nationwide Entertainment Report 1";break
		  case 35:   optionName = "RTE - Nationwide Entertainment Report 2";break
		  case 36:   optionName = "RTE - Nationwide Entertainment Report 3";break
		  case 37:   optionName = "RTE - Nationwide Entertainment Report 4";break
		  case 38:   optionName = "RTE - Nationwide Entertainment Report 5";break
		  case 39:   optionName = "RTE - Nationwide Entertainment Report 6";break
		  case 40:   optionName = "RTE - Nationwide Entertainment Report 7";break
		  case 41:   optionName = "RTE - Nationwide Entertainment Report 8";break
		  case 42:   optionName = "RTE - Nationwide Entertainment Report 9";break
		  case 43:   optionName = "RTE - Nationwide Entertainment Report 10";break
		  case 44:   optionName = "RTE - Nationwide Entertainment Report 11";break
		  case 45:   optionName = "RTE - Nationwide Entertainment Report 12";break
		  case 46:   optionName = "RTE - Nationwide Entertainment Report 13";break
		  case 47:   optionName = "RTE - Nationwide Entertainment Report 14";break
		  case 48:   optionName = "RTE - Nationwide Entertainment Report 15";break
		  case 49:   optionName = "RTE - Nationwide Entertainment Report 16";break
		  case 50:   optionName = "RTE - Nationwide Entertainment Report 17";break
		  case 51:   optionName = "RTE - Nationwide Entertainment Report 18";break
		  case 52:   optionName = "RTE - Nationwide Entertainment Report 19";break
		  case 53:   optionName = "RTE - Nationwide Entertainment Report 20";break
		  case 54:   optionName = "RTE - Nationwide Entertainment Report 21";break
		  case 55:   optionName = "RTE - Nationwide Entertainment Report 22";break
		  case 56:   optionName = "RTE - Nationwide Entertainment Report 23";break
		  case 57:   optionName = "RTE - Nationwide Entertainment Report 24";break
		  case 58:   optionName = "RTE - Nationwide Entertainment Report 25";break
		  case 59:   optionName = "RTE - Nationwide Entertainment Report 26";break
		  case 60:   optionName = "RTE - Nationwide Entertainment Report 27";break		
		  case 61:   optionName = "RTE - Nationwide Entertainment Report 28";break		
		  case 62:   optionName = "RTE - Nationwide Entertainment Report 29";break
		  case 63:   optionName = "RTE - Nationwide Entertainment Report 30";break		  
		  }
		 updateStatus("NOW PLAYING: TV Programmming:  "+optionName);
		flashVideoPlayer.playVideo(video);
	}

	
	function updateVideoCorporate() {
		var comboBox = document.forms['videoForm'].corporate;
		var video = comboBox.options[comboBox.selectedIndex].value;
		switch(comboBox.selectedIndex) {
		  case 2:   optionName = "Promo - Modern Green";break
		  case 3:   optionName = "Promo - BMW N Conlans & Sons";break		  
		  case 4:   optionName = "Promo - Total DVD";break
		  case 5:   optionName = "Promo - In Dublin Magazine";break	  	  
		  case 7:   optionName = "Eircom – Success Stories – Georges Bistro";break
		  case 8:   optionName = "Eircom – Success Stories – Fogarty Insurance";break
		  case 9:   optionName = "Eircom – Success Stories – Collins Mc Nicholas";break
		  case 11:   optionName = "Eircom – Expert Insight – Denise Cox";break
		  case 12:   optionName = "Eircom – Expert Insight – Rosita Wolfe";break
		  case 14:   optionName = "Oracle – Case Study – TedCastle Oil Projects";break
		  case 15:   optionName = "Oracle – Case Study – Ulster Carpets";break
		  case 16:   optionName = "HP – Case Study – Micros Fidelio";break
		  case 18:   optionName = "Events  - O2 Blackberry Launch";break
		  case 19:   optionName = "Bank Of Ireland – Student Awards";break
		  case 20:   optionName = "Events  - Absolut Motions";break  
		  case 21:   optionName = "O2 In the Park - The O2 Village";break
		  case 23:   optionName = "EPK - I Keano Musical";break
		  }
		  updateStatus("NOW PLAYING: Corporate: "+optionName);
		flashVideoPlayer.playVideo(video);
	}
	
		/* When the user clicks the play button in the form, update the videoStatus textarea, and call the playVideo() function within the SWF, passing it the URL of the FLV file. */
	function updateVideoCommercial() {
		var comboBox = document.forms['videoForm'].commercial;
		var video = comboBox.options[comboBox.selectedIndex].value;
		switch(comboBox.selectedIndex) {
		  case 2:   optionName = "Phonesystems.ie";break
		  case 3:   optionName = "Raleigh Bikes";break		  
		  case 4:   optionName = "Leinster Timber Products";break
		  case 5:   optionName = "Brennan Hotels";break	
		  case 6:   optionName = "Kilkenny Tourism";break	  	  
		  case 7:   optionName = "BMW - N Conlans & Sons";break
		  case 8:   optionName = "Gaiety Theatre – Aladdin";break
		  case 9:   optionName = "Gaiety Theatre – Stones in his Pockets";break
		  case 10:   optionName = "Mc Guirk’s Golf";break
		  case 11:   optionName = "Spirit Dublin";break
		  case 12:   optionName = "McGrattans Restaurant";break
		  case 13:   optionName = "Eurocycles & Eurobaby";break
		  case 14:   optionName = "Aquaid";break
		  case 15:   optionName = "Newbridge Silverware - Weather Ident";break
	  }
	  	  
		updateStatus("NOW PLAYING: TV Commercials: "+optionName);
		flashVideoPlayer.playVideo(video);
	}

	// Call the pauseResume() function within the SWF.
	function callFlashPlayPauseVideo() {
		flashVideoPlayer.pauseResume();
	}
	
	function updateStatus(message) {
		//document.forms['nowPlaying'].videoStatus.value = message + "\n";
		document.getElementById("nowPlaying").innerHTML = message;

	}

	/* The updateStatus() function is called from the SWF from the onStatus() method of the NetSream object. */
	//function updateStatus(message) {
		//document.forms['videoForm'].videoStatus.value += message + "\n";
	//}
