var head = document.getElementsByTagName("head")[0]; var jsloaded = false; var protloaded = false; function loadProtoSearchfood(){ var script = document.createElement('script'); script.id = 'prototype'; script.type = 'text/javascript'; if (script.addEventListener) script.addEventListener("load", function(){ protloaded=true; loadScriptacuSearchFood();}, false); else script.onreadystatechange = function() { if (this.readyState == "complete") {protloaded=true; loadScriptacuSearchFood();} } script.src = "http://www.searchfood.com/sf/prototype/js/prototype.js"; try{ head.appendChild(script); } catch(e){ return ; } } var loadingscriptacu = false; function loadScriptacuSearchFood(){ loadingscriptacu=true; var script = document.createElement('script'); script.id = 'scriptaculous'; script.type = 'text/javascript'; if (script.addEventListener) script.addEventListener("load", function(){jsloaded=true;loadSFModule(); }, false); else script.onreadystatechange = function() { if (this.readyState == "complete") {jsloaded=true;loadSFModule();} } script.src = "http://www.searchfood.com/sf/prototype/js/effects.js"; head.appendChild(script); } var moduleloaded = false; loadProtoSearchfood(); function setMinHeight(horizontal){ if($('module_restaurant_command_reserv') && $('module_restaurant_command_reserv').visible()){ if(horizontal){ var minheight = $('module_externe_sf_logo').getHeight()+$('module_restaurant_title').getHeight()+$('module_restaurant_cuisines').getHeight()+$('module_restaurant_services').getHeight(); } else{ var minheight = $('module_restaurant_images').getHeight()+$('module_externe_sf_logo').getHeight()+$('module_restaurant_title').getHeight()+$('module_restaurant_cuisines').getHeight()+$('module_restaurant_services').getHeight()+$('module_restaurant_command_reserv').getHeight()+10; minheight=minheight+20; } if(minheight>$('module_externe_global_outer').getHeight() || ($('module_externe_global_outer').up() && minheight>$('module_externe_global_outer').up().getHeight())){ if($('module_externe_global_outer').up()) new Effect.Morph($('module_externe_global_outer').up(),{style:'height:'+minheight+'px;max-height:'+minheight+'px;'}); new Effect.Morph('module_externe_global_outer',{style:'height:'+minheight+'px;max-height:'+minheight+'px;'}); new Effect.Morph('module_externe_outer',{style:'height:'+(minheight-$('module_externe_sf_logo').getHeight())+'px;max-height:'+(minheight-$('module_externe_sf_logo').getHeight())+'px;'}); } } else setTimeout(function(){setMinHeight(horizontal);},200); } function checkAndLoad(dontcheck){ if(dontcheck || (jsloaded && $('module_restaurant_services') && $('module_restaurant_title') && $('module_restaurant_cuisines') && $('module_restaurant_images'))){ setMinHeight(false); new Effect.Appear('module_restaurant_images',{duration:0.5,queue:'end'}); new Effect.Appear('module_restaurant_title',{duration:0.5,queue:'end'}); new Effect.Appear('module_restaurant_cuisines',{duration:0.5,queue:'end'}); new Effect.Appear('module_restaurant_services',{duration:0.5,queue:'end'}); new Effect.Parallel([new Effect.Appear('module_restaurant_command_reserv',{sync:true}),new Effect.Move('module_restaurant_command_reserv',{x:0,y:-35,sync:true,mode:'relative'})],{duration:1,queue:'end'}); setTimeout(function(){ if($('sf_load_module_script')) $('sf_load_module_script').remove(); var newSFScript = document.createElement('script'); newSFScript.src = 'http://www.searchfood.com/moduleexterne/getCrossDomainResto?id=3'; newSFScript.id = 'sf_load_module_script'; newSFScript.type = 'text/javascript'; document.body.appendChild(newSFScript); },10000); } else{ setTimeout(function(){checkAndLoad(dontcheck);},500); } } function loadSFModule(){ if(!jsloaded){ if(!loadingscriptacu) loadScriptacuSearchFood(); } else if(!moduleloaded){ if(document.getElementById('modulesearchfoodcontainer')){ moduleloaded=true; document.getElementById('modulesearchfoodcontainer').innerHTML="
\"179_47logo_searchfood_white\"
"; checkAndLoad(false); } else{ setTimeout(loadSFModule,500); } } }