var currentVid = "";

function $(n){return document.getElementById(n);}


function showVodCFW(vidToPlay){
	//alert(vidToPlay);
	
	showGrayOverlay();
	ColdFusion.Window.show('video');
	
	if(vidToPlay != currentVid){
		currentVid = vidToPlay;
		embedVodPlayer(vidToPlay);
	}
}

function hideVodCFW(){
	ColdFusion.Window.hide('video');
	hideGrayOverlay();
}

function hideGrayOverlay(){
	$('darkenScreenObject').style.display='none';
}

function showGrayOverlay() {
	var opacity = 40;
	var opaque = (opacity / 100);		
	var zindex = 4999;
	var grayBG = $('darkenScreenObject'); 			
	
	// Calculate the page width and height 
	if( document.body && ( document.body.scrollWidth || document.body.scrollHeight ) ) {
		var pageWidth = document.body.scrollWidth+'px';
		var pageHeight = document.body.scrollHeight+'px';
	} else if( document.body.offsetWidth ) {
	  var pageWidth = document.body.offsetWidth+'px';
	  var pageHeight = document.body.offsetHeight+'px';
	} else {
	   var pageWidth='100%';
	   var pageHeight='100%';
	}
	
	//set the shader to cover the entire page and make it visible.
	grayBG.style.opacity=opaque;                      
	grayBG.style.MozOpacity=opaque;                   
	grayBG.style.filter='alpha(opacity='+opacity+')';
	grayBG.style.zIndex=zindex;        
	grayBG.style.width= pageWidth;
	grayBG.style.height= pageHeight;
	grayBG.style.display='block';
}

getViewportHeight=function(){var height = 0;if( document.documentElement && document.documentElement.clientHeight ) {height = document.documentElement.clientHeight;} else if( document.body && document.body.clientHeight ) {height = document.body.clientHeight;}else if( window.innerHeight ) {height = window.innerHeight - 18;}return height;};
getViewportScrollY=function(){var scrollY = 0;if( document.documentElement && document.documentElement.scrollTop ) {scrollY = document.documentElement.scrollTop;}else if( document.body && document.body.scrollTop ) {scrollY = document.body.scrollTop;}else if( window.pageYOffset ) {scrollY = window.pageYOffset;}else if( window.scrollY ) {scrollY = window.scrollY;}return scrollY;};

