var initialse=false;var context=[];var xhr_object=[];var timerAntiblocage=[];var ajax_in_progress=[false,false,false,false];var ajax_loaded=[false,false,false,false];var action_in_progress=false;var transitions_in_progress=false;var spin_in_progress=false;var no_more_transitions=false;var screen_width=320;var screen_height=460;var check_delay=10000;var transitionDuration=750;var flipDuration=1200;var activePageId;var idlePageId;var oldPageId;var cookieName="cinefilIphone";var ignore=["fond","jump1","listPreload","url","target","statique","charte","type","going_forward","club","wgslat","wgslon","add","pn","nav","ville","pagePath","reste","lie","nocinap","domain","tab","cookieDomain","cookie","browser","activeTab","areTransformsSupported","uid","images","oldTab","posterVisible"];var images1=[];var images2=[];var images3=[];var imagesStored=[];var nbaffiche;var filmsList=[];var idList=[];function init(){if(!initialse){initGlobals();hide_address_bar();if(!context.browser){context.browser=getBrowser(!context.browser)}updateContex(context,analyseURL());context.charte="IPC";context.areTransformsSupported=(window.WebKitCSSMatrix?true:false);context.activeTab=1;context.oldTab=false;context.posterVisible=false;if(context.pagePath=="ProfilFilm"){context.activeTab=0;context.oldTab=1;context.posterVisible=true}if(context.pagePath=="ChoixFilm"){if(context.tab=="affiche"){context.activeTab=1}else{if(context.tab=="nouveau"){context.activeTab=2}else{context.activeTab=3}}}var b=getCookie(cookieName);var a=false;if(context.pagePath!="Accueil"){a=true}if(!b){var b=[];b.uid=createRandomId(10)}createCookie(cookieName,b,context.cookieDomain);updateContextFromCookie(context,b);if(context.pagePath=="Accueil"){addToPage(activePageId,dispHomePage(),false,true,false);setTimeout("executeJump('hide')",3000)}return}}function getAction(c,f,h){var b=[];var k=arguments.length;if(k>=4){for(var d=3;d<k;d=d+2){b[arguments[d]]=arguments[d+1]}}var g=accueil=false;if(c==="redirect"){g=true}else{if(c==="Accueil"){accueil=true}}var j=true;if(accueil||g||b.listPreload){j=false}if(!useMainAjaxPipe(!b.add,g,j)){return}if(g&&b.url){if(b.nextPageWithoutTransition){no_more_transitions=true}if(b.target==="blank"){window.open(b.url,"_blank")}else{window.location=b.url}return}if(b.listPreload){$(b.listPreload).className+=" preload"}if(c=="ProfilFilm"&&b.poster){b.activeTab=0;context.posterVisible=true}if(!h||h===""){h="Cube"}if(no_more_transitions){h=false}b.type=h;b.going_forward=f;if(accueil){var e=dispHomePage();transition(h,f,e,"ACC",false);overrideGlobals(b)}else{b.pagePath=c;var a=getUrl(b);getPage(a,b)}}function getPageSuccess(a,c){if(!c.listPreload){stopSpinning()}if(c.add){if(c.pagePath==="ChoixFilm"){var b=[];b=a.split("@@@@@");removeDiv("footerLinks"+c.tab,"AutourFilm"+c.tab);addToDiv("AutourFilm"+c.tab,b[0],true);setToDiv("delayedScript"+c.tab,b[1]);setTimeout(function(){executeDivJavascript("delayedScript"+c.tab,context.browser=="firefox",true)},200)}else{if(c.pagePath==="ProfilFilm"){if(c.tab==="avis"){removeDiv("footerLinks","AutourAvis");addToDiv("AutourAvis",a,true)}else{if(c.tab==="seances"){setToDiv("AutourSeances",a);removeClassName($("AutourSeances"),"hidden");executeJump("hide")}}}}resizeContainerHeight(1100);action_in_progress=false}else{executeJump("hide");transition(c.type,c.going_forward,a,c.fond,false)}overrideGlobals(c)}function analyseURL(){var c=location.href;var f=[];var m=[];var e=[];var d=[];var b=[];var m=c.split("?");e=m[0].split("/");var o=e.length;var j=e[2];f.fulldomain=j;d=j.split(".");if(d[0]=="www"){j=j.substr(4)}else{if(d[0]=="club"){j=j.substr(5)}}f.domain=j;if(isLocal(f.domain)){f.cookieDomain=f.domain}else{f.cookieDomain=j.substr(2)}if(e[3]==""||e[3]=="iphonecinefil.html"){f.pagePath="Accueil"}else{f.pagePath=e[3]}if(o>4&&e[4]){var h=e[4];if(h.substr(0,5).toLowerCase()=="cinap"){h=h.substr(5)}f.pagePath=h;var g=["ChoixSalle","ProfilSalle","SalleProximite"];var n=[];var k=[];if(g.indexOf(f.pagePath)!=-1){if(o>5&&e[5]){f.ville=e[5]}if(o>6&&e[6]){f.reste=e[6]}if(o>7&&e[7]){f.tab=e[7]}}else{if(o>5&&e[5]){f.reste=e[5]}if(o>6&&e[6]){f.tab=e[6]}}}var a=getStringFromRequest("nav");if(a){f.nav=a}return f}function getUrl(e){if(!isSet(e)||!e){var e=context}var o="";var r="";var k="";var d="";var a="";var j=context.pagePath;var b="www.";var n="http://";if((e.club||context.club)&&e.club!=="end"){if(e.club){var g={club:e.club};updateCookie(cookieName,g,context);context.club=e.club}k+="club="+context.club+"&"}else{if(e.club==="end"&&context.club){delKey("club");var g={club:"NULL"};updateCookie(cookieName,g,context)}}if(e.pagePath){j=e.pagePath}if(e.nav){a=e.nav;k+="nav="+a+"&"}else{if(context.nav){a=context.nav;k+="nav="+a+"&"}}if(e.ville){o=e.ville}else{if(a=="SAL"&&context.ville){o=context.ville}}if(e.reste){r=e.reste+"/"}if(e.tab){d=e.tab+"/"}if(e.lie){k+="lie="+e.lie+"&"}else{if(context.lie){k+="lie="+context.lie+"&"}}if(e.pn){k+="pn="+e.pn+"&"}if(e.add){k+="add=true&"}if(e.wgslat&&e.wgslon){k+="wgslat="+e.wgslat+"&wgslon="+e.wgslon+"&"}else{if(context.wgslat&&context.wgslon){k+="wgslat="+context.wgslat+"&wgslon="+context.wgslon+"&"}}if(context.uid){e.uid=context.uid}for(var m in e){if(validkey(m)&&ignore.indexOf(m)==-1){k+=m+"="+e[m]+"&"}}if(j=="ProfilFilm"){var q=getSallesPreferes();if(q){k+="salles="+q+"&"}}if(k){k="?"+k;k=k.slice(0,-1)}if(e.noqs){k=""}var h=context.domain.split(".");if(Number(h[0])==h[0]){b=""}if(e.nocinap){var p=""}else{var p="Cinap"}var f=["ChoixSalle","ProfilSalle","SalleProximite"];if(o&&f.indexOf(e.pagePath)!=-1){o+="/"}else{o=""}var c=n+b+context.domain+"/"+p+j+"/"+o+r+d+k;if((context.domain==="m.cinefil.localhost"||isLocal(context.domain))&&context.browser!="ie"&&window.console&&window.console.firebug){console.log("url : "+c)}return c}function overrideGlobals(b){delKeys(["reste","pn","tab"]);images1=[];images2=[];images3=[];imagesStored=[];filmsList=[];idList=[];if(b){if(b.activeTab||b.activeTab===0){context.activeTab=b.activeTab}else{if(!b.add&&!b.avis){context.activeTab=1}}if(b.pagePath){context.pagePath=b.pagePath}if(b.charte){context.charte=b.charte}if(b.ville){if(b.ville!=context.ville){var a={ville:b.ville};updateCookie(cookieName,a,context);context.ville=b.ville}}if(b.reste){context.reste=b.reste}if(b.pn){context.pn=b.pn}if(b.wgslat&&b.wgslon){context.wgslat=b.wgslat;context.wgslon=b.wgslon}if(b.lie){context.lie=b.lie}if(b.nav){context.nav=b.nav}}else{delKeys(["ville","pagePath","reste","nav"])}}function dispHomePage(){var e="";delKey("ville");context.pagePath="Accueil";var d=getSallesPreferes();if(d){var a="ListeSalles";e=",'salles','"+d+"'"}else{var a="ChoixVille"}today=new Date();dateToChange=new Date(2009,7,4);var c;if(today<dateToChange){c='<IMG class="homeImg" SRC="http://photos.cityvox.com/photos_original/125/233/387453.jpg">'}else{c="<script type=\"text/javascript\">var qsp = {'ville' : 'france','pagePath' : 'PubliciteOrange','reste' : '_'+context.uid,'noqs' : true};var urlPub = getUrl(qsp)+'?acc=true';getPub(urlPub, 'AutourPubOrange', 1);<\/script>"}var b="<div class=\"main\"><div id=\"FILM\" onclick=\"getAction('ChoixFilm', true, 'Cube', 'nav', 'FIL')\"><h1>Quel film ?</h1></div><div id=\"SALLE\" onclick=\"getAction('"+a+"', true, 'Cube', 'nav', 'SAL'"+e+')"><h1>Dans quelle salle ?</h1></div></div><div id="AutourPubOrange" class="AutourPubOrange"></div>'+c+'<!-- eStat --><SCRIPT LANGUAGE="JavaScript"><!--var _PJS=0;//--><\/script><SCRIPT LANGUAGE="JavaScript" SRC="http://prof.estat.com/js/ml.js"><\/script><SCRIPT LANGUAGE="JavaScript"><!--if(_PJS) _estatl("280080157428","230030157427","IPCFRA","---","ACC","---");//--><\/script><noscript><IMG SRC="http://prof.estat.com/m/web/280080157428?g=230030157427&c=IPCFRA&p=---&l3=ACC&l4=---" BORDER="0" WIDTH="1" HEIGHT="1" />';"</noscript><!-- /eStat -->";return b}if(!document.addEventListener&&document.attachEvent){context.browser="ie";Object.prototype.addEventListener=function(b,c,a){if(this.attachEvent){this.attachEvent("on"+b,c)}};var i,l=document.all.length;for(i=0;i<l;i++){document.all[i].addEventListener=Object.prototype.addEventListener}window.addEventListener=Object.prototype.addEventListener;document.addEventListener=Object.prototype.addEventListener}if(!Array.indexOf){Array.prototype.indexOf=function(b){for(var a=0;a<this.length;a++){if(this[a]==b){return a}}return -1}}if(window.addEventListener){window.addEventListener("load",function(){setTimeout(init,100)},false)}else{alert("Votre browser n'est pas supporté sur cette platforme Mobile")};
