	nn4 = (document.layers)? true : false;
	ie4 = (document.all)? true : false;
	nn6 = (document.getElementById && !ie4)? true : false;


function getPosition() {
    e = window.event;
    var cursor = {x:0, y:0};
    if (e.pageX || e.pageY) {
        cursor.x = e.pageX;
        cursor.y = e.pageY;
    } 
    else {
        var de = document.documentElement;
        var b = document.body;
        cursor.x = e.clientX + 
            (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
        cursor.y = e.clientY + 
            (de.scrollTop || b.scrollTop) - (de.clientTop || 0);
    }
    return cursor;
}


function setItem(k,q)
{
	//showAlert();
	document.getElementById('imgpost').src='s.php?key='+k+'&q='+q;
//	if (q>0)
		alert('Товар успешно добавлен в корзину.');
//	else
//		alert('Товар удален из корзины.');
//	if(confirm('Товар успешно добавлен в корзину. Для того чтобы перейти к оформлению нажмите "ОК"')){
//		self.setTimeout('self.location=\'index.php?id=6447\'', 100);
//	}
}

function setItemR(k,q)
{
	document.all['imgpost'].src='s.php?key='+k+'&q='+q;
	self.setTimeout('self.location=\'index.php?id=6447&m=0\'', 100);
}

function setItem2(k,q)
{
	document.all['imgpost'].src='s.php?key='+k+'&q='+q;
	self.setTimeout('self.location=\'index.php?id=6447&m=1\'', 100);
}

function goBas() {
	self.location='index.php?id=6447&m=0';
}

function setItem3(k)
{
	if (!document.all['i'+k].checked){
		document.all['imgpost'].src='s.php?key='+k;
		alert('Товар успешно добавлен в корзину. Пожалуйста, перейдите в корзину для оформления заказа.');
	}
}


