/* ===========================================================================
 * SCHEDULE THE BEHAVIOURS
 * =========================================================================== 
 */

/* Google map functions */
$(window).resize(function()
{
	if(typeof loadMap==='function')
		loadMap();
});

$(window).unload(function()
{
	if(typeof GUnload==='function')
		GUnload();
});

$(document).ready(function()
{
	if(typeof loadMap==='function')
		loadMap();
});

$(document).ready(function()
{
	//geo();
});



$(document).ready(function()
{	
	/*
	$("#navigation li ul").hide(); 
	*/
	$("#nav li").hover(
		function () 
		{
			$(this).addClass("hover");
		},
		function()
		{
			$(this).removeClass("hover");
		}
	);//hover
	
});


/* Set links */
$(document).ready(function()
{	
	$("a.tool-print").click(
		function () 
		{
			if (window.print)
				window.print();
			else
				alert("Sorry, your browser doesn't support the print feature. Use the File menu on your browser to select Print.");
			return false;	
		}
	);
	
	$("a[rel='external']").attr("target","_blank");
});

/* Set the tooltips */
$(document).ready(function()
{	
	/* http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/ */
	/*
	$('#tools a').tooltip(
	{
		track: true,
		delay: 0,
		showURL: false,
		showBody: " - ",
		opacity: 1.0,
		fade: 100
	});
	*/
});


/* Do some page tidying */
$(document).ready(function()
{
	$("#nav li.current + li a").css("background-position","100% 0");
	$("#nav li.last.current a").css("border-right","none");
	
	// Add inner class to header for image mask
	$("h3").wrapInner("<span></span>");
	$("h3").addClass("inline");
	
	// if(typeof fixMenuForIE==='function')
	// 	fixMenuForIE();
		
		
	var winWidth = $(window).width();
	if(winWidth%2==1)
		$("body").css("padding-right","1px");
		
	if($('#feature img').length)
		$("#feature").append("<div id=\"featuremask\"></div>");
});


