jQuery.preloadImages = function()
{
	for(var i = 0; i<arguments.length; i++)
	{
		jQuery("<img>").attr("src", arguments[i]);
	}
};

jQuery(document).ready(function() {		
	$.preloadImages("/i/floors/window.gif", "/i/home_s.gif", "/i/mail_s.gif", "/i/map_s.gif");
	$('.mmenu_item').each(function() {
		$.preloadImages($(this).attr("img_menu_over"));
		$(this).css("background", "url("+$(this).attr("img_menu")+") no-repeat");
		$(this).hover(
			function(){
				$(this).css("background", "url("+$(this).attr("img_menu_over")+") no-repeat");
			},
			function(){
				$(this).css("background", "url("+$(this).attr("img_menu")+") no-repeat");
			}
		)
	});
/**/
	//$(".floor-item img").maphilight({fillColor: 'E6E6E6', fillOpacity: 0.7, stroke: false, alwaysOn: true});
	$(".floor-wrap").jMap();
	
	$("map > area").jqBubble();
	
	$(".floor-switch").click(function(){
		var id = $(this).attr("id");
		id = "#floor_" + id.substring(14);
		//alert(id);
		$(".floor-scroll").scrollTo($(id), {easing:'easeOutExpo', duration:1000, axis:'x'});
		$(".floor-switch").removeClass("active");
		$(this).addClass("active");
		return false;
	});
});