







function add_to_cart_double(idgoods) {
	var idp = $('#id_products'+idgoods).val();
	var idm = $('#idmat'+idgoods).val();
	
//	alert (idp+' ' +idm);
	
/*	*/	
	$('#spinner').show();
	data = {
		id_products: idp,
		id_material: idm,
	};
	$.post('/catalog/scr_double.php', data, function(out){
		var count = out.count;
		var price = out.price;
		if(count>0) {
			var text = 'В корзине '+count+' товаров';
			NewWind('/basket/popup2.php?id='+idgoods);
		} 
/*	*/	
		else {
			var text = 'Ваша корзина пуста';			
		}
		
		$('#cart_info').text(text);
		$('#spinner'+idgoods).hide();
		$('#readytext'+idgoods).text(text);
		$('#readytext'+idgoods).show();

	}, "json");
		
	return false;

} // End of add_to_cart



function markAllRows( container_id ) {
    var rows = document.getElementById(container_id).getElementsByTagName('tr');
    var unique_id;
    var checkbox;

    for ( var i = 0; i < rows.length; i++ ) {

        checkbox = rows[i].getElementsByTagName( 'input' )[0];

        if ( checkbox && checkbox.type == 'checkbox' ) {
            unique_id = checkbox.name + checkbox.value;
            if ( checkbox.disabled == false ) {
                checkbox.checked = true;
                if ( typeof(marked_row[unique_id]) == 'undefined' || !marked_row[unique_id] ) {
                    rows[i].className += ' marked';
                    marked_row[unique_id] = true;
                }
            }
        }
    }

    return true;
}


function unMarkAllRows( container_id ) {
    var rows = document.getElementById(container_id).getElementsByTagName('tr');
    var unique_id;
    var checkbox;

    for ( var i = 0; i < rows.length; i++ ) {

        checkbox = rows[i].getElementsByTagName( 'input' )[0];

        if ( checkbox && checkbox.type == 'checkbox' ) {
            unique_id = checkbox.name + checkbox.value;
            checkbox.checked = false;
            rows[i].className = rows[i].className.replace(' marked', '');
            marked_row[unique_id] = false;
        }
    }

    return true;
}