var homePageCoverflow=false,eventCard=false;
window.addEvent("domready",function(){$("select_diffusion_cinema")&&new elSelect({container:"select_diffusion_cinema"});$("select_seance_cinema")&&new elSelect({container:"select_seance_cinema"});$("select_reserver_prochainement_1")&&new elSelect({container:"select_reserver_prochainement_1"});$("select_reserver_prochainement_2")&&new elSelect({container:"select_reserver_prochainement_2"});$("filmCoverflow")&&(homePageCoverflow=new FilmCoverflow($("filmCoverflow"),filmData),Cgp.elementList.push(homePageCoverflow));
$$(".geoloc_select").each(function(a){a.addEvent("click",function(a){a.preventDefault();Cgp.setVilleId(a.target.title)})});$("eventCard")&&(eventCard=new EventCard,Cgp.elementList.push(eventCard));$$(".select_cinema").each(function(a){new elSelect({container:a.get("id")})});$("viewAllFilmsLink")&&($("viewAllFilmsLink").addEvent("click",function(a){a=new Event(a);a.stop();$("viewAllFilms").toggle()}),$("viewAllFilms").getElement("a.close").addEvent("click",function(a){a=new Event(a);a.stop();$("viewAllFilms").hide()}));
var a=$("pub_carre"),b=$("cinemas_map");if(a&&a.getStyle("height")!="0px"||b)if(b=$$(".col-right")[0]){var c=getHeaderContentHeight();c&&c!="0px"&&(b.setStyle("margin-top","-"+c),b.setStyle("padding-top","10px"))}if(!a||a&&a.getStyle("height")=="0px")(a=$("pub-col-right"))&&a.setStyle("display","none");a=new Class.ElementBandeau;Cgp.elementList.push(a);$$(".reserver_bloc").each(function(a){a=new Class.ElementFilm(a,false);Cgp.elementList.push(a)});$$(".reserver_bloc_cinema").each(function(a){a=new Class.ElementFilm(a,
true);Cgp.elementList.push(a)});userObject.isConnected()&&(a=$("menu_compte"),b=$("mon_compte"),a&&b&&($("mon_compte").getChildren(0).set("html","Mon Compte"),b=userObject.getUser(),a="",b.prenom&&b.nom?(a=b.prenom.replace(/\+/g," "),b=b.nom.replace(/\+/g," "),a="<strong>Bonjour "+a+" "+b+"</strong>"):a="Bonjour",new Request.HTML,b='<a href="index.php?do=mon_compte&sub=logout&return='+currentUrl+'" title="D&eacute;connexion">D&eacute;connexion</a>',c=new Element("li"),c.set("html",a),c.inject($("mon_compte"),
"before"),c=new Element("li"),c.set("html",b),c.inject($("mon_compte"),"after")),updateFavoriLinks(),updateAddFavorisLinks(),updateDeleteFavorisLinks());$("pub_banniere")&&(a=$("pub_banniere").getHeight(),a>0&&$(document.body).getStyle("background-image").test("/v3/img/communs/back-content.png")&&(Browser.ie?(b=$(document.body).getStyle("background-position-y"),a+=b&&b.length>1?b.toInt():0):(b=$(document.body).getStyle("background-position").match("^[0-9]+[a-z]+ (-?[0-9]+)px$"),a+=b&&b.length>1?b[1].toInt():
0),$(document.body).setStyle("background-position","0 "+a+"px")));$("changer_ville").addEvent("click",function(){$("information_block").setStyle("display","none")});userObject.synchronizeUser.delay(15E3,userObject);!Browser.ie6&&location.protocol!="https:"&&(a=$("lienv2"))&&a.setStyle("display","block");Cgp._reloadAll()});
function updateFavoriLinks(){$$(".favorilink").each(function(a){var b=a.get("class").split(" ")[1],c=b.split("_")[0],b=b.split("_")[1];html=userObject.getFavoriLink(b,c);a.set("html",html)})}function updateAddFavorisLinks(){$$(".addfavori").length>0&&$$(".addfavori").each(function(a){a.addClass("ajout-favoris");var b=a.get("class").split(" ")[1].split("_")[1];b&&a.addEvent("click",function(){userObject.setFavori(b,"add")})})}
function updateDeleteFavorisLinks(){$$(".deletefavori").length>0&&$$(".deletefavori").each(function(a){a.addClass("retirer-fav favoris-mini");var b=a.get("class").split(" ")[1].split("_")[1];b&&a.addEvent("click",function(){userObject.setFavori(b,"delete")})})}function getHeaderContentHeight(){var a=$("header-content");return a?a.getStyle("height"):"0px"}
function showSelectedForYouOffer(a,b,c){var f=[];if(b>0){var d=userObject.getKeyFromStatus();if(d.length&&typeof offresSortedBySelectedForYou!="undefined"){d=offresSortedBySelectedForYou[d];if(c.length>0)for(var e=0;e<c.length;e++)d.erase(c[e]);if(d&&d.length)for(c=0;c<b&&d.length>0;c++){e=d.getRandom();d.erase(e);var g=$(a+e);g&&(g.setStyle("display","block"),f.push(e))}}}return f}function closeInfoBlock(){$("information_block").setStyle("display","none")};

