
function isIapple(){if(navigator.userAgent.match(/iPad/i))
return 1;if(navigator.userAgent.match(/iPhone/i))
return 2;else
return 0;}
var ajaxRequestCounter;function loadStart(){ajaxRequestCounter=0;$.loader({className:"blue-with-image-2",content:""});}
function loadFinish(totalAjaxRequest){ajaxRequestCounter++;if(ajaxRequestCounter>=totalAjaxRequest){$.loader('close');}}
function popupRestaurant(id){$.ajax({type:"POST",url:"action.php",data:"action=affiche_restaurant_infos_json&id="+id+"&controller=CVMPublicController",dataType:"text",success:function(data){var obj=$.parseJSON(data);$("#popupRestaurant").html('<p>');if(obj.modeOffline=="yes"){$("#popupRestaurant").append('<img src="templates/images/staticmap.png" align="right" />');}
else{$("#popupRestaurant").append('<img src="http://maps.google.com/maps/api/staticmap?center='+obj.latitude+','+obj.longitude+'&zoom=16&size=200x200&markers='+obj.latitude+','+obj.longitude+'&sensor=false" align="right" />');}
$("#popupRestaurant").append(obj.adresse+'<br />'+obj.npa+' '+obj.ville+'<br /><br />Tel1: '+obj.tel1);if(obj.tel2){$("#popupRestaurant").append('<br />Tel2: '+obj.tel2);}
if(obj.fax){$("#popupRestaurant").append('<br />Fax: '+obj.fax);}
if(obj.email){$("#popupRestaurant").append('<br /><br />'+obj.email);}
if(obj.url){$("#popupRestaurant").append('<br /><a href="http://'+obj.url+'" target="_blank">'+obj.url+'</a>');}
$("#popupRestaurant").append('</p>');$("#popupRestaurant").dialog({title:obj.nom,width:500,height:300});}});}
function toggleSearch(){$('#divSearch').slideToggle(400);$('#inputSearch').focus();}
