var anim_delay=80000;var anim_time=1000;var anim_start_text="Play";var anim_stop_text="Pause";var anim_easing="swing";$(document).ready(function(){tb_init("a.thickbox, area.thickbox, input.thickbox");init_home_slider();if($(".map").size()>0){$(".map").load_maps()}clear_fields_on_focus();add_external_link_icons();prepare_map();$("ul.numbered-links").centreNav();$(".module h2").each(function(){if($(this).children("span.locomotion").size()>0){$(this).css({"padding-right":"70px"})}});adjustSliderHeights();equalHeight($("body.home .module.half .inner"));equalHeight($("body.home .module.third .inner"));equalHeight($("ul.event-list li .inner, ul.thumb-list li .inner"));equalHeight($("body.t5 div#primary div.module.third .inner"));equalHeight($(".two-col-alt #primary .col.third .inner"));equalHeight($("body.t19 .col.half .inner, body.t25 .col.half"));equalHeight($("body.t19 .col.third .inner"));equalHeight($("body.t21 div.third"));equalHeight($("body.t21 div.half .inner,body.t2 div.half .inner"));equalHeight($("body.t21.two-col .module.third .inner"));equalHeight($("body.t25 .col.half .inner"));$("#blinds h2").blinds();do_date_picker();var b=$(".map-items .general-slider, .single-image");var a=$(".general-slider").not(b);init_common_sliders(a);imgLoader=new Image();imgLoader.src=tb_pathToImage;$("a.thickbox, area.thickbox, input.thickbox").bind("tb_show",function(){init_common_sliders("#TB_window .general-slider")})});function init_home_slider(){$("#home-slider").addClass("slideable");$("#home-slider").anythingSlider({easing:anim_easing,autoPlay:true,delay:anim_delay,startStopped:true,animationTime:anim_time,hashTags:true,buildNavigation:true,pauseOnHover:true,startText:anim_start_text,stopText:anim_stop_text,useStartStop:true,autoStart:true,navigationFormatter:function(b,a){return""}});$("#home-slider .thumbNav, #home-slider #slider-start-stop").wrapAll('<div id="controls">')}function init_common_sliders(a){var c=$(a).not(".slideable");c.addClass("slideable");if(c.hasClass("navigable")){var b=true}else{var b=false}if(c.hasClass("static")){var d=false}else{var d=true}c.anythingSlider({easing:anim_easing,autoPlay:d,delay:anim_delay,startStopped:true,animationTime:anim_time,hashTags:true,buildNavigation:true,pauseOnHover:true,startText:anim_start_text,stopText:anim_stop_text,useStartStop:false,autoStart:true,usePrevNext:b,navigationFormatter:function(f,e){return""}});c.find(".thumbNav").wrap('<div class="controls">')}function prepare_map(){$(".map-items").css("display","none");$("ul.map-points a.thickbox").each(function(){var a=$(this).attr("href");a=a.replace(/#/,"");$(this).attr("href","#TB_inline?height=590&width=700&inlineId="+a+"&modal=false")})}function equalHeight(a){tallest=0;a.each(function(){thisHeight=$(this).height();if(thisHeight>tallest){tallest=thisHeight}});a.height(tallest)}$.fn.extend({centreNav:function(a){return this.each(function(){var b=($(this).find("li").size()*20);$(this).css("width",b).css("margin","0 auto").css("float","none");if(isIe6()){$(this).css("width",b)}})}});function do_date_picker(){var b=new Date();if($.query.get("cal-date")&&$.query.get("cal-date").length==10){b.setDate($.query.get("cal-date").substring(0,2));b.setMonth($.query.get("cal-date").substring(3,5)-1);b.setFullYear($.query.get("cal-date").substring(6,10))}if($("form#cal-dates").size()>0){var a=$("form#cal-dates").find("fieldset");if($(a).replaceWith('<input name="cal-date" class="text date-pick" type="text"/>')){$(".date-pick").datePicker().val(b.asString()).trigger("change");$(".date-pick").dpSetOffset(25,45);$("div.calendar-filters").addClass("with-pop-up")}}}function add_external_link_icons(){if(!isIe6()){$("#content a[href*='/PDF/']").not("#content h1 a, #content h2 a, #content h3 a, #content h4 a").addClass("pdf");$("#content a[href*='/word/']").not("#content h1 a, #content h2 a, #content h3 a, #content h4 a").addClass("word");$("#content a").not("#content h1 a, #content h2 a, #content h3 a, #content h4 a, a[href^='mailto:'], a img").each(function(){if(this.hostname&&this.hostname!==location.hostname){if(!$(this).children()[0]){$(this).attr("rel","nofollow");$(this).attr("target","_blank");$(this).addClass("external")}}})}}function isIe6(){if($.browser.msie&&($.browser.version<7)){return true}else{return false}}function clear_fields_on_focus(){$("input[type=text]").focus(function(){if(this.value==this.defaultValue){this.value=""}}).blur(function(){if(!this.value.length){this.value=this.defaultValue}})}$(window).ready(function(){if(!isIe6()){$("#ddlCountry").selectbox();$("#dd").selectbox();$("#mm").selectbox();$("#yy").selectbox();$(".t8 #ddpagination-top").selectbox();$(".ddpagination").selectbox();$(".jquery-selectbox-currentItem").css("margin-top","2px");$(".t9 .jquery-selectbox-currentItem").css("margin-top","-20px");$(".jquery-selectbox").css("margin-top","1px");$(".jquery-selectbox").not($(".t17 .jquery-selectbox")).addClass("input-yellow");$("select#cat").selectbox();$("select#comp").selectbox();$("#ddera, #ddrailway").selectbox();$(".t17 .jquery-selectbox .jquery-selectbox-currentItem").css("margin-top","0");$("#ddpresslocation").selectbox();$("#ddpressyear").selectbox();$("#ddpressmonth").selectbox();$(".t11 #ddpresslocation").addClass("input-yellow");$(".t8  .jquery-selectbox").addClass("input-yellow");$(".t11  .jquery-selectbox, .t23 .jquery-selectbox").addClass("input-yellow").css({"z-index":2000});$(".t9 #ddcategory").selectbox();$(".t9 .jquery-selectbox-currentItem").css("margin-top","4px");$(".t9 .jquery-selectbox").css({"margin-top":"4px",width:"225px"});$(".t9 .jquery-selectbox-list").css({width:"220px"});$(".t9 .jquery-selectbox").addClass("input-yellow");var d=1000;var c=500;$("div.jquery-selectbox, div.jquery-selectbox-list").each(function(){$(this).css("zIndex",d++)});$(".module, .bottom-corners, span.cc").each(function(){$(this).css({"z-index":c--})});$(".bottom-corners, span.cc").css("z-index",0);var e=1000;$(".bottom-corners span.cc").each(function(){$(this).css("zIndex",e);e-=10});$("#birth_date").css("padding-top","6px");$("input:checkbox").next().css("position","relative").append("<span class='custom_checkbox'></span>").prev().each(function(){var a=$(this).next().find("span");if($(this).attr("checked")){a.addClass("yes")}});$("ul.checks label").click(function(){$(this).find("span").toggleClass("yes");var a=$(this).prev();if(a.attr("checked")){a.removeAttr("checked")}else{a.attr("checked","checked")}return false})}});function adjustSliderHeights(){var a=0;$(".t2-slider,.t3-slider,.t5-slider").each(function(){var b=$(this).find(".general-slider-content li.item");b.each(function(){a=$(this).outerHeight()>a?$(this).outerHeight():a});$(".t2-slider, .t2-slider .general-slider-content,.t3-slider, .t3-slider .general-slider-content,.t5-slider, .t5-slider .general-slider-content").css("height",a+"px")})};
