// JavaScript Document: Dynamic Popup Video Display

 //====== VIDEO PLAYER SETINGS =======
 var swfPlayer = "player.swf";
 var playerwidth = 494;
 var playerheight = 341;
 var blnAutoPlay = "true";
 //===== Gray Cover Layer Setting =====
 var coverheight = "1800px"
 //====================================
function insertVideo(vfile) {
	var jsVideoObj = document.getElementById('videoObject')
	var flvFile = vfile+'.flv';
	var objhtml = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+playerwidth+'" height="'+playerheight+'" id="player" align="">'+'\r\n';
	objhtml = objhtml+'  <param name="allowScriptAccess" value="always" />'+'\r\n';
	objhtml = objhtml+'  <param name="movie" value="'+swfPlayer+'" />'+'\r\n';
	objhtml = objhtml+'  <param name="quality" value="high" />'+'\r\n';
	objhtml = objhtml+'  <param NAME=scale VALUE=noscale>'+'\r\n';
	objhtml = objhtml+'  <param NAME=salign VALUE="LT">'+'\r\n';
	objhtml = objhtml+'  <param NAME=FlashVars VALUE="contentPath='+flvFile+'&affiliateID=&bufferTime=7&autoPlay='+blnAutoPlay+'&startStreaming=true&hasInfoButton=false&hasVideoChrome=false">'+'\r\n';
	objhtml = objhtml+'  <param name="bgcolor" value="#ffffff" />'+'\r\n';
	objhtml = objhtml+'  <embed src="'+swfPlayer+'" FlashVars="contentPath='+flvFile+'&affiliateID=&bufferTime=7&autoPlay='+blnAutoPlay+'&startStreaming=true&hasInfoButton=false&hasVideoChrome=false" quality="high" scale=noscale bgcolor="#ffffff" width="'+playerwidth+'" height="'+playerheight+'" name="player" salign="lt" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+'\r\n';
	objhtml = objhtml+'</object>';
	jsVideoObj.innerHTML = objhtml;
}
function showPopUp(videofile) {
	var cvr = document.getElementById("cover");
	var vid = document.getElementById("videowindow");
	insertVideo(videofile);
	cvr.style.display = "block";
	vid.style.display = "block";
	cvr.style.width = "100%";
	cvr.style.height = coverheight;
}
function closePopUp() {
	var cvr = document.getElementById("cover");
	var vid = document.getElementById("videowindow");
	cvr.style.display = "none";
	vid.style.display = "none";
	location.reload(false);
}
