function add_to_cart(id,action,table) {
	
	quant = document.getElementById('quant'+id).value;
	
	if (!action) action = 0;
	
	link = 'http://www.btkmetal.ru/products/?id='+id+'&quant='+quant+'&action='+action+'&table='+table;
	
	id = 'priceRequestGetMessage';
	
	wait = '<div style="text-align:center"><strong>Подождите, идет загрузка</strong><br /><br /><img alt="loading..." title="подождите, идет загрузка данных..." src="http://www.btkmetal.ru/img/process_bar.gif" /></div>';
	
	document.getElementById('priceRequestMessage').style.display = '';
	document.getElementById('priceRequestGetMessage').innerHTML = wait;
	
	sendPriceRequestGet(id,link)
	
}

function sendPriceRequestGet(id,link) {

	var oXmlHttp = zXmlHttp.createRequest();
    oXmlHttp.open("get", link, true);
    oXmlHttp.onreadystatechange = function () {
		if (oXmlHttp.readyState == 4) {
			if (oXmlHttp.status == 200) {
				priceLayOut(id, oXmlHttp.responseText);
			} else {
				priceLayOut(id, "An error occurred: " + oXmlHttp.statusText); //statusText is not always accurate
			}
		 }            
     };
     oXmlHttp.send(null);

}


function priceLayOut(id, sText) {
	
	button = '<div align="center" style="padding-top:5px;"><a href="javascript:hideShow(\'priceRequestMessage\',\'\');" title="Закрыть ообщение" class="button">OK</a></div>';
	
	res = document.getElementById(id);
		
	res.innerHTML = sText+button;
   
}

function priceSubmit() {
	
	name = document.getElementById('name').value;
	org = document.getElementById('org').value;
	tel = document.getElementById('tel').value;
	
	if (!name || !org || !tel) {
		alert('Не все поля заполнены!');
	} else {
		document.price.submit();
	}
	
}