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

function show_prd_vs()
{
	$.ajax({
		url: 'ishop/show_prd_vs/1',
		cache: true,
		success: function(html){
			$('.path_p2').html('Добавлено к стравнению');
			$('.outer_content').html(html);
			$.scrollTo(0, 800, {queue:true});
		}
	});	
}

function vs_remove(id)
{
	$.ajax({
		url: 'ishop/show_remove_prd_vs/' + id,
		cache: true,
		success: function(html){
			$('.outer_content').html(html);
		}
	});
}

function vs_vs()
{
	alert('2');
}

$(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();});
