function ImageSwapper(){var f=3;var h=new Array();var i=new Array();var d=0;var l=0;var a=true;var j=new Array();var m=false;var b=false;this.addFullImage=function(n){h.push(n);d++};this.addTNImage=function(n,o){i.push({obj:n,src:o})};this.startRotate=function(n){if(i.length>0){a=false;if(!b){this.rotate(n)}}};this.stopRotate=function(n){a=true};this.swapMain=function(n){a=true;c(n)};this.loadAllThumbnails=function(){var n;for(n in i){if(i[n].src){i[n].obj.src=i[n].src}}};this.rotate=function(n){b=false;if(!a&&h.length){if(!n){n=4000}c(d);if(++d==i.length){d=0}while(e(d)>=0){if(++d==i.length){d=0}}b=true;setTimeout("imageSwapper.rotate()",n)}};this.doFlash=function(){g()};function c(o){var n=e(o);if(n>=0){k(n)}else{h[l].src=i[o].src;j[l]=0;h[l].border=0;h[l].hspace=f;h[l].vspace=f;if(++l==h.length){l=0}}}function e(n){for(var o=0;o<h.length;o++){if(h[o].src==i[n].src){return o}}return -1}function k(n){j[n]=2;if(!m){m=true;g()}}function g(){var n=true;for(var o=0;o<h.length;o++){if(j[o]>0){if(h[o].border==0){h[o].border=f;h[o].hspace=0;h[o].vspace=0}else{h[o].border=0;h[o].hspace=f;h[o].vspace=f;j[o]--}n=false}}if(n){m=false}else{setTimeout("imageSwapper.doFlash()",500)}}}function highlight(a){var b=a.src;a.src=b.replace("_normal","_high")}function lowlight(a){var b=a.src;a.src=b.replace("_high","_normal")}function hideThumbs(){hideLayer("tnDiv");hideLayer("hideTnDiv");showLayer("showTnDiv");imageSwapper.startRotate();photosHidden=true;lowlight(document.getElementById("photoButton"))}function showThumbs(){imageSwapper.loadAllThumbnails();showLayer("tnDiv");hideLayer("showTnDiv");showLayer("hideTnDiv");photosHidden=false;highlight(document.getElementById("photoButton"))}function toggleThumbs(){if(photosHidden){showThumbs()}else{hideThumbs()}}function openPrettyPhoto(){if(!jQuery.prettyPhoto){loadJS("/js/prettyPhoto/jquery.prettyPhoto.js",loadPrettyPhotoCallback);return}$("a[rel^='prettyPhoto']").first().click()}function loadPrettyPhotoCallback(){for(var a=0;a<ppImages.length;a++){if(ppImages[a]){$("#prettyPhotoHide").append('<a href="'+ppImages[a]+'" rel="prettyPhoto[gallery2]"><img src="'+ppImages[a]+'" height="60" alt="'+hotelName+'" /></a>')}}if($.browser.msie&&$.browser.version<8){$("a[rel^='prettyPhoto']").prettyPhoto({overlay_gallery:false})}else{$("a[rel^='prettyPhoto']").prettyPhoto()}openPrettyPhoto()};
