var checkIt;
var currentPos;

var indepthDiv;
var indepthDivOffetTop = 0;
var theTop = 30;
var old = theTop;

window.onload = function()
{ 
	init();
	
	if ( testForObject('indepth_container', '') )
	{
		indepthDiv = document.getElementById("indepth_container");
		
		MoveIndepth();
	}
}

function OpenMenuHB(menu)
{
	if (document.getElementById(menu).style.display != "block")
	{
		document.getElementById(menu).style.display = "block";
	}
	else
	{
		document.getElementById(menu).style.display = "none";
	}
}

function init()
{
	InitMainMenu();
	
	// Init search form
	InitSearchForm();
}

function MoveIndepth()
{
	/*if (indepthDivOffetTop == 0)
	{
		indepthDivOffetTop = indepthDiv.offsetTop;
	}
		
	if (window.innerHeight)
	{
		  pos = window.pageYOffset
	}
	else if (document.documentElement && document.documentElement.scrollTop)
	{
		pos = document.documentElement.scrollTop
	}
	else if (document.body)
	{
		  pos = document.body.scrollTop
	}
	
	if (pos > indepthDivOffetTop)
	{
		indepthDiv.style.marginTop = pos - indepthDivOffetTop + 20 + "px";
	}
	else
	{
		indepthDiv.style.marginTop = 10 + "px";
		indepthDivOffetTop = 0;
	}

	old = pos;*/
	
	temp = setTimeout('MoveIndepth()',100);
}

function testForObject(Id, Tag)
{
  var o = document.getElementById(Id);
  if (o)
  {
    if (Tag)
    {
      if (o.tagName.toLowerCase() == Tag.toLowerCase())
      {
        return o;
      }
    }
    else
    {
      return o;
    }
  }
  return null;
}