
/*---[ Details ]---------------------------------------
Global Javascript Scripts
Author: Lee Powell
Contact: lee.powell@soup.co.uk
-------------------------------------------------------*/

/* jQuery Document Load
-------------------------------------------------------*/
$(document).ready(function(){

	
	var content = $('#content');
	
	if( content.hasClass('home') ) 
	{
		homeInit();
	}

	// Hook for checking if user has flash version required
	if( swfobject.hasFlashPlayerVersion("9.0.0") ){
		$('html').addClass('swfobject-active');
	}
});



/* Homepage
-------------------------------------------------------*/
function homeInit()
{
	var params = {
			quality: "high",
			scale: "noscale",
			wmode: "window",
			allowscriptaccess: "always",
			bgcolor: "#FFFFFF",
			salign: "tl"
	};
	var attributes = {
		id: "flashcontent",
		name: "flashcontent"
	};
	var flashVars = { 
			hostName: host,
			gateway: basePath+'gateway.php',
			mainUrl: basePath+'swf/RingMyBell.swf',
			webcamWrapperUrl: basePath+'swf/webcamWrapper.swf'	
	};
	
	//determine which homepage swf to use, based on page state
	var homeSwf = basePath+'swf/stub.swf';


	// embed the homepage
	swfobject.embedSWF(homeSwf, "flash-content", "940", "550", "9.0.0", false, flashVars, params, attributes);
}

/* Print page
-------------------------------------------------------*/
function printPage()
{
	window.print();
}


/* Container Handlers - Setter and Getter for setting
   Flash movie height
   Use vanilla JS to avoid conflicts outside of the namespace
-------------------------------------------------------*/
/*function getContainerHeight() {
	var fc = document.getElementById('consequences');
		
	return fc.scrollHeight;
}

function setContainerHeight(h) {
	if(!h || h=='' || parseInt(h)>4500){
		return;
	}
	var fc = document.getElementById('consequences');
		
	fc.height = parseInt(h) + 'px';
	
	if(jQuery.browser.msie){
		$('#footer').hide().show();
		
	}
	
}*/
