﻿// objElement: The name of the object to show the hint over
// strHint:    The hint text
function fInitHints(strElement, strHint)
{
	 objElement = document.getElementById(strElement);
	 objElement.href="Javascript:void(null);"

   objElement.innerHTML = objElement.innerHTML + '<span id="' + strElement+ 'Info" style="display:none;position:absolute;top:20px;left:10px;width:292px;border:1px solid #000000;background-color:#FFFFFF;color:#000;text-align: center;z-index:26;"><iframe id="ifInfo' + objElement.id + '"scrolling="auto" width="290" height="100"></iframe></span>';
   f = document.getElementById('ifInfo' + objElement.id);
   f.contentWindow.document.write('<html><body>' + strHint  + '</body></html>');
   f.contentWindow.document.close();

   return true;
}

function fCleanHelp()
{
    if ((window.event.srcElement.id.indexOf('imgHelp') == -1) && (strElem != ''))
    {
	     objElement = document.getElementById(strElem+'Info');
	     objAbtElement = document.getElementById(strAbtElement);
         if ((objElement.style.display == 'inline'))
	        objElement.style.display = 'none';
    }
}

var lastOpenHint = null
var strElem = '';
var strAbtElement = '';

function fFlipHint(strElement,strAboutElement)
{
    strAbtElement = strAboutElement
    strElem = strElement
    var popup    = false;
    var flipleft = false;
    var intLeftOffset = 0;

	 objElement = document.getElementById(strElement+'Info');
	 objAbtElement = document.getElementById(strAboutElement);

//document.body.scrollHeight

		if ((popup) && (flipleft))
			objElement.className = 'infoleftup';

		if (objElement.style.display == 'inline')
		{
			 objElement.style.display = 'none';
	         objElement = '';
	         objAbtElement = '';
		}
		else
		{
			if (lastOpenHint != null)
				lastOpenHint.style.display = 'none';
				
			if (objAbtElement.id.indexOf('lbl') != -1)
				intLeftOffset = objAbtElement.offsetLeft
			else
				intLeftOffset = objAbtElement.offsetLeft-11

			objElement.style.left = intLeftOffset;

			if (parseInt(getTopPos(objAbtElement))+122 > objBrowserSpecs.InnerHeight)
				objElement.style.top = objAbtElement.offsetTop-objAbtElement.offsetHeight-90;
			else
				objElement.style.top = objAbtElement.offsetTop+objAbtElement.offsetHeight-9;

			objElement.style.display = 'inline';
			lastOpenHint = objElement;
		}
}

function getTopPos(inputObj)
{
	var returnValue = inputObj.offsetTop;
  while((inputObj = inputObj.offsetParent) != null)
		returnValue += inputObj.offsetTop;
	return returnValue;
}

function GetSize()
{
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' )
  {
    //Non-IE
    objBrowserSpecs.InnerWidth = window.innerWidth;
    objBrowserSpecs.InnerHeight = window.innerHeight;
  } 
  else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
  {
    //IE 6+ in 'standards compliant mode'
    objBrowserSpecs.InnerWidth = document.documentElement.clientWidth;
    objBrowserSpecs.InnerHeight = document.documentElement.clientHeight;
  } 
  else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    objBrowserSpecs.InnerWidth = document.body.clientWidth;
    objBrowserSpecs.InnerHeight = document.body.clientHeight;
  }
}

function BrowserSpecs(intSW, intSH, intIW, intIH)
{
	this.InnerWidth = intIW;
	this.InnerHeight = intIH;
}


objBrowserSpecs = new BrowserSpecs(0,0,0,0);
GetSize()
