function resizeImages() {
	
	$("#img-container").css('height', $(window).height() - 173);
	$(".text").css('height', $(window).height() - 174);
	
	
	//var object = $('span.nothumb > img');
	var object  = $('div.scrubber > img , span.nothumb > img , span.homehover > img, span.homehover > a > img, , span.nothumb > object , span.nothumb > object > embed, span.nothumb > object > object');
	
	object.each(function() {
	
		var owidth  = $(this).attr('width');
		var oheight = $(this).attr('height');
		
		var corr = correction + extra;
		
		var	wheight = $(window).height();
		var nheight;
		var nwidth;

		if (wheight != undefined) {
		
			nheight = wheight - corr;
			
			if (nheight < 200) { nheight = 200 }
			if (nheight > 700) { nheight = 700 }
			
			nwidth = Math.round( owidth * ( nheight / oheight ) );
			
			$(this).css('height', nheight);
			$(this).css('width',  nwidth);

		}
			
	});
	
	var scrubber_elements  = $('span.scrubber, span.scrubber > div, span.scrubber > div.scrubber-pager > a ');
	
	scrubber_elements.each(function() {
	
		var owidth  = parseInt( $(this).css('width')  );
		var oheight = parseInt( $(this).css('height') );		
		var oleft 	= parseInt( $(this).css('left')   );		
		
		var corr = correction + extra;
		
		var	wheight = $(window).height();
		var nheight;
		var nwidth;
		var nleft;

		if (wheight != undefined) {
		
			nheight = wheight - corr;
			
			if (nheight < 200) { nheight = 200 }
			if (nheight > 700) { nheight = 700 }
			
			nwidth = Math.round( owidth * ( nheight / oheight ) );
			nleft  = Math.round( oleft  * ( nheight / oheight ) );			
			
			$(this).css('height', nheight);
			$(this).css('width',  nwidth );
			$(this).css('left',   nleft  );
			
		}
			
	});
	
	var objects  = $('img.extra');
	
	objects.each(function() {
		var margin 	= $(this).attr('height') +  30;
		var nheight = $(this).attr('height') * .85;
		var nwidth  = $(this).attr('width')  * .85;
	
		$(this).attr('height', nheight);
		$(this).attr('width',  nwidth);
		
		$(this).css('marginTop', -margin);
		
		//$(this).hide();

	});
	

};

function resizeTextfield() {
	var object = $('.text');
	var	height = $(window).height();
	var width = $(document).width();
	object.css('min-height', height - correction);
}

function resizeNews() {
	if ( jQuery.browser.msie && jQuery.browser.version <= 7 ) {
		var items = $(".news-item:visible");
		if (items.size() > 0) {
			$(".news").css( 'width' , items.size() * 412 + 72 + 212 );
		}
	}	
}

var resizeTimer = null;
$(window).bind('resize', function() {
    if (resizeTimer) clearTimeout(resizeTimer);
    resizeTimer = setTimeout(onResize, 100);
});

function onResize() {
	resizeImages();
	resizeTextfield();
}
