(function($){$.fn.popup=function(options){var jQueryMatchedObj=this;jQueryMatchedObj.css({cursor:'pointer'});function _initialize(){_start(this,jQueryMatchedObj);return false;}
function _start(objClicked,jQueryMatchedOb){var imageLink=objClicked.getAttribute('longdesc');$('embed, object, select, .pointer').css({'visibility':'hidden'});$('body').append('<div id="popup-background"></div><div id="popup-frame-container"><div id="popup-frame"><div id="popup-frame-controlbox"><img id="popup-frame-close" class="right" src="img/_close.gif" /></div><img id="popup-frame-image" src="" width="32" height="32" /></div></div>');var arrPageSizes=___getPageSize();$('#popup-background').css({position:'absolute',backgroundColor:'#000',opacity:0.75,width:arrPageSizes[0],height:arrPageSizes[1],left:0,top:0,zIndex:990}).fadeIn();var arrPageScroll=___getPageScroll();$('#popup-frame-container').css({position:'absolute',top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0],width:'100%',zIndex:999,'text-align':'center'});$('#popup-frame-controlbox').css({height:26,width:375,backgroundColor:'#fff'});$('#popup-frame-print, #popup-frame-close').css({cursor:'pointer',margin:'12px 11px 0 0'});$('#popup-frame').css({backgroundColor:'#fff',margin:'0 auto',width:375,height:300});$('#popup-frame-image').css({width:32,height:32,margin:'0 0 0 0'});var objImagePreloader=new Image();objImagePreloader.onload=function(){$('#popup-frame-image').css({margin:'11px 11px 37px 11px'});$('#popup-frame-image').attr('src',objImagePreloader.src);$('#popup-frame').animate({width:objImagePreloader.width+22,height:objImagePreloader.height+74},'medium');$('#popup-frame-controlbox').animate({width:objImagePreloader.width+22},'medium');$('#popup-frame-image').animate({width:objImagePreloader.width,height:objImagePreloader.height},'medium');objImagePreloader.onload=function(){};};objImagePreloader.src=imageLink;$('#popup-background,#popup-frame-container,#popup-frame-close').click(function(){_finish();});$('#popup-frame-print').click(function(){$('#popup-frame').print();return false;});$(window).resize(function(){var arrPageSizes=___getPageSize();$('#popup-background').css({width:arrPageSizes[0],height:arrPageSizes[1]});var arrPageScroll=___getPageScroll();$('#popup-frame-container').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]});});}
function _finish(){$('#popup-frame-container').remove();$('#popup-background').fadeOut(function(){$('#popup-background').remove();});$('embed, object, select, .pointer').css({'visibility':'visible'});}
function ___getPageSize(){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(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
if(xScroll<windowWidth){pageWidth=xScroll;}else{pageWidth=windowWidth;}
arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight);return arrayPageSize;};function ___getPageScroll(){var xScroll,yScroll;if(self.pageYOffset){yScroll=self.pageYOffset;xScroll=self.pageXOffset;}else if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop;xScroll=document.documentElement.scrollLeft;}else if(document.body){yScroll=document.body.scrollTop;xScroll=document.body.scrollLeft;}
arrayPageScroll=new Array(xScroll,yScroll);return arrayPageScroll;};return this.unbind('click').click(_initialize);};})(jQuery);$(document).ready(function(){$('.popup').popup();});
