var curImgID = 0; var itval = null; function bindMap() { if (!$("#map_canvas")[0]) return; var newark = new google.maps.LatLng(59.93965,30.377932); var myOptions = { zoom: 17, center: newark, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); var marker = new google.maps.Marker({ position: newark, map: map, title:(lang=="en" ? "Ресторан \"Франческо\"" : "Restaurant \"Francesco\"") }); var marker = new google.maps.Marker({ position: new google.maps.LatLng(59.93985,30.377932), map: map, title:(lang=="en" ? "Ресторан \"Франческо\"" : "Restaurant \"Francesco\""), icon:"/i/title_"+lang+".jpg" }); } function bindGalleryKeys() { if ($("#gal")[0]) { $.hotkeys.remove("right"); $.hotkeys.remove("left"); $.hotkeys.add("right",{ type:"keydown" },function() { moveToGalleryImage(+1,null); return false; }); $.hotkeys.add("left",{ type:"keydown" },function() { moveToGalleryImage(-1,null); return false; }); } if ($(".photos-cont")[0]) { $.hotkeys.remove("right"); $.hotkeys.remove("left"); $.hotkeys.add("right",{ type:"keydown" },function() { var gallery_id = $("#fullimage").attr("gallery_id"); var cont = $(".photos-cont .photos[gallery_id="+gallery_id+"]")[0]; moveToEventImage(cont,+1); return false; }); $.hotkeys.add("left",{ type:"keydown" },function() { var gallery_id = $("#fullimage").attr("gallery_id"); var cont = $(".photos-cont .photos[gallery_id="+gallery_id+"]")[0]; moveToEventImage(cont,-1); return false; }); } } function bindPageScroller() { $(".scrollable").jScrollPane({ scrollbarWidth:8, showArrows:true, arrowSize:8 }); if ($(".scrollable:first").parent().find(">.jScrollPaneTrack")[0]) { $("#nav-page .down").click(function() { if ($(".jScrollPaneContainer > div:first")[0]) $(".jScrollPaneContainer > div:first")[0].scrollBy(300); }); $("#nav-page .up").click(function() { if ($(".jScrollPaneContainer > div:first")[0]) $(".jScrollPaneContainer > div:first")[0].scrollBy(-300); }); } else { $(".scroll_cont").css("border-bottom","none"); $("#nav-page .up,#nav-page .down").hide(); } } function checkContactForm() { var name = jQuery("#contact-form input[name='contact_name']")[0].value; var email = jQuery("#contact-form input[name='contact_email']")[0].value; var phone = jQuery("#contact-form input[name='contact_phone']")[0].value; var guests = jQuery("#contact-form input[name='contact_guests']")[0].value; var tm = jQuery("#contact-form input[name='contact_time']")[0].value; var dt = jQuery("#contact-form input[name='contact_date']")[0].value; var notes = jQuery("#contact-form textarea[name='contact_notes']")[0].value; jQuery("#contact-form .error").hide(); if (!name || !phone || !email || !dt) { if (!phone) { jQuery(".error",jQuery("#contact-form input[name='contact_phone']").parent()[0]).show(); jQuery("#contact-form input[name='contact_phone']").focus(); } if (!dt) { jQuery(".error",jQuery("#contact-form input[name='contact_date']").parent()[0]).show(); jQuery("#contact-form input[name='contact_date']").focus(); } if (!email) { jQuery(".error",jQuery("#contact-form input[name='contact_email']").parent()[0]).show(); jQuery("#contact-form input[name='contact_email']").focus(); } if (!name) { jQuery(".error",jQuery("#contact-form input[name='contact_name']").parent()[0]).show(); jQuery("#contact-form input[name='contact_name']").focus(); } return false; } $.post((lang=="en" ? "/en" : "")+"/reservation/",{ contact_post:"post", contact_name:name, contact_email:email, contact_phone:phone, contact_date:dt, contact_time:tm, contact_guests:guests, contact_notes:notes, is_ajax:"true", ms:new Date().getTime() },function(res) { if (res=="OK") { $("#contact-form").hide(); $("#reservation_form .success").show(); } else { alert(lang=="en" ? "Error was occured during reservation creating, try again" : "Произошла ошибка во время создания заказа, попробуйте еще раз"); } }); return false; } function checkContactFormEng() { var name = jQuery("#contact-form-en input[name='contact_name']")[0].value; var email = jQuery("#contact-form-en input[name='contact_email']")[0].value; var phone = jQuery("#contact-form-en input[name='contact_phone']")[0].value; var guests = jQuery("#contact-form-en input[name='contact_guests']")[0].value; var tm = jQuery("#contact-form-en input[name='contact_time']")[0].value; var dt = jQuery("#contact-form-en input[name='contact_date']")[0].value; var notes = jQuery("#contact-form-en textarea[name='contact_notes']")[0].value; jQuery("#contact-form-en .error").hide(); if (!name || !phone || !email || !dt) { if (!phone) { jQuery(".error",jQuery("#contact-form-en input[name='contact_phone']").parent()[0]).show(); jQuery("#contact-form-en input[name='contact_phone']").focus(); } if (!dt) { jQuery(".error",jQuery("#contact-form-en input[name='contact_date']").parent()[0]).show(); jQuery("#contact-form-en input[name='contact_date']").focus(); } if (!email) { jQuery(".error",jQuery("#contact-form-en input[name='contact_email']").parent()[0]).show(); jQuery("#contact-form-en input[name='contact_email']").focus(); } if (!name) { jQuery(".error",jQuery("#contact-form-en input[name='contact_name']").parent()[0]).show(); jQuery("#contact-form-en input[name='contact_name']").focus(); } return false; } $.post((lang=="en" ? "/en" : "")+"/reservation/",{ contact_post:"post", contact_name:name, contact_email:email, contact_phone:phone, contact_date:dt, contact_time:tm, contact_guests:guests, contact_notes:notes, is_ajax:"true", ms:new Date().getTime() },function(res) { if (res=="OK") { $("#contact-form-en").hide(); $("#reservation_form_en .success").show(); } else { alert("Error was occured during reservation creating, try again"); } }); return false; } function getSizeLite(el){ return { wb:el.offsetWidth||0, hb:el.offsetHeight||0 }; } function closeGallery() { $("#fullimage .loading").stop(); $("#fullimage").stop().css({ width:2,height:150,"margin-left":-1,"margin-top":-1 }).hide(); $("#fullimage_close").stop().css({ "margin-left":-1,"margin-top":-1 }).hide(); $("#fullimage > img.full").hide(); $("#fullimage").stop(); $("#tour_movie,#tour_movie_close,#reservation_form,#reservation_form_en,#reservation_close,#reservation_lang").hide(); $("a","#reservation_close").text("закрыть"); $("a",this).text("in english"); $("#overlay").fadeOut(500); return false; }; var ival = null; function onGalleryImageClick() { var fw = parseInt($(this).attr("rw")); var fh = parseInt($(this).attr("rh")); var txt = $(this).attr("title"); if (txt) { fh+=30; $("#fullimage .fullimagedesc").text(txt).show(); } else $("#fullimage .fullimagedesc").text("").hide(); setImageHeight(fw,fh); $("#overlay").css("opacity",0).show().fadeTo(500,0.9); $("#fullimage .loading").hide(); $("#fullimage .loading img").hide(); var full_image = $("#fullimage > img.full")[0]; ival = setInterval(function() { $("#fullimage .loading").show(); $("#fullimage .loading img").show(); $(full_image).hide(); clearInterval(ival); ival = null; },100); $.preload([ $(this).attr("href") ], { onFinish: function(data) { clearInterval(ival); ival = null; $("#fullimage > .loading").hide(); $(full_image).attr({ "src":data.image }).fadeIn(300); } }); return false; } function bindGalleryImages() { $("a.gallery_image").click(onGalleryImageClick); } function moveToGalleryImage(direction,link) { var cur_img = $("#gal .galphotos .selected").removeClass("selected")[0]; if (!cur_img) cur_img = $("#gal .galphotos a:first")[0]; if (!cur_img) return false; var count = $("#gal .galphotos_more img").length; switch(direction) { case 0: cur_img = link; break; case -1: if ($(cur_img).prev()[0]) cur_img = $(cur_img).prev()[0]; else { var pos = parseInt($(">img:first",cur_img).css("left")); $("#gal .galphotos_more img").each(function(i) { $(this).css("left",i*151); }); $("#gal .galphotos img").each(function(i) { $(this).css("left",(count+i)*151); }); $("#gal .galphotos")[0].scrollLeft = pos+count*151; $("#gal .galphotos").prepend($("#gal .galphotos_more").html()); rebindGallery(); cur_img = $(cur_img).prev()[0]; } break; case +1: if ($(cur_img).next()[0]) cur_img = $(cur_img).next()[0]; else cur_img = $("#gal .galphotos a:first")[0]; break; } $(cur_img).addClass("selected"); var pos = parseInt($(">img:first",cur_img).css("left")); $("#gal .galphotos").animate({ "scrollLeft":pos },1500); var img_index = $("#gal .galphotos a").index(cur_img)+1; if (count-img_index<=4) { var last_pos = parseInt($("#gal .galphotos a:last > img").css("left")); $("#gal .galphotos_more img").each(function(i) { $(this).css("left",last_pos+(i+1)*151); }); $("#gal .galphotos").append($("#gal .galphotos_more").html()); rebindGallery(); } var fullimage = $("#gal .first")[0]; var fullimage2 = $("#gal .second")[0]; $("#gal .loading").hide(); $("#gal .loading img").hide(); var isLoading = false; itval = setInterval(function() { $("#gal .loading").show(); $("#gal .loading img").show(); //$(fullimage).hide(); //$(fullimage2).hide(); clearInterval(itval); var isLoading = true; itval = null; },100); $.preload([ $(cur_img).attr("href") ], { onFinish: function(data) { clearInterval(itval); itval = null; $("#gal .loading").hide(); var imgel = ($("#gal img.first").is(".active") ? $("#gal img.second")[0] : $("#gal img.first")[0]); var fw = parseInt($(cur_img).attr("rw")); var l = (609-fw)/2; var txt = $(">span:first",cur_img).text(); $("#gal .desc").html(""+txt+""+txt); $("#gal")[0].customAnimate = true; $("#gal")[0].op = 1; $("#gal")[0].params = { direction:direction,isLoading:isLoading,oldElem:$("#gal .active")[0],newElem:imgel }; $(imgel).css("left",l).attr({ "src":data.image }).show(); $("#gal").stop().animate({ op:0 },{ duration: 1000,complete:function() { $("#gal .active").removeClass("active").css("margin-left",0).hide(); $(imgel).addClass("active"); $("#gal")[0].params = null; } }); $("#gal .pager .cur_pic").text(img_index); } }) } function rebindGallery() { $("#gal .galphotos a").unbind("click").click(function() { moveToGalleryImage(0,this); return false; }); } function bindGallery() { bindGalleryKeys(); $("#gal .galphotos a").click(function() { moveToGalleryImage(0,this); return false; }); $("#galnav .left,#gal .pager .prev").click(function() { moveToGalleryImage(-1,null); return false; }); $("#galnav .right,#gal .pager .next").click(function() { moveToGalleryImage(+1,null); return false; }); } function bindMainPics() { $("#main_pics .row1 div,#main_pics .row2 div").hover(function() { $(this).addClass("jsover").find("a").css("opacity",0); $(this).find("a").stop().animate({ opacity:1 },300); },function() { $(this).removeClass("jsover"); }); } function bindMainPicsFooter() { $("#main_pics_footer div").hover(function() { $(this).addClass("jsover").find("a").css("opacity",0); $(this).find("a").stop().animate({ opacity:1 },300); },function() { $(this).removeClass("jsover"); }); } function moveToEventImage(cont,direction) { $("#fullimage").attr("gallery_id",$(cont).attr("gallery_id")); var cur_img = $(">.selected",cont).removeClass("selected")[0]; if (!cur_img) cur_img = $(">a:first",cont)[0]; if (!cur_img) return false; switch(direction) { case -1: if ($(cur_img).prev()[0]) cur_img = $(cur_img).prev()[0]; else cur_img = $(">a:last",cont)[0]; break; case +1: if ($(cur_img).next()[0]) cur_img = $(cur_img).next()[0]; else cur_img = $(">a:first",cont)[0]; break; } $(cur_img).addClass("selected"); var img_index = $(">a",cont).index(cur_img)+1; $("#fullimage .pager .page").text(img_index); $("#fullimage .pager .pages").text($(">a",cont).length); var fw = parseInt($(cur_img).attr("rw")); var fh = parseInt($(cur_img).attr("rh")); var txt = $(cont).parent().find(">h2").text(); if (txt!="") { fh+=30; $("#fullimage .fullimagedesc").text(txt).show(); } else { $("#fullimage .fullimagedesc").text("").hide(); fh+=10; } setImageHeight(fw,fh); $("#fullimage .loading").hide(); $("#fullimage .loading img").hide(); var full_image = $("#fullimage > img.full")[0]; ival = setInterval(function() { $("#fullimage .loading").show(); $("#fullimage .loading img").show(); $(full_image).hide(); clearInterval(ival); ival = null; },100); $.preload([ $(cur_img).attr("href") ], { onFinish: function(data) { clearInterval(ival); ival = null; $("#fullimage > .loading").hide(); $(full_image).attr({ "src":data.image }).fadeIn(300); } }); } function onEventToggler() { var cont = $(this).parent().find(">.photos")[0]; $("#overlay").css("opacity",0).show().fadeTo(500,0.9); moveToEventImage(cont,0); return false; } function bindEventsImages() { $(".photos-cont .toggler").click(onEventToggler); $(".photos-cont .image-toggler").click(function() { $(this).parent().find(".toggler:first").trigger("click"); }); $("#fullimage .full").click(function() { var gallery_id = $("#fullimage").attr("gallery_id"); var cont = $(".photos-cont .photos[gallery_id="+gallery_id+"]")[0]; moveToEventImage(cont,+1); return false; }); $("#fullimage .nav .prev").click(function() { var gallery_id = $("#fullimage").attr("gallery_id"); var cont = $(".photos-cont .photos[gallery_id="+gallery_id+"]")[0]; moveToEventImage(cont,-1); return false; }); $("#fullimage .nav .next").click(function() { var gallery_id = $("#fullimage").attr("gallery_id"); var cont = $(".photos-cont .photos[gallery_id="+gallery_id+"]")[0]; moveToEventImage(cont,+1); return false; }); } function moveToItemPic(direction,isTimer) { var cur_img = $("#about_gallery .galphotos .selected").removeClass("selected")[0]; if (!cur_img) cur_img = $("#about_gallery .galphotos a:first")[0]; if (!cur_img) return false; switch(direction) { case -1: if ($(cur_img).prev()[0]) cur_img = $(cur_img).prev()[0]; else cur_img = $("#about_gallery .galphotos a:last")[0]; break; case +1: if ($(cur_img).next()[0]) cur_img = $(cur_img).next()[0]; else cur_img = $("#about_gallery .galphotos a:first")[0]; break; } $(cur_img).addClass("selected"); var img_index = $("#about_gallery .galphotos a").index(cur_img)+1; var fullimage = $("#about_gallery .piccont .first")[0]; var fullimage2 = $("#about_gallery .piccont .second")[0]; $("#about_gallery .loading").hide(); $("#about_gallery .loading img").hide(); var isLoading = false; if (!isTimer) { unbindAboutTimer(); } var itval = setInterval(function() { $("#about_gallery .loading").show(); $("#about_gallery .loading img").show(); $(fullimage).hide(); $(fullimage2).hide(); clearInterval(itval); var isLoading = true; itval = null; },100); $.preload([ $(cur_img).attr("href") ], { onFinish: function(data) { clearInterval(itval); itval = null; $("#about_gallery .loading").hide(); var imgel = ($("#about_gallery .piccont .first").is(".active") ? $("#about_gallery .piccont .second")[0] : $("#about_gallery .piccont .first")[0]); $("#about_gallery .piccont")[0].customAnimate = true; $("#about_gallery .piccont")[0].op2 = 1; $("#about_gallery .piccont")[0].params = { isLoading:isLoading,oldElem:$("#about_gallery .piccont .active")[0],newElem:imgel }; $(imgel).attr({ "src":data.image }).show(); $("#about_gallery .piccont").stop().animate({ op2:0 },{ duration: 1000,complete:function() { $("#about_gallery .piccont .active").removeClass("active"); $(imgel).addClass("active"); $("#about_gallery .piccont")[0].params = null; bindAboutTimer(); } }); $("#about_gallery .pager .cur_pic").text(img_index); } }) } var aval = null; function unbindAboutTimer() { if (aval) { clearInterval(aval); aval= null; } } function bindAboutTimer() { unbindAboutTimer(); aval = setInterval(function() { moveToItemPic(+1,true); },4000); } function bindAboutGallery() { bindAboutTimer(); $("#about_gallery .nav .prev").click(function() { moveToItemPic(-1); return false; }); $("#about_gallery .nav .next").click(function() { moveToItemPic(+1); return false; }); $("#about_gallery .piccont").hover(function() { $("#about_gallery .nav div").stop(true,true).fadeIn(500); },function() { $("#about_gallery .nav div").stop(true,true).fadeOut(500); }); } function onDateSelect(dateText) { $("#contact-form .contact_date_text").text(dateText); $("#contact-form input[name='contact_date']")[0].value=dateText; } function onDateSelectEng(dateText) { $("#contact-form-en .contact_date_text").text(dateText); $("#contact-form-en input[name='contact_date']")[0].value=dateText; } function adjustRatio(img) { var imageratio = 943/1279; var winheight = (document.body.clientHeight === undefined)?window.innerHeight:document.body.clientHeight; var winwidth = (document.body.clientWidth === undefined)?window.innerWidth:document.body.clientWidth; winratio = winheight / winwidth; if(winratio > imageratio) { $("#pagebg img").css({ height:"100%",width:"auto" }); } else { $("#pagebg img").css({ height:"auto",width:"100%" }); } } function getPositionLite(el) { var x = 0, y = 0; while(el) { x += el.offsetLeft || 0; y += el.offsetTop || 0; el = el.offsetParent; } return { x:x, y:y }; } $(document).ready(function() { adjustRatio(); $(window).bind("resize",adjustRatio); // bindAboutGallery(); var $_fx_step_default = $.fx.step._default; $.fx.step._default = function (fx) { if (!fx.elem.customAnimate) return $_fx_step_default(fx); if (fx.prop=="op" && fx.elem.params) { if ($(fx.elem.params.oldElem).css("opacity")>fx.now && !fx.elem.params.isLoading) $(fx.elem.params.oldElem).css("opacity",fx.now); $(fx.elem.params.newElem).css("opacity",1-fx.now); } if (fx.prop=="op2" && fx.elem.params) { if ($(fx.elem.params.oldElem).css("opacity")>fx.now && !fx.elem.params.isLoading) $(fx.elem.params.oldElem).css("opacity",fx.now); $(fx.elem.params.newElem).css("opacity",1-fx.now); } fx.elem.updated = true; }; $("#overlay").click(closeGallery); bindGalleryImages(); bindGallery(); bindMainPics(); bindMainPicsFooter(); bindEventsImages(); $("ul.slider li > a").click(function() { var el = this; var skipShowing = false; $("ul.slider li > a.selected").each(function() { if (el==this) { skipShowing = true; } $(this).removeClass("selected"); $(this).parent().find(">.desccont").stop(true,true).animate({ height:0 },300,function() { $(this).hide().css("height","auto"); }); }); if (!skipShowing) { $(this).addClass("selected"); var el = $(this).parent().find(">.desccont>.desc")[0]; if (el) { $(el).parent().css("height",0).show(); var size = getSizeLite(el); $(el).parent().stop(true,true).animate({ height:size.hb },300); } } }); $("#more-news").click(function() { var url = $(this).attr("href").replace("more/","more/ajax/"); var link = this; $.get(url,{ },function(res) { $(">.ajax-list",res).children().each(function() { $(".list").append(this); if ($(this).is(".item")) { $(".gallery_image",this).click(onGalleryImageClick); } }); if ($(">.ajax-more-news",res)[0]) $(link).attr("href",$(">.ajax-more-news",res).attr("href")); else $(link).hide(); $(".scrollable").jScrollPane({ scrollbarWidth:8, showArrows:true, arrowSize:8 }); }); return false; }); $("#more-events").click(function() { var url = $(this).attr("href").replace("more/","more/ajax/"); var link = this; $.get(url,{ },function(res) { $(">.ajax-list",res).children().each(function() { $("#events").append(this); if ($(this).is(".item")) { $(".toggler",this).click(onEventToggler); } }); if ($(">.ajax-more-events",res)[0]) $(link).attr("href",$(">.ajax-more-events",res).attr("href")); else $(link).hide(); $(".scrollable").jScrollPane({ scrollbarWidth:8, showArrows:true, arrowSize:8 }); }); return false; }); jQuery("#contact-form .reset").click(function() { jQuery("#contact-form .error").hide(); }); jQuery("#contact-form").submit(checkContactForm); jQuery("#contact-form-en .reset").click(function() { jQuery("#contact-form-en .error").hide(); }); jQuery("#contact-form-en").submit(checkContactFormEng); var calconfig = $.extend({ onSelect:onDateSelect,minDate:0.1,showStatus: true, showOn: 'focus', buttonText: '' },$.datepicker.regional['ru']); calconfig.dateFormat='dd M yy'; var calconfig2 = $.extend({ onSelect:onDateSelectEng,minDate:0.1,showStatus: true, showOn: 'focus', buttonText: '' },$.datepicker.regional['en']); calconfig2.dateFormat='dd M yy'; $('#contact-form .datepicker').datepicker(calconfig); $('#contact-form-en .datepicker').datepicker(calconfig2); bindPageScroller(); $(".tourlink").click(function() { $("#overlay").css("opacity",0).show().fadeTo(500,0.9); $("#tour_movie,#tour_movie_close").show(); return false; }); $("#tour_movie_close,#reservation_close,#fullimage_close").click(closeGallery); $("#contacts-left a.reservation,#contacts a.reservation").click(function() { $("#overlay").css("opacity",0).show().fadeTo(500,0.9); $("#reservation_form .success,#reservation_form_en .success").hide(); $("#contact-form").show(); $("#reservation_form,#reservation_close,#reservation_lang").show(); return false; }); if ($("#recipes-list")[0]) { $("#recipes-list").css({ "padding-left":80 }); $(".scroll_cont").css({ "border":"none","padding":"0" }).wrap("
"); $(".sc").css({ "position":"relative","left":-60,"margin-right":-60 }).append("
"); $(".sc .jScrollPaneContainer").css("width",680); } $("#recipes-list li a").hover(function() { if ($(this).parent().parent().is("selected")) return; $(this).parent().parent().addClass("selected"); // $(".scroll_cont .jScrollPaneContainer").css({"overflow":"visible","overflow-x":"visible"}); $(".thumb",$(this).parent().parent()[0]).removeClass("thumb").addClass("thumb-selected"); },function() { $(this).parent().parent().removeClass("selected"); $(".thumb-selected",$(this).parent().parent()[0]).removeClass("thumb-selected").addClass("thumb"); // $(".scroll_cont .jScrollPaneContainer").css({"overflow":"hidden","overflow-x":"hidden"}); }); var irtp = null; $("#big_pic img").click(function() { $("#big_pic").hide(); }).hover(function() { if (irtp) { clearInterval(irtp); irtp=null; } },function() { if (irtp) { clearInterval(irtp); irtp=null; } irtp = setInterval(function() { $("#big_pic").hide(); clearInterval(irtp); irtp= null; },500); }); $("#recipe .thumb_pic").hover(function() { if (irtp) { clearInterval(irtp); irtp=null; } var img_src = $("img:first",this).attr("src"); var pos = getPositionLite($("img",this)[0]); var recipe_pos = getPositionLite($("#recipe")[0]); $("#big_pic img").attr("src",img_src).css("top",pos.y-recipe_pos.y).parent().show(); return false; },function() { if (irtp) { clearInterval(irtp); irtp=null; } irtp = setInterval(function() { $("#big_pic").hide(); clearInterval(irtp); irtp= null; },500); }); $("#bottom_b .pics:first").cycle({ fx:"fade", speed:2000, timeout:6000 }); var iiv = setInterval(function() { $("#bottom_b .pics:eq(1)").cycle({ fx:"fade", speed:2000, timeout:6000 }); clearInterval(iiv); iiv= null; },2000); var iiv2 = setInterval(function() { $("#bottom_b .pics:last").cycle({ fx:"fade", speed:2000, timeout:6000 }); clearInterval(iiv2); iiv2= null; },4000); var iii = null; $("#gal .piccont").hover(function() { if (iii) { clearInterval(iii); iii=null; } $("#gal .desc").stop(true,true).fadeIn(300); },function() { if (iii) { clearInterval(iii); iii=null; } iii = setInterval(function() { $("#gal .desc").stop(true,true).fadeOut(300); },1000); }); $("#gal div,#gal .desc").hover(function() { if (iii) { clearInterval(iii); iii=null; } },function() { if (iii) { clearInterval(iii); iii=null; } iii = setInterval(function() { $("#gal .desc").stop(true,true).fadeOut(300); },1000); }); bindMap(); $("#reservation_lang").click(function() { if ($("a",this).text()=="in english") { $("#reservation_form").hide(); $("#reservation_form_en").show(); $("a","#reservation_close").text("close"); $("a",this).text("по-русски"); } else { $("#reservation_form_en").hide(); $("#reservation_form").show(); $("a","#reservation_close").text("закрыть"); $("a",this).text("in english"); } return false; }); });