(function(){
	/*
	 * Videoplaza client-side JavaScript support code
	 * Copyright (c) 2008 by Videoplaza, www.videoplaza.com
	 * email: info@videoplaza.com
	 */
	var videoplaza_js_impact = window.videoplaza_js_impact = {
				// Testing the Impact format
        impactShow : function( flv_url, link_url, rnd ) {
           	
           	var cHeight = document.documentElement.clientHeight;
           	var cWidth = document.documentElement.clientWidth;
           	
           	
           	var flash_width = Math.round(cWidth * .95);
           	var flash_height = Math.round((flash_width / 16) * 9);
           	
           	if( (flash_height + 30) > (cHeight * .90) ) {
           		flash_height = Math.round(cHeight * .90);
           		flash_width = Math.round((flash_height / 9) * 16);
           	}
           	
           	var element;
           	element = document.getElementById('impact');
           	element.style.display = 'block';
           	element.style.visibility = 'visible';
           	
           	var flashdiv;
           	flashdiv = document.getElementById('impactflash');
           	flashdiv.style.display = 'block';
           	flashdiv.style.left = 
           	'50%';
           	flashdiv.style.top = '50%';
           	flashdiv.style.marginLeft = String('-' + Math.round(flash_width/2) + 'px');
           	flashdiv.style.marginTop = String('-' + Math.round((flash_height/2) + 15) + 'px');
           	
		   	//set flashvars
			var flashvars = {};
			flashvars.flvsource = flv_url;
			flashvars.linkurl = link_url;
			flashvars.width = flash_width;
			flashvars.height = flash_height;
			flashvars.rnd = rnd;
			
			//set params
			var params = {};
			params.allowfullscreen = "true";
			params.allowscriptaccess = "always";
			//params.wmode = "transparent";
		    var flashPlayerVersion = swfobject.getFlashPlayerVersion();
		    if(flashPlayerVersion.major + "." + flashPlayerVersion.minor + "." + flashPlayerVersion.release == "9.0.115"){
				params.wmode = "opaque";
			}
	
			var attributes = {};
		   
			swfobject.embedSWF("http://service.cdn.videoplaza.com/resources/custom/ImpactVideoSWF.swf", "if", flashvars.width, flashvars.height + 30, "9.0.124", "expressInstall.swf", flashvars, params, attributes);
		   	 
        },
        
        impactHide : function() {
            var element;
            element = document.getElementById("impact");
            element.style.display = "none";
            var flashdiv;
            flashdiv = document.getElementById("impactflash");
            flashdiv.style.display = "none";
        },
        
        /*
		 * Used by flash to know whether vpsupport is loaded or not.
		 */
		isHere : function() {
			return true;
		}
		
	};
})();