// JavaScript Document

function swapVideo(){
	if (document.getElementById("video")) {
		document.getElementById("video").style.display = "block";
	}
	if (document.getElementById("tourDisplay")) {
	document.getElementById("tourDisplay").style.display = "block";
	}
	if (document.getElementById("titleIcon")) {
		document.getElementById("titleIcon").src = "/images/ipix/video-logo.gif";
	}
	if (document.getElementById("videoTitle")) {
		document.getElementById("videoTitle").innerHTML =   document.selector.videos.options[document.selector.videos.selectedIndex].innerHTML;
	}
	if(document.getElementsByName('myMovieName')) {
		document.getElementsByName('myMovieName')[0].src = document.selector.videos.value;
	}
		
	if(document.selector.videos.options!=0){
		var content = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="310" height="230" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" id="myMovieName"><param name="movie" value="http://146.101.141.196/flash/country/' + document.selector.videos.value + '/mwplayer.swf" /><param name="allowFullScreen" value="true" /><param name="quality" value="high" /><param name="bgcolor" value="#FFFFFF" /><embed src="http://146.101.141.196/flash/country/' + document.selector.videos.value + '/mwplayer.swf" quality="high" allowfullscreen="true" bgcolor="#FFFFFF" width="310" height="230" name="myMovieName" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>';
		if (document.getElementById("videodisplay")) {
			document.getElementById("videodisplay").innerHTML = content;
		}
	}
		
	if(document.selector.videos){document.selector.videos.selectedIndex = 0;}
}
		

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function playFullscreen() {
	//check if the video is playing. If
	//true, change to full screen. If not
	//start checking to see when it is
	
	if (3 == MediaPlayer.playState) {
		MediaPlayer.fullscreen='true';
	} else {
		MediaPlayer.controls.play();
		if(!stateTimer) stateTimer=
		window.setInterval(checkstate, 500);
	}
}

function checkState() {
	// Check periodically to see if the video has
	// started. If so, destroy the timer and change to
	// fullscreen

	if (3 == MediaPlayer.playState) {
		window.clearInterval( stateTimer );
		stateTimer = null;
		MediaPlayer.fullscreen = 'true';
	}
}
