/** 
 * @projectDescription - Fevered Sleep	
 * @author - Playlab Ltd
 * @version 1
 */

/**
 * Set jQuery into noConflict mode
 */
var $j = jQuery.noConflict();

/** 
* Allow jQuery to fire the page 'onload'
* @id jQueryLoader
*/
$j(document).ready(function(){
	//Add a class to the body tag if JS is on.
	$j('body').addClass('hasJS');


	//ID of the page we are on.
	var bodyID = $j('body').attr('id');
	
	//different actions, depending on bodyID
		var domToggle;
		switch(bodyID){
			case 'home':
				$j('#content').css({backgroundPosition: '0 60%'});
				// about
				$j('#nav .item1 a').mouseover(function(){
					$j('#content').css({backgroundPosition:'0 60%'}); 
				});
				
				// what's happening
				$j('#nav .item2 a').mouseover(function(){
					$j('#content').css({backgroundPosition:'-900px 60%'}); 
				});

				// in dev
				$j('#nav .item3 a').mouseover(function(){
					$j('#content').css({backgroundPosition:'-1800px 60%'}); 
				});

				// archive
				$j('#nav .item4 a').mouseover(function(){
					$j('#content').css({backgroundPosition:'-2700px 60%'}); 
				});

				// gallery
				$j('#nav .item5 a').mouseover(function(){
					$j('#content').css({backgroundPosition:'-3600px 60%'}); 
				});

				// calendar
				$j('#nav .item6 a').mouseover(function(){
					$j('#content').css({backgroundPosition:'-4500px 60%'}); 
				});

				// mailing list
				$j('#nav .item7 a').mouseover(function(){
					$j('#content').css({backgroundPosition:'-5400px 60%'}); 
				});

				// contact us
				$j('#nav .item8 a').mouseover(function(){
					$j('#content').css({backgroundPosition:'-6300px 60%'}); 
				});

				/*
				if($j.browser.msie && $j.browserversion < 7) {
					//$j("#content").pngfix();
					//$j('#content').css({backgroundPosition:'-9999px -9999px'}); 
				}
				*/


				break;
			default:
				// attach fancybox to all image links with class of fancybox
				$j("#content a.fancybox").fancybox({ 
					'hideOnContentClick': true,
					'overlayShow': true,
					'overlayOpacity': 0.8
				}); 
				$j("#content a").attr({title:" ", alt:" "});
				$j("#content img").attr({title:" ", alt:" "});
				break;
		}
		
		// pngfix for PNGs
		//$j("#content").pngfix();
		//$j("#header").pngfix();
		//$j("#wrapper").pngfix();



});
