function GetNextFirstDayOfWeekForMonth(b){var g=["January","February","March","April","May","June","July","August","September","October","November","December"],h=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];if(b<0||b>6)throw"Invalid argument exception";var a=new Date,f=a.getDate(),d=a.getMonth(),e=a.getFullYear(),c=GetFirstDayOfMonth(a,b);if(f>c){if(d>=10){a.setMonth(0);a.setFullYear(e+1)}else a.setMonth(d+1);c=GetFirstDayOfMonth(a,b)}return h[b]+" "+g[a.getMonth()]+" "+c+", "+a.getFullYear()}function GetFirstDayOfMonth(a,b){a.setDate(1);var c=a.getDay();return 1+(b-c+7)%7}function getSiteBaseUrl(){var a=window.location.href.indexOf(window.location.host);return window.location.href.substr(0,a+window.location.host.length)}(function(a){a.fn.createfilmstrip=function(c){var b={countImages:0,countStripImages:0,imageClass:"",path:"",imageRootName:"",imageExtension:".jpg",imageWidth:50,animateStrip:true,delay:2e3,fadeTime:500};try{if(c.countStripImages==0||c.countImages==0)throw"InvalidArguments";if(c.path==null||c.path=="")throw"InvalidPath";if(c.countStripImages>c.countImages)throw"InvalidImageCountSettings";if(c.imageRootName==null||c.imageRootName=="")throw"InvalidImageSettings";if(c.imageExtension==null||c.imageExtension=="")throw"InvalidImageSettings";if(c.imageWidth<=0)throw"InvalidImageSettings";}catch(q){if(q=="InvalidArguments")alert("Invalid filmstrip image count setting(s)");else if(q=="InvalidImageCountSettings")alert("Filmstrip image count cannpt be greater than number of available images");else if(q=="InvalidPath")alert("Invalid Path Location setting(s)");else q=="InvalidImageSettings"&&alert("Invalid Image setting(s)");return}b=c;var i=a(this),h=[],f="filmstripImage",j="rotatingImageFrame",n=b.countStripImages*b.imageWidth;i.parent().css("width",n);i.css("width",n);for(var p=function(a){return b.path+b.imageRootName+a+b.imageExtension},k=function(c){var a=c.replace(b.path+b.imageRootName,"");return parseInt(a.replace(b.imageExtension,""))},g=function(a,e,f){if(e>b.imageCount&&f)return;var c=-1;while(true){c=Math.floor(Math.random()*b.countImages+1);if(a.length==b.countImages)break;if(jQuery.inArray(c,a)==-1)break}if(f){var d=jQuery.inArray(e,a);d!=-1&&a.splice(d,1)}a.push(c);return p(c)},m=0,d=1;d<=b.countStripImages;d++){i.append('<span id="'+j+d+'" style="position: relative; left: '+m+'px" ></span>');m+=b.imageWidth;var o=a("#"+j+d);o.append("<img alt='' >").find(":last-child").attr({"class":b.imageClass,id:f+"B"+d,src:g(h,false)}).css({left:0,position:"absolute","z-order":5e3});o.append("<img alt='' >").find(":last-child").attr({"class":b.imageClass,id:f+"A"+d,src:g(h,false)}).css({left:0,position:"absolute","z-order":5001})}var e=0,l=0;b.animateStrip&&setInterval(function(){do e=Math.floor(Math.random()*b.countStripImages+1);while(e==l);l=e;var c=a("#"+f+"A"+e),i=a("#"+f+"B"+e),d;c.fadeToggle(b.fadeTime,function(){if(c.css("display")=="none"){d=k(c.attr("src"));c.attr("src",function(){return g(h,d,true)})}else{d=k(i.attr("src"));i.attr("src",function(){return g(h,d,true)})}})},b.delay)}})(jQuery);function ProtectedImage(){window.alert("These images are the property of Emerald Sea Dive Club and can not be copied or saved!");return}function PreviewSelectedThumbnailPhoto(c,a,b){if(a==null||a.length==0)return;$("#"+c).attr({src:a,alt:b})}$.fn.ifExists=function(a){this.length&&$(a(this))};function ToggleRegion(b){var a=$("#"+b);a.ifExists(function(){a.slideToggle("medium")})}
