	function addLoadEvent(func) { 
	  //alert('added: '+func);
	  var oldonload = window.onload; 
	  if (typeof window.onload != 'function') { 
	    window.onload = func; 
	  } else { 
	    window.onload = function() { 
	      if (oldonload) { 
	        oldonload(); 
	      } 
	      func(); 
	    } 
	  } 
	} 

	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;
	}

	function showSearchPopup(vElement)
	{
	document.getElementById('searchPopup').style.top=(getY(vElement))+(vElement.offsetHeight)+4+"px";
	document.getElementById('searchPopup').style.left=(getX(vElement)-68+(vElement.offsetWidth/2))+"px";
	document.getElementById('searchPopup').innerHTML='<span style="color:black;font-size:11px;">Type in a search query<br><span style="color:rgb(100,100,100);font-size:10px;">search runs automatically</span></span>';
	document.getElementById('searchPopup').style.display='block';
	}

	function hideSearchPopup()
	{
	document.getElementById('searchPopup').style.display='none';
	}

	function showFeaturePopup(vElement,vName,vType)
	{
	document.getElementById('featurePopup').style.top=(getY(vElement))+(vElement.offsetHeight)-3+"px";
	document.getElementById('featurePopup').style.left=(getX(vElement)-68+(vElement.offsetWidth/2))+"px";
	document.getElementById('featurePopup').innerHTML='<span style="color:black;font-size:11px;">' + vName + '<br><span style="color:rgb(100,100,100);font-size:10px;">' + vType + '</span></span>';
	document.getElementById('featurePopup').style.display='block';
	}

	function hideFeaturePopup()
	{
	document.getElementById('featurePopup').style.display='none';
	}
	
	function showProductInfo(vElement,vName,vDescription,vType)
	{
	document.getElementById('productPopupBig').style.top=(getY(vElement))-67+"px";
	document.getElementById('productPopupBig').style.left=(getX(vElement))-10+"px";
	document.getElementById('productPopupBig').innerHTML='<span style="color:black;font-size:13px;">' + vName + '<br><span class="smallText" style="padding-top:20px;">' + vType + '</span><br><div style="margin-left:180px;">' + vDescription + '</div></span>';
	document.getElementById('productPopupBig').style.display='block';
	}

	function hideProductInfo()
	{
	document.getElementById('productPopupBig').style.display='none';
	}

	function getInternetExplorerVersion() {
		var rv = -1; // Return value assumes failure.
		if (navigator.appName == 'Microsoft Internet Explorer') {
			var ua = navigator.userAgent;
			var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
			if (re.exec(ua) != null)
				rv = parseFloat(RegExp.$1);
		}
		return rv;
	}

	var IEVer = getInternetExplorerVersion();

var vSessionRefresh=60000;

function registerUserLocation()
{
	if (window.XMLHttpRequest){xmlhttp=new XMLHttpRequest();} else {xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
	xmlhttp.onreadystatechange=function()
	  {
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
		if (xmlhttp.responseText!='')
			{}
		}
	  }
	xmlhttp.open("POST","/_ajaxRegisterUserLocation.asp",true);
	xmlhttp.send();
}
addLoadEvent(function(){registerUserLocation();});

function refreshSession()
{
if (window.XMLHttpRequest){xmlhttp=new XMLHttpRequest();} else {xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
xmlhttp.onreadystatechange=function(){if (xmlhttp.readyState==4 && xmlhttp.status==200){}}
xmlhttp.open("POST","/_ajaxRefreshSession.asp?" + Math.random(),true);
xmlhttp.send();
setTimeout('refreshSession()',vSessionRefresh);
}
addLoadEvent(function(){setTimeout('refreshSession()',vSessionRefresh);});

function setOpacity(el, value) 
{
value = Math.min(1, Math.max(value, 0));// ensure value is in [0-1] range
// set opacity or filter alpha depending on what's supported
	el.style.opacity = value;
	el.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(Opacity=' + (value * 100) + ')';
	el.style.filter = 'alpha(opacity=' + (value * 100) + ')';
}

