(function($){"use strict";var obj=$([]);var tempOptions;$(window).bind('resize.fullScreenImageInner',function(){if(obj.length){obj.fullScreenImageInner();}});$('img.fsi').load(function(){if(obj.length){obj.fullScreenImageInner();}});$.fn.fullScreenImageInner=function(options){if(typeof options==='undefined'){options=tempOptions;} else{tempOptions=options;} var defaults={imageHeight:1000,imageWidth:1600,verticalSpace:0,horizontalSpace:0,windowHeight:$(window).height(),verticalPosition:'center',horizontalPosition:'center'};options=$.extend(defaults,options);this.each(function(){obj=$(this);var fullScreenImageInner=obj.find('img');var windowWidth=$(window).width();var objHeight=options.windowHeight-options.horizontalSpace;var objWidth=windowWidth-options.verticalSpace;var heightDifference;var widthDifference;var imageNewWidth;var imageNewHeight;var imageTopMinusMargin;var imageLeftMinusMargin;obj.css({height:objHeight,width:objWidth,position:'relative',overflow:'hidden'});fullScreenImageInner.css({position:'absolute',maxWidth:'none',maxHeight:'none'});if(options.imageHeight<=options.windowHeight){heightDifference=options.windowHeight-options.imageHeight;}else{heightDifference=options.imageHeight-options.windowHeight;} if(options.imageWidth<=windowWidth){widthDifference=windowWidth-options.imageWidth;}else{widthDifference=options.imageWidth-windowWidth;} if(widthDifference<=heightDifference){imageNewWidth=(options.windowHeight/options.imageHeight)*options.imageWidth;if(imageNewWidth