jQuery(document).ready(function(){
jQuery(".maxheight").setFullHeight(745);
jQuery(".lightwindow").attr('params','lightwindow_type=external');});
jQuery.fn.extend({
	setFullHeight :  function(doch){
		var self = this, tww = jQuery(window).width(),dh = doch || jQuery(document).height();
		var setHeight = function(){
			var wh = jQuery(this).height();
				self.height(((wh > dh)?wh:dh));
		}
		
		jQuery(window).resize(function(e){
			var ww = jQuery(window).width();
			if(tww != ww) setHeight();
		});
		setHeight();
	}
});

