var productVideo;
var blankVideo;
var flvVideoPlayer;

productVideo = '/scripts/blank.swf';
blankVideo = '/scripts/blank.swf';
flvVideoPlayer = 'resources/flvplayer.swf';

function ShowVideo() {
			    			    
				loadFlash();
			
				if (document.getElementById) { // DOM 3: IE5+, NS6, Firefox#
					if (document.getElementById("pnlMainImage") != null) {document.getElementById("pnlMainImage").style.display = "none";};
					if (document.getElementById("hypVideoImage") != null) {document.getElementById("hypVideoImage").style.display = "none";};
					if (document.getElementById("pnlFlashObject") != null) {document.getElementById("pnlFlashObject").style.display = "block";};
					if (document.getElementById("hypPhotoImage") != null) {document.getElementById("hypPhotoImage").style.display = "block";};
				} else if (document.layers) { // Netscape 4
					if (document.pnlMainImage != null) {ddocument.pnlMainImage.style.display = "none";};
					if (document.hypVideoImage != null) {ddocument.hypVideoImage.style.display = "none";};
					if (document.pnlFlashObject != null) {ddocument.pnlFlashObject.style.display = "block";};
					if (document.hypPhotoImage != null) {ddocument.hypPhotoImage.style.display = "block";};
				} else if (document.all) { // IE 4
					if (document.all.pnlMainImage != null) {document.all.pnlMainImage.style.display = "none";};
					if (document.all.hypVideoImage != null) {document.all.hypVideoImage.style.display = "none";};
					if (document.all.pnlFlashObject != null) {document.all.pnlFlashObject.style.display = "block";};
					if (document.all.hypPhotoImage != null) {document.all.hypPhotoImage.style.display = "block";};
				}
			}

			function HideVideo() {				
				if (document.getElementById) { // DOM 3: IE5+, NS6, Firefox
					if (document.getElementById("pnlMainImage") != null) {document.getElementById("pnlMainImage").style.display = "block";};
					if (document.getElementById("hypVideoImage") != null) {document.getElementById("hypVideoImage").style.display = "block";};
					if (document.getElementById("pnlFlashObject") != null) {document.getElementById("pnlFlashObject").style.display = "none";};
					if (document.getElementById("hypPhotoImage") != null) {document.getElementById("hypPhotoImage").style.display = "none";};
				} else if (document.layers) { // Netscape 4
					if (document.pnlMainImage != null) {ddocument.pnlMainImage.style.display = "block";};
					if (document.hypVideoImage != null) {ddocument.hypVideoImage.style.display = "block";};
					if (document.pnlFlashObject != null) {ddocument.pnlFlashObject.style.display = "none";};
					if (document.hypPhotoImage != null) {ddocument.hypPhotoImage.style.display = "none";};
				} else if (document.all) { // IE 4
					if (document.all.pnlMainImage != null) {document.all.pnlMainImage.style.display = "block";};
					if (document.all.hypVideoImage != null) {document.all.hypVideoImage.style.display = "block";};
					if (document.all.pnlFlashObject != null) {document.all.pnlFlashObject.style.display = "none";};
					if (document.all.hypPhotoImage != null) {document.all.hypPhotoImage.style.display = "none";};
				}
				loadFlash(blankVideo);
			}
			
			function loadFlash(flashUrl) {
				var flashMovie, so;
				
				if (!flashUrl) {
					flashUrl = productVideo;
				}
				
				if (flashUrl.indexOf('.flv') > -1) {
					//flashUrl = 'http://video.asos.com/FLVPlayer_Dynamic.swf?file=' + flashUrl;
					//so = new SWFObject(flashUrl, "objFlashVideo", "100%", "100%", "8", "#ffffff");
					so = new SWFObject(flvVideoPlayer, "objFlashVideo", "250", "250", "8", "#ffffff");
    			so.addParam("allowfullscreen","true");
    			so.addVariable("file", productVideo);
    			so.addVariable("autostart ","true");
    			
				} else {
					so = new SWFObject(flashUrl, "objFlashVideo", "250", "250", "8", "#ffffff");
				}
				
				if (document.getElementById("pnlFlashObject") != null) {so.write("pnlFlashObject");};
			}
			
			function getMovie() {
				var flashMovie;
				var movieName = "objFlashVideo";
				
				if (window.document[movieName]) {
					return window.document[movieName];
				}
				if (navigator.appName.indexOf("Microsoft Internet")==-1) {
					if (document.embeds && document.embeds[movieName])
						return document.embeds[movieName]; 
				} else {
					return document.getElementById(movieName);
				}
			}
			
			function getFlash() {
				var finishedHtml;
				
				window.open('http://www.macromedia.com/go/getflashplayer');
				
				finishedHtml = '<table cellpadding="0" cellspacing="0" border="0" height="370" width="290"><tr>';
				finishedHtml += '<td valign="middle" class="product_grey_dark_sml" height="370" width="290">';
				finishedHtml += 'If you have successfully installed the flash player then reload the page or <br>';
				finishedHtml += '<a href="javascript:location.reload();">click here to view the video</a>.';
				finishedHtml += '<br><br>';
				finishedHtml += 'You may need to close all of your browser windows in order for the intall to complete.';
				finishedHtml += '<br><br>';
				finishedHtml += '<a href="/infopages/pgehelpdesk.aspx#cantviewvid">Click here to visit our help section</a> if you\'re still having problems.';
				finishedHtml += '</td></tr></table>';
				pnlFlashObject.innerHTML = finishedHtml;
			}
