var alertwindow=0;


function alertbg()
{
	var favHeight = document.getElementById('favBg');
	favHeight.style.height = pHeight() + 'px';
	

}


function alertremoveshow(text,oklocation) {
	alertokshow('Weet u zeker dat u '+text+' wilt verwijderen?',"document.location.href='"+oklocation+"';");
}

function alertokshow(text,okaction) {
	alertshow('<div class="infobox">'+text+' <br><br><div class="buttonrow"><input type="button" onClick="'+okaction+'" value="Ja" class="button_m"><input type="button" onClick="alerthide()" value="Nee" class="button_m"></div></div>');
}

function alertshowimage(img) {
	alertshow('<img src="'+img+'">');
}


function alertcenterwindowa() {
	if (alertwindow==1) {
		alertcenterwindow();	
		setTimeout("alertcenterwindowa()",100);
	}
}

function alertshow(text,hide) {
		alertwindow=1;

		document.getElementById('maintotal').className='hideselect';

		document.getElementById('alertwindow').style.visibility="visible";
		document.getElementById('alertbg').style.visibility="visible";
		alertcenterwindow();
		
		setTimeout("alertcenterwindowa()",100);

		document.getElementById('alertcontent').innerHTML = text;

		if (hide==1) {
			setTimeout("alerthide()", 2000);
		}
}

function alertbg()
{
  var favHeight = document.getElementById('alertbg');
  favHeight.style.height = pHeight() + 'px';

	
}

addLoadEvent(function() { alertbg() } );




function alerthide() {
	alertwindow=0;
	document.getElementById('maintotal').className='';
	document.getElementById('alertcontent').innerHTML ='';
	document.getElementById('alertwindow').style.visibility="hidden"
	document.getElementById('alertbg').style.visibility="hidden"	
}

function alertcenterwindow() {



	var standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body


	var ie=document.all && !window.opera
	var dom=document.getElementById
	var scroll_top=(ie)? standardbody.scrollTop : window.pageYOffset
	var scroll_left=(ie)? standardbody.scrollLeft : window.pageXOffset
	var docwidth=(ie)? standardbody.clientWidth : window.innerWidth-16
	var docheight=(ie)? standardbody.clientHeight: window.innerHeight
	var docheightcomplete=(standardbody.offsetHeight>standardbody.scrollHeight)? standardbody.offsetHeight : standardbody.scrollHeight
	var objwidth=document.getElementById('alertwindow').offsetWidth
	var objheight=document.getElementById('alertwindow').offsetHeight
	document.getElementById('alertbg').style.width=docwidth+"px" //set up veil over page
	document.getElementById('alertbg').style.height=docheightcomplete+"px" //set up veil over page
	document.getElementById('alertbg').style.left=0 //Position veil over page
	document.getElementById('alertbg').style.top=0 //Position veil over page

	document.getElementById('alertwindow').style.left=docwidth/2-objwidth/2+"px" //Position interstitial box
	var topposition=(docheight>objheight)? scroll_top+docheight/2-objheight/2+"px" : scroll_top+5+"px" //Position interstitial box
	document.getElementById('alertwindow').style.top=Math.floor(parseInt(topposition))+"px"




	
}


function OffWindowHeight()
{
 var OffWindowHeight=0;

 window.scrollTo(0,10000000);

 if(typeof self.pageYOffset!='undefined')
 OffWindowHeight=self.pageYOffset;
 else if(document.compatMode && document.compatMode != 'BackCompat')
 OffWindowHeight=document.documentElement.scrollTop;
 else if(document.body && typeof(document.body.scrollTop)!='undefined')
 OffWindowHeight=document.body.scrollTop;

 window.scrollTo(0,0);

 return OffWindowHeight;
}

function WindowHeight() 
{
  var WindowHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) 
  WindowHeight = window.innerHeight;
  else if (document.documentElement &&  document.documentElement.clientHeight) 
  WindowHeight = document.documentElement.clientHeight;
  else if(document.body && document.body.clientHeight) 
  WindowHeight = document.body.clientHeight;

  return WindowHeight;
}

function pHeight()
{
  var pHeight = OffWindowHeight() + WindowHeight();
  return pHeight;
  
}








