// ============= DisableKeys.js =============//

// Keys to be disabled can be added to the lists below.
// The number is the key code for the particular key
// and the text is the description displayed in the
// status window if the key [combination] is pressed.

var badKeys = new Object();
badKeys.single = new Object();
badKeys.single['8'] = 'Backspace is';
badKeys.single['13'] = 'Enter';
badKeys.single['116'] = 'F5 (Refresh)';
//badKeys.single['122'] = 'F11 (Full Screen)';

badKeys.alt = new Object();
//badKeys.alt['37'] = 'Alt+Left Cursor';
//badKeys.alt['39'] = 'Alt+Right Cursor';

badKeys.ctrl = new Object();
badKeys.ctrl['78'] = 'Ctrl+N';
//badKeys.ctrl['79'] = 'Ctrl+O';

//paginas die moeten worden genegeerd bij de button disable
var PagesToIgnore = new Array();
PagesToIgnore[0] = 'SPE001_BH_Inloggen.aspx';
PagesToIgnore[1] = 'SPE001_PR_Inloggen.aspx';
PagesToIgnore[2] = 'SPE200_EDU_Inloggen.aspx';


var boolIgnoreDisableKeys = false;


function checkKeyCode(type, code) {
if (badKeys[type][code]) {
return true;
} else {
return false;
}
}
function getKeyText(type, code) {
return badKeys[type][code];
}

var ie=document.all;
var w3c=document.getElementById&&!document.all;

function keyEventHandler(evt) {


    if (boolIgnoreDisableKeys == true) {
        return true;
    }

//controle of er pages moeten worden geignored
var I = 0;

var docloc = document.location.toString().toLowerCase();
for (I = 0;I <PagesToIgnore.length;I++)
{
	
	if (docloc.indexOf(PagesToIgnore[I].toLowerCase()) != -1)
	{
		//deze wordt niet disabled
		return true;
	}
	
}




this.target = evt.target || evt.srcElement;
this.keyCode = evt.keyCode || evt.which;
var targtype = this.target.type;
if (w3c) {
if (document.layers) {
this.altKey = ((evt.modifiers & Event.ALT_MASK) > 0);
this.ctrlKey = ((evt.modifiers & Event.CONTROL_MASK) > 0);
this.shiftKey = ((evt.modifiers & Event.SHIFT_MASK) > 0);
} else {
this.altKey = evt.altKey;
this.ctrlKey = evt.ctrlKey;
}
// Internet Explorer
} else {
this.altKey = evt.altKey;
this.ctrlKey = evt.ctrlKey;
}
// Find out if we need to disable this key combination
var badKeyType = 'single';
if (this.ctrlKey) {
badKeyType = 'ctrl';
} else if (this.altKey) {
badKeyType = 'alt';
}
if (checkKeyCode(badKeyType, this.keyCode)) {
return cancelKey(evt, this.keyCode, this.target, getKeyText(badKeyType, this.keyCode));
}
}

function cancelKey(evt, keyCode, target, keyText) {


if (keyCode==116 ) 
{
// Don't want to disable 116 t in mozilla
	if (target.type == 'text' || target.type == 'textarea' ||target.type == 'password') 
	{
			window.status = '';
			return true;
	}
}





if (keyCode==13) 
{
// Don't want to disable Enters text areas
	if ( target.type == 'textarea') 
	{
		window.status = '';
		return true;
	}
}
//if (keyCode==8 || keyCode==13) {


//********************************************
//backspace niet disable in een textbox en textare
if (keyCode==8) 
{
// Don't want to disable Backspace in text fields
	if (target.type == 'text' || target.type == 'textarea' ||target.type == 'password') 
	{
			window.status = '';
			return true;
	}
}

if (evt.preventDefault) {
evt.preventDefault();
evt.stopPropagation();
} else {
evt.keyCode = 0;
evt.returnValue = false;
}
	window.status = keyText+' not allowed / '+ keyText+' niet toegestaan' ;	
	setTimeout(	resetStatusText , 5000);
return false;
}

function resetStatusText()
{
	window.status = "";
}

// ============= DisableKeys.js =============//

// ============= PageSetup.inc =============//



