var overlayer=function(){return{init:function(){var overlayContainer=document.createElement('div');var contentContainer=document.createElement('div');var innerContentContainer=document.createElement('div');overlayContainer.setAttribute('id','overlay');$(overlayContainer).hide();contentContainer.setAttribute('id','overlay-wrapper');$(contentContainer).hide();innerContentContainer.setAttribute('id','overlay-content');$(innerContentContainer).appendTo(contentContainer);$('body').append(overlayContainer);$('body').append(contentContainer);$.each($('.overlaybutton[rel]'),function(i,item){$(this).click(function(){overlayer.show($(this).attr('rel'));return false;});});$.each($('.overlaycontent'),function(i,item){$(this).css('width',$(this).width()+'px');$(this).hide();});},enableKeyboardNav:function(){$(document).bind('keydown',overlayer.keyboardAction);},disableKeyboardNav:function(){$(document).unbind('keydown',overlayer.keyboardAction);},keyboardAction:function(event){var keycode=event.keyCode;var escapeKey;if(event.DOM_VK_ESCAPE){escapeKey=event.DOM_VK_ESCAPE;}else{escapeKey=27;} var key=String.fromCharCode(keycode).toLowerCase();if(keycode==escapeKey){overlayer.hide();}},show:function(contentID){$('#overlay-content').html($(contentID).html());overlayer.enableKeyboardNav();$('#overlay-wrapper').show();var closestInput=$('#overlay-content input').filter(function(){return $(this).attr('type')!='hidden';}).eq(0);if(closestInput){closestInput.focus();} var closeButton=$('#overlay-content .close').filter(function(){return $(this).attr('type')!='hidden';}).eq(0);if(closeButton){$(closeButton).click(function(){overlayer.hide();return false;});} $('#overlay-content').css('width','445px');if($(window).scrollTop()>75){overlayer.scrollToTop(30);}},hide:function(){overlayer.disableKeyboardNav();$('#overlay').hide();$('#overlay-wrapper').hide();$('#overlay-content').html('');},getPageSize:function(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;} var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth;}else{windowWidth=self.innerWidth;} windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;} if(yScroll1){if(config.vertical) height=height*config.visible;else width=width*config.visible;} ul.wrap('