var qfTimerId = null;
var prevElement;
var prefClassName;


function showQuickFinder(onFlash)
{
		clearTimeout(qfTimerId);
		document.getElementById("qfContainer").style.display = "block";

		if (onFlash != null && onFlash == true)
		{
			document.getElementById("qfContainer").className = "noPrint qfContainerFlashTop qfContainerFlashLeft";
		}
		else
		{
			document.getElementById("qfContainer").className = "noPrint qfContainerTop qfContainerLeft";
		}

		document.body.style.cursor = 'default';
}

function quickFinderIn()
{
	clearTimeout(qfTimerId);
}

function quickFinderOut()
{
	qfTimerId = setTimeout("hideQuickFinder()", 300);
}

function hideQuickFinder()
{
	document.getElementById("qfContainer").style.display = "none";
	qfTimerId = null;
	clearCount = 0;
}

function findPosition( oElement ) {
  if( typeof( oElement.offsetParent ) != 'undefined' ) {
    for( var posX = 0, posY = 0; oElement; oElement = oElement.offsetParent ) {
      posX += oElement.offsetLeft;
      posY += oElement.offsetTop;
    }
    return [ posX, posY ];
  } else {
    return [ oElement.x, oElement.y ];
  }
}

function showList(element, isCategory)
{
	if (prevElement && document.getElementById(prevElement.id + "ProdList") && document.getElementById(prevElement.id))
	{
		document.getElementById(prevElement.id + "ProdList").style.display = "none";
		prevElement.className=prevClassName;
	}

	document.getElementById(element.id + "ProdList").style.display = "block";
	prevClassName = element.className;

	if (isCategory == true)
	{
		element.className='qfElementCatArrow';
	}
	else
	{
		element.className='qfElementArrow';
	}

	prevElement = element;
}
