// JavaScript Document

var ElementUtil = new Object();
ElementUtil.getElementPosition = function(elt){
	//alert(elt);
  var position = new Object();    
  if(elt.style.position == "absolute") {
	position.left = parseInt(elt.style.left);
	position.top = parseInt(elt.style.top);
  }
  else {
	position.left = ElementUtil.calcPosition(elt, "Left");      
	position.top = ElementUtil.calcPosition(elt, "Top");      
  }  
  return position;
}

ElementUtil.calcPosition = function(elt, dir){
	var tmpElt = elt;
	var pos = parseInt(tmpElt["offset" + dir]);
	while(tmpElt.tagName != "HTML" && tmpElt.tagName != "BODY") {
		tmpElt = tmpElt.offsetParent;
		pos += parseInt(tmpElt["offset" + dir]);
	}
	return pos;
}

ElementUtil.getElementDimension = function(elt) {
  var dim = new Object();
  dim.width = elt.offsetWidth;
  dim.height = elt.offsetHeight;
  return dim;
}

function setLeftTop(div_id) {
	document.getElementById(div_id).style.left = '10px';
	document.getElementById(div_id).style.top = '20px';
}
function hideCombos() {
	document.frmGo.comboWishList.style.visibility="hidden";
	document.frmGo.comboDisplay.style.visibility="hidden";
	document.frmGo.comboSortBy.style.visibility="hidden";	
}
function showCombos() {
	document.frmGo.comboWishList.style.visibility="visible";
	document.frmGo.comboDisplay.style.visibility="visible";
	document.frmGo.comboSortBy.style.visibility="visible";	
}
function hideFirstCombo(){
	if (document.getElementById('comboFeeling1')) {
		document.getElementById('comboFeeling1').style.visibility = 'hidden';
	} else if (document.getElementById('comboFeelingD1')) {
		document.getElementById('comboFeelingD1').style.visibility = 'hidden';
	}
}
function showFirstCombo(){
	if (document.getElementById('comboFeeling1')) {
		document.getElementById('comboFeeling1').style.visibility = 'visible';
	} else if (document.getElementById('comboFeelingD1')) {
		document.getElementById('comboFeelingD1').style.visibility = 'visible';
	}
}