function addEvent(obj, evType, fn, useCapture) {
// General function for adding an event listener
if (obj.addEventListener) {
obj.addEventListener(evType, fn, useCapture);
return true;
} else if (obj.attachEvent) {
var r = obj.attachEvent('on' + evType, fn);
return r;
} else {
alert(evType+' handler could not be attached');
}
}
function addKeyEvent() {
// Specific function for this particular browser
var e = (document.addEventListener) ? 'keypress' : 'keydown';
addEvent(document,e,keyEventHandler,false);
}
addKeyEvent();



//To disable the right mouse button
//document.oncontextmenu=new Function('return false');


function isIE()
{
if (navigator.appName == "Microsoft Internet Explorer")
		{
			return true;
		}
	else
		{
		return false;
		}
}



// ============= PageSetup.inc =============// 

function readMetaCheckbox(cb, hidden, countElements)
{
    var objCb;
    var objHidden;
    var objTempBox;
    var strTempValue;
    //objCb=document.getElementByName(cb);
	objHidden=document.getElementById(hidden);
	//alert("HALLO: " + objHidden.value + "\n Elementen: " + countElements);

	strTempValue='';
    objHidden.value='';
	for(i=0; i <= (countElements-1); i++) 
	{
		objTempBox = document.getElementById(cb + '_' + i)
		
		if(objTempBox.checked)
		{
			strTempValue=strTempValue + objTempBox.value + ',';
		}
		
 	//alert("HALLO: " + objTempBox.value); 
	}
	

	//weghalen van laatste komma:
	var length;
	length = strTempValue.length;
	objHidden.value = strTempValue.substr(0, length-1);

}

//functie voor refresen frames (top- en menu-) na login procedure
function refreshAfterLogin(postback)
{
    //alert("test");
    if (postback == 'False' || postback == null) {
    	parent.menu.location.reload(); 
	    //split op vraagteken (weghalen params om oneindig vernieuwen te voorkomen
	    var url = new String(parent.banner.location);
	    myString = new String(url)
	    splitString = myString.split("?")
    	
	    //alert(splitString.length);
	    if (splitString.length = 2)
	    { parent.banner.location = splitString[0]; }
	    else
	    { parent.banner.location = strTopbanner;}
	}
}

function nl2br_js(myString) {
    var regX = /\n/gi;

    s = new String(myString);
    s = s.replace(regX, "<br /> \n");
    return s;
}

function addTextFCK(strSource, strDefaultFCK) {
    if (current_selected_spaw != '') {
        var objText = document.getElementById(strSource);
        var myValue = nl2br_js(objText.value);

        var oFCKeditor = FCKeditorAPI.GetInstance(current_selected_spaw);
        oFCKeditor.InsertHtml(myValue);

       
    }
    else if (!(strDefaultFCK === undefined )) {
    
        
        var objText = document.getElementById(strSource);
        var myValue = nl2br_js(objText.value);

        var oFCKeditor = FCKeditorAPI.GetInstance(strDefaultFCK);
        oFCKeditor.InsertHtml(myValue);
    }
    
}
function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') { window.onload = func; }
    else { window.onload = function() { oldonload(); func(); } } 
}
function addText(strSource, strTarget)
{
			var objText = document.getElementById(strSource);
			var myValue = objText.value;
			
			var myField=document.getElementById(strTarget);
			var endOfLine='';
			var bbCode1='';
			var bbCode2='';
			
			//this is target textbox where we are supposed insert the text at cursor position
			
			var bbb;
			if(bbCode1=='[url=null]') { bbCode1=''; bbCode2=''; }
			if(bbCode1=='[imgs]' && myValue==null) { bbCode1=''; bbCode2=''; myValue=''; }
			
			if (document.selection) {
			//IE support
			var str = document.selection.createRange().text;
			myField.focus();
			sel = document.selection.createRange();
			sel.text = bbCode1 + myValue + bbCode2 + endOfLine;
			if(myValue=='') { bbb=bbCode2.length; sel.moveStart('character',-bbb); sel.moveEnd('character',-bbb); }
			sel.select();
			return;
			}
			//MOZILLA/NETSCAPE support
			else if (myField.selectionStart || myField.selectionStart == '0') {
			var startPos = myField.selectionStart;
			var endPos = myField.selectionEnd;
			var bbb2, bbV, eoll;
			if(myValue=='') myValue = myField.value.substring(startPos, endPos);
			//alert(myValue);
			myField.value = myField.value.substring(0, startPos) + bbCode1 + myValue + bbCode2 + endOfLine + myField.value.substring(endPos, myField.value.length);
			if(myValue=='') { bbb=bbCode1.length; myField.selectionStart=startPos+bbb; myField.selectionEnd=endPos+bbb; }
			else {
			bbb=bbCode1.length;
			bbb2=bbCode2.length;
			bbV=myValue.length;
			eoll=endOfLine.length;
			myField.selectionStart=startPos+bbV+bbb+bbb2+eoll;
			myField.selectionEnd=myField.selectionStart;
			}
			myField.focus();
			
			return;
			}  else {
			myField.value += myValue;
			return;
			}
		
}



