/* ======================================================================================
 * Filename: javascript/functions.js
 * Author: Rebecca Skeers, rebecca@webmistress.com.au, www.webmistress.com.au
 * Copyright: Rebecca Skeers
 * Date: 1 December 2010
 * Description: JavaScript functions for the Parkside Foundation Staff website.
 * Visual design: Kieran Bradley, kieran@workhorse.net.au, www.workhorse.net.au
 *
 * This file may not be used for any purpose other than for the Parkside Foundation website 
 * and may not be copied or modified without written permission from the author.
 * ======================================================================================
 */
 
 

$(document).ready(function()
{	
	$('#col2 ul li a[href*="jpg"]').lightBox();
	$("a[rel='external']").attr("target","_blank");
	$("p img.image-left").closest("p").css("padding","0");
	$("p img.image-right").closest("p").css("padding","0");
	
	$("#content img").not("#content a>img").each(
		function( intIndex )
		{
			var imgAlt = $(this).attr('alt');
			var imgTitle = $(this).attr('title');
			if(imgAlt && !imgTitle)
				$(this).attr('title',imgAlt);
		}
	);
});
	
$(window).load(function()
{
	
	$("#col2 ul li a img").each(
		function( intIndex )
		{
			var spanItem = $("<span></span>");
			var listItem = $(this).closest("a");
			spanItem.css("width",listItem.width()+"px");
			spanItem.css("height",listItem.height()+"px");
			$(this).closest("a").append(spanItem);
		}
	);
	
});






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