/* ======================================================================================
 * Filename: theme/javascript/functions.js
 * Author: Rebecca Skeers, rebecca@webmistress.com.au, www.webmistress.com.au
 * Copyright: Rebecca Skeers
 * Date: 24 Nov 2010
 * Description: JavaScript functions for the ArcTas 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 ArcTas website 
 * and may not be copied or modified without written permission from the author.
 * ======================================================================================
 */

$(document).ready(function()
{	

	// Drop down menus for IE6
	$("#nav li").hover(
		function () 
		{
			$(this).addClass("hover");
		},
		function()
		{
			$(this).removeClass("hover");
		}
	);
	
	
	$('a.lightbox').lightBox();

	
	// Links with rel="external" open in a new window
	$("a[rel='external']").attr("target","_blank");
	
	// Print link functionality
	$("a.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;	
		}
	);

	$("p > img.image-left").closest("p").css("padding","0");
	$("p > img.image-right").closest("p").css("padding","0");
	
	
	
	//$("h3").wrapInner("<span></span>");
	$("h3").addClass("alt");
	$("<div class=\"clear\"></div>").insertAfter('h3');
	
});





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