	function updateCart()
	{	
		var cart_td=document.getElementById('cart');
		if(document.cookie.indexOf('Caps')!=-1)
		{
			fillCart();	
			cart_td.setAttribute('valign', 'bottom');
			cart_td.setAttribute('align', 'right');
		}
		else
		{
			cart_td.innerHTML ='<td width="640" id="cart" ><p id="phone">(495) <span class="big">676 01 04</span> / с 9 до 19 по московскому времени</p></td>';
			cart_td.setAttribute('valign', '');
			cart_td.setAttribute('align', '');
				  
		}

	}
	


//---------------------- Создаем объект xmlhttp request -------------------
var xmlHttp;
 
function getXmlHttp(){
    var xmlhttp;
    try {
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
        try {
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (E) {
            xmlhttp = false;
        }
    }
 
    if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
	{
        xmlhttp = new XMLHttpRequest();
    }
    return xmlhttp;
}
//-------------------------------------------------------------------------

//------------------ Отсылаем запрос на сервер ----------------------------
function fillCart() 
{
	 xmlhttp = getXmlHttp();     
       
    if (typeof(xmlhttp)=='object') 
	{   		
        xmlhttp.onreadystatechange=xmlhttpResults;
		var url='./include/cartClass.php';
		if(navigator.userAgent.indexOf('Opera')!=-1 && document.location!='http://'+document.domain+'/') 
			{
					url='.'+url;
			}

		xmlhttp.open('GET', url, true);
		xmlhttp.send(null);
	}
	else
	{
        alert('Your browser is not remote scripting enabled.');
    }
}

//-------------------------------------------------------------------------


//------------- Принимает ответ от сервера и выводим результат ------------

function xmlhttpResults() 
{	
	var str;
    if (xmlhttp.readyState==4)
	{ 	
    	if (xmlhttp.status==200) 
		{	
        	str=xmlhttp.responseText;
			
			document.getElementById('cart').innerHTML=str;
        }
    }
}

//-------------------------------------------------------------------------

function saveOrder(ind)
{	
	var form=document.getElementById('solarcap');
	var valCookie='';
	for(i=0;i<form.length;i++)
	{
		if(form[i].className=='qty') valCookie +=';'+form[i].id+','+parseFloat(form[i].value);
	}
	valCookie=valCookie.substr(1, valCookie.length);
	form['saveThis'].value=valCookie;
	if(ind==1)
	form['back'].value=1;
}