function requiredfieldmaxlength(obj,ln)
{
// deze functie kapt de tekst af van een tekstbox op een bepaalde lengte 
// requiredfieldmaxlength(this, 3800);
	if(obj.value.length > ln) 
		{
			obj.value=obj.value.substring(0,ln);
		}
}

//functie om alle active checkmarks om te zetten
function check_all_marks(value) 
{ 
	var checkBoxes = document.getElementsByTagName('input'); 
	for (i = 0; i < checkBoxes.length; i++) 
		{ 
			if (checkBoxes[i].type == 'checkbox')// controle of het een checkbix is
				{
					if (checkBoxes[i].disabled ==false) // controle of de checkmark enabled is
						{
						if ( value == null)
							{
								value = !checkBoxes[i].checked;
							}
						checkBoxes[i].checked = value ; 
						}
				}
		}		

}

//functie die ALLE submit buttons op het scherm disabled na button click
function global_disablebuttonsonpostback(strButID)
{ 

	//alert(typeof(Page_ClientValidate));
	//alert(strButID);
	
	if(typeof(Page_ClientValidate)== "undefined")
	{
		//mozilla, e.a	
		//alert("undefXX")
		
		// disable van de buttons
			var btns= document.getElementsByTagName('input'); 
			for (i = 0; i < btns.length; i++) 
			{ 
				if (btns[i].type == 'submit')
				{
					btns[i].disabled =true;
				}
			}
		
		__doPostBack('butOK','');
	}
	else //IE
	{

	if (typeof(Page_ClientValidate) == 'function')
	{
	
		if (Page_ClientValidate()==true)
		{
	
			// disable van de buttons
			var btns= document.getElementsByTagName('input'); 
			for (i = 0; i < btns.length; i++) 
			{ 
				if (btns[i].type == 'submit')
				{
					btns[i].disabled =true;
				}
			}
			
			__doPostBack('butOK','');
			
		}
	}		
	
	}


}

