JQ=$;$(document).ready(function(){oB.settings.addThis=false;oB.settings.fadeControls=true;oB.settings.showDots=true;oB.settings.autoplay=true;oB.settings.inlineWidth=350;function e(f){if(f==="exit"||f===""){c(true)}else{if(f!==""){d(f,true)}}}$.history.init(e,{unescape:","});function c(g){$("#background").hide();$("#footer").show();var f=$("#header h1");f.addClass("inactive");$("#nav").children().each(function(){$(this).removeClass("inactive")});if(g==true){$("html,body").animate({scrollTop:0},200,"swing")}$("#nav p").each(function(){$(this).show()});$("#exit").hide()}$("#header h1").click(function(){$.history.load("exit")});$("#exit").click(function(){$.history.load("exit")});$("#quick").hover(function(){a()},function(){});$("#sitemap_wrap").hover(function(){},function(){a()});$(".prochainement_btn").live("click",function(){$("html,body").animate({scrollTop:$("#prochainement").offset().top-16},200,"swing")});$(".cettesemaine_btn").live("click",function(){$("html,body").animate({scrollTop:$("#nav").offset().top+20},200,"swing")});$(".suggestions_btn").live("click",function(){$("html,body").animate({scrollTop:$("#suggestions").offset().top-16},200,"swing")});function a(){$("#sitemap_wrap").slideToggle("fast")}function d(j,f){var i="";params=j.split(",");j=params[0];if(params.length>0){i=params[1]}if(j==="trailers"){j="movies";i="trailers"}$("#background").show();$("#footer").hide();$("#content").html($("#"+j+"_html").comments());$("#nav").children().each(function(){if($(this).attr("id").search(j)==-1){$(this).addClass("inactive")}else{$(this).removeClass("inactive")}});if(f==true){$("html,body").animate({scrollTop:$("#nav").offset().top+20},200,"swing");if(i==="next"){$("html,body").animate({scrollTop:$("#prochainement").offset().top-65},200,"swing")}else{if(i==="trailers"){}else{if(i&&i!==""){var r=$("#"+i);if(r){$("html,body").animate({scrollTop:r.offset().top-$("#nav").height()+70},200,"swing")}}}}}$("#nav p").each(function(){$(this).hide()});b();setTimeout(function(){$("#tracker").attr("src","/track/"+j+"/")},500);$("#exit").show();var l=$("#header h1");l.removeClass("inactive");if(j=="movies"){$(".all_posts").each(function(){var y=$(this).find(".synopsis_wrap");var x=$(this).find("h3");var v=y.children(".synopsis");var s=v.height();var t=y.find(".synopsis_full");var w=y.children(".show_more");var m=$(this).find(".thumbnail");var z=$(this).find(".trailer");if(v.height()<t.height()){w.show()}var u=function(){if(w.html()==="+"){if(v.height()<t.height()){v.animate({height:t.height()+5},"normal");w.html("-")}JQ.scrollTo(y,"slow",{offset:-75})}else{v.animate({height:s},"normal");w.html("+");if(s===t.height()){JQ.scrollTo(y,"slow",{offset:-75})}}};w.click(u);x.click(u);if(z){m.title="Voir la bande annonce";m.click(function(){z.click()})}});$(".wrap_schedules").click(function(){$.history.load("agenda")});var k;if(typeof orangebox_vars!=="undefined"){$("a[rel*=lightbox]").orangeBox(orangebox_vars)}else{$("a[rel*=lightbox]").orangeBox()}if(i==="trailers"){setTimeout(function(){$("a[rel*=lightbox]").filter(":first").click()},500)}}if(j=="links"){$.getScript("http://api.flickr.com/services/feeds/photos_public.gne?tags=cin%C3%A9ma-lefoyer-acign%C3%A9&format=json")}if(j=="agenda"){var h=new Date();var p=h.getDate();var g=h.getMonth();var q=h.getFullYear();events=[{title:"All Day Event",start:new Date(q,g,1)},{title:"Long Event",start:new Date(q,g,p-5),end:new Date(q,g,p-2)},{id:999,title:"Repeating Event",start:new Date(q,g,p-3,16,0),allDay:false},{id:999,title:"Repeating Event",start:new Date(q,g,p+4,16,0),allDay:false},{title:"Meeting",start:new Date(q,g,p,10,30),allDay:false},{title:"Lunch",start:new Date(q,g,p,12,0),end:new Date(q,g,p,14,0),allDay:false},{title:"Birthday Party",start:new Date(q,g,p+1,19,0),end:new Date(q,g,p+1,22,30),allDay:false},{title:"Click for Google",start:new Date(q,g,28),end:new Date(q,g,29),url:"http://google.com/"}];events=[];$("#calendar").fullCalendar({header:{left:"prev,next today",center:"title",right:""},firstDay:1,editable:false,timeFormat:"H(:mm)",eventSources:[schedules,{events:event_schedules,color:"white",textColor:"red"},events,{url:"/agenda/",error:function(){alert("there was an error while fetching events!")},color:"white",textColor:"blue"}],eventClick:function(v,s,m){var t=false;if(v.url){var u=new RegExp("^m_");if(v.url.match(u)){$.history.load("movies,"+v.url)}else{t=true}}return t},eventMouseover:function(t,s,m){$("a[href='"+t.url+"']").css("background-color","red")},eventMouseout:function(t,s,m){$("a[href='"+t.url+"']").css("background-color","white")}})}if(j=="contact"){var o=$("#contactform");o.submit(function(m){$("#contactform #contact_sendbutton").attr("disabled",true);$.ajax({url:o.attr("action"),type:"POST",data:o.serializeArray(),dataType:"json",success:function(t){var s="Votre message n'a pas pu &#234;tre envoy&#233;.<br/> Vous pouvez envoyez un message directement &#224; <a href='mailto:contact@cinemalefoyer.fr'>contact@cinemalefoyer.fr</a>";if(t){if(t.bad==="false"){s="Votre message a correctement &#233;t&#233; envoy&#233;."}}$("#testcall").html(s);$("#testcall").orangeBox("create");$("#contactform #contact_sendbutton").attr("disabled",false)},error:function(){alert("error");$("#contactform #contact_sendbutton").attr("disabled",false)},});return false});var n=$("#newsletterform");n.submit(function(m){$("#newsletterform #newsletter_sendbutton").attr("disabled",true);$.ajax({url:n.attr("action"),type:"POST",data:n.serializeArray(),dataType:"json",success:function(t){var s="Un probl&#232;me est survenu lors de la gestion de votre abonnement.<br />Veuillez prendre contact directement avec <a href='mailto:webmaster@cinemalefoyer.fr'>webmaster@cinemalefoyer.fr</a>";if(t){if(t.bad==="false"){s="Inscription/d&#233;sinscription prise en compte"}}$("#testcall").attr("title","Newsletter");$("#testcall").html(s);$("#testcall").orangeBox("create");$("#newsletterform #newsletter_sendbutton").attr("disabled",false)},error:function(){alert("error");$("#newsletterform #newsletter_sendbutton").attr("disabled",false)},});return false})}if(_gaq){_gaq.push(["_trackEvent",j,"Open",""])}}$("#scrollable_left").scrollable({circular:true}).navigator({navi:"#navi_left"});$("#scrollable_right").scrollable({circular:true}).navigator({navi:"#navi_right"});$("#nav").children().click(function(){var f=$(this).attr("id").split("_")[1];if(f==="trailers"&&window.location.hash==="#"+f){setTimeout(function(){$("a[rel*=lightbox]").filter(":first").click()},500)}$.history.load(f)});$("#current_movie_list img").click(function(){$.history.load("movies,"+$(this).attr("goto"))});$("#current_movie_list h2").live("click",function(){$.history.load("movies")});$("#next_movie_list img").live("click",function(){$.history.load("movies,"+$(this).attr("goto"))});$("#next_movie_list h2").click(function(){$.history.load("movies,next")});preloadContentDelay=1000;setTimeout(function(){preloadNode=$("<div></div>");preloadNode.css({position:"absolute",left:"-100000px",top:"-100000px",height:"1px",width:"1px",overflow:"hidden"});preloadNode.append($("#movies_html").comments());preloadNode.append($("#agenda_html").comments());preloadNode.append($("#cinema_html").comments());preloadNode.append($("#links_html").comments());$("body").append(preloadNode)},preloadContentDelay);function b(){$(".hoverable").hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")})}b()});function jsonFlickrFeed(b){var c=$("#flickrContainer");var a=0;while(a<6&&a<b.items.length){c.append('<a href="'+b.items[a].link+'"><img id="flickr_'+[a]+'" src="'+b.items[a].media.m.replace("_m","_s")+'" alt="'+b.items[a].title+'"></a>');a++}};
