function _posDivs(){
	var tempVar = $(document).width();
	$('#fixed').width(tempVar);
}

$(document).ready(function(){
	var mleft = $('.sel').width() + 'px';
	if ($('.sel').width() > 180){mleft = '180px'};
	var mbot = $('.sub').height() - 16 + 'px';
	$('.sub').css('margin', '-17px 0 -' + mbot + ' ' + mleft).fadeIn();
	
	$(window).scroll(function (){
		var div = $(document).scrollTop(); 
 
		if(div > 200) {
			$('#fixed').fadeIn('fast');
		} else {
			$('#fixed').fadeOut('fast');
		}
	});

	_posDivs();
	$(window).resize(function(){_posDivs();});
	

	$(".main").bind("ajaxSend", function(){
		$('#loader').css({'display' : 'block'});
	}).bind("ajaxComplete", function(){
		$('#loader').css({'display' : 'none'});
	});
	
	$(".add_prd").each(function(){
		$(this).click(function(){
			$.ajax({
				url: $(this).attr('href'),
				cache: true,
				success: function(html){
					eval(html);
				}
			});
			return false;
		});
	});
	
/*
	$("table.h100").parent('td').each(function(){
		$(this).children('table.h100').css({'height' : $(this).height()});
	});*/

}).resize(function(){_posDivs();});