//functies voor pop-up divje

	// Determine browser and version.

			function Browser() {

			  var ua, s, i;

			  this.isIE    = false;
			  this.isNS    = false;
			  this.version = null;

			  ua = navigator.userAgent;

			  s = "MSIE";
			  if ((i = ua.indexOf(s)) >= 0) {
			    this.isIE = true;
			    this.version = parseFloat(ua.substr(i + s.length));
			    return;
			  }

			  s = "Netscape6/";
			  if ((i = ua.indexOf(s)) >= 0) {
			    this.isNS = true;
			    this.version = parseFloat(ua.substr(i + s.length));
			    return;
			  }

			  // Treat any other "Gecko" browser as NS 6.1.

			  s = "Gecko";
			  if ((i = ua.indexOf(s)) >= 0) {
			    this.isNS = true;
			    this.version = 6.1;
			    return;
			  }
			}

			var browser = new Browser();

			// Global object to hold drag information.

			var dragObj = new Object();
			dragObj.zIndex = 0;

			function dragStart(event, id) {

			  var el;
			  var x, y;

			  // If an element id was given, find it. Otherwise use the element being
			  // clicked on.

			  if (id)
			    dragObj.elNode = document.getElementById(id);
			  else {
			    if (browser.isIE)
			      dragObj.elNode = window.event.srcElement;
			    if (browser.isNS)
			      dragObj.elNode = event.target;

			    // If this is a text node, use its parent element.

			    if (dragObj.elNode.nodeType == 3)
			      dragObj.elNode = dragObj.elNode.parentNode;
			  }

			  // Get cursor position with respect to the page.

			  if (browser.isIE) {
			    x = window.event.clientX + document.documentElement.scrollLeft
			      + document.body.scrollLeft;
			    y = window.event.clientY + document.documentElement.scrollTop
			      + document.body.scrollTop;
			  }
			  if (browser.isNS) {
			    x = event.clientX + window.scrollX;
			    y = event.clientY + window.scrollY;
			  }

			  // Save starting positions of cursor and element.

			  dragObj.cursorStartX = x;
			  dragObj.cursorStartY = y;
			  dragObj.elStartLeft  = parseInt(dragObj.elNode.style.left, 10);
			  dragObj.elStartTop   = parseInt(dragObj.elNode.style.top,  10);

			  if (isNaN(dragObj.elStartLeft)) dragObj.elStartLeft = 0;
			  if (isNaN(dragObj.elStartTop))  dragObj.elStartTop  = 0;

			  // Update element's z-index.

			  dragObj.elNode.style.zIndex = ++dragObj.zIndex;

			  // Capture mousemove and mouseup events on the page.

			  if (browser.isIE) {
			    document.attachEvent("onmousemove", dragGo);
			    document.attachEvent("onmouseup",   dragStop);
			    window.event.cancelBubble = true;
			    window.event.returnValue = false;
			  }
			  if (browser.isNS) {
			    document.addEventListener("mousemove", dragGo,   true);
			    document.addEventListener("mouseup",   dragStop, true);
			    event.preventDefault();
			  }
			}

			function dragGo(event) {

			  var x, y;

			  // Get cursor position with respect to the page.

			  if (browser.isIE) {
			    x = window.event.clientX + document.documentElement.scrollLeft
			      + document.body.scrollLeft;
			    y = window.event.clientY + document.documentElement.scrollTop
			      + document.body.scrollTop;
			  }
			  if (browser.isNS) {
			    x = event.clientX + window.scrollX;
			    y = event.clientY + window.scrollY;
			  }

			  // Move drag element by the same amount the cursor has moved.

			  dragObj.elNode.style.left = (dragObj.elStartLeft + x - dragObj.cursorStartX) + "px";
			  dragObj.elNode.style.top  = (dragObj.elStartTop  + y - dragObj.cursorStartY) + "px";

			  if (browser.isIE) {
			    window.event.cancelBubble = true;
			    window.event.returnValue = false;
			  }
			  if (browser.isNS)
			    event.preventDefault();
			}

			function dragStop(event) {

			  // Stop capturing mousemove and mouseup events.

			  if (browser.isIE) {
			    document.detachEvent("onmousemove", dragGo);
			    document.detachEvent("onmouseup",   dragStop);
			  }
			  if (browser.isNS) {
			    document.removeEventListener("mousemove", dragGo,   true);
			    document.removeEventListener("mouseup",   dragStop, true);
			  }
			}



			function showFloatableDiv(id, title, text)
			{

				var y;

				if (self.pageYOffset)
					y = self.pageYOffset;
				else if (document.documentElement && document.documentElement.scrollTop)
					y = document.documentElement.scrollTop;
				else if (document.body)
					y = document.body.scrollTop;

				if (document.getElementById('video')) {
					document.body.removeChild(document.getElementById('video'))
				}

				/*
				var posx = 0;
				var posy = 0;
				var e = window.event;
				if (e.pageX || e.pageY)
				{
				posx = e.pageX;
				posy = e.pageY;
				}
				else if (e.clientX || e.clientY)
				{
				posx = e.clientX + document.body.scrollLeft;
				posy = e.clientY + document.body.scrollTop;
				}
				*/
				
				//alert(posx + ' ' + posy);

				var node = document.createElement('div');
				node.style.width = '370px';
				node.style.height = '142px';
				node.style.position = 'absolute';
				node.style.left = parseInt((document.body.clientWidth/2)-220) + 'px';
				node.style.top = (y + 220) + 'px';
				//node.style.left = 'px';
				//node.style.top  = 'px';

				node.style.padding = '8px';
				node.style.border = '1px solid #000';
				node.style.background = 'white';
				//node.style.overflow = 'auto';

				node.innerHTML = '';
				node.innerHTML += '<div id="FloatableDivHeader" class="datagridheader" onmousedown="dragStart(event, \'video\');">&nbsp;&nbsp;' + title + '</div>';
				node.innerHTML += '<span id="FloatableDivClose" onclick="document.body.removeChild(document.getElementById(\'video\')); location.href=\'#p' + id + '\'"><img src="/images/closewindow.gif" /></span><br />';
				node.innerHTML += '<div id="FloatableDiv" class="contentbody" style="background: none; border: 0; overflow:auto; width:337px; height:123px;" >' + text + '</div>';

				node.id = 'video';
				document.body.appendChild(node)

				var dragObj = new Object();
				dragObj.zIndex = 0;


			}	
		
