var win2 = false ; var win3 = false ; var win4 = false ; var popupWin = false ; var winfaq = false ; var xhr_object = null; var page_section = "" ; var work_in_progress = new Array() ; function thisMovie(movieName) { if (navigator.appName.indexOf("Microsoft") != -1) { return window[movieName] } else { return document[movieName] } } function fla_nous_ecrire () { if (page_section != "recherche") affiche_section("recherche") ; var movie = thisMovie("accueil") ; movie.OuvreContact(); } function fla_mention_legale () { if (page_section != "recherche") affiche_section("recherche") ; var movie = thisMovie("accueil") ; movie.OuvreMentionsLegales(); } function fla_recherche () { if (page_section != "recherche") affiche_section("recherche") ; var movie = thisMovie("accueil") ; movie.OuvreRecherche(); } function preload_popup () { /* if (popupWin) popupWin.close(); popupWin = window.open ("about:blank","popupWin","resizable=yes,status=no,toobars=no,scrollbars=yes,width=860,height=600"); */ } function recherche_vide () { } function urlpage (url) { //popupWin.document.location.href = url ; window.open (url,"popupWin","resizable=yes,status=no,toobars=no,scrollbars=yes,width=860,height=600"); //popupWin.focus () ; } function OuvreAide(file) { if (win2) win2.close(); win2 = window.open ("aide.php?swf="+file,"win2","resizable=no,status=no,toobars=no,scrollbars=np,width=320,height=320"); } function OuvreFiche () { if (win3) win3.close(); win3 = window.open ("http://www.manger-en-alsace.com/php/client/fiche.php","winfiche","width=550,height=550,statusbar=no,scrollbars=no,resizable=no") ; } function OuvreFicheResto (idresto) { if (win3) win3.close(); win3 = window.open ("http://www.manger-en-alsace.com/php/client/fiche.php?idresto="+idresto,"winfiche","width=550,height=550,statusbar=no,scrollbars=no,resizable=no") ; } function OuvreRecette (idresto,idrecette) { if (win3) win3.close(); win3 = window.open ("http://www.manger-en-alsace.com/php/client/fiche.php?idresto="+idresto+"&idrecette="+idrecette,"win"+idresto,"width=550,height=550,statusbar=no,scrollbars=no,resizable=no") ; } function OuvreToutesRecettes (idrecette) { if (win3) win3.close(); win3 = window.open ("http://www.manger-en-alsace.com/php/client/fiche_recettes.php?idrecette="+idrecette,"win"+idrecette,"width=550,height=550,statusbar=no,scrollbars=no,resizable=no") ; } function OuvreTousEvenements () { if (win3) win3.close(); win3 = window.open ("http://www.manger-en-alsace.com/php/client/fiche_evenements.php","winevents","width=550,height=550,statusbar=no,scrollbars=no,resizable=no") ; } function ouvre_planzone () { if (win4) win4.close(); win4 = window.open ("http://www.manger-en-alsace.com/php/client/carte.php","win4","width=347,height=250,statusbar=no,scrollbars=no,resizable=no") ; } function ouvre_faq() { if (winfaq) winfaq.close(); winfaq = window.open ("http://www.manger-en-alsace.com/flash/FAQ/","winfaq","width=500,height=300,statusbar=no,scrollbars=yes,resizable=no") ; } function open_envoieami () { window.open ("http://www.manger-en-alsace.com/php/client/envoie_ami.php","winenvoieami","width=292,height=261,statusbar=no,scrollbars=no,resizable=no") ; } function addBookmark(url,title) { if (window.sidebar) { window.sidebar.addPanel(title, url,""); } else if( document.all ) { window.external.AddFavorite( url, title); } else if( window.opera && window.print ) { return true; } } function affiche_section (sectnom) { page_section = sectnom ; SendGetRequest("page/"+sectnom+".php",affiche_section_request) ; } function affiche_section (sectnom,param) { SendGetRequest("page/"+sectnom+".php?"+param,affiche_section_request) ; } function affiche_section_request () { if (xhr_object.readyState == 4) { document.getElementById("framecenter").innerHTML = xhr_object.responseText ; } } function UpdateMenu () { i = 0 ; while (document.getElementById("tablemenu"+i) ) { obj = document.getElementById("tablemenu"+i) ; UpdateMenuShow(obj,false,true,1); i++ ; } } function UpdateMenuShow (obj,show, first,vitesse) { //alert (document.getElementById("tablemenu"+i)) ; if (obj.style.height.indexOf("px") != 0) height = new Number(obj.style.height.substr(0,obj.style.height.length-2)); else height = new Number (obj.style.height) ; if (vitesse < 0) vitesse = 1 ; id = obj.id.substr(obj.id.length-1) ; if (first) { work_in_progress[id] = show ; } if (show && work_in_progress[id] == show) { if (height != NaN && height < 100) { height=height+vitesse ; obj.style.height = height ; //alert (vitesse) ; if (height <= 51) vitesse = vitesse + 1 ; else vitesse = vitesse - 1 ; setTimeout(function(){UpdateMenuShow(obj,show,false,vitesse)},1) ; } else work_in_progress[id] = !show ; } else if(!show && work_in_progress[id] == show) { if (height != NaN && height > 0) { height=height-vitesse ; obj.style.height = height ; if (height >= 49) vitesse = vitesse + 1 ; else vitesse = vitesse - 1 ; setTimeout(function(){UpdateMenuShow(obj,show,false,vitesse)},1) ; } else work_in_progress[id] = !show ; } } function pausecomp(millis) { var date = new Date(); var curDate = null; do { curDate = new Date(); } while(curDate-date < millis); } function SendGetRequest(xhr_url,CallBackRequest) { //alert(xhr_url+" -- "+CallBackRequest) ; if ( window.XMLHttpRequest ) { // Objet XmlHttpRequest pour les moteurs GECKO xhr_object = new XMLHttpRequest(); } else if ( window.ActiveXObject ) { // Objet XmlHttpRequest pour Internet Explorer xhr_object = new ActiveXObject( 'Microsoft.XMLHTTP' ); } else { // Navigateur non-compatible alert( 'Votre navigateur ne supporte pas les objets XMLHTTPRequest...' ); return; } // On ouvre la requete vers la page désirée xhr_object.open( 'GET', xhr_url, true ); // On lui donne le pointeur de fonction de retour xhr_object.onreadystatechange = CallBackRequest; // On envoi la requete xhr_object.send( null ); } function valid_ajout_image (url) { var movie = thisMovie("accueil") ; movie.SetVariable("urlimage", url); } function appelUpload () { window.open ("/php/client/upload.php","winpopup","width=300,height=105,scrollbars=no,status=no") ; } function appelUploadSwf () { window.open ("/php/client/uploadswf.php","winpopup","width=300,height=105,scrollbars=no,status=no") ; }