var d=document;function showToursMenu(){var d='div#toursMenu';var m=$(d);var g=$(d+' > ul > li');var u=$(d+' > ul > li > ul');$(d+' > ul').attr('class','fancy');g.find('h4 > a').click(function(){if($(this).parent().parent().hasClass('open'))$(this).parent().next().slideUp('normal',function(){$(this).parent().removeClass('open')});else $(this).parent().next().slideDown('normal').parent().addClass('open')});m.prepend('<a class="show">show all</a><a class="hide">hide all</a>');m.find('a.show').click(function(){u.slideDown('normal').parent().addClass('open');$(this).hide().next().show()});m.find('a.hide').hide().click(function(){u.slideUp('normal',function(){$(this).parent().removeClass('open')});$(this).hide().prev().show()})}function preloadImg(){for(var i=0;i<arguments.length;i++){jQuery("<img>").attr("src",arguments[i])}}function createMouseovers(a,b){var i,dotAt,imgFile,imgExt;for(i=0;i<a.length;i++){dotAt=a[i].src.lastIndexOf(".");if(dotAt>0){imgFile=a[i].src.substr(0,dotAt);imgExt=a[i].src.substr(dotAt+1);if(imgFile.lastIndexOf(b)==imgFile.length-b.length){}else{a[i].outSrc=a[i].src;a[i].overSrc=imgFile+b+"."+imgExt;$(a[i]).bind("mouseenter",function(){this.src=this.overSrc});$(a[i]).bind("mouseleave",function(){this.src=this.outSrc});preloadImg(a[i].overSrc)}}}}function addEnlargeIcons(){var b=/^(light|shadow)box(\[(.*?)\])?/i;var c=/^(?:.+\.(png|jpg|jpeg|jpe|gif|bmp)((\?.*)|(\s*$)))$/i;var a=d.getElementsByTagName('a'),rel,imgs,iconDiv,w,h,bTop;for(var i=0,len=a.length;i<len;++i){rel=a[i].getAttribute('rel');href=a[i].getAttribute('href');if(rel&&(match=b.exec(rel))!=null){imgs=a[i].getElementsByTagName('img');if(imgs.length==1&&href&&href.match(c)){iconDiv=document.createElement("div");iconDiv.className="enlarge";w=imgs[0].width;if(!w)w=$(imgs[0]).width();$(iconDiv).css("width",w);$(iconDiv).css("float",$(imgs[0]).css("float"));bTop=parseInt($(imgs[0]).css("border-top-width"));$(iconDiv).css("background-position",'100% '+bTop+'px');$(iconDiv).css("padding-top",bTop+'px');$(iconDiv).css("margin-top",$(imgs[0]).css("margin-top"));$(iconDiv).css("margin-left",parseInt($(imgs[0]).css("margin-left").replace(/auto/,'0'))+parseInt($(imgs[0]).css("border-left-width"))+'px');$(iconDiv).css("margin-right",parseInt($(imgs[0]).css("margin-right").replace(/auto/,'0'))+parseInt($(imgs[0]).css("border-right-width"))+'px');a[i].insertBefore(iconDiv,imgs[0]);h=parseInt($(iconDiv).css('height'));if(!h)h=$(iconDiv).height();$(imgs[0]).css("margin-top",(h+bTop)*-1+"px");if(match[2]!=null&&match[2]!=''){a[i].iconDiv=iconDiv;$(a[i]).bind("mouseenter",function(){this.iconDiv.className="enlarge on"});$(a[i]).bind("mouseleave",function(){this.iconDiv.className="enlarge"})}}}}}function checkFormSaved(){checkFormsStarted();window.onbeforeunload=function(){if(document.formsStarted&&!document.bypassSaveCheck){return"You have some changes that have not been saved."}}}function bypassSaveCheck(){document.bypassSaveCheck=true}function checkFormsStarted(a){document.formsStarted=false;var b,element;for(var i=0;i<document.forms.length;i++){b=document.forms[i];for(var j=0;j<b.elements.length;j++){element=b.elements[j];if(element.type!='button'&&element.type!='submit'&&element.type!='hidden'){$(element).change(function(){document.formsStarted=true;if(a){eval(a)}})}}}}function checkEmail(a,b){hideHint(a);if(!isValidEmailAddress(jQuery.trim(a.value))){alert(upperCaseFirst(b)+" does not appear to be in the correct format.");a.focus();return false}else{return true}}function checkURL(a,b,c){hideHint(a);alert(b+jQuery.trim(a.value));if(!isValidURL(b+jQuery.trim(a.value))){alert(upperCaseFirst(c)+" does not appear to be a valid URL.");a.focus();return false}else{return true}}function checkExists(a,b){hideHint(a);if(jQuery.trim(a.value)==""){alert("Please fill in "+b+".");a.focus();return false}else{return true}}function checkSelect(a,b,c){hideHint(a);var d=null;var e;if(a.length&&a.length>0&&a.type&&a.type=="select-one"){if(a.selectedIndex){d=a.options[a.selectedIndex].value}}else if(a.length&&a.length>0&&a[0].type&&(a[0].type=="radio"||a[0].type=="checkbox")){e="multiple";for(var f=0;f<a.length;f++){if(a[f].checked){d=a[f].value;break}}}else{return true}if(d==null||d==b){alert("Please select "+c+".");if(e=="multiple"){a[0].focus()}else{a.focus()}return false}else{return true}}function checkLength(a,b,c,d,e){hideHint(a);var f=false;var g=jQuery.trim(a.value);if(e==""){if(g.length<d){if(d==1){alert(upperCaseFirst(b)+" you entered is too short. Please make it at least 1 character long.")}else{alert(upperCaseFirst(b)+" you entered is too short. Please make it at least "+d+" characters long.")}}else if(g.length>c){alert(upperCaseFirst(b)+" you entered is too long. Please make it less than "+c+" characters long.")}else{f=true}}else if(g.length!=e){if(e==1){alert(upperCaseFirst(b)+" you entered is the wrong length. Please make it 1 character long.")}else{alert(upperCaseFirst(b)+" you entered is the wrong length. Please make it "+absolute+" characters long.")}}else{f=true}if(!f){a.focus()}return f}function hideHint(a){if(a.hint&&jQuery.trim(a.value)==a.hint){a.value=''}if(a.oColor){a.style.color=a.oColor}}function showHint(a){if(a.hint&&jQuery.trim(a.value)==''||jQuery.trim(a.value)==a.hint){a.style.color='#BBB';a.value=a.hint}else if(a.oColor){a.style.color=a.oColor}}function fieldHint(a,b){if(a){a.hint=b;var c=$(a).color;a.oColor=(c?c:"#000");showHint(a);$(a).focus(function(){hideHint(this)});$(a).change(function(){showHint(this)});$(a).blur(function(){showHint(this)});$(a.form).submit(function(){hideHint(a.form[a.name])})}}function getRadioValue(a,b){if(a&&a[b]){var c=a[b];for(var i=0;i<c.length;i++){if(c[i].checked){return c[i].value}}}return null}function isArray(a){return(a.constructor.toString().indexOf("Array")!=-1)}function isValidEmailAddress(a){var b=a.match(/^(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z]{2,})$/i);return(b!=null)}function isValidURL(a){return(a)?eval("/^(https?|ftp):\\/\\/(([a-zA-Z0-9][-a-zA-Z0-9]*[a-zA-Z0-9]?\\.)+[a-zA-Z]{2,}|(([0-9]?[0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]?[0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]))(\\/[-A-Z0-9+&@#\\/%?=~_|!:,.;]*)?$/i.test(url)"):false}function writeEmailAddress(a,b,c){if(writeEmailAddress.arguments.length<3||c==""){c="friendlyplanet.com"}var d=a+"@"+c;if(writeEmailAddress.arguments.length<2){b="Inquiry from "+c}document.write("<a href=\"mailto:"+d+"?subject="+b+"\">"+d+"</a>")}function upperCaseFirst(a){if(a.length>1){a=a.substring(0,1).toUpperCase()+a.substring(1,a.length)}return a}function popupWindow(a,b,w,h,c){var d=600;var e=800;var f=0,left=0;if(window.screen&&window.screen.height&&window.screen.height){d=window.screen.height;e=window.screen.width}d=d-75;e=e-50;if((h==0)||(d<h)){h=d}if((w==0)||(e<w)){w=e}if(c){left=(screen.width-w)/2;f=(screen.height-h)/2}var g="toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,scrollbars=yes,width="+w+",height="+h+",left="+left+",top="+f+"";var i=window.open(a,b,g);if(parseInt(navigator.appVersion)>=4){i.window.focus()}return false}