function recalc2(changed, variable) {    var res = 0;		   $('.calc_radio_' + variable).each(function () {	//alert($(this).attr('checked'));	if($(this).attr('checked') == true)		{		var needed_color_name = $("label[for='"+$(this).attr('id')+"']").attr("title");						//$("#property134_"+variable)				//var needed_razmer_name = $(this.options[this.selectedIndex]).attr('data-val');		var needed_razmer_name = $('#property134_'+variable+' :selected').text();				var needed_hidden_name = variable + '_' + needed_color_name + '_' + needed_razmer_name;				needed_hidden_name = needed_hidden_name.replace(" ","_"); 				//alert(needed_hidden_name); 				real_polotno_price =  Number($("#"+needed_hidden_name).val());				//alert(real_polotno_price);				var info_radio = $(this).attr('id') + ' ' + $(this).attr('checked') + ' ' + $(this).attr('data-val') + ' ';		}	//alert(info_radio);      /*   var c = 0;        if ($('#count_' + $(this).attr('id')).length > 0) { //если есть элемент с количеством            c = Number($('#count_' + $(this).attr('id')).val()); //получаем его значение        }        if (isNaN(c) || c <= 0) c = 1; //если элемента нет, ввели 0 или не число        res = res + Number($(this.options[this.selectedIndex]).attr('data-val')) * c;*/		    });					    $('.calc_' + variable).each(function () {//	alert($(this).attr('id'));        var c = 0;        if ($('#count_' + $(this).attr('id')).length > 0) { //если есть элемент с количеством            c = Number($('#count_' + $(this).attr('id')).val()); //получаем его значение        }        if (isNaN(c) || c <= 0) c = 1; //если элемента нет, ввели 0 или не число				this_id_value = $(this).attr('id')		test_is_polotno_array = this_id_value.split('_');				if(test_is_polotno_array[0] == 'property134' && real_polotno_price)			{						res = res + real_polotno_price * c;			}		else			{						res = res + Number($(this.options[this.selectedIndex]).attr('data-val')) * c;			}       		    });	     var total_count = $('.total_count_' + variable).val() || 1;    res *= total_count;//alert(res);	if(real_polotno_price) $('#text_' + variable).text(real_polotno_price);    $('#total_price_' + variable + ' span').text(res + ' р.');    $('#result_' + variable).val(res).attr('value', res);}$(document).ready(function() {    function doCollageResize() {        var w = $('body').width();        var collage = $('.collage');        var collage_width = $('.collage').width();        if (collage_width < 875) {            // 195            var percent = collage_width / 875;            var height = 195 * percent;            var elapsed = 195 - height;            $('.collage').height(Math.round(height));            $('.collage').css('top', 29 + parseInt(elapsed / 2));            $('.collage').css('left', '273px');        } else {            $('.collage').height(195);            $('.collage').css('top', 29);            var body_width = $('body').width() - 30;            var elapsed_width = body_width - collage_width;            $('.collage').css('left', Math.round(elapsed_width / 2) + 50);        }        var collage_shadow = $('.collage_shadow')        var collage_position = collage.offset();        collage_shadow.width(collage.width() - 10);        collage_shadow.height(collage.height() - 10);        collage_shadow.css('left', collage_position.left + 5);        collage_shadow.css('top', collage_position.top + 5);    }    $(window).resize(function() {        doCollageResize();    });    doCollageResize();    function resizeProductButtons() {        var addProducts = $('.additional_products .product');        var aContainer = $('.additional_products');        var width = addProducts.length * addProducts.width();        var aWidth = aContainer.width();        if (aWidth >= width) {            aContainer.width(width);        } else {            aContainer.width('auto');        }      //  $('.additional_products').width(width);        ;        function product_buttons(el1) {            var tops = []            $('.product_buttons:eq(' + el1 + '), .product_buttons:eq(' + (el1 + 1) + ')').each(function(i, item) {                $(item).css('padding-top', '12px');                var h = $(item).position().top;                tops[tops.length] = {                    top: h,                    elem: $(item)                };            });            if (tops.length == 2) {                for (var i = 0; i < tops.length; i++) {                    var top1 = tops[i];                    i++;                    var top2 = tops[i];                    if (top1.top > top2.top) {                        top2.elem.css('padding-top', top1.top - top2.top + 12);                    } else {                        top1.elem.css('padding-top', top2.top - top1.top + 12);                    }                }            }        }        product_buttons(0);        product_buttons(2);        product_buttons(4);        product_buttons(6);        product_buttons(8);        /*if ($('.product_buttons').length > 1) {         $('.product_buttons').each(function(i, item) {         $(item).css('padding-top', '12px');         var h = $(item).position().top;         tops[tops.length] = {         top: h,         elem: $(item)         };         });         for (var i = 0; i < tops.length; i++) {         var top1 = tops[i];         i++;         var top2 = tops[i];         if (top1.top > top2.top) {         top2.elem.css('padding-top', top1.top - top2.top + 12);         } else {         top1.elem.css('padding-top', top2.top - top1.top + 12);         }         }         }*/    }    resizeProductButtons();    $(window).resize(function() {        resizeProductButtons();    });    if ($.browser.msie) {        $('.center_col .inside').wrap($('<div></div>').addClass('ie_shadow_wrapper'));        $('<div></div>').addClass('ie_shadow').insertBefore($('.center_col .inside'));        function setShadowSize() {            var w = $('.center_col .inside').width();            var h = $('.center_col .inside').height();            $('.ie_shadow_wrapper .ie_shadow').width(w + 60).height(h + 45).css('top', -9).css('left', -15);        }        setShadowSize();        $(window).resize(function() {            setShadowSize();        });    }    jQuery.extend(jQuery.easing,    {        mySwing: function(x, t, b, c, d) {            // force opera to redraw            resizeProductButtons();            return jQuery.easing['swing'](x, t, b, c, d);        }    });    $('.show_description_link').click(function(e) {        e.preventDefault();        $(this)                .parent()                .find('.small').show('fast', 'mySwing').end()                .find('.hide_description_link').show().end()                .end()                .hide();    });    $('.hide_description_link').click(function(e) {        e.preventDefault();        $(this)                .parent()                .find('.small').hide('fast', 'mySwing').end()                .find('.show_description_link').show().end()                .end()                .hide();    });    $('.main_menu .submenu li a').hover(function(e) {        $(this).parent().css('background-color', '#bc1d05');    }, function() {        $(this).parent().css('background-color', 'transparent');    });    if ($.browser.msie) {        $('.main_menu td .menu_item_wrapper').each(function(i, item) {            var w = $('.submenu', $(item)).width();            var h = $('.submenu', $(item)).height();            if (h) {                $('<div></div>').addClass('ie_shadow').hide().css('z-index', 150).appendTo($(item))                        .width(w + 20).height(h + 63).css('top', -20).css('left', -20);            }        });    }    $('.main_menu td .menu_item_wrapper').hover(function(e) {        var td = $(this).closest('td');        var width = td.width() - 1;        if ($.browser.msie) {            if (td.prev().length == 0 || td.next().length == 0) {                //width += 1;            } else {            }        }        if ($(this).is($('.main_menu td:first .menu_item_wrapper'))) {        }        td.addClass('hover');        if (td.next().length == 0) {            td.addClass('last_hover');        }        td.find('.arrow').hide();        if (!$.browser.msie) {            td.find('.submenu').css('display', 'block').width(width)                    .find('.overlay').fadeTo(0, 0.3).fadeTo(500, 0.9).end()                    .find('ul').fadeTo(500, 1, function() {            });        } else {            $('.ie_shadow', this).show();            td.find('.submenu').css('display', 'block').width(width)                    .find('.overlay').fadeTo(0, 0.9).end()                    .find('ul').fadeTo(0, 1);        }    }, function() {        $('.ie_shadow', this).hide();        var td = $(this).closest('td');        td.removeClass('hover').removeClass('last_hover');        td.find('.submenu .overlay').stop(true).fadeTo(0, 0);        td.find('.submenu .ul').stop(true).fadeTo(0, 0);        td.find('.submenu').css('display', 'none');        td.find('.arrow').show();    });});
