function a(a){return document.getElementById(a);}
function verifAvis(){if(a('avis_note').value==0){alert(T_JS_COMMENTNOTE);return false;}
return true;}
function showBloc(id){if(a(id).style.display!="block")a(id).style.display="block";else a(id).style.display="none";}
function addToFavoris(title,url){function myMessage(raccourciClavier){alert(T_JS_FAVMSG.replace("{KEY}",raccourciClavier));}
if(navigator.userAgent.indexOf('Konqueror')>=0){myMessage("CTRL + B");}
else if(window.external&&typeof(window.externalAddFavorite)=='function'){window.external.AddFavorite(url,title);}
else if(document.all&&(navigator.userAgent.indexOf('Win')<0)){myMessage("CMD + D");}
else if(navigator.userAgent.indexOf('Chrome')){myMessage("CTRL + D");}
else if(window.chrome&&window.print){myMessage("CTRL + T");}
else if(window.sidebar){window.sidebar.addPanel(title,url,"");}
else if(document.layers){myMessage("CTRL + D");}
hideOverlay();}
function addToMyFavorites(shop){$.getJSON("/ajax/ajax.addshopmember.php",{idb:shop},function(j){hideOverlay();});}
function addToFavoriteAsAMember(title,url,idb){if(!$("#addToFavorite").size())$("body").append("<div id='addToFavorite'></div>");else $("#addToFavorite").empty();$("#addToFavorite").append('<h1>'+T_SHOP_ADD_FAVORITE+'</h1><table id="choices"><tr><td><a title="'+T_FAV_ADD2BROWSER+'" href="#" id="btnMyNav">'+(EXT=='fr'?'<img src="'+PATH_TO_STATIC+'/images/btn_favnav.gif" alt="'+T_FAV_ADD2BROWSER+'"/>':T_FAV_ADD2BROWSER)+'</a></td><td><a title="'+T_FAV_ADD2ACCOUNT+'" href="#" id="btnMyAccount" class="oneChoice">'+(EXT=='fr'?'<img src="'+PATH_TO_STATIC+'/images/btn_favaccount.gif" alt="'+T_FAV_ADD2ACCOUNT+'"/>':T_FAV_ADD2ACCOUNT)+'</a></td></table>');$("#btnMyAccount").click(function(){addToMyFavorites(idb);return false;});$("#btnMyNav").click(function(){addToFavoris(title,url);return false;});showOverlay("addToFavorite");}
function addToFavoriteWithCallBack(title,url,idb){if(!$("#addToFavorite").size())$("body").append("<div id='addToFavorite'></div>");else $("#addToFavorite").empty();$("#addToFavorite").append('<h1>'+T_SHOP_ADD_FAVORITE+'</h1><table id="choices"><tr><td><a title="'+T_FAV_ADD2BROWSER+'" href="#" id="btnMyNav">'+(EXT=='fr'?'<img src="'+PATH_TO_STATIC+'/images/btn_favnav.gif" alt="'+T_FAV_ADD2BROWSER+'"/>':T_FAV_ADD2BROWSER)+'</a></td><td><a title="'+T_FAV_MAKEACCOUNT+'" href="/membre/inscription.php?shopILike='+idb+'" class="oneChoice">'+(EXT=='fr'?'<img src="'+PATH_TO_STATIC+'/images/btn_account.gif" alt="'+T_FAV_MAKEACCOUNT+'"/>':T_FAV_MAKEACCOUNT)+'</a></td></table>');$("#btnMyNav").click(function(){addToFavoris(title,url);return false;});showOverlay("addToFavorite");}
function updateCatMenu(city,perim){if(city>0){xmlGet(a('cat_menu'),"/ajax/ajax.getmenuoncityprox.php?idv="+city+"&d="+perim);}}
function updateListeVilleMenu(dep){if(dep.length<2){a('localize_city').innerHTML='<option value="">'+T_JS_CITY+'</option>';}else{xmlGet(a('localize_city'),"/ajax/ajax.selectvilleonmenu.php?cp="+dep);}}
function updateListeVille(cp){if(searching==undefined||searching!=cp){var searching=cp;if(cp.length<2){a('villeAuto').innerHTML='<option value="">'+T_JS_CITY+'</option>';}else{xmlGet(a('villeAuto'),"/ajax/ajax.selectvilleoncp.php?cp="+cp);}}}
function loadCity(cp,eltid,reCenterMyGMap){if(cp.length<2)return;var recenter=0;if(reCenterMyGMap&&reCenterMyGMap==true)recenter=1;xmlGet(a(eltid),"/ajax/ajax.selectvilleonmenu.php?cp="+cp+"&recenter="+recenter);}
function addVilleMembre(bid){xmlGet(a('popspace'),"/ajax/ajax.add_ville_membre.php?idb="+bid);}
function xmlGet(eltid,script){var xhr_object=null;if(window.XMLHttpRequest){xhr_object=new XMLHttpRequest();}else if(window.ActiveXObject){xhr_object=new ActiveXObject("Microsoft.XMLHTTP");}else{alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");return;}
xhr_object.open("GET",script,true);xhr_object.onreadystatechange=function(){if(xhr_object.readyState==4){eltid.innerHTML=(xhr_object.responseText);}}
xhr_object.send(null);}
function xmlPost(eltid,script,postdata){var xhr_object=null;if(window.XMLHttpRequest){xhr_object=new XMLHttpRequest();}else if(window.ActiveXObject){xhr_object=new ActiveXObject("Microsoft.XMLHTTP");}else{alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");return;}
xhr_object.open("POST",script,true);xhr_object.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xhr_object.send(postdata);xhr_object.onreadystatechange=function(){if(xhr_object.readyState==4){eltid.innerHTML=(xhr_object.responseText);}}}
function xmlGetWithWaitMsg(eltid,script,msg){var xhr_object=null;if(window.XMLHttpRequest){xhr_object=new XMLHttpRequest();}else if(window.ActiveXObject){xhr_object=new ActiveXObject("Microsoft.XMLHTTP");}else{alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");return;}
xhr_object.open("GET",script,true);xhr_object.onreadystatechange=function(){if(xhr_object.readyState==4){eltid.innerHTML=(xhr_object.responseText);}else{eltid.innerHTML=msg;}}
xhr_object.send(null);}
function cleanStars(nb){for(i=1;i<=5;i++){elt='star_'+i;if(i<=nb){a(elt).src='/static/images/star_on.gif';}else{a(elt).src='/static/images/star_off.gif';}}}
function setStars(nb){for(i=1;i<=5;i++){elt='star_'+i;if(i<=nb){a(elt).src='/static/images/star_on.gif';}else{a(elt).src='/static/images/star_off.gif';}}}
function cancelAvis(){a('avis_titre').value='';a('avis_texte').value='';a('form_avis').style.display='none';}
function loadAvisForm(){if(!$('#form_avis').find('form').size()){$('#form_avis').html('<p>'+T_LABEL_LOADING+'...</p>').load('/ajax/ajax.formaddavis.php');}}
function loadPictureForm(){if(!$('#form_photos').find('form').size()){$('#form_photos').html('<p>'+T_LABEL_LOADING+'...</p>').load('/ajax/ajax.formaddpic.php');}}
function loadEventForm(){if(!$('#form_event').find('form').size()){$('#form_event').html('<p>'+T_LABEL_LOADING+'...</p>').load('/ajax/ajax.formaddevent.php');}}
function mailfriend(id){openWindow('/mailfriend.php?id='+id,500,450);}
function openWindow(url,w,h){openWindowWithName(url,w,h,'_blank');}
function openWindowWithName(url,w,h,name){var fenetre;if(fenetre==null||fenetre.closed){var width=w;var height=h;var left=window.screen.width/2-(width/2);var top=window.screen.height/2-(height/2);fenetre=window.open(url,name,'toolbar=0, location=0, directories=0, status=0, scrollbars=1, resizable=1, copyhistory=0, menuBar=0, width='+width+'px, height='+height+'px,left='+left+'px, top='+top+'px');fenetre.focus();}else{fenetre.focus();}}
function xmlNavMenu(w,c,b){if(a(w).style.display=='block')a(w).style.display='none';else{xmlGetWithWaitMsg(a(w),"/ajax/ajax.getsubcat.php?sub="+c+"&bl="+b,'<li>'+T_LABEL_LOADING+'...</li>');a(w).style.display='block';}}
function swap(el){if(a(el).style.display=='block'||a(el).style.display=='')a(el).style.display='none';else a(el).style.display='block';}
var keyUp=38,keyDown=40,currElt=-1;var lastVal;function xSearchLoc(val,w){a(w).style.display='block';if(lastVal!=val){a(w).innerHTML=T_LABEL_LOADING+'...';currElt=-1;xmlGet(a(w),"/ajax/ajax.searchlochelper.php?val="+escape(val));}
lastVal=val;}
function xInscSearchLoc(val,w){a(w).style.display='block';if(lastVal!=val){currElt=-1;xmlGet(a(w),"/ajax/ajax.inscrlochelper.php?val="+escape(val));}
lastVal=val;}
function navClav(e,w){var elz=a(w).getElementsByTagName('DIV');var elzLen=elz.length;k=document.layers?e.which:e.keyCode;if(k==keyDown&&currElt<elz.length-1){currElt++;if(currElt>0)a(elz[currElt-1].id).className='unselected';if(currElt<elz.length-1)a(elz[currElt+1].id).className='unselected';a(elz[currElt].id).className='selected';}
else if(k==keyDown)a(elz[currElt].id).className='selected';if(k==keyUp&&currElt>=0){currElt--;if(currElt>0)a(elz[currElt-1].id).className='unselected';if(currElt<elz.length-1)a(elz[currElt+1].id).className='unselected';a(elz[(currElt<0?0:currElt)].id).className='selected';}}
function xSearchLocDep(val,w){a(w).style.display='block';xmlGet(a(w),"/ajax/ajax.searchlocdephelper.php?val="+escape(val));}
function hide(w){a(w).style.display='none';}
function hideOnBlur(w){setTimeout('hide("'+w+'")',500);}
function hideOnEnter(w){setTimeout('hide("'+w+'")',0);}
function dd(d){w=a('locmaphelper');w.innerHTML=T_LABEL_LOADING+'...';w.style.display='block';w.style.position='absolute';w.style.left=xMouseP+'px';w.style.top=yMouseP+'px';xmlGet(w,'/ajax/ajax.vildep.php?dep='+d);}
function de(lat,lng){w=a('locmaphelper');w.innerHTML=T_LABEL_LOADING+'...';w.style.display='block';w.style.position='absolute';w.style.left=xMouseP+'px';w.style.top=yMouseP+'px';xmlGet(w,'/ajax/closestcity.php?lat='+lat+'&lng='+lng);}
var xMouseP,yMouseP,navigateur;function getNav(){n=navigator.appName;v=navigator.appVersion;rMac=new RegExp('Macintosh','ig');rWin=new RegExp('Windows','ig');if(n=='Netscape'){if(rWin.test(v))return'FF';rSaf=new RegExp('AppleWebKit','ig');if(rSaf.test(v))return'Safari';if(rMac.test(v))return'Mac';}
else if(n=='Opera')
{if(rMac.test(v))return'Mac';return'Opera';}
return'IE';}
function getMousePos(e){if(navigator.appName=="Netscape"){winW=window.innerWidth;winH=window.innerHeight;}
else{winW=document.body.offsetWidth;winH=document.body.offsetHeight;}
xMouseP=((navigator.appName.substring(0,3)=="Net")?e.pageX:event.x+document.body.scrollLeft)-((winW-920)/2)+27;if(navigateur=='IE')xMouseP+=120;yMouseP=((navigator.appName.substring(0,3)=="Net")?e.pageY:event.y+document.body.scrollTop);}
navigateur=getNav();if(navigator.appName.substring(0,3)=="Net")document.captureEvents(Event.MOUSEMOVE);document.onmousemove=getMousePos;document.onload=getMousePos;function checkHourType(input){var r=new RegExp("^[0-9]+$");var value=input.value;if(!r.test(value)){input.style.border="1px solid #f00";}else{input.style.border="1px solid #3da80b";}}
function reCenterGMap(lon,lat){alert(window.curGMap);window.curGMap.setCenter(new GLatLng(lat,lon),13);}
function showConnectBox(){loadAndDisplay('/ajax/login.popup.php');}
function hideConnectBox(){a('overlay').style.display='none';a('connectbox').style.display='none';a('connectcont').style.display='none';fuckPubz(false);}
function loadAndDisplay(url){$('#cbox').remove();$.get(url,function(c){$("body").append('<div id="cbox">'+c+'</div>');showOverlay();});}
function blackScreen(){var bs;bs=document.getElementById("divOverlay");if(!bs){bs=document.createElement("div");bs.setAttribute("id","divOverlay");document.getElementsByTagName("body").item(0).appendChild(bs);}
bs.style.display="block";}
function showOverlay(){id='cbox';var box=document.getElementById(id);if(!box)return;box=box.parentNode.removeChild(box);var overLayContener;overLayContener=document.getElementById("overLayContener");var overlayBox=document.getElementById("overlayBox");if(!overLayContener){overLayContener=document.createElement("div");overLayContener.setAttribute("id","overLayContener");var closeLink=document.createElement("a");closeLink.setAttribute("id","closeLink");closeLink.appendChild(document.createTextNode("Fermer"))
closeLink.onclick=function(){hideOverlay();return false;}
overLayContener.appendChild(closeLink);overlayBox=document.createElement("div");overlayBox.style.display="block";overlayBox.setAttribute("id","overlayBox");overLayContener.appendChild(overlayBox);document.getElementsByTagName("body").item(0).appendChild(overLayContener);}
fuckPubz(true);box.style.display="block";overlayBox.appendChild(box);blackScreen();overLayContener.style.display="block";}
function hideOverlay(){var overlayBox=document.getElementById("overlayBox");if(overlayBox.hasChildNodes()){var exContent=overlayBox.childNodes;var l=exContent.length;var oneNode;var body=document.getElementsByTagName("body").item(0);for(var i=0;i<l;i++){oneNode=exContent[i].parentNode.removeChild(exContent[i]);body.appendChild(oneNode);oneNode.style.display="none";}}
fuckPubz(false);document.getElementById("overLayContener").style.display="none";document.getElementById("divOverlay").style.display="none";}
function fuckPubz(iAmOk){if(!$.browser.msie)return;if(iAmOk){$("select, object, embed").css("visibility","hidden");}else{$("select, object, embed").css("visibility","visible");}}
function qualityInit(current_idb){$('#quality_ok').click(function(){$.post('/ajax/ajax.qualite.php',{idb:current_idb,quality:1,quality_info:'Info OK'},function(){$('#quality').html('<p>'+T_QUALITY_JS_VOTE+'</p>');});});$('#quality_nok').click(function(){$('#quality').html('<p>'+T_QUALITY_JS_OK+'<br /><input type="button" id="quality_hok" value="'+T_LABEL_YES+'" /> <input type="button" id="quality_hnok" value="'+T_LABEL_NO+'" /></p>');$('#quality_hnok').click(function(){$('#quality').html('<p>'+T_QUALITY_JS_DOUKNOW+'<br /><input type="button" id="quality_hkok" value="'+T_LABEL_YES+'" /> <input type="button" id="quality_hknok" value="'+T_LABEL_NO+'" /></p>');$('#quality_hkok').click(function(){$('#quality').html('<p>'+T_QUALITY_JS_REDIRECT+'</p>');setTimeout(function(){window.location='/horaires/ajouter-commerce.php?edit='+current_idb+'#horaires';},3000);});$('#quality_hknok').click(function(){$('#quality').html("<p style='text-align:left'>"+T_QUALITY_JS_COMMUNITY+"<br /><a href=\"/horaires/\">"+T_LABEL_KNOW_MORE+"</a></p>");});});$('#quality_hok').click(function(){qualityForm(current_idb,T_QUALITY_JS_OTHER,T_QUALITY_JS_OTHER_TEXT+' : ');});});$('#quality_not').click(function(){qualityForm(current_idb,T_QUALITY_JS_404,T_QUALITY_JS_404_TEXT+'&nbsp;:');return false;});$('#quality_dup').click(function(){qualityForm(current_idb,T_QUALITY_JS_DOUBLE,T_QUALITY_JS_DOUBLE_TEXT+'&nbsp;:');return false;});}
function qualityForm(current_idb,raison,text){$('#quality').html('<p>'+text+'<br /><textarea id="quality_info" style="width: 235px; height:150px;"></textarea><br /><input type="button" id="quality_submit" value="'+T_LABEL_SUBMIT+'" /></p>');$('#quality_info').focus();$('#quality_submit').click(function(){var qinfo=$('#quality_info').val();if($.trim(qinfo)==''){alert(T_QUALITY_JS_PRECISE);return false;}
$.post('/ajax/ajax.qualite.php',{idb:current_idb,quality:-1,quality_info:raison+' > '+qinfo},function(){$('#quality').html('<p>'+T_QUALITY_JS_THANKS+'</p>');});});}
function addOW(h,k){var td=$('#tabHoraire_'+h).find('#day_'+h+'_'+k);if(td.find('div').length<3){var divow=$('#tabHoraire_'+h).find('div.trancheTabHoraire:first');if(td.find('div').length==0){var t=1;}else{var divid=td.find('div:last').attr('id').split('_');var t=divid[divid.length-1];}
t=parseInt(t)+k*100000000000+1;td.append('<div id="ow_'+h+'_'+k+'_'+t+'" class="trancheTabHoraire">'+divow.html().replace(/value="([0-9]+)"/g,'').replace(/periods\[([0-9]+)\]\[([0-9]+)\]/g,'periods['+h+']['+t+']')+'</div>');$('#ow_'+h+'_'+k+'_'+t).find('input:first').attr('value',k);$('#ow_'+h+'_'+k+'_'+t).find('input').not(':hidden').val('');}}
function delOW(h,k){var td=$('#tabHoraire_'+h).find('#day_'+h+'_'+k);if(td.find('div').length&&$('#tabHoraire_'+h).find('div.trancheTabHoraire').length){td.find('div:last').remove();}}
function copyOW(h,k){if(k>1){$('#tabHoraire_'+h).find('#day_'+h+'_'+k).empty().append($('#tabHoraire_'+h).find('#day_'+h+'_'+(parseInt(k)-1)).children().clone());$('#tabHoraire_'+h).find('#day_'+h+'_'+k).find('div.trancheTabHoraire').each(function(){var t=Math.ceil(Math.random()*10000000);$(this).attr('id','ow_'+h+'_'+k+'_'+t);$(this).find('input:first').val(k);$(this).find('input').each(function(){var nid=$(this).attr('name').replace(/periods\[([0-9]+)\]\[([0-9]+)\]/g,'periods['+h+']['+t+']');$(this).attr('name',nid).attr('id',nid);});});}}
function addPeriod(){var nbTabHoraires=$('.tablor').length;if(nbTabHoraires<=5){var newtid=$('.tablor:last').attr('id').split('_');newtid=parseInt(newtid[1])+1;var tabHoraire=$('#tabHoraire_0').html();tabHoraire=tabHoraire.replace(/periods\[([0-9]+)\]/g,'periods['+newtid+']');tabHoraire=tabHoraire.replace(/ow_0/g,"ow_"+newtid);tabHoraire=tabHoraire.replace(/day_0/g,"day_"+newtid);tabHoraire=tabHoraire.replace(/OW\(0/g,"OW("+newtid);tabHoraire=tabHoraire.replace(/<!--/,"");tabHoraire=tabHoraire.replace(/-->/,"");$('#addPeriod').before('<div class="tablor" id="tabHoraire_'+newtid+'">'+tabHoraire+'</div>');$('#tabHoraire_'+newtid).find('input').not(':hidden').val('');}}
function delPeriod(tabH){var nbTabHoraires=$('.tablor').length;if(nbTabHoraires>1)$(tabH).parent().parent().remove();}
function google_ad_request_done(google_ads){var s='';var i;if(google_ads.length==0){return;}
var pinfo='<p style="margin:0px 0px 5px 0px;"><a href=\"'+google_info.feedback_url+'\" style="color:#000000;text-decoration: none;">Annonces Google</a></p>';var ptarget='_blank';s+='<div style="width:582px; background-color:#FFEBB1;border:1px solid #FBCD4C; margin-bottom: 15px;margin-left: 2px; text-align: left; padding: 5px;">';s+=pinfo;if(google_ads[0].type=="flash"){s+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="'+
google_ad.image_width+'" HEIGHT="'+
google_ad.image_height+'"> <PARAM NAME="movie" VALUE="'+
google_ad.image_url+'">'+'<PARAM NAME="quality" VALUE="high">'+'<PARAM NAME="AllowScriptAccess" VALUE="never">'+'<EMBED src="'+
google_ad.image_url+'" WIDTH="'+
google_ad.image_width+'" HEIGHT="'+
google_ad.image_height+'" TYPE="application/x-shockwave-flash"'+' AllowScriptAccess="never" '+' PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>';}else if(google_ads[0].type=="image"){s+='<a href="'+
google_ads[0].url+'" target="'+ptarget+'" title="afficher la page '+
google_ads[0].visible_url+'" onmouseout="window.status=\'\'" onmouseover="window.status=\'afficher la page '+
google_ads[0].visible_url+'\';return true"><img border="0" src="'+
google_ads[0].image_url+'"width="'+
google_ads[0].image_width+'"height="'+
google_ads[0].image_height+'"></a>';}else if(google_ads[0].type=="html"){s+=google_ads[0].snippet;}else{if(google_ads.length==1){s+='<p style="margin:0px;"><a style="text-decoration:underline;font-size:16px;margin-top:5px;color:#80238F;font-weight: bold;" href="'+
google_ads[0].url+'" target="'+ptarget+'" onmouseout="window.status=\'\'" onmouseover="window.status=\'afficher la page '+
google_ads[0].visible_url+'\';return true">'+
google_ads[0].line1+'</a><br /><span style="color:#000000;font-size:14px">'+
google_ads[0].line2+' '+
google_ads[0].line3+'</span><br /><a target="'+ptarget+'" style="color:#008000;font-size:14px;text-decoration:none" href="'+
google_ads[0].url+'" onmouseout="window.status=\'\'" onmouseover="window.status=\'afficher la page '+
google_ads[0].visible_url+'\';return true">'+
google_ads[0].visible_url+'</a></p>';}else if(google_ads.length>1){for(i=0;i<google_ads.length;++i){s+='<p style="margin: 5px 0px 0px 0px;"><a target="'+ptarget+'" style="text-decoration:underline;color:#80238F;font-size:14px;font-weight:bold;" href="'+
google_ads[i].url+'" onmouseout="window.status=\'\'" onmouseover="window.status=\'afficher la page '+
google_ads[i].visible_url+'\';return true">'+
google_ads[i].line1+'</a><br /><a target="'+ptarget+'" style="color:#008000;margin-right:10px;text-decoration:none;" href="'+
google_ads[i].url+'" onmouseout="window.status=\'\'" onmouseover="window.status=\'afficher la page '+
google_ads[i].visible_url+'\';return true">'+
google_ads[i].visible_url+'</a> <span style="color:#000000">'+
google_ads[i].line2+' '+
google_ads[i].line3+' </span></p>';}}
if(google_ads[0].bidtype=="CPC"){google_adnum=google_adnum+google_ads.length;}}
s+='</div>';document.write(s);return;}