var buttonCart = null;

function addToCartExecute() {
	if (buttonCart != null) {
		posDiv()
		document.getElementById("divMessageBox").style.display = "block";
		setTimeout(hDiv, 3000);
	}
}

function addToCartCalling(obj) {
	buttonCart = obj;
}

function hDiv() {
	document.getElementById("divMessageBox").style.display = "none";
}


function posDiv() {
	if (buttonCart != null) {
		var asse_x = getX(buttonCart);
		var asse_y = getY(buttonCart);
		document.getElementById("divMessageBox").style.left = (asse_x - 110) + "px";
		document.getElementById("divMessageBox").style.top = (asse_y - 36) + "px";
	}
}

function getY(oElement) {
	var iReturnValue = 0;
	while (oElement != null) {
		iReturnValue += oElement.offsetTop;
		oElement = oElement.offsetParent;
	}
	return iReturnValue;
}

function getX(oElement) {
	var iReturnValue = 0;
	while (oElement != null) {
		iReturnValue += oElement.offsetLeft;
		oElement = oElement.offsetParent;
	}
	return iReturnValue;
}

/*Show hide*/
function findElementById( elementId )
{
	var theElement = null;
	try
	{
		if( document.getElementById )
			theElement = document.getElementById( elementId );
		else
			theElement = document.all[ elementId ];
	}
	catch( e )
	{
		theElement = null;
	}
	return theElement;
}


function showTab(id)
{
	findElementById("box_" + id).style.display = "block";
	findElementById("tab_" + id).className = ( id == "comment" ? "on last" : "on" );
	findElementById("tab_" + id).blur();
}

function hideTab(id)
{
	findElementById("box_" + id).style.display = "none";
	findElementById("tab_" + id).className = ( id == "comment" ? "off last" : "off" );
}



