/*
/*	onLoad Functions
/*	----------------
/*	These initialize some of the dynamic functionality used by the theme
*/

	// skin names for adding and removing
	skinList = ["blue", "green", "orange", "purple", "red", "teal", "chocolate", "mirage"]
	// real-time skin changing
	function switchSkin(skin) {
		$(skinList).each(function (i,style) {
			$('body').removeClass(style);
		});
		$('body').addClass(skin);
		$.cookie("skin", skin);
	}
	

$(document).ready(function() {
	
	// initialise pngFix (IE sucks)
	$('#logo').supersleight();
	$('#search').supersleight();
	$('#page-content').supersleight();
	
	// initialize modal (fancybox)
	$("a.zoom").fancybox({
		'padding': 1, 
		'overlayOpacity': 0.7, 
		'zoomSpeedIn': 500, 
		'zoomSpeedOut': 500
	});
	
	// initialize login modal (fancybox)
	$("a.login").fancybox({
		'padding': 1, 
		'showCloseButton': false,
		'frameWidth': 400,
		'frameHeight': 200,
		'hideOnContentClick': false
	});
		// initialize theme changer modal (fancybox)
	$("a.tc").fancybox({
		'padding': 1, 
		'showCloseButton': false,
		'frameWidth': 500,
		'frameHeight': 190,
		'hideOnContentClick': false
	});
	
	// initialize anchor tag scrolling effect (scrollTo)
	$.localScroll();
	
	// initialize skin changer		
	function skinPreviewUpdate() { 
		$('#theme-title').attr('title',this.alt); 
	}
	var skin = $.cookie("skin");
	if (skin == "" || skin === null) skin="mirage";
	switchSkin(skin);
	
	$('a[href="#"]').click( function(){
		return false;
	});	

});