function mainmenu(){
$(" #nav ul ").css({display: "none"}); // Opera Fix


/*preload images*/
$("#nav img").each(function() {
	rollsrc = $(this).attr("src");
	rollON = rollsrc.replace(/.gif$/ig,"_over.gif");
	$("<img>").attr("src", rollON);
});

$(" #nav li").hover(function(){/*on rollover*/
		/*fix rollover images*/
		theimg = $(this).find('img:first');
		if (theimg.is("img")) {
			imgsrc=theimg.attr("src");
			imgsrc=imgsrc.replace(/b_/,"v_");
			theimg.attr("src",imgsrc);
		}
		/*show submenu*/
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(400);
		},function(){ /*onrollout*/
		/*return image*/
		theimg = $(this).find('img:first');
		if (theimg.is("img")) {
			imgsrc=theimg.attr("src");
			imgsrc=imgsrc.replace(/v_/,"b_");
			theimg.attr("src",imgsrc);
		}

		/*hide submenu*/
		$(this).find('ul:first').css({visibility: "hidden"});
		});
}

function sliders() {
	$(".slider").hover(function(i){
		$(this).animate({width:340	},{queue:false});
	}, function(i) {
		$(this).animate({width:40},{queue:false});	
	});
}

$(document).ready(function($) {
	mainmenu();
	sliders();
});
