/* ===========================================================================
 * 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()
{
	// Use this example, or...
	//$('a[@rel*=lightbox]').lightBox(); // Select all links that contains lightbox in the attribute rel
	// This, or...
	//$('#gallery a').lightBox(); // Select all links in object with gallery ID
	// This, or...
	$('a.lightbox').lightBox(); // Select all links with lightbox class
	// This, or...
	//$('a').lightBox(); // Select all links in the page
	// ... The possibility are many. Use your creative or choose one in the examples above
});

/* 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");
});


$(document).ready(function()
{	
	$("#logomap li#climate a").hover
	(
		function () { $("#logomap").css("background-position","-400px 0"); },
		function() { $("#logomap").css("background-position","0 0"); }
	);
	
	$("#logomap li#schools a").hover
	(
		function () { $("#logomap").css("background-position","-1400px 0"); },
		function() { $("#logomap").css("background-position","0 0"); }
	);
	
	$("#logomap li#biodiversity a").hover
	(
		function () { $("#logomap").css("background-position","-200px 0"); },
		function() { $("#logomap").css("background-position","0 0"); }
	);
	
	$("#logomap li#partnerships a").hover
	(
		function () { $("#logomap").css("background-position","-1200px 0"); },
		function() { $("#logomap").css("background-position","0 0"); }
	);
	
	$("#logomap li#energy a").hover
	(
		function () { $("#logomap").css("background-position","-800px 0"); },
		function() { $("#logomap").css("background-position","0 0"); }
	);
	
	$("#logomap li#curriculum a").hover
	(
		function () { $("#logomap").css("background-position","-600px 0"); },
		function() { $("#logomap").css("background-position","0 0"); }
	);
	
	$("#logomap li#health a").hover
	(
		function () { $("#logomap").css("background-position","-1000px 0"); },
		function() { $("#logomap").css("background-position","0 0"); }
	);
	
	$("#logomap li#waste a").hover
	(
		function () { $("#logomap").css("background-position","-1600px 0"); },
		function() { $("#logomap").css("background-position","0 0"); }
	);
	
	$("#logomap li#water a").hover
	(
		function () { $("#logomap").css("background-position","-1800px 0"); },
		function() { $("#logomap").css("background-position","0 0"); }
	);
});






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


/* Do some page tidying */
$(document).ready(function()
{
	$("#col3 p img:eq(0)").addClass("photo1");
	$("#col3 p img:eq(1)").addClass("photo2");
	$("#col3 p img:eq(2)").addClass("photo3");
	$("#col3 p img:eq(3)").addClass("photo1");
	$("#col3 p img:eq(4)").addClass("photo2");
	$("#col3 p img:eq(5)").addClass("photo3");
	
	
	
	$("img.photo1").parent().addClass("photo1holder");
	$("img.photo2").parent().addClass("photo2holder");
	$("img.photo3").parent().addClass("photo3holder");
	
	$("img.photo1").after("<div class=\"pin\"></div>");
	$("img.photo2").after("<div class=\"pin\"></div>");
	$("img.photo3").after("<div class=\"pin\"></div>");

	
});



