	function cbBasketAdd(ajax){
//		alert('yo');
		var basket = ajax.SelectSingleNode('Connector/Basket');
//		alert(basket);
		if(basket){																					   
//			alert(basket.attributes.getNamedItem('count').value);
			if(basket.attributes.getNamedItem('count').value > 0){
//				alert(document.getElementById('basket_info').innerHTML);
				var str = '<table style="font-size:1.2em"><tr><td align="center"><img src="/images/basket.jpg"></td><td align="right">Товаров:<br><br>На&nbsp;сумму:</td><td align="left"><strong><div id="count" style="display:inline">'+ basket.attributes.getNamedItem('count').value+'</div></strong><br><br>';
				if(!basket.attributes.getNamedItem('noprice').value)
					str += '<strong><div id="price" style="display:inline">'+basket.attributes.getNamedItem('price').value+'</div>&nbsp;руб.</strong>';
				else
					str += '<span style="color:#0b0;font-size:120%;font-weight:bold">call</span>';
				str += '</td></tr></table><div style="text-align:center; font-size:1.1em;"><a href="/basket/">Посмотреть/Оформить заказ</a></div>';				
				document.getElementById('basket_info').innerHTML = str;
				if(basket.attributes.getNamedItem('count').value == 1){
					document.getElementById('bb').style.color='#f00'; //#ef8000
					document.getElementById('bb').style.fontSize='1.8em'; //#ef8000
					var to=200;
					setTimeout("document.getElementById(\'bb\').style.color=\'#ef8000\';",to);
					setTimeout("document.getElementById(\'bb\').style.fontSize=\'1.6em\';",to);
					setTimeout("document.getElementById(\'bb\').style.color=\'#f00\';",to*2);
					setTimeout("document.getElementById(\'bb\').style.fontSize=\'1.8em\';",to*2);
					setTimeout("document.getElementById(\'bb\').style.color=\'#ef8000\';",to*3);
					setTimeout("document.getElementById(\'bb\').style.fontSize=\'1.6em\';",to*3);
					 //#ef8000
				}
			}else
				document.getElementById('basket_info').innerHTML = '<table style="font-size:1.2em"><tr><td align="center"><img src="/images/basket.jpg"></td><td align="center">Ваша корзина пуста</td></tr></table>';
		}
	}
	function addToBasket(id){
		var ajax = new AJAX();
		ajax.LoadUrl('/basket/add.html?addtobasket=' + id, cbBasketAdd);
	}
	
	function cbBasketSetSize(ajax){
		var basket = ajax.SelectSingleNode('Connector/Basket');
		if(basket){}
	}

	function setSize(num, size_id){
		var ajax = new AJAX();
		ajax.LoadUrl('/basket/setsize.html?num=' + num + '&sizeid=' + size_id, cbBasketSetSize);
	}

	function filterSubmit(){
		var link = '';
		var vendor = document.getElementById('vendorSelect').value;		
//		vendor=vendor.replace(' ','_');
		var minp =  document.getElementById('minprice').value;
		var maxp =  document.getElementById('maxprice').value;
		if(vendor != 'all') link = '/vendor/' + vendor;
		if(minp > 0) link = link + '/minp/' + minp;
		if(maxp > 0) link = link + '/maxp/' + maxp;
		var loc = window.location.pathname;
		//alert(window.location.pathname);
		//var arr = /^(.*?)(\/vendor\/.*?)?(\/minp\/.*?)?(\/maxp\/.*?)?.*$/.exec(window.location.pathname);
		loc = loc.replace(/\/vendor\/[^\/]+/, "");
		loc = loc.replace(/\/minp\/[^\/]+/, "");
		loc = loc.replace(/\/maxp\/[^\/]+/, "");
		loc = window.location.protocol + '//' + window.location.host + loc + link;
		//alert(loc);
		window.location = loc;
		return false;
	}

