<!--
function ConfirmButton(msg,objform) {
	if(confirm(msg)) {
		//alert(objform);
		objform.submit();
	}
}
function HideOpen(obj){
	if(refobj(obj).style.display == '' || refobj(obj).style.display == 'inline'){
		refobj(obj).style.display = 'none';
	}else{
		refobj(obj).style.display = 'inline';

	}
}

var TID = "";
var SEC = 5;

function sendToCart(id,price,sale) {
	terminateCart();
	
	var req = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
	req.onreadystatechange = function() {
		if (req.readyState == 4) {
			sety = getY(-50);
			setx = getX(-80);
			if(sety < 100){
				sety = 220;
			}

			if(req.responseText == ''){
				refobj('msgCart').innerHTML = "Этот товар уже добавлен ранее!";
			}else{
				expStr = req.responseText.split('-');
				refobj('ordersum').innerHTML = expStr[0];
				refobj('numproducts').innerHTML = expStr[1];
				//refobj('cartpic').src = '/images/cart_full.gif';
				
			}
			refobj('carttable').style.left = setx + "px";
			refobj('carttable').style.top = sety + "px";
			refobj('carttable').style.position = "absolute";
			refobj('carttable').style.display = "inline";
			TID = window.setTimeout("timer()", 1000);
			//alert(req.responseText);

		}
	}
	req.open("POST",'/.modules/cart/', true);
	req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	req.send('id='+id+'&price='+price+'&sale='+sale);
}



function refobj(object){
	if (document.getElementById){
		if (document.getElementById(object)) {
			return document.getElementById(object);
		} else {
			return false;
		}
	}else if (document.all){
		return eval('document.all.' + object);
	}else if (document.layers){
		return eval('document.layers[' + object+']');
	}else{
		return false;
	}
}


function toggle_off(object){
	object = refobj(object);
	if ( !object.style ){
		return false;
	}
	object.style.display = 'none';
}

function toggle_on(object){
	object = refobj(object);
	if ( !object.style ){
		return false;
	}
	object.style.display = 'inline';
}

function timer(){
	SEC = SEC - 1;
	if (SEC <= 0) {
		clearTimeout(TID);
		closeCartBox();
	} else {
		window.refobj("seconds").innerHTML = SEC;
		TID = window.setTimeout("timer()", 1000);
	}
}

function closeCartBox(){
	SEC = 6;
	toggle_off('carttable');
}

function terminateCart(){
	clearTimeout(TID);
	closeCartBox();
}


function getX(displacement){
	return getWindowWidth()/2 + displacement + getBodyScrollLeft();
}
function getY(displacement){
	return getWindowHeight()/2 + displacement + getBodyScrollTop();
}

function getBodyScrollTop(){
	return self.pageYOffset ||
	(document.documentElement && document.documentElement.scrollTop) ||
	(document.body && document.body.scrollTop);
}
function getBodyScrollLeft(){
	return self.pageXOffset ||
	(document.documentElement && document.documentElement.scrollLeft) ||
	(document.body && document.body.scrollLeft);
}
function getWindowHeight(){
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}
function getWindowWidth() {
	var windowWidth = 0;
	if (typeof(window.innerWidth) == 'number') {
		windowWidth = window.innerWidth;
	}
	else {
		if (document.documentElement && document.documentElement.clientWidth) {
			windowWidth = document.documentElement.clientWidth;
		}
		else {
			if (document.body && document.body.clientWidth) {
				windowWidth = document.body.clientWidth;
			}
		}
	}
	return windowWidth;
}

var subitem = new Array();
function show(Id) {
	node = document.getElementById('node'+Id);
	node.style.display = 'inline';
	
	for(var field in subitem){
			if (field != ('node'+Id)){
				document.getElementById(field).style.display = 'none';
				an_id = subitem.pop();
			}
	}
	if(subitem['node'+Id] != 1 && node != 'undefined'){
		subitem['node'+Id] = 1;
	}else{
		subitem.push(node.id);
	}
}
-->