var _lang={};var _popupbox=null;var _gallery=null;_lang.bookmark="Bookmark ";_lang.same="-- Same as start --";window.AllLocations=[];window.Locations={};$(document).ready(function(){_popupbox=$(".popup_box").overlay({top:20,expose:{color:"#666666",loadSpeed:200,opacity:0.5},closeOnClick:true,api:true});$.fn.extend(_popupbox,{setTitle:function(l){this.getOverlay().find(".popup_box_title").html(l)},setContent:function(l){this.stopLoading();this.getOverlay().find(".popup_box_content").html(l)},openContent:function(l){this.stopLoading();this.setContent(l);this.load()},startLoading:function(){var l=this.getOverlay().find(".popup_box_content");l.empty();l.addClass("ajax-loading")},stopLoading:function(){var l=this.getOverlay().find(".popup_box_content").removeClass("ajax-loading")}});var k=$("#allratesform");if(k){k.submit(function(){var l="remote?method=getPackageRates";$.ajax({type:"POST",url:l,dataType:"json",data:"&"+k.serialize()+"&tmp=1",beforeSend:function(){$("#allrates").empty();$("#allrates").addClass("ajax-loading")},success:function(m){$("#allrates").html(m.data);$("#allrates").removeClass("ajax-loading")}});return false});var c=$("select[name=adult]");var b=$("select[name=child]");c.change(function(){b.empty();optionChild='<option value="0">0</option>';var l=4-$(this).val()+1;for(var m=1;m<l;m++){optionChild+='<option value="'+m+'">'+m+"</option>"}b.append(optionChild);return false})}var a=$("#searchform select[name=pickup_location]");var d=$("#searchform select[name=dropoff_location]");if(a&&d){a.bind("change",function(m){d.empty();optionDropoff='<option value="'+this.value+'">-- Same as start --</option>';if(window.Locations[this.value]){for(var l=0;l<window.Locations[this.value].length;l++){var n=window.AllLocations[window.Locations[this.value][l]];optionDropoff+='<option value="'+n[0]+'">'+unescape(n[1])+"</option>"}d.append(optionDropoff)}else{for(key in window.AllLocations){var n=window.AllLocations[key];optionDropoff+='<option value="'+n[0]+'">'+unescape(n[1])+"</option>"}d.append(optionDropoff)}m.preventDefault()})}var j=$("#searchform").get();var i=$("#searchform select[name=pickup_location]");var h=$("#searchform select[name=dropoff_location]");if(j){$(j).bind("submit",function(l){if($(i).val()==0||$(h).val()==0){alert("Please enter both a pick up location and a drop off location.");l.preventDefault()}})}var g=$("#bookmark");if(g){g.bind("click",function(m){var n=window.location.toString().replace("#","");n=n.split("?a=");n=n[0];n+=(n.indexOf("?")<0)?"?bookmark=1":"&bookmark=1";window.status=_lang.bookmark+n;if(window.sidebar){window.sidebar.addPanel(document.title,n,"")}else{if(window.opera&&window.print){var l=document.createElement("a");l.setAttribute("href",n);l.setAttribute("title",document.title);l.setAttribute("rel","sidebar");l.click()}else{if(document.all){window.external.AddFavorite(n,document.title)}else{alert("Please press CTRL + D shortcut or CMD + D (for Mac) in order to bookmark this site.")}}}m.preventDefault()})}var f=$("#newsletterform");if(f){f.submit(function(){var l="remote?method=subscribeNewsletter";$("#javascriptrespDiv").remove();$.ajax({type:"POST",url:l,dataType:"json",data:"&"+f.serialize()+"&tmp=1",beforeSend:function(){f.before('<div id="javascriptrespDiv" class="newsletters"></div>');$("#javascriptrespDiv").addClass("ajax-loading")},success:function(m){$("#javascriptrespDiv").remove();f.before('<div id="javascriptrespDiv" class="newsletters">'+m.data+"</div>");$("#javascriptrespDiv").click(function(){$(this).remove()});$("#javascriptrespDiv").removeClass("ajax-loading")}});return false})}var e=["#newsletterform input[name=Email]","#newsletterform input[name=Name]","#searchform2 input[name=code]"];$.each(e,function(m,l){$(l).click(function(){if($(this).val()=="(enter email address here)"||$(this).val()=="(enter your first name)"||$(this).val()=="(enter cruise code/name)"){$(this).val("")}})});createPopups();createGallery()});function createPopups(){createPopupWins();createTooltip()}function createTooltip(){var a=$("a.tooltip").get();$.each(a,function(c,b){var d=$(b).attr("title");$(b).bind("mouseover",function(g){var f=$(b).offset().left-25;var h=$(b).offset().top+30;var e=d;if(e=="span"){e=$(b).find("span").html()}$(".tooltip_box_btm").html(e);$(".tooltip_box").css({left:f+"px",top:h+"px"});if(d){$(".tooltip_box").show()}$(b).removeAttr("title")});$(b).bind("mouseout",function(e){$(".tooltip_box").hide();$(b).attr("title",d)})})}function createPopupWins(){var a=$("a.popup").get();$.each(a,function(c,b){$(b).bind("click",function(d){loadPopup($(b).attr("rel"));d.preventDefault()})})}function loadPopup(a){_popupbox.load();var b="remote?method=getInfo";$.ajax({type:"POST",url:b,dataType:"json",data:"data="+a+"&tmp=1",beforeSend:function(){_popupbox.startLoading()},success:function(c){_popupbox.setTitle(c.title);_popupbox.setContent(c.data)}})}function sendQuote(b){var a="remote?method=sendOffer";$.ajax({type:"POST",url:a,dataType:"json",data:"&"+$("#quoteform").serialize()+"&tmp=1",beforeSend:function(){_popupbox.startLoading()},success:function(c){_popupbox.setContent(c.data)}})}function createGallery(){_gallery=$(".gallery_box").overlay({top:20,expose:{color:"#666666",loadSpeed:200,opacity:0.5},closeOnClick:true,api:true});$(".gallery_box_scroll").scrollable({items:".gallery_box_items",vertical:true,size:6}).mousewheel();var a=$(".gallery_box_scroll").scrollable();$.fn.extend(a,{add:function(c){var b=this;if(!b.imgRepo){b.imgRepo=new Array}$.each(c,function(e,h){$(h).click(function(i){_gallery.load();b.click($(this).attr("rel"));b.getItems().filter(".active").click();i.preventDefault()});var d=jQuery.inArray($(h).attr("href"),b.imgRepo);if(d<0){d=b.getSize();b.imgRepo[d]=$(h).attr("href");var g=new Image();var f=$(h).find("img");if(f){g.src=f.attr("src");g.rel=$(h).attr("href");g.title=f.attr("alt")}else{g.src=$(h).attr("href");g.rel="";g.title=$(h).attr("title")}b.getItemWrap().append(g);$(g).click(function(l){var j=$(this).attr("rel");if(!j){j=$(this).attr("src")}var m=$(".gallery_box_image");var k=m.find("img").fadeTo("medium",0.5);var i=new Image();i.onload=function(){k.attr("src",j);var n=((m.height()/i.height)<(m.width()/i.width))?(m.height()/i.height):(m.width()/i.width);k.height(i.height*n);k.width(i.width*n);if(k.height()<m.height()){k.css("padding-top",((m.height()-k.height())/2))}else{k.css("padding-top",0)}k.fadeTo("fast",1);$(".gallery_box span.gallery_box_count").html((b.getClickIndex()+1)+" / "+b.getSize())};i.src=j})}$(h).attr("rel",d)});b.reload().end();b.getItems().filter(":first").click()}});a.add($("a.imgpopups"));$(".gallery_box a.gallery_box_prev").bind("click",function(b){a.click(a.getClickIndex()-1);a.getItems().filter(".active").click();$(".gallery_box span.gallery_box_count").html((a.getClickIndex()+1)+" / "+a.getSize());b.preventDefault()});$(".gallery_box a.gallery_box_next").bind("click",function(b){a.click(a.getClickIndex()+1);a.getItems().filter(".active").click();$(".gallery_box span.gallery_box_count").html((a.getClickIndex()+1)+" / "+a.getSize());b.preventDefault()})};