function preloadImages( imageRoot ){
	if (document.images) {

		preloadPics(imageRoot,
		'logo-jetstyle', 'logo-jetstyle-'
		);

		preloadPics(imageRoot+'meta/',
		'home', 'home-',
		'mail', 'mail-',
		'map', 'map-'
		);
	}

	preloadFlag = true;
}

var hoverTimeOut;

$(document).ready(function(){
	if ($(".downHome p").get(0) && $(".downHome p").html().length < 1) {
		$(".downHome").css("display", "none");
	}
	
	$(".service-menu > ul > li").hover(
	function () {
		$(this).removeAttr();
		$(this).hover(
		function () {
			$(this).css("display", "block");
			$(this).addClass("hov-");
		},
		function () {
			$(this).removeClass("hov-");
		}
		);
		$(this).addClass("hov-");
	},
	function () {
		$(this).removeClass("hov-");
	}
	);

	$(".menu > ul > li").hover(
	function () {
		$(".menu li").each(
		function() {
			$(this).removeClass("hov-");
		});

		$(this).addClass("hov-");
		clearTimeout(hoverTimeOut);
	},
	function () {
		$(".menu li").each(function() {
			$(this).removeClass("hov-");
		});

		$(this).addClass("hov-");
		hoverTimeOut = setTimeout("removeHoverClass('"+this.id+"')", 100);
	}
	);

	$(document).find("img").each(function(){
		if ( $(this).attr("bigsrc") ) {
			$(this).css("cursor", "pointer");
			$(this).bind("click", function(e){
			  var d = getWindowSize($(this).attr("bigwidth"), $(this).attr("bigheight"));
			  var preview = window.open("", '_blank', 'width='+d.width+',height='+d.height+',top='+d.top+',left='+d.left+',resizable=0,toolbar=0,directories=0,location=0,menubar=0,personalbar=0,scrollbars='+(d.scroll ? 'yes' : 'no')+',status=0');
			  preview.focus();
			  var imgBigSrc = document.location.protocol + "//" + document.location.host + $(this).attr("bigsrc");
			  $(preview).ready(function(){
			  	$(preview.document.body).css("padding", "0px");
			  	$(preview.document.body).css("margin", "0px");
			  	$(preview.document.body).append("<img src='" + imgBigSrc + "'" +
			  	" onclick='window.close();' style='cursor:pointer;' alt='закрыть' title='закрыть'>");
			  });
			});
		}
	});
});

function removeHoverClass( object ) {
	$("#"+object).removeClass('hov-');
}





