--- jquery.lightbox.js	2008-04-09 01:28:51.000000000 +0300
+++ jquery.lightbox.resize.js	2008-04-09 01:37:46.000000000 +0300
@@ -29,6 +29,11 @@
  * @example Visit {@link http://jquery.com/plugins/project/jquerylightbox_bal} for more information.
  */
 
+/*****************************************************************************
+	modified by ssaki - this version WILL resize images bigger than viewable area
+*****************************************************************************/
+ 
+ 
 // Start of our jQuery Plugin
 (function($)
 {	// Create our Plugin function, with $ as the argument (we pass the jQuery object over later)
@@ -398,16 +403,16 @@
 		files: {
 			// If you are doing a repack with packer (http://dean.edwards.name/packer/) then append ".packed" onto the js and css files before you pack it.
 			js: {
-				lightbox:	'js/jquery.lightbox.js'
+				lightbox:	'js/jquery.lightbox.resize.js'
 			},
 			css: {
-				lightbox:	'css/jquery.lightbox.css'
+				lightbox:	'styles/jquery.lightbox.css'
 			},
 			images: {
-				prev:		'images/prev.gif',
-				next:		'images/next.gif',
-				blank:		'images/blank.gif',
-				loading:	'images/loading.gif'
+				prev:		'img/lb_prev.gif',
+				next:		'img/lb_next.gif',
+				blank:		'img/lb_blank.gif',
+				loading:	'img/loading_blck.gif'
 			}
 		},
 		
@@ -786,6 +791,61 @@
 					var iWidth  = options.width;
 					var iHeight = options.height;
 					
+					//******************************************************************************************************************************
+					// ssaki ->
+					
+					// some pseudo-constants
+					minFreeWidth = 50;
+					minFreeHeight = 100;
+					
+					// get window size ( code extracted from pre 1.1.0 getPageSize )
+					var windowWidth, windowHeight;
+	
+					if (self.innerHeight) {	// all except Explorer
+						if(document.documentElement.clientWidth){
+							windowWidth = document.documentElement.clientWidth; 
+						} else {
+							windowWidth = self.innerWidth;
+						}
+						windowHeight = self.innerHeight;
+					} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
+						windowWidth = document.documentElement.clientWidth;
+						windowHeight = document.documentElement.clientHeight;
+					} else if (document.body) { // other Explorers
+						windowWidth = document.body.clientWidth;
+						windowHeight = document.body.clientHeight;
+					}
+					
+					//calc proportions of image and viewable window
+					imgProp = options.width / options.height;
+					scrProp = windowWidth / windowHeight;
+					
+					// resize image if bigger than win size
+					if ( imgProp > scrProp )
+					{
+						if ( iWidth > (windowWidth - minFreeWidth) )
+						{
+							// image is wider than the viewable zone so resize width
+							resizeRatio = iWidth / ( windowWidth - minFreeWidth );
+							iWidth = windowWidth - minFreeWidth;
+							iHeight = Math.floor ( iHeight / resizeRatio );
+						}
+					}
+					else
+					{
+						if ( iHeight > (windowHeight - minFreeHeight) )
+						{
+							// image is taller than the viewable zone so resize height
+							resizeRatio = iHeight / ( windowHeight - minFreeHeight );
+							iHeight = windowHeight - minFreeHeight;
+							iWidth = Math.floor ( iWidth / resizeRatio );
+						}
+					}
+					$('#lightbox-image').css( {height: iHeight, width: iWidth} );
+					
+					// -> ssaki
+					//******************************************************************************************************************************
+
 					// Get current width and height
 					var cWidth = $('#lightbox-imageBox').width();
 					var cHeight = $('#lightbox-imageBox').height();
