function sfHover()
{
	var sfEls = document.getElementById("nav").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++)
	{
		sfEls[i].onmouseover=function()
		{
			this.className+=" over";
			//alert(this.className);
		}

		sfEls[i].onmouseout=function(e)
		{
			this.className=this.className.replace(new RegExp(" over\\b"), "");
		}
	}
}

function open_policing_in_the_community()
{
	window.open("http://elearning.policeacademy.edu.au/bbcswebdav/institution/Media/eLearning/Media%20Section/Web%20Stream%202008/June/WebStreamJune08.html","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=800, height=550");
}

function load_sfHover()
{
	if(window.attachEvent) sfHover();
}

/* -#- Home Page Flash -#- */
/**
 * Loads the various flash elements on the home page
 *
 */
function load_ocp_flash()
{
	var flashvars = {};
	var params = {wmode: "opaque", base: ".", allowscriptaccess: "always"};
	var attributes = {};

	swfobject.embedSWF("/flash/ocp_banner.swf", "flash", "645", "350", "8.0.0","/flash/expressInstall.swf", flashvars, params, attributes);	
}

function load_video()
{
	var flashvars = {};
	var params = {wmode: "opaque", base: ".", allowscriptaccess: "always"};
	var attributes = {};

	swfobject.embedSWF("/flash/video_home_275x256.swf", "video", "275", "256", "9.0.0","/flash/expressInstall.swf", flashvars, params, attributes);	
}

/**
 * Expands the video container of the homepage video module
 *
 * This would normally be called from the flash when the video is played.
 */
function expandVideo()
{
	 var container = document.getElementById('video_module');
	 container.style.height = '275px';
	 container.style.width = '275px';
	 container.style.marginTop = '-74px';
}

/**
 * Contracts the video container of the homepage video module
 *
 * This would normally be called from the flash when the video is closed.
 */
function contractVideo()
{
	var container = document.getElementById('video_module');
	container.style.height = '156px';
	container.style.width = '275px';
    container.style.marginTop = '45px';
}


/* -#- Right Content Flash -#- */
/**
 * Loads the given flash file into the right content flash module container
 *
 * @param string filename
 */
function load_right_content_flash(filename)
{
	if(filename.length == 0 )
	{
		alert('Please specify file for right content flash');
	}
	
	var flashvars = {};
	var params = {wmode: "opaque", base: ".", allowscriptaccess: "always"};
	var attributes = {};
	
	swfobject.embedSWF("/flash/" + filename, "right_video", "276", "379", "8.0.0","/flash/expressInstall.swf", flashvars, params, attributes);
}
