$(document).ready(function(){
	
	var y_pos = function(obj){
		var pos = $(obj).css("background-position");
		if(pos == 'undefined' || pos == null) pos = parseInt($(obj).css("background-position-y"));
		else pos = pos.split(" ")[1];
		return parseInt(pos) || 0;
	}
	
	$("div#shortmenu a").hover(
		function(){
			if(!$(this).hasClass("active")) $(this).css("background-position", "0 " + (y_pos($(this)) - 27) + "px");
		},
		function(){
			if(!$(this).hasClass("active")) $(this).css("background-position", "0 " + (y_pos($(this)) + 27) + "px");
		}
	);
	
	$("div#menu li").hover(
		function(){
			$(this).addClass("sfhover");
			var el = $(this).children();
			if(!el.hasClass("active")) el.css("background-position", "0 " + (y_pos(el) - 36) + "px");
		},
		function(){
			$(this).removeClass("sfhover");
			var el = $(this).children();
			if(!el.hasClass("active")) el.css("background-position", "0 " + (y_pos(el) + 36) + "px");
		}
	);
	
	$('div#scroller').jScrollPane();
	
	$('div#fader ul').innerfade({
		speed: 1000,
		timeout: 8000,
		type: 'random',
		containerheight: '229px',
		animationtype: 'fade'
	});
	
});