var hideMenu = null;

function dummy() {}

function getRefToDiv(divID) {
    if( document.layers ) { //Netscape layers
        return document.layers[divID]; }
    if( document.getElementById ) { //DOM; IE5, NS6, Mozilla, Opera
        return document.getElementById(divID); }
    if( document.all ) { //Proprietary DOM; IE4
        return document.all[divID]; }
    if( document[divID] ) { //Netscape alternative
        return document[divID]; }
    return false;
}

function mvDiv(divID_as_a_string,x,y) {
	var myReference = getRefToDiv(divID_as_a_string), noPx = document.childNodes ? 'px' : 0;
	if( !myReference ) { return; }
	if( myReference.style ) { myReference = myReference.style; }
	myReference.left = x + noPx; myReference.top = y + noPx;
}

function showDiv(divID_as_a_string) {
  clearTimeout(hideMenu);
    //get a reference as above ...
    myReference = getRefToDiv(divID_as_a_string);
    if( !myReference ) {
        return false; //don't go any further
        //return anything would work,
        //but I am using false to show failure
    }
    //now we have a reference to it
    if( myReference.style ) { //DOM & proprietary DOM
        myReference.style.visibility = 'visible';
    } else {
        if( myReference.visibility ) { //Netscape
            myReference.visibility = 'show';
        } else {
            return false; //don't go any further
        }
    }
    return true;
}

function hideDiv(divID_as_a_string) {
    //get a reference as above ...
    myReference = getRefToDiv(divID_as_a_string);
    if( !myReference ) {
        return false; //don't go any further
        //return anything would work,
        //but I am using false to show failure
    }
    //now we have a reference to it
    if( myReference.style ) { //DOM & proprietary DOM
        myReference.style.visibility = 'hidden';
    } else {
        if( myReference.visibility ) { //Netscape
            myReference.visibility = 'hide';
        } else {
            return false; //don't go any further
        }
    }
    return true;
}

function findImg(divID_as_a_string,imgName) {
      var myReference = getRefToDiv(divID_as_a_string);
	if( document.layers ) {
          return myReference.document.images[imgName]; }
      else {
          return document.images[imgName]; }
}

function replaceImg(divID_as_a_string,imgName,imgSrc) {
      var refToImg = findImg(divID_as_a_string,imgName);
      refToImg.src=imgSrc;
}

function checkFields() {
missinginfo = "";
if (document.form.Naam_organisatie.value == "") {
missinginfo += "\n         -  naam organisatie";
}
if (document.form.Naam.value == "") {
missinginfo += "\n         -  uw naam";
}
if (document.form.TelNr.value == "") {
missinginfo += "\n         -  telefoonnummer";
}
if ((document.form.Email.value != "") &&
((document.form.Email.value.indexOf('@') == -1) ||
(document.form.Email.value.indexOf('.') == -1))) {
missinginfo += "\n         -  het E-mail adres is niet geldig";
}

if (missinginfo != "") {
missinginfo ="Wilt u de volgende gegevens nog invullen:\n" +
"____________________________________\n" +
missinginfo + "\n____________________________________\n";
alert(missinginfo);
return false;
}
else return true;
}