$.extend({URLEncode:function(a){var d="",b=0;a=a.toString();var g=/(^[a-zA-Z0-9_.]*)/;while(b<a.length){var c=g.exec(a.substr(b));if(c!=null&&c.length>1&&c[1]!=""){d+=c[1];b+=c[1].length}else{if(a[b]==" ")d+="+";else{var f=a.charCodeAt(b),e=f.toString(16);d+="%"+(e.length<2?"0":"")+e.toUpperCase()}b++}}return d},URLDecode:function(e){var a=e,f,c,d=/(%[^%]{2})/;while((m=d.exec(a))!=null&&m.length>1&&m[1]!=""){b=parseInt(m[1].substr(1),16);c=String.fromCharCode(b);a=a.replace(m[1],c)}return a}});var zoomoptions={zoomWidth:391,zoomHeight:330,xOffset:26,yOffset:0,title:false,preloadImages:true,showPreload:true,preloadText:"<br/>loading..."};(function(a){a.fn.global=function(){a(".underlinecurrentpage a,a.underlinecurrentpage").underlineCurrentPageLinks();a(".underlinecurrentdirectory a, a.underlinecurrentdirectory").underlineCurrentDirectoryLinks();a(".underlineparentdirectory a, a.underlineparentdirectory").underlineParentDirectoryLinks()}})(jQuery);(function(a){a.fn.underlineSelectedLinks=function(b){var c={cssClassToApply:""},b=a.extend(c,b);a(this).each(function(){if(b.cssClassToApply!="")a(this).addClass(b.cssClassToApply);else{var c=a(this).attr("style");if(a(this).attr("style")==undefined)a(this).attr("style","text-decoration:underline");else a(this).attr("style",a(this).attr("style")+";text-decoration:underline")}})}})(jQuery);(function(a){a.fn.underlineCurrentPageLinks=function(b){var d={cssClassToApply:""},b=a.extend(d,b),c=a.URLDecode(window.location.pathname.split("/")[window.location.pathname.split("/").length-1].replace("/",""));a(this).each(function(){if(c==(a(this).attr("href").indexOf("?")>-1?a(this).attr("href").substring(0,a(this).attr("href").indexOf("?")):a(this).attr("href")).replace("/",""))if(b.cssClassToApply!="")a(this).addClass(b.cssClassToApply);else{var d=a(this).attr("style");if(a(this).attr("style")==undefined)a(this).attr("style","text-decoration:underline");else a(this).attr("style",a(this).attr("style")+";text-decoration:underline")}})}})(jQuery);(function(a){a.fn.getNextFolderAfter=function(e,b){var d={suffixWithSlash:false,prefixWithSlash:false},b=a.extend(d,b),c={suffixWithSlash:b.suffixWithSlash,prefixWithSlash:b.prefixWithSlash,nextFolderOnly:true};return a().getFoldersAfter(e,c)}})(jQuery);(function(a){a.fn.getFoldersAfter=function(b,e){var h={suffixWithSlash:false,prefixWithSlash:false,nextFolderOnly:false},e=a.extend(h,e),g=window.location.pathname.toLowerCase(),c="";b=b.toLowerCase();if(b.lastIndexOf("/")!=b.length-1)b+="/";var d=g.indexOf(b)+b.length;if(d-b.length>=0){var f=-1;if(e.nextFolderOnly)f=g.indexOf("/",d);else var i=g.lastIndexOf("/");if(f>d)c=window.location.pathname.substring(d,f)}if(c.length>0){c+=e.suffixWithSlash?"/":"";c=(e.prefixWithSlash?"/":"")+c}return c}})(jQuery);(function(a){a.fn.underlineCurrentDirectoryLinks=function(b){var c={cssClassToApply:""},b=a.extend(c,b);a(this).each(function(){var e=a(this).attr("href"),d=e.substring(0,e.lastIndexOf("/"));if(d.length>0){d=d.replace(window.location.protocol+"//"+window.location.hostname,"");var c=window.location.pathname;c=c.substring(0,c.lastIndexOf("/"));if(c==d)if(b.cssClassToApply!="")a(this).addClass(b.cssClassToApply);else{var f=a(this).attr("style");if(a(this).attr("style")==undefined)a(this).attr("style","text-decoration:underline");else a(this).attr("style",a(this).attr("style")+";text-decoration:underline")}}})}})(jQuery);(function(a){a.fn.underlineParentDirectoryLinks=function(b){var c={cssClassToApply:""},b=a.extend(c,b);a(this).each(function(){var c=a(this).attr("href"),d=c.substring(0,c.lastIndexOf("/"));if(d.length>0)if(window.location.pathname.substring(0,c.lastIndexOf("/")).indexOf(d)>-1)if(b.cssClassToApply!="")a(this).addClass(b.cssClassToApply);else{var e=a(this).attr("style");if(a(this).attr("style")==undefined)a(this).attr("style","text-decoration:underline");else a(this).attr("style",a(this).attr("style")+";text-decoration:underline")}})}})(jQuery);(function(a){a.fn.setupImagesMovies=function(b,e,c,d){var f={zoomitem:".MYCLASS",thumbnailfolder:"thumbnail",largefolder:"large",zoomfolder:"zoom",base:"/stormsites/toast/images/products/thumbnail/",largebase:"/stormsites/toast/images/products/large/",zoombase:"/stormsites/toast/images/products/zoom/",moviebase:"/stormsites/toast/movies/products/",imagesuffix:".jpg",omnituresupport:true,flowplayerkey:"$27abd0e2b7695ac95d7",mediaserver:""},b=a.extend(f,b);return this.each(function(){var f=1,g=4;function i(d,c,b){var e=d,a=new Array(e+1);if(b==0)a[0]=c;else a[0]=c+"_"+b;a[1]=c+"_"+(b+1);a[2]=c+"_"+(b+2);a[3]=c+"_"+(b+3);f=f+d;return a}function m(c,d){var b=c,a=new Array(b+1);a[0]=d+"_mov";return a}function h(e){var d=new Image(61,79);d.src=e.image;if(b.omnituresupport){var g="Product "+c+": Thumbnail "+(e.index+1);a(d).click(function(){linkCode(d,g)})}if(e.found){a(d).click(function(){newsrc=d.src.replace(b.thumbnailfolder,b.largefolder);newimg=newsrc.substr(newsrc.lastIndexOf("/")+1);switchImg(newimg,b.mediaserver)});a(d).attr("style","cursor:pointer");var f=a("<li class='slideProducts'></li>").append(d);if(e.index==0)a(".slideNavProducts").prepend(f);else a(".slideNavProducts").append(f)}}function l(g){var f=new Image(61,79);f.src=g.image;b.omnituresupport&&a(f).click(function(){linkCode(f,"Product "+c+": Video Thumbnail "+(g.index+1))});if(g.found){var h=a("<a class='popup2' href='/movies/"+e+"/"+c+"/"+d+".htm'></a>").append(f);a("#productDetailThumbs").append(h);a(".popup2").popupWindow({centerBrowser:1,centerScreen:0,height:547,left:0,location:0,menubar:0,resizable:1,scrollbars:1,status:0,width:594,windowName:"movie",windowURL:null,top:0,toolbar:0})}else a("#productDetailThumbs").css("visibility","hidden")}function j(d){if(d.failed==0){var k=i(g,c,f);a.preload(k,{base:b.base,ext:b.imagesuffix,onComplete:h,onFinish:j})}else if(d.failed==g&&f==9||f==5){var e=m(1,c,1);a.preload(e,{base:b.base,ext:b.imagesuffix,onComplete:l,onFinish:n})}else a("#carsouselwrap").removeClass()}function n(a){if(a.failed==0);}var k=i(g,c,f);a.preload(k,{base:b.base,ext:b.imagesuffix,onComplete:h,onFinish:j});a.preload(k,{base:b.largebase,ext:b.imagesuffix})})}})(jQuery);