jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d);},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b;},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b;},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b;},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b;},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b;},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b;},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b;},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b;},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b;},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b;},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b;},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b;},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b;},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b;},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b;},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b;},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b;},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b;}});;(function($)
{function makePos(self,initpos)
{var _childs=self.data("_vgchild");var _width=self.width();var _bodyW=1000;var _defW=self.data("_vgopt").gridDefWidth||290+15+15+5;var _selRefGrid=self.data("_vgopt").selRefGrid||".latest_project div.x1";var _selFitWidth=self.data("_vgopt").selFitWidth||".bg_container";if($(_selRefGrid).get().length)
{var _colW=getSize($(_selRefGrid).eq(0))[0];}
else
{var _colW=_defW;}
var _colWSum=Math.floor(_bodyW/_colW)*_colW;if($.isArray(_selFitWidth))
{for(var i=0;i<_selFitWidth.length;i++)
{$(_selFitWidth[i]).width(_colWSum);}}
else
{$(_selFitWidth).width(_colWSum);}
var _ofsL=0;var _ofsT=(initpos)?2000:0;var _adjL=(initpos)?0.5:1;var _adjT=(initpos)?0.5:1;var _matrix=[[0,_width,0]];var _hmax=0;_childs.each(function(i)
{var _c=$(this);var _size=getSize(_c);var _point=getAttachPoint(_matrix,_size[0]);_matrix=updateAttachArea(_matrix,_point,_size);_hmax=Math.max(_hmax,_point[1]+_size[1]);_c.data("_vgleft",Math.floor((_point[0]+_ofsL)*_adjL));_c.data("_vgtop",Math.floor((_point[1]+_ofsT)*_adjT));});self.data("_vgwrapheight",_hmax);heightTo(self);};function getAttachPoint(mtx,width)
{var _mtx=mtx.concat([]).sort(matrixSortDepth);var _max=_mtx[_mtx.length-1][2];for(var i=0,imax=_mtx.length;i<imax;i++)
{if(_mtx[i][2]>=_max)break;if(_mtx[i][1]-_mtx[i][0]>=width)
{return[_mtx[i][0],_mtx[i][2]];}}
return[0,_max];};function updateAttachArea(mtx,point,size)
{var _mtx=mtx.concat().sort(matrixSortDepth);var _cell=[point[0],point[0]+size[0],point[1]+size[1]];for(var i=0,imax=_mtx.length;i<imax;i++)
{if(_cell[0]<=_mtx[i][0]&&_mtx[i][1]<=_cell[1])
{delete _mtx[i];}
else
{_mtx[i]=matrixTrimWidth(_mtx[i],_cell);}}
return matrixJoin(_mtx,_cell);};function matrixSortDepth(a,b)
{return((a[2]==b[2]&&a[0]>b[0])||a[2]>b[2])?1:-1;};function matrixSortX(a,b)
{if(a==null||b==null)return 0;else return(a[0]>b[0])?1:-1;};function matrixJoin(mtx,cell)
{var _mtx=mtx.concat([cell]).sort(matrixSortX);var _mtx_join=[];for(var i=0,imax=_mtx.length;i<imax;i++)
{if(!_mtx[i])continue;if(_mtx_join.length>0&&_mtx_join[_mtx_join.length-1][1]==_mtx[i][0]&&_mtx_join[_mtx_join.length-1][2]==_mtx[i][2])
{_mtx_join[_mtx_join.length-1][1]=_mtx[i][1];}
else
{_mtx_join.push(_mtx[i]);}}
return _mtx_join;};function matrixTrimWidth(a,b)
{if(a[0]>=b[0]&&a[0]<b[1]||a[1]>=b[0]&&a[1]<b[1])
{if(a[0]>=b[0]&&a[0]<b[1])
{a[0]=b[1];}
else
{a[1]=b[0];}}
return a;};function getSize(child)
{var _w=child.width();var _h=child.height();_w+=5;_h+=5;return[_w,_h];};function heightTo(self)
{var _self=self;var _delay=_self.data("_vgchild").length*(_self.data("_vgopt").delay||0)
+_self.data("_vgopt").time||500;_self.stop();if(_self.height()<_self.data("_vgwrapheight"))
{if($.browser.msie)
{_self.height(_self.data("_vgwrapheight"));}
else
{_self.animate({height:_self.data("_vgwrapheight")+"px"},(_self.data("_vgopt").time||500),"easeOutQuart");}}
else
{clearTimeout(_self.data("_vgwraptimeout"));_self.data("_vgwraptimeout",setTimeout(function(){if($.browser.msie)
{_self.height(_self.data("_vgwrapheight"));}
else
{_self.animate({height:_self.data("_vgwrapheight")+"px"},(_self.data("_vgopt").time||500),"easeOutQuart");}},_delay));}};function moveTo(childs)
{childs.each(function(i)
{var _c=$(this);_c.css("left",_c.data("_vgleft")+"px");_c.css("top",_c.data("_vgtop")+"px");});};function animateTo(childs,easing,time,delay)
{var _self=$(childs).parent();var isMove=false;var imax=childs.length;var i,_c,_pos;for(i=0;i<imax;i++)
{_c=$(childs[i]);_pos=_c.position();if(_pos.left!=_c.data("_vgleft")&&_pos.top!=_c.data("_vgtop"))
{isMove=true;}}
if(isMove)
{if(typeof(_self.data("_vgopt").onStart)=="function")_self.data("_vgopt").onStart();childs.each(function(i)
{var _c=$(this);var _opt={duration:time,easing:easing};if(childs.size()-1==i)
{_opt.complete=_self.data("_vgopt").onFinish||null;}
clearTimeout(_c.data("_vgtimeout"));_c.data("_vgtimeout",setTimeout(function(){_c.animate({left:_c.data("_vgleft")+"px",top:_c.data("_vgtop")+"px"},_opt);},i*delay));});}};function refleshHandler(tg)
{var _self=tg;clearTimeout(_self.data("_vgtimeout"));makePos(_self);_self.data("_vgtimeout",setTimeout(function(){animateTo(_self.data("_vgchild"),_self.data("_vgopt").easeing||"linear",_self.data("_vgopt").time||500,_self.data("_vgopt").delay||0);},250));};function setFontSizeListener()
{var s=$("<span />").text(" ").attr("id","_vgridspan").hide().appendTo("body");s.data("size",s.css("font-size"));s.data("timer",setInterval(function(){if(s.css("font-size")!=s.data("size"))
{s.data("size",s.css("font-size"));$(window).resize();}},500));};$.fn.extend({vgrid:function(option)
{var _self=$(this);var _opt=option||{};_self.data("_vgopt",_opt);_self.data("_vgchild",_self.find("> *"));_self.data("_vgdefchild",_self.data("_vgchild"));_self.css({"position":"relative","width":"auto"});_self.data("_vgchild").css("position","absolute");if(_self.data("_vgopt").forceAnim)
{makePos(_self,true);moveTo(_self.data("_vgchild"));refleshHandler(_self);}
else{makePos(_self);moveTo(_self.data("_vgchild"));}
if(_self.data("_vgopt").fadeIn)
{var _prop=(typeof(_self.data("_vgopt").fadeIn)=='object')?_self.data("_vgopt").fadeIn:{time:_self.data("_vgopt").fadeIn};_self.data("_vgchild").each(function(i)
{var _c=$(this);_c.css('display','none');setTimeout(function(){_c.fadeIn(_prop.time||250);},i*(_prop.delay||0));});}
$(window).resize(function(e)
{refleshHandler(_self);setTimeout(function(){refleshHandler(_self)},250);});setFontSizeListener();return _self;},vgrefresh:function(easeing,time,delay,func)
{var _obj=$(this);if(_obj.data("_vgchild"))
{_obj.data("_vgchild",_obj.find("> *"));_obj.data("_vgchild").css("position","absolute");makePos(_obj);time=typeof(time)=="number"?time:_obj.data("_vgopt").time||500;delay=typeof(delay)=="number"?delay:_obj.data("_vgopt").delay||0;animateTo(_obj.data("_vgchild"),easeing||_obj.data("_vgopt").easeing||"linear",time,delay);if(typeof(func)=='function')
{setTimeout(func,_obj.data("_vgchild").length*delay+time);}}
return _obj;},vgsort:function(func,easeing,time,delay)
{var _obj=$(this);if(_obj.data("_vgchild"))
{_obj.data("_vgchild",_obj.data("_vgchild").sort(func));_obj.data("_vgchild").each(function(num){$(this).appendTo(_obj);});makePos(_obj);animateTo(_obj.data("_vgchild"),easeing||_obj.data("_vgopt").easeing||"linear",typeof(time)=="number"?time:_obj.data("_vgopt").time||500,typeof(delay)=="number"?delay:_obj.data("_vgopt").delay||0);}
return _obj;}});})(jQuery);;function maxImage(options,selector){var resizeMsgDefaults={show:false,location:'before',message:'Original: ([w]w x [h]h)'};var slideInterval;var opts=jQuery.extend({wait:true,imageArray:[],maxFollows:'both',verticalOffset:0,horizontalOffset:0,leftSpace:0,topSpace:0,rightSpace:0,bottomSpace:0,overflow:'hidden',position:'absolute',isBackground:false,zIndex:-1,verticalAlign:'center',horizontalAlign:'center',maxAtOrigImageSize:false,slideShow:false,slideDelay:5,slideShowTitle:true,loaderClass:'loader',resizeMsg:resizeMsgDefaults,currentSlide:0},options);opts.resizeMsg=jQuery.extend(resizeMsgDefaults,options.resizeMsg)
var jQueryMatchedObj=$(selector);function _initialize(){_start(jQueryMatchedObj,jQueryMatchedObj);return false;}
function _start(image,jQueryMatchedObj){if(opts.slideShow){_setup_slideshow(jQueryMatchedObj);}else if(opts.isBackground){Background._setup_background(image);}else{Others._setup_others(image,opts);}}
Others={_setup_others:function(image,opts){$jQueryMatchedObj=$(image);$(window).load(function(){_get_orig_data($jQueryMatchedObj);_size_image($jQueryMatchedObj);_center_image($jQueryMatchedObj);Others._configure_css(image,opts);$(window).resize(function(){_size_image($jQueryMatchedObj);_center_image($jQueryMatchedObj);});});},_configure_css:function(image,opts){if(opts.position=='absolute'){$(image).css({'overflow':'hidden','left':opts.leftSpace,'top':opts.topSpace,'position':'absolute'});if(opts.verticalAlign=='bottom'){$(image).css({'bottom':opts.bottomSpace,'top':'auto'});}
if(opts.horizontalAlign=='right'){$(image).css({'right':opts.rightSpace,'left':'auto'});}}else{$(image).css({'margin-top':opts.topSpace,'margin-right':opts.rightSpace,'margin-bottom':opts.bottomSpace,'margin-left':opts.leftSpace,'position':opts.position});}}}
Background={_setup_background:function(image){$jQueryMatchedObj=$(image);$jQueryMatchedObj.hide();Background._configure_css(image);$(window).load(function(){_get_orig_data($jQueryMatchedObj);_size_image($jQueryMatchedObj);_center_image($jQueryMatchedObj);$jQueryMatchedObj.show();$(window).resize(function(){_size_image($jQueryMatchedObj);_center_image($jQueryMatchedObj)});});},_configure_css:function(image){$(image).css({'z-index':opts.zIndex});if(opts.position=='absolute'){$(image).css({'overflow':'hidden','left':opts.leftSpace,'top':opts.topSpace,'position':'absolute'});$('html').css({'overflow-y':opts.overflow});if(opts.verticalAlign=='bottom'){$(image).css({'bottom':opts.bottomSpace,'top':'auto'});}
if(opts.horizontalAlign=='right'){$(image).css({'right':opts.rightSpace});}}else{$(image).css({'margin-top':opts.topSpace,'margin-right':opts.rightSpace,'margin-bottom':opts.bottomSpace,'margin-left':opts.leftSpace,'position':opts.position});}}}
function _setup_slideshow(jQueryMatchedObj){_build_slideshow_structure(jQueryMatchedObj);opts.imageArray.length=0;if(jQueryMatchedObj.length==1){opts.imageArray.push(new Array(objClicked.getAttribute('src'),objClicked.getAttribute('title')));}else{for(var i=0;i<jQueryMatchedObj.length;i++){opts.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('src'),jQueryMatchedObj[i].getAttribute('title')));$(jQueryMatchedObj[i]).attr('original',$(jQueryMatchedObj[i]).attr('src')).attr('src','');}}
_configure_css();_loads_image(0);}
function _build_slideshow_structure(){for(var i=0;i<jQueryMatchedObj.length;i++){$(jQueryMatchedObj[i]).addClass('slides slide-'+i).after('<div class="slideTitle">'+$(jQueryMatchedObj[i]).attr('title')+'</div>');}
$('.slideTitle').hide().css({'padding':'10px','background':'#e0e0e0','position':'absolute','bottom':'0','right':'5%','opacity':'0.8'});}
function _loads_image(nums){var currentImage=nums;var objImagePreloader=new Image();objImagePreloader.onload=function(){$('.slide-'+currentImage).attr('src',opts.imageArray[currentImage][0]);_get_orig_data($('.slide-'+currentImage));_size_image($('.slide-'+currentImage));_center_image($('.slide-'+currentImage));$(window).resize(function(){_size_image($('.slide-'+(currentImage)));_center_image($('.slide-'+currentImage));});if(currentImage==0){_start_timer(0);}
if(currentImage<opts.imageArray.length-1){setTimeout(function(){_loads_image(currentImage+1);},500);}}
objImagePreloader.src=opts.imageArray[currentImage][0];}
function _change_image(nums){showTimer('stop',nums);if(nums<opts.imageArray.length-1){lastSlide=nums-1;}else{lastSlide=opts.imageArray.length-1;}
for(var i=0;i<opts.imageArray.length;i++){$('.slide-'+i).css({'z-index':opts.zIndex-1}).fadeOut('slow');}
$('.slide-'+lastSlide).css({'z-index':opts.zIndex-1}).fadeOut('slow');$('.slide-'+nums).css({'z-index':opts.zIndex}).fadeIn('slow');showTimer('start',nums);}
function showTimer(state,currentSlide){var slideDelay=opts.slideDelay*1000;if(state=="start"){slideInterval=setInterval(function(){showCounter()},slideDelay);$('.content').hover(function(){pauseShow()},function(){resumeShow()});function pauseShow(){clearInterval(slideInterval);$('.latest_project').fadeTo('fast',0);$('.header').fadeTo('fast',0);}
function resumeShow(currentSlide){clearInterval(slideInterval);slideInterval=setInterval(function(){showCounter()},slideDelay);$('.latest_project').fadeTo('fast',1);$('.header').fadeTo('fast',1);}}else if(state=="stop"){clearInterval(slideInterval);}
function showCounter(){if(currentSlide<opts.imageArray.length-1){currentSlide++;lastSlide=currentSlide-1;}else{currentSlide=0;lastSlide=opts.imageArray.length-1;}
$('.slide-'+lastSlide).css({'z-index':opts.zIndex-1}).fadeOut('slow');$('.slide-'+currentSlide).css({'z-index':opts.zIndex}).fadeIn('slow');if(opts.slideShowTitle){next_title(currentSlide,lastSlide);}}}
function _start_timer(currentSlide){$('.'+opts.loaderClass).hide();$('.slide-'+currentSlide).css({'z-index':opts.zIndex}).fadeIn();if(opts.slideShowTitle){$('.slide-'+currentSlide).next('.slideTitle').css({'z-index':opts.zIndex+1}).fadeIn();}
var slideDelay=opts.slideDelay*1000;function showCounter(){if(currentSlide<opts.imageArray.length-1){currentSlide++;lastSlide=currentSlide-1;}else{currentSlide=0;lastSlide=opts.imageArray.length-1;}
$('.slide-'+lastSlide).css({'z-index':opts.zIndex-1}).fadeOut('slow');$('.slide-'+currentSlide).css({'z-index':opts.zIndex}).fadeIn('slow');if(opts.slideShowTitle){next_title(currentSlide,lastSlide);}}
slideInterval=setInterval(function(){showCounter()},slideDelay);$('.content').hover(function(){pauseShow()},function(){resumeShow()});var slideInterval;function pauseShow(){clearInterval(slideInterval);$('.latest_project').fadeTo('fast',0);$('.header').fadeTo('fast',0);}
function resumeShow(){clearInterval(slideInterval);slideInterval=setInterval(function(){showCounter()},slideDelay);$('.latest_project').fadeTo('fast',1);$('.header').fadeTo('fast',1);}}
function _configure_css(){for(i=0;i<opts.imageArray.length;i++){if(opts.position=='absolute'){$('.slide-'+i).css({'position':'absolute','overflow':'hidden'});$('html').css({'overflow-y':opts.overflow});if(opts.verticalAlign=='bottom'){$('.slide-'+i).css({'bottom':opts.bottomSpace});}else{$('.slide-'+i).css({'top':opts.topSpace});}
if(opts.horizontalAlign=='right'){$('.slide-'+i).css({'right':opts.rightSpace});}else{$('.slide-'+i).css({'left':opts.leftSpace});}}else{$('.slide-'+i).css({'margin-top':opts.topSpace,'margin-right':opts.rightSpace,'margin-bottom':opts.bottomSpace,'margin-left':opts.leftSpace,'position':opts.position});}
$('.slide-'+i).next('.slideTitle').css({'position':'absolute','bottom':0,'right':'5%'});}}
function next_title(currentSlide,lastSlide){$('.slide-'+lastSlide).next('.slideTitle').fadeOut();$('.slide-'+currentSlide).next('.slideTitle').fadeIn();}
function _center_image(image){$jQueryMatchedObj=image;if(opts.horizontalAlign=='center'){var pageWidth=$(window).width()-opts.horizontalOffset;var newWidth=-1*($jQueryMatchedObj.width()-pageWidth)/2;$(image).css({'left':newWidth});}
if(opts.verticalAlign=='center'){var pageHeight=$(window).height()-opts.verticalOffset;var newHeight=-1*($jQueryMatchedObj.height()-pageHeight)/2;$(image).css({'top':newHeight});}}
function _get_orig_data(image){$jQueryMatchedObj=image;$jQueryMatchedObj.attr('origWidth',$jQueryMatchedObj.width());$jQueryMatchedObj.attr('origHeight',$jQueryMatchedObj.height());$jQueryMatchedObj.attr('ratio',find_ratio($jQueryMatchedObj.width(),$jQueryMatchedObj.height()));}
function _size_image(image){$jQueryMatchedObj=image;var originalWidth=to_i($jQueryMatchedObj.attr('origWidth'));var originalHeight=to_i($jQueryMatchedObj.attr('origHeight'));var ratio=$jQueryMatchedObj.attr('ratio');if(originalWidth==0||originalHeight==0){setTimeout(function(){_get_orig_data(image);_size_image(image);},100);return;}
var width_and_height=[];width_and_height=find_width_and_height(originalWidth,originalHeight,ratio);$jQueryMatchedObj.width(width_and_height[0]);$jQueryMatchedObj.height(width_and_height[1]);_show_resize_message(originalWidth,originalHeight,image);}
function _show_resize_message(originalWidth,originalHeight,image){if((to_i($jQueryMatchedObj.width())!=originalWidth||to_i($jQueryMatchedObj.height())!=originalHeight)&&opts.resizeMsg.show){$(".maximage_resized").remove();opts.resizeMsg.message=opts.resizeMsg.message.replace('[w]',originalWidth).replace('[h]',originalHeight);var insertStr='<div class="maximage_resized">'+opts.resizeMsg.message+'</div>';if(opts.resizeMsg.location.toLowerCase()=="before"){$jQueryMatchedObj.before(insertStr);}else{$jQueryMatchedObj.after(insertStr);}}}
function find_width_and_height(originalWidth,originalHeight,ratio){var pageWidth=$(window).width()-opts.horizontalOffset;var pageHeight=$(window).height()-opts.verticalOffset;if(!opts.isBackground){if(opts.maxFollows=='both'){max_follows_width(pageWidth,ratio);if(height>pageHeight){max_follows_height(pageHeight,ratio);}}else if(opts.maxFollows=='width'){max_follows_width(pageWidth,ratio);}else if(opts.maxFollows=='height'){max_follows_height(pageHeight,ratio);}}else{width=pageWidth+40;height=width/ratio;if(height<pageHeight){height=pageHeight-(opts.topSpace+opts.bottomSpace);width=height*ratio;}}
if(opts.maxAtOrigImageSize&&width>originalWidth){arrayImageSize=new Array(originalWidth,originalHeight);}else{arrayImageSize=new Array(width,height);}
return arrayImageSize;}
function max_follows_height(pageHeight,ratio){height=pageHeight-(opts.topSpace+opts.bottomSpace);width=height*ratio;}
function max_follows_width(pageWidth,ratio){width=pageWidth-(opts.leftSpace+opts.rightSpace);height=width/ratio;}
function find_ratio(width,height){width=to_i(width);height=to_i(height);var ratio=width/height;ratio=ratio.toFixed(2);return ratio;}
function to_i(i){last=parseInt(i);return last;}
function debug($obj){if(window.console&&window.console.log){window.console.log($obj);}}
jQueryMatchedObj.each(_initialize);var publicFunctions=new Object()
publicFunctions._change_image=_change_image;return publicFunctions;};;
/*
 * jQuery resize event - v1.1 - 3/14/2010
 * http://benalman.com/projects/jquery-resize-plugin/
 * 
 * Copyright (c) 2010 "Cowboy" Ben Alman
 * Dual licensed under the MIT and GPL licenses.
 * http://benalman.com/about/license/
 */
(function($,window,undefined){'$:nomunge';var elems=$([]),jq_resize=$.resize=$.extend($.resize,{}),timeout_id,str_setTimeout='setTimeout',str_resize='resize',str_data=str_resize+'-special-event',str_delay='delay',str_throttle='throttleWindow';jq_resize[str_delay]=250;jq_resize[str_throttle]=true;$.event.special[str_resize]={setup:function(){if(!jq_resize[str_throttle]&&this[str_setTimeout]){return false;}
var elem=$(this);elems=elems.add(elem);$.data(this,str_data,{w:elem.width(),h:elem.height()});if(elems.length===1){loopy();}},teardown:function(){if(!jq_resize[str_throttle]&&this[str_setTimeout]){return false;}
var elem=$(this);elems=elems.not(elem);elem.removeData(str_data);if(!elems.length){clearTimeout(timeout_id);}},add:function(handleObj){if(!jq_resize[str_throttle]&&this[str_setTimeout]){return false;}
var old_handler;function new_handler(e,w,h){var elem=$(this),data=$.data(this,str_data);data.w=w!==undefined?w:elem.width();data.h=h!==undefined?h:elem.height();old_handler.apply(this,arguments);};if($.isFunction(handleObj)){old_handler=handleObj;return new_handler;}else{old_handler=handleObj.handler;handleObj.handler=new_handler;}}};function loopy(){timeout_id=window[str_setTimeout](function(){elems.each(function(){var elem=$(this),width=elem.width(),height=elem.height(),data=$.data(this,str_data);if(width!==data.w||height!==data.h){elem.trigger(str_resize,[data.w=width,data.h=height]);}});loopy();},jq_resize[str_delay]);};})(jQuery,this);;var IE6=(navigator.userAgent.indexOf("MSIE 6")>=0)?true:false;if(IE6){$(function(){$("<div>").css({'position':'absolute','top':'0px','left':'0px',backgroundColor:'black','opacity':'0.75','width':'100%','height':$(window).height(),zIndex:5000}).appendTo("body");$("<div class='container'><div class='content' style='background:#333;'><img style='margin-right:15px;' src='http://www.3bit.co.uk/wp-content/themes/3bit/images/no-ie6.png' alt='' width='128px' height='128px' style='float: left;'/><p><br /><strong>Sorry! This page doesn't support Internet Explorer 6.</strong><br /><br />If you'd like to read our content please <a href='http://getfirefox.org'>upgrade your browser</a> or <a href='http://www.3bit.co.uk/feed'>subscribe to our RSS feed</a>.</p></div></div>").css({'top':'10%','left':'10%',width:600,paddingRight:10,height:400,'position':'absolute',zIndex:6000}).appendTo("body");});}
