

$(document).ready(function(){

	$('#cols1 .col').longdiv();
	
	//$('.section a').has('img').facebox();
	
	

	$.facebox.settings['close_image'] = 'http://www.trancons.ru/@@/trancons_resources/img/closelabel.png';
	
	//$('.section a').has('img').facebox();
	
	//$('a.popup').has('img').lightBox();
	
	/*
	$('a.popup').has('img').click(function(e){
		return hs.expand(this);
	})
	*/
	

	$('a.popup').has('img').each(function(i,n){
			$(n).lightBox();
		});
	
		
});


$.fn.longdiv = function(options) {

	var items = $(this);

	options = $.extend({
		heightProvider: $(items.parents()[0])
	}, options || {});
	
	var measure = $(options.heightProvider).height();
	
	items.each(stretch);
	
	function stretch() {
		var item = $(this);
		
		if (item.height() < measure) {
			var paddings = parseInt(item.css('paddingTop')) + parseInt(item.css('paddingBottom')) 
			var margins = parseInt(item.css('marginTop')) + parseInt(item.css('marginBottom'))
			var h = measure - paddings - margins; 
			item.height(h);
		}
	}
	
}








 
