
$(function(){var $images=$('a[href$=jpg] img, a[href$=jpeg] img, a[href$=png] img, a[href$=gif] img');$images.each(function(){var $image=$(this);var $link=$(this).parent();var srcView=$link.attr('href');var srcThumb=$image.attr('src');$link.attr('href','#');$link.click(function(){if(geckImgBox.isUsed){return false;}
geckImgBox.isUsed=true;var img=new Image();$(img).load(function(){geckImgBox.progressOff($link);geckImgBox.showImage($link,img);geckImgBox.isUsed=false;});$(img).error(function(){geckImgBox.progressOff($link);geckImgBox.isUsed=false;});img.src=srcView;return false;});});});geckImgBox={isUsed:false,progressOn:function(linkObject){$(linkObject).css({position:'relative'})
$('<div/>').attr('id','geckImageBoxProgress').css({opacity:0}).appendTo(linkObject).animate({opacity:0.8},100);},progressOff:function(linkObject){$('#geckImageBoxProgress',linkObject).animate({opacity:0},500,'',function(){$(this).remove();});},showImage:function(link,imgView){var docHeight=$(document).height();var docWidth=$(document).width();var winHeight=$(window).height();var winWidth=$(window).width();var scrollTop=$(window).scrollTop();var $mainWrap=$('<div/>');$mainWrap.attr('id','geckImageBoxView');$mainWrap.css({position:'absolute',top:0,left:0,width:'100%',height:docHeight,zIndex:1000000});$mainWrap.click(function(){geckImgBox.hideImage();});$mainWrap.appendTo('body');var $background=$('<div/>');$background.addClass('background');$background.css({position:'absolute',top:0,left:0,width:'100%',height:docHeight,display:'none',opacity:0.6});$background.appendTo($mainWrap);$background.fadeIn(1000);var $imgFrame=$('<div/>')
$imgFrame.addClass('imgFrame');$imgFrame.append(imgView);$imgFrame.appendTo($mainWrap);var imgHeight=$(imgView).height();var imgWidth=$(imgView).width();$imgFrame.css({position:'absolute',top:((winHeight-imgHeight)/2)+scrollTop,left:((winWidth-imgWidth)/2),display:'none'});$imgFrame.fadeIn(400);},hideImage:function(){$('#geckImageBoxView').animate({opacity:0},400,'',function(){$(this).remove();});}}
