<!--
/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Saul Salvatierra :: http://myarea.com.sapo.pt
with help from Ultimater :: http://ultimiacian.tripod.com  */

var theObj="";

function toolTip(prodName,prodDescr,me,itens) {
  theObj=me;
  theObj.onmousemove=updatePos;
  if(itens == "2"){
  	document.getElementById('toolTipBox').innerHTML= "<div id=\"tt_content\"><dt>" + prodName + "</dt><dd>" + prodDescr + "</dd></div><span id=\"tt_bottom\"></span>";
  } else {
	  document.getElementById('toolTipBox').innerHTML= "<div id=\"tt_content\"><dd style=\"padding-top:10px;\">" + prodDescr + "</dd></div><span id=\"tt_bottom\"></span>";
  }
  document.getElementById('toolTipBox').style.top = -500;
  document.getElementById('toolTipBox').style.display="block";
  window.onscroll=updatePos;
}

function updatePos() {
	
	var ev=arguments[0]?arguments[0]:event;
	var x=ev.clientX;
  
	if (x > 800){ 
		document.getElementById('toolTipBox').style.marginLeft = '-160px';
		document.getElementById('tt_bottom').style.backgroundRepeat = 'no-repeat';
		document.getElementById('tt_bottom').style.backgroundPosition = '160px -2px';
		} else {
			document.getElementById('toolTipBox').style.marginLeft = '-10px';
			document.getElementById('tt_bottom').style.backgroundRepeat = 'no-repeat';
			document.getElementById('tt_bottom').style.backgroundPosition = '10px -2px';
			}
  
	var y=ev.clientY;	
	
	var divHeight = document.getElementById('toolTipBox').offsetHeight;
	diffX=-15;
	diffY=-(divHeight - document.documentElement.scrollTop);
	document.getElementById('toolTipBox').style.top  = y-5+diffY+(document.body.scrollTop)+ "px";
	document.getElementById('toolTipBox').style.left = x-2+diffX+document.body.scrollLeft+"px";
	theObj.onmouseout=hideMe;
}

function hideMe() {
  document.getElementById('toolTipBox').style.display="none";
}

// ===========================================================================
// FUNCTION TO POSITION PRODUCTS ELEMENTS ON PRODUCT SELECTOR
// ===========================================================================

function toggleProd(id,state,mgTop){

	if(state == 'show'){
		document.getElementById(id).style.display = 'block'
		document.getElementById('nav_cat').style.left = "221px";
		document.getElementById('nav_cat').style.marginTop = mgTop;
		} else {
			document.getElementById(id).style.display = 'none'
			}
}

// ===========================================================================
// FUNCTION....
// ===========================================================================

function setNavSection(divId,spanId,sectionId,text,origText){
	document.getElementById(divId).style.backgroundColor = '#8375C4';
	document.getElementById(divId).style.backgroundImage = 'url(images/illustrations/close_nav_section.gif)';
	document.getElementById(spanId).innerHTML = text;
	document.getElementById(sectionId).href = 'javascript:closeNavSection("' + divId + '","' + spanId + '","' + sectionId + '","' + origText + '");';
	document.getElementById('cat_looking').style.visibility = 'hidden';
	
}

function closeNavSection(divId,spanId,sectionId,text){

	document.getElementById(divId).style.backgroundColor = '#6D509A';
	document.getElementById(divId).style.backgroundImage = 'url(images/illustrations/arrow_nav_section.gif)';
	document.getElementById(spanId).innerHTML = text;
	document.getElementById(sectionId).href = 'javascript:void(0);';
	document.getElementById('cat_looking').style.visibility = 'visible';
}

// TOOL TIP FOR BUY BOX
var theObj="";


/*
function buyBox(me){
	theObj=me;
	document.getElementById('buyBox').style.display = 'block';
	theObj.onmouseout=closeBox;
}
*/

function buyBox(me,boxTop,boxLeft)
{
	buyBoxDiv = document.getElementById('buyBox');

	buyBoxDiv.style.left = boxLeft + "px";
	buyBoxDiv.style.top = boxTop + "px";

	theObj = me;
	buyBoxDiv.style.display = 'block';
	
	theObj.onmouseout = closeBox;
}

function show90210Tip(me)
{
	tipDiv = 	document.getElementById('tip');
	tipDiv.style.display = 'block';
	
	theObj = me;
	theObj.onmouseout = closeTip;
}

function closeTip()
{
	document.getElementById('tip').style.display = 'none';
}

function closeBox(){
	document.getElementById('buyBox').style.display = 'none';
}
-->