//einde functies voor pop-up divje


// functie om een cookie uit telezen

function ReadCookie(cookieName) 
{
	var theCookie=""+document.cookie;
	var ind=theCookie.indexOf(cookieName);
	if (ind==-1 || cookieName=="") return "PE-Online"; 
	var ind1=theCookie.indexOf(';',ind);
	if (ind1==-1) ind1=theCookie.length; 
	return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}

function globalHideItem(trID, boolHide) 
{
    var vSibling = document.getElementById(trID);
    if (boolHide == false) 
    {
        vSibling.style.display = "block";
    }
    else 
    {
        vSibling.style.display = "none";
    }
}


// functie om de titel in te stellen
	var pagetitle = ReadCookie("pe_ApplicationTitle");
	//	document.title = pagetitle;

	if (typeof (Ignoresetpagetitle) == "undefined") {
	    parent.document.title = pagetitle;
	}
	window.status = "";

	// main functies van google analytics binnen halen
	var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
	document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
	
	
	
	
	// functie om dialog te showen middels een functie
	
	
	
    
        document.write('<script type="text/javascript" src="/components/webdialogV2/webdialogV2.js"></script>'); 
        var winshowFixedDialog;
    	function showFixedDialog(url, obj)
	    {
	    	 
	    	 //obj.DialogShowLocationbar="0" ;
	    	 //obj.DialogCenterscreen="1" ;
	    	 //obj.DialogFullScreen="0" ;
	    	 //obj.DialogTop="100" ;
	    	 //obj.DialogUrl=url; ;
	    	 //obj.DialogShowScrollbars="1" ;
	    	 //obj.DialogWidth="910" ;
	    	 //obj.DialogShowMenubar="0" ;
	    	 //obj.DialogShowToolbar="0" ;
	    	 //obj.DialogHeight="600" ;
	    	 //obj.DialogLeft="100" ;
	    	 //obj.DialogisResizable="1" ;
	    	 //obj.DialogShowStatusbar="1" ;
	    	 //obj.DialogShowDirectoriesbar="0" ;
	    	// A.DialogEventToBind="onclick" ;
	    	 //A.href="javascript:return false;";
	    	 //obj.DialogName="winshowFixedDialog" ;
	    	 //winshowFixedDialog = webdialogV2_showdialog(obj ,winshowFixedDialog);
	        
        obj.setAttribute('DialogShowLocationbar', '0');
        obj.setAttribute('DialogCenterscreen', '1');
        obj.setAttribute('DialogFullScreen', '0');
        obj.setAttribute('DialogTop', '100');
        obj.setAttribute('DialogUrl', url);
        obj.setAttribute('DialogShowScrollbars', '1');
        obj.setAttribute('DialogWidth', '910');
        obj.setAttribute('DialogShowMenubar', '0');
        obj.setAttribute('DialogShowToolbar', '0');
        obj.setAttribute('DialogHeight', '600');
        obj.setAttribute('DialogLeft', '100');
        obj.setAttribute('DialogisResizable', '1');
        obj.setAttribute('DialogShowStatusbar', '1');
        obj.setAttribute('DialogShowDirectoriesbar', '0');
        obj.setAttribute('DialogName', 'winshowFixedDialog');
        winshowFixedDialog = webdialogV2_showdialog(obj ,winshowFixedDialog);

	}
	
	
	function showreportpage(obj,reportid,filetype,save,email,filter,custompage)
	{
	// create the url string
	var url;
	if(custompage==false)
	    {
	        url = '/allroles/reports/reportstartpage.aspx'
	    }
	else
	   {
	           url = '/allroles/reports/customreportstartpage.aspx'
	   }
	   
	   
	   url = url + '?reportid=' + reportid;
	   url = url + '&filetype=' + filetype;
	   url = url + '&save=' + save;
	   url = url + '&email=' + email;
	   url = url + '&filter=' + filter;
	   
	    obj.setAttribute('DialogShowLocationbar', '0');
        obj.setAttribute('DialogCenterscreen', '1');
        obj.setAttribute('DialogFullScreen', '0');
        obj.setAttribute('DialogTop', '100');
        obj.setAttribute('DialogUrl', url);
        obj.setAttribute('DialogShowScrollbars', '1');
        obj.setAttribute('DialogWidth', '650');
        obj.setAttribute('DialogShowMenubar', '0');
        obj.setAttribute('DialogShowToolbar', '0');
        obj.setAttribute('DialogHeight', '300');
        obj.setAttribute('DialogLeft', '100');
        obj.setAttribute('DialogisResizable', '1');
        obj.setAttribute('DialogShowStatusbar', '1');
        obj.setAttribute('DialogShowDirectoriesbar', '0');
        obj.setAttribute('DialogName', 'winshowFixedDialog');
        winshowFixedDialog = webdialogV2_showdialog(obj ,winshowFixedDialog);

    }
   
    function show_Xaurum_Alert(id, myWidth) {

        scroll(0, 0);

        var objAlertDiv = document.getElementById(id);
        var objAlertWaiterDiv = document.getElementById(id + '_waiter')

        //alert(objAlertDiv);

        //bepalen breedte scherm
        var screen_x, screen_y;
        var correction_x, correction_y;
        
        correction_x = 0;
        correction_y = -100;
        
        if (self.innerHeight) // all except Explorer
        {
          
            screen_x = self.innerWidth;
            screen_y = self.innerHeight;

            correction_x = -21;

            //alert("Not-IE: " + screen_x);
        }
        else if (document.documentElement && document.documentElement.clientHeight)
        // Explorer 6 Strict Mode
        {
            screen_x = document.documentElement.clientWidth;
            screen_y = document.documentElement.clientHeight;
        }
        else if (document.body) // other Explorers
        {
            screen_x = document.body.clientWidth;
            screen_y = document.body.clientHeight;

            //alert("IE: " + screen_x);
        }

        var waiter_x, waiter_y;

        if (myWidth == 0)
        {objAlertDiv.style.width = '400px'; }
        else
        { objAlertDiv.style.width = String(myWidth) + 'px';}

        waiter_x = Left(objAlertDiv.style.width, objAlertDiv.style.width.length - 2);
        waiter_y = Left(objAlertDiv.style.height, objAlertDiv.style.height.length - 2);

        if (parent.frames.length == 3) {
            //alert("sander");
            correction_x = correction_x - 71;
        }

        objAlertDiv.style.left = String(((screen_x - waiter_x) / 2) + correction_x) + 'px';
        objAlertDiv.style.top = String(((screen_y - waiter_y) / 2) + correction_y) + 'px';
        
        objAlertDiv.style.display = 'block';

        //alert(((screen_x - waiter_x) / 2) + correction_x);
        //alert(objAlertDiv.style.left);

        //wait4erbck
        objAlertWaiterDiv.style.top = 0;
        objAlertWaiterDiv.style.left = 0;
        objAlertWaiterDiv.style.height = String(screen_y) + 'px';
        objAlertWaiterDiv.style.width = String(screen_x) + 'px';
        objAlertWaiterDiv.style.visibility = "visible";
        objAlertWaiterDiv.style.cursor = "wait";

        //scrollbar weghalen
        document.body.style.overflow = "hidden";

        //selects verwijderen
        xaurum_showhide_selects('none');

    }

    function xaurum_hide_alert(controlID) {

        //alert(controlID);

        objAlertDiv = document.getElementById(controlID)
        objAlertWaiterDiv = document.getElementById(controlID + '_waiter')

        objAlertWaiterDiv.style.cursor = "default";
        objAlertWaiterDiv.style.visibility = "hidden";
        objAlertDiv.style.display = "none";

        document.body.style.overflow = "auto";
        
        xaurum_showhide_selects('inline');
    }

    function Left(str, n) {
        if (n <= 0)
            return "";
        else if (n > String(str).length)
            return str;
        else
            return String(str).substring(0, n);
    }

    function xaurum_showhide_selects(setdisplay) {
        //Detect IE5.5+
        version = 0
        if (navigator.appVersion.indexOf("MSIE") != -1) {
            temp = navigator.appVersion.split("MSIE")
            version = parseFloat(temp[1])
        }
        if (version < 7 && version != 0) {
            // looping through all forms on the page
            for (f = 0; f < document.forms.length; f++) {
                var elements = document.forms[f].elements;
                // looping through all elements on certain form
                for (e = 0; e < elements.length; e++) {
                    if (elements[e].type == "select-one") {
                        elements[e].style.display = setdisplay;
                    }
                }
            }
        }
    }

    window.onresize = alertwaiterresizer;
    window.onscroll = alertwaiterresizer;

    function getElementsByName_iefix(tag, name) {

        var elem = document.getElementsByTagName(tag);
        var arr = new Array();
        for (i = 0, iarr = 0; i < elem.length; i++) {
            att = elem[i].getAttribute("name");
            if (att == name) {
                arr[iarr] = elem[i];
                iarr++;
            }
        }
        return arr;
    }

    function resizer() {

        if (xaurum_waiter_background) {
            if (xaurum_waiter_background.style.visibility == 'visible') {
                var x, y;
                var test1 = document.body.scrollHeight;
                var test2 = document.body.offsetHeight

                if (test1 > test2) // all but Explorer Mac
                {
                    x = document.body.scrollWidth - 2;
                    y = document.body.scrollHeight - 2;
                }
                else // Explorer Mac;
                //would also work in Explorer 6 Strict, Mozilla and Safari
                {
                    x = document.body.offsetWidth;
                    y = document.body.offsetHeight;
                }

                xaurum_waiter_background.style.width = String(x) + 'px';
                xaurum_waiter_background.style.height = '100%';
            }
        }
    }
    function alertwaiterresizer() {

        //alert("HOOIOI");

        //als er voor de uploads al een waiter is, dan deze resizen
        var objUploadWaiter = document.getElementById('xaurum_waiter_background');
        if (objUploadWaiter != null) {
            resizer();
        }
        
        //ophalen alertwaiter op basis van tag/name        
        var arr = new Array();
        arr = getElementsByName_iefix("div", "xaurum_alertwaiter_background")

        //alert("hoisss" + (arr.length));

        //als er minimaal 1 alertwaiter is
        if (arr.length > 0) 
        {

            for (var i = 0; i <= arr.length-1; i++) {

                var myAlertWaiter = arr[i];

                //alert("Arr(0): " + myAlertWaiter);

                if (myAlertWaiter != null) {

                    //alert("hoi" + myAlertWaiter);

                    if (myAlertWaiter.style.visibility == 'visible') {

                        //alert(myAlertWaiter);

                        var x, y;
                        var test1 = document.body.scrollHeight;
                        var test2 = document.body.offsetHeight;

                        //alert(test1 + ' / ' + test2);

                        if (test1 > test2) // all but Explorer Mac
                        {
                            x = document.body.scrollWidth - 2;
                            y = document.body.scrollHeight - 2;
                            //alert('ALL: ' + y);
                        }
                        else // Explorer Mac;
                        //would also work in Explorer 6 Strict, Mozilla and Safari
                        {
                            x = document.body.offsetWidth;
                            y = document.body.offsetHeight;
                            //alert('Mac: ' + y);
                        }

                        //alert(String(y));

                        //myAlertWaiter.style.height = '100%'//String(y) + 'px';
                        //myAlertWaiter.style.width = '100%'//String(x) + 'px';
                        //myAlertWaiter.style.height = String(y) + 'px';
                        myAlertWaiter.style.width = String(x) + 'px';
                        myAlertWaiter.style.height = '100%';
                        //myAlertWaiter.style.width = '100%';


                    }
                }
            }
        }


    }