var loadingFlash=getImagesUrl().toString()+"wait.swf";var loadingImage=new Image();loadingImage.src=getImagesUrl().toString()+"wait.gif";var page="";function CustomFunctions(){page=getPage();var a=[];var b=true;if(page!="booking"){a[0]=searchValidation()}if(page=="search"){}if(page=="regions"){}if(page=="accommodations"){}if(page=="offers"){}if(page=="booking"){a[1]=bookingFormValidation()}for(i=0;i<a.length;i++){if(!a[i]&&a[i]==="undefined"){b=false}if(a[i]===false){b=false}}if(b){pageTransitions()}return b}function searchValidation(){var a=true;if(document.getElementById("childCount")){var b=($("#childCount").val()!=="0")?true:false;var d=[];var c=true;var e=0;$("p.child select").each(function(f){if($(this).val()!==""){d[f]=true;e++}});if(e<$("#childCount").val()){c=false}if(b&&c===false){a=false;alert("You are searching for a holiday with children, but have not provided their ages")}}return a}function bookingFormValidation(){if(page=="booking"){var a=true;if($("#AcceptTerms").length>0){if($("#AcceptTerms:checked").length===0){alert("Please accept the booking terms and conditions.");a=false}}if($("#AcceptInsurance").length!==0&&a){if($("#AcceptInsurance:checked").length===0){alert("Please accept the insurance disclaimer");hilite("AcceptInsurance",3);a=false}}if($("#AcceptPassport").length!==0&&a){if($("#AcceptPassport:checked").length===0){alert("Please accept the passport and visa conditions for this booking");hilite("AcceptPassport",3);a=false}}}return a}function hilite(b,a){$object=$("#"+b);$label=$("label[for="+b+"]");if(a>0){if($object.length>0&&$label.length>0){$label.css("background-color","#F7F7E7");$label.fadeTo("slow",0.3,function(){$label.fadeTo("slow",1,function(){$object.bind("click",function(){$label.css("font-weight","normal")});hilite(b,a-1)})})}else{if($object.length>0&&$label.length===0){$object.fadeTo("slow",0.3,function(){$object.fadeTo("slow",1,function(){hilite(b,a-1)})})}}}else{if($object.length>0&&$label.length>0){$label.css("background-color","#fff")}}}function pageTransitions(){var a='<div id="loadingAnimation" style="background:#fff;position:absolute;width:'+$("body").width()+"px;height:"+$("body").height()+'px;z-index:1;"></div>';a+='<div id="loadingAnimation2" style="background:#f7f7e7;border:solid 1px #fba445;-moz-border-radius:10px;-webkit-border-radius:10px;position:absolute;top:'+(($(window).scrollTop()+($(window).height()/2))-60)+"px;left:"+(($(window).width()/2)-164)+'px;width:289px;height:24px;padding:30px;z-index:2;"></div>';$("body").prepend(a);$("#loadingAnimation").fadeTo(0,0).fadeTo("slow",0.8);$("#loadingAnimation2").fadeTo(0,0).fadeTo("slow",1,function(){a="";if($.browser.msie&&($.browser.version+0)>6){a+='<object type="application/x-shockwave-flash" width="289" height="24"> <param name="movie" value="'+loadingFlash+'" /> <img src="'+loadingImage.src+'" alt="loading" /> </object>'}else{a+='<img src="'+loadingImage.src+'" alt="loading" /> '}$(this).prepend(a)})}function getPage(){var a="";if($("#breadcrumb li.breadcrumb_search strong").length>0){a="search"}if($("#breadcrumb li.breadcrumb_accommodations strong").length>0){a="accommodations"}if($("#breadcrumb li.breadcrumb_offers strong").length>0){a="offers"}if($("#breadcrumb li.breadcrumb_booking strong").length>0){a="booking"}return a}function getImagesUrl(){var a="";if(window.location.protocol==="http:"){a+="http://";if(window.location.host.toString().indexOf("travelmedia")!==-1){a+="laf.accessemedia.com/tt/opodo/images/"}if(window.location.host.toString().indexOf("holidays.opodo")!==-1){a+="laf.traveltainment.co.uk/tt/opodo/images/"}}if(window.location.protocol==="https:"){a+="https://";if(window.location.host.toString().indexOf("accessemedia")!==-1){a+="laf.secure.accessemedia.com/tt/opodo/images/"}if(window.location.host.toString().indexOf("holidays.opodo")!==-1){a+="laf.secure.traveltainment.co.uk/tt/opodo/images/"}}return a}function CheckForm(){var a=true;var b=true;var d=true;var e=GetElementById("Action");CleanAction();var c=GetElementById("DestinationAirport");if(c!==null){if(c.value.replace(/ /g,"").length===0){if(e!==null){e.value="Refresh"}}}d=IsValidDate(GetElementById("FromDate").value,GetElementById("ToDate").value);if(window.CustomFunctions!==undefined&&d){b=CustomFunctions()}if(!b||!d){a=false}return a};