$.extend({	getUrlVars: function(){		var vars = [], hash;		var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');		for(var i = 0; i < hashes.length; i++){			hash = hashes[i].split('=');			vars.push(hash[0]);			vars[hash[0]] = hash[1];		}		return vars;	},	getUrlVar: function(name){		return $.getUrlVars()[name];	}
});$(document).ready(function(){   	var page = $.getUrlVar('page');	var last = $.cookie('pageLast');  	if(page == null) page=2;  	if(page > 3){		if(page == 4) page=1;       		if(page == 5) page=2;       		if(page >= 6) page=3;	}       	$('#container').append('<div id="bkg1"></div><div id="bkg2"></div><div id="bkg3"></div>');	if( last == page){		$('#bkg'+page).show();    	}else{     		$('#bkg'+last).css('z-index','1').show();    		$('#bkg'+page).css('z-index','2').delay(500).fadeIn(1000, 'linear', function(){      			$.cookie('pageLast', page);		});	}  	$('#menu ul li').not('#menu ul ul li').append('<span></span>');	$('#menu ul li').not('#menu ul ul li').hover(		function(){ 			$('span', this).stop(true, true).slideDown(500, 'easeOutBounce');			$('ul', this).stop(true, true).delay(200).slideDown(500, 'easeOutBounce');		},		function(){ 			$('span', this).stop(true, true).delay(100).slideUp(100, 'linear');			$('ul', this).stop(true, true).slideUp(100, 'linear');		}	);   	//category hover	$('ul.category li').hover(		function(){			$(this).css('top','0').stop(true, false).animate(			{				top : '-20px',				boxShadow: '3px 10px 15px 0px #000'			}, 300);		},		function(){			$(this).animate(			{				top : '0',				boxShadow: '2px 4px 7px 0px #000'			}, 500);		}	);	});                                                
