// JavaScript Document

/*	----------------------------
 *	Preload images
 *	----------------------------
 */
$.preloadImages = function() {
	for(var i = 0; i<arguments.length; i++)
	{
		jQuery("<img>").attr("src", arguments[i]);
	}
}
$.preloadImages("images/various/site_banner.jpg", 
				"images/various/site_slogan.jpg", 
				"images/various/page_background.jpg",
				"images/various/bullet.jpg",
				"images/menu/menu_Lft.jpg", 
				"images/menu/menu_mid.jpg", 
				"images/menu/menu_Rgt.jpg", 
				"images/border/border_BL.jpg",
				"images/border/border_BR.jpg",
				"images/border/border_TL.jpg",
				"images/border/border_TR.jpg",
				"images/border/border_Bot.jpg",
				"images/border/border_Lft.jpg",
				"images/border/border_Rgt.jpg",
				"images/border/border_Top.jpg",
				"images/divider/divider_Lft.jpg",
				"images/divider/divider_Mid.jpg",
				"images/divider/divider_Rgt.jpg");

/*	----------------------------
 *		Document Ready
 *	----------------------------
 */	
$(document).ready(function() {
	jQueryGlobalFunctions();
	jQueryLocalFunctions();
	return false;
});

/*	----------------------------
 *		Global Functions
 *	----------------------------
 */	
function jQueryGlobalFunctions()
{
	/*
	 *******************************************
	 *	Preload images
	 *******************************************
	 */
		$.preloadImages = function()
		{
			for(var i = 0; i<arguments.length; i++)
			{
				jQuery("<img>").attr("src", arguments[i]);
			}
		}
	/*
	 *******************************************
	 *	Highlight Active link in Navigation Bar
	 *******************************************
	 */
		var path = location.pathname.substring(1);
	//	var path = location.pathname.substring(12); // localhost only!
		
		if (path.length < 1) { path = 'index.html'; }
		
		$('#nav a[href$="' + path + '"]').parent().addClass('active');
	/*
	 *******************************************
	 *	Optional - Slideshows
	 *******************************************
	 */
		if ($(".pics").length) {
			$('#slideshow').cycle({  fx: 'fade', cleartype: 1, speed: 2000 });
		}
}

function jQueryLocalFunctions(){} // STUB DO NOT USE
