/* ===========================================================================
 * Filename: javascript/functions.js
 * Author: Rebecca Skeers, rebecca@webmistress.com.au, www.webmistress.com.au
 * Copyright: Rebecca Skeers
 * Date: 25 Aug 2009
 * Description: Contains JavaScript functions for the CEPU Tasmania website.
 *
 * This file may not be used for any purpose other than for the CEPU Tasmania
 * website and may not be modified without written permission from the author.
 * =========================================================================== 
 */

/* 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()
{	
	// External links
	$("a[rel='external']").attr("target","_blank");
	
	// Paragraphs containing images
	$("p > img.image-left").parent().css("padding-bottom","0");
	$("p > img.image-right").parent().css("padding-bottom","0");
	
	// Design enhancements
	$("#header").append("<div id=\"topfigure\"></div>");
	$(".homepage #content").prepend("<div id=\"mainfigure\"></div>");
	
	$("#content #col2 h2").addClass("fancy");
	$("#additional-content #col1 h2").addClass("fancy");
	$("#additional-content #col2 h2").addClass("fancy");
	$("#additional-content #col3 h2").addClass("fancy");
	
	$("#content #col2 h2").wrapInner("<span></span>");
	$("#additional-content #col1 h2").wrapInner("<span></span>");
	$("#additional-content #col2 h2").wrapInner("<span></span>");
	$("#additional-content #col3 h2").wrapInner("<span></span>");
	
	//$("#additional-content #col1 h2:last").addClass("newsletter");
	
	// Fix PNG for IE6
	$(document).pngFix();
	
	$('a.lightbox').lightBox();
	
	$("li > a.pdf").parent().parent().addClass("nobullet");
	$("li > a.doc").parent().parent().addClass("nobullet");
	$("li > a.xls").parent().parent().addClass("nobullet");
	$("li > a.ppt").parent().parent().addClass("nobullet");
	$("li > a.zip").parent().parent().addClass("nobullet");
});




