function hasCheckedFilesOrDirs(theForm) {
      z = 0;
	  var hc = false;
	 for(z=0; z<theForm.length && !hc;z++){
      if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall'){
		  hc = theForm[z].checked;
	  }
     }
	 return hc;
    }

function checkUncheckAll(theForm) {
      z = 0;
	 for(z=0; z<theForm.length;z++){
      if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall'){
	  theForm[z].checked = !theForm[z].checked;
	  }
     }
    }

function checkAll(theForm) {
      z = 0;
	 for(z=0; z<theForm.length;z++){
      if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall'){
	  theForm[z].checked = true;
	  }
     }
    }
	
	function uncheckAll(theForm) {
      z = 0;
	 for(z=0; z<theForm.length;z++){
      if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall'){
	  theForm[z].checked = false;
	  }
     }
    }


function insertAtCursor(myField, myValue) {
//IE support
if (document.selection) {
myField.focus();

//in effect we are creating a text range with zero
//length at the cursor location and replacing it
//with myValue
sel = document.selection.createRange();
sel.text = myValue;
}

//Mozilla/Firefox/Netscape 7+ support
else if (myField.selectionStart || myField.selectionStart == '0') {

//Here we get the start and end points of the
//selection. Then we create substrings up to the
//start of the selection and from the end point
//of the selection to the end of the field value.
//Then we concatenate the first substring, myValue,
//and the second substring to get the new value.
var startPos = myField.selectionStart;
var endPos = myField.selectionEnd;
myField.value = myField.value.substring(0, startPos)+ myValue+ myField.value.substring(endPos, myField.value.length);
} else {
myField.value += myValue;
}
} 


function playMusic(nm) {
	obj = document.embeds[nm];
	if(obj.Play) obj.Play();
	return true;
}
function stopMusic(nm) {
	obj = document.embeds[nm];
	if(obj.Stop) obj.Stop();
	return true;
}
function rewMusic(nm) {
	obj = document.embeds[nm];
	if(obj.Rewind) obj.Rewind();
	return true;
}

function noenter() {
  return !(window.event && window.event.keyCode == 13); 
  }
  function isenter() {
  return (window.event && window.event.keyCode == 13); 
  }

  function submitOnEnter(frm) {
  alert("submitting??");
  if (window.event && window.event.keyCode == 13){
    alert("yeop");
//    	frm.submit();	
	} else {
	  alert("nope");	
	}

  }
  
  
  function getBrowserWidth(){
	if (window.innerWidth) //if browser supports window.innerWidth
		return window.innerWidth;
	else
  	return document.body.clientWidth;
  }
  function getBrowserHeight(){
	if (window.innerHeight) //if browser supports window.innerWidth
		return window.innerHeight;
	else
  	return document.body.clientHeight;
  }
  
  function popupfaq(key){
	document.ioform.helptopicitem.value=key;
	document.ioform.ioexecute.value='requesthelp';
	iopostgethelp(document.ioform); 
		

	}


if (document.layers) { // Netscape
    document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove = captureMousePosition;
} else if (document.all) { // Internet Explorer
    document.onmousemove = captureMousePosition;
} else if (document.getElementById) { // Netcsape 6
    document.onmousemove = captureMousePosition;
}
// Global variables
xMousePos = 0; // Horizontal position of the mouse on the screen
yMousePos = 0; // Vertical position of the mouse on the screen
xMousePosMax = 0; // Width of the page
yMousePosMax = 0; // Height of the page

function captureMousePosition(e) {
    if (document.layers) {
        // When the page scrolls in Netscape, the event's mouse position
        // reflects the absolute position on the screen. innerHight/Width
        // is the position from the top/left of the screen that the user is
        // looking at. pageX/YOffset is the amount that the user has
        // scrolled into the page. So the values will be in relation to
        // each other as the total offsets into the page, no matter if
        // the user has scrolled or not.
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    } else if (document.all) {
        // When the page scrolls in IE, the event's mouse position
        // reflects the position from the top/left of the screen the
        // user is looking at. scrollLeft/Top is the amount the user
        // has scrolled into the page. clientWidth/Height is the height/
        // width of the current page the user is looking at. So, to be
        // consistent with Netscape (above), add the scroll offsets to
        // both so we end up with an absolute value on the page, no
        // matter if the user has scrolled or not.
        xMousePos = e.x+document.body.scrollLeft;
        yMousePos = e.y+document.body.scrollTop;
        xMousePosMax = document.body.clientWidth+document.body.scrollLeft;
        yMousePosMax = document.body.clientHeight+document.body.scrollTop;
    } else if (document.getElementById) {
        // Netscape 6 behaves the same as Netscape 4 in this regard
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    }
}

function framePrint(whichFrame){
parent[whichFrame].focus();
parent[whichFrame].print();
}

function checkrequiredbert(which) {

var pass=true;

if (document.images) {

for (i=0;i<which.length;i++) {

var tempobj=which.elements[i];

if (tempobj.name.substring(0,8)=="required") {

if (((tempobj.type=="text"||tempobj.type=="textarea")&&

tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&

tempobj.selectedIndex==0)) {

pass=false;

break;

         }

      }

   }

}

if (!pass) {

shortFieldName=tempobj.name.substring(8,30).toUpperCase();

alert("Sorry, u heeft het "+shortFieldName+" veld niet volledig ingevuld.");

return false;

}

else

return true;

}