function fnAlert(strContainerDivId,strImageDivId)
{
	try{
	var oUpDownImageDiv = document.getElementById(strImageDivId);
	
	var oDivAreaContainer =  document.getElementById(strContainerDivId); 
	
	if(oDivAreaContainer != null)
	{
		var intHeight = oDivAreaContainer.scrollHeight;
		var documentHeight = document.body.clientHeight;
		var reducePixels = 0;
		var finalHeight=0;
		
		if(strContainerDivId == 'divListAreaContainer')
		{
			switch(documentHeight)
			{
				case 589: reducePixels = 210; break;
				case 685: reducePixels = 210; break;
				case 845: reducePixels = 515;  break;
				case 871: reducePixels = 515;  break;
			}			
			finalHeight=documentHeight - reducePixels;
			//document.title = documentHeight+","+intHeight +","+finalHeight;
		}
		else if(strContainerDivId == 'divDetailAreaContainer')
		{
			switch(documentHeight)
			{
				case 589: reducePixels = 210; break;
				case 685: reducePixels = 215; break;
				case 845: reducePixels = 215;  break;
				case 871: reducePixels = 215;  break;
			}
			finalHeight=documentHeight - reducePixels;
			//document.title = documentHeight+","+intHeight +","+finalHeight;
		}
				
		if(parseInt(intHeight,10) > parseInt(finalHeight,10))
		{				
			oUpDownImageDiv.style.display = ''; 	
		}
	}
	}
	catch(ex)
	{
		alert('fnAlert');
	}
}

function fnSetScrollTopForListDetailArea(intListScrollTop,intDetailScrollTop)
{
	document.getElementById('divListAreaContainer').scrollTop = intListScrollTop;
	document.getElementById('divDetailAreaContainer').scrollTop = intDetailScrollTop;
}
					
function fnPreserveScrollbarPosition(strListAreaCnt,strDetailAreaCnt)
{
	try
	{
		if(typeof(strListAreaCnt) != 'undefined' && strListAreaCnt != '')
			document.getElementById('hdnListDivScrollTop').value= document.getElementById(strListAreaCnt).scrollTop;
		else
			document.getElementById('hdnListDivScrollTop').value=0;
		
		if(typeof(strDetailAreaCnt) != 'undefined' && strDetailAreaCnt != '')
			document.getElementById('hdnDetailDivScrollTop').value= document.getElementById(strDetailAreaCnt).scrollTop;
		else
			document.getElementById('hdnDetailDivScrollTop').value = 0;
	}
	catch(ex)
	{
	}
}

function fnScrollDivWithMouseWheel(strId)
{
    if (event.wheelDelta >= 120)
        fnScrollDiv(strId,'UP')
    else if (event.wheelDelta <= -120)
        fnScrollDiv(strId,'DOWN')  
}

function fnScrollDiv(strElemenId,strAction)
{
    switch(strAction)
    {
        case 'UP':
        eval("document.all." + strElemenId + ".doScroll('up');");
        break;
        
        case 'DOWN':
        eval("document.all." + strElemenId + ".doScroll('down');");
        break;        
    }    
}
	
function fnSetSubmenuTopPosition()
{
	try
	{
	var oMainMenuDiv = document.all.divMainMenu;
	var oSubMenuDiv = document.all.divSubMenu;
	if(oMainMenuDiv)
	{
		if(oSubMenuDiv)
			oSubMenuDiv.style.top = GetOffsetTop(oMainMenuDiv) + 22 ;
	}
	}
	catch(ex)
	{
		alert('fnSetSubmenuTopPosition');
	}
}	

function getposOffset(what, offsettype)
{
	var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
	var parentEl=what.offsetParent;
	while (parentEl!=null)
	{
		totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
		parentEl=parentEl.offsetParent;
	}
return totaloffset;
}

function fnSetSubmenuLeftPosition()
{
	try
	{
	var oSubMenu = document.getElementById("divSubmenu");
	var oLink = null;
	var intLeft = 0;
	
	if(document.getElementById("hd_Nieuws")) 
	{
		oLink = document.getElementById("a_Actueel");
		intLeft = getposOffset(oLink,'left') - 85;		
		oSubMenu.style.left = intLeft + "px";
	}
	}
	catch(ex)
	{
		alert('fnSetSubmenuLeftPosition');
	}
	
}

function GetOffsetTop(oEl) 
{
	var iTop = oEl.offsetTop;
	while((oEl = oEl.offsetParent) != null)
		iTop += oEl.offsetTop;
	return iTop;
}


var gbStopScroll=true;

function ScrollDown(Id){
  gbStopScroll=false;

if(Id == "divDetailAreaContainer")
{
  DoScrollDetail(3,Id);
}
else
{
DoScroll(3,Id);
}
}

function ScrollUp(Id){
  gbStopScroll=false;
if(Id == "divDetailAreaContainer")
{
  DoScrollDetail(-3,Id);
}
else
{
DoScroll(-3,Id);
}
}

function DoScroll(Increment, Id){

  var loDiv=document.all(Id);
  var liCurrentScrollTop=loDiv.scrollTop;
  loDiv.scrollTop+=Increment;
  if(!gbStopScroll && (divListAreaContainer.scrollTop == liCurrentScrollTop + Increment))
{
   setTimeout("DoScroll(" + Increment + ",\"" + Id + "\");", 10);
 }
}

function DoScrollDetail(Increment, Id){

  var loDiv=document.all(Id);
  var liCurrentScrollTop=loDiv.scrollTop;
  loDiv.scrollTop+=Increment;
  if(!gbStopScroll && (divDetailAreaContainer.scrollTop == liCurrentScrollTop + Increment))
{
   setTimeout("DoScrollDetail(" + Increment + ",\"" + Id + "\");", 10);
 }
}

function StopScroll(){
 gbStopScroll=true;
}
