

function openEmail(string3, string2, string1){
         location.href = "mailto:" + string1 + "@" + string2 + "." + string3;
         //return = false;
}

var menuOpen = -1;

function menuOver(menuID){
         var x = document.getElementById(menuID).innerHTML;
         if(x.charCodeAt(x.length-1) != 187){
                document.getElementById(menuID).innerHTML = x + " &raquo;";
                if(x.length < 19){
                    document.getElementById(menuID).style.paddingRight = "0px";
                    document.getElementById(menuID).style.width = "139px";
                }
         }
         for(var i=0;i<totalMenu;i++){
             if(document.getElementById("menu" + i).innerHTML.charCodeAt(document.getElementById("menu" + i).innerHTML.length-1) == 187 && i != menuID.substr(4)){
                 document.getElementById("menu" + i).innerHTML = document.getElementById("menu" + i).innerHTML.substring(0,document.getElementById("menu" + i).innerHTML.length -1);
             }
         }
}
function menuOut(menuID){
         var x = document.getElementById(menuID).innerHTML;
         var menuTest = false;
         for(var i=0;i<=total;i++){
           if(i!=menuID && document.getElementById('subMenu' + i)){
               if(document.getElementById('subMenu' + i).style.display == ''){

               }
          }
         }


         if(x.charCodeAt(x.length-1) == 187){
                document.getElementById(menuID).innerHTML = x.substring(0,x.length -1);
         }
         var raquoTest = false;
         for(var i=0;i<totalMenu;i++){
             if(menuID.substr(4) != i && document.getElementById("menu" + i).innerHTML.charCodeAt(document.getElementById("menu" + i).innerHTML.length-1) == 187){
                raquoTest = true;
             }
         }
         if(raquoTest == false && document.getElementById(selectedMenu)){
             document.getElementById(selectedMenu).innerHTML += " &raquo;";
         }
//         if(document.getElementById('menu' + menuOpen)){
//            if(document.getElementById("menu" + menuOpen).innerHTML.charCodeAt(document.getElementById("menu" + menuOpen).innerHTML.length-1) != 187){
//                  document.getElementById('menu' + menuOpen).innerHTML += " &raquo;";
//            }
//         }
}

function menu2Over(menuID){
         var x = document.getElementById(menuID).innerHTML;
         if(x.charCodeAt(x.length-1) != 187){
                document.getElementById(menuID).innerHTML = x + " &raquo;";
         }
         for(var i=0;i<5;i++){
             if(document.getElementById("menu2" + i)){
             if(document.getElementById("menu2" + i).innerHTML.charCodeAt(document.getElementById("menu2" + i).innerHTML.length-1) == 187 && i != menuID.substr(5)){
                 document.getElementById("menu2" + i).innerHTML = document.getElementById("menu2" + i).innerHTML.substring(0,document.getElementById("menu2" + i).innerHTML.length -1);
             }
             }
         }
}
function menu2Out(menuID){
         var x = document.getElementById(menuID).innerHTML;
         var menuTest = false;

         if(x.charCodeAt(x.length-1) == 187){
                document.getElementById(menuID).innerHTML = x.substring(0,x.length -1);
         }
         var selectedTest = "";
         var raquoTest = false;
         for(var i=0;i<5;i++){
           if(document.getElementById("menu2" + i)){
             if(menuID.substr(4) != i && document.getElementById("menu2" + i).innerHTML.charCodeAt(document.getElementById("menu2" + i).innerHTML.length-1) == 187){
                raquoTest = true;
             }
             if(document.getElementById("menu2" + i).className == 'MENU_SUB_INACTIVE'){
                 selectedTest = "menu2" + i;
             }
           }
         }
         if(raquoTest == false && document.getElementById(selectedTest)){
             document.getElementById(selectedTest).innerHTML += " &raquo;";
         }
}

function menuSubOver(menuID){
         var x = document.getElementById(menuID).innerHTML;
         if(x.charCodeAt(x.length-1) != 187){
                document.getElementById(menuID).innerHTML = x + " &raquo;";
                if(x.length < 19){
                    document.getElementById(menuID).style.paddingRight = "0px";
                    document.getElementById(menuID).style.width = "139px";
                }
         }
         for(var i=0;i<subTotal;i++){
             if(document.getElementById("menuSub" + i)){
             if(document.getElementById("menuSub" + i).innerHTML.charCodeAt(document.getElementById("menuSub" + i).innerHTML.length-1) == 187 && i != menuID.substr(7)){
                 document.getElementById("menuSub" + i).innerHTML = document.getElementById("menuSub" + i).innerHTML.substring(0,document.getElementById("menuSub" + i).innerHTML.length -1);
             }
             }
         }
         if(document.getElementById("subSelected")){
              if(document.getElementById("subSelected").innerHTML.charCodeAt(document.getElementById("subSelected").innerHTML.length - 1) == 187){
                    document.getElementById("subSelected").innerHTML = document.getElementById("subSelected").innerHTML.substring(0,document.getElementById("subSelected").innerHTML.length-1);
              }
         }
}
function menuSubOut(menuID){
         var x = document.getElementById(menuID).innerHTML;
         var menuTest = false;
         if(x.charCodeAt(x.length-1) == 187){
                document.getElementById(menuID).innerHTML = x.substring(0,x.length -1);
         }
         var raquoTest = false;
         for(var i=0;i<subTotal;i++){
           if(document.getElementById("menuSub" + i)){
             if(menuID.substr(8) != i && document.getElementById("menuSub" + i).innerHTML.charCodeAt(document.getElementById("menuSub" + i).innerHTML.length-1) == 187){
                raquoTest = true;
             }
           }
         }
         if(raquoTest == false && document.getElementById("subSelected")){
             document.getElementById("subSelected").innerHTML += " &raquo;";
         }
}

function printURL(pageID){
         window.open('print.asp?EPID=' + pageID, 'printWindow', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=1,width=560,height=470,left = 242,top = 144');
}

function openMenu(menuID,submenuID){
         if(document.getElementById('subMenu' + menuID).style.display == ''){
              document.getElementById('subMenu' + menuID).style.display = 'none';
              document.getElementById('subMenu' + menuID).style.height = '0';
              for(var i=0;i<totalMenu;i++){
                      document.getElementById('menu' + i).className = 'MENU_MAIN_INACTIVE';
                      if(document.getElementById('menu' + i).innerHTML.charCodeAt(document.getElementById('menu' + i).innerHTML.length-1) == 187){
                           //document.getElementById('menu' + i).innerHTML = document.getElementById('menu' + i).innerHTML.substring(0,document.getElementById('menu' + i).innerHTML.length - 2);
                      }
              }
              menuOpen = -1;
         } else {
              document.getElementById('subMenu' + menuID).style.display = '';
              for(var i=0;i<totalMenu;i++){
                      document.getElementById('menu' + i).className = 'MENU_MAIN_INACTIVE';
                      if(document.getElementById('menu' + i).innerHTML.charCodeAt(document.getElementById('menu' + i).innerHTML.length-1) == 187){
                           document.getElementById('menu' + i).innerHTML = document.getElementById('menu' + i).innerHTML.substring(0,document.getElementById('menu' + i).innerHTML.length - 2);
                      }

              }
              document.getElementById('menu' + submenuID).className = 'MENU_MAIN_ACTIVE';
              document.getElementById('menu' + submenuID).innerHTML += " &#187;"
              menuOpen = submenuID;
         }
         for(var i=0;i<=total;i++){
          if(i!=menuID && document.getElementById('subMenu' + i)){
           document.getElementById('subMenu' + i).style.display = 'none';
          }
         }
}

function unloadFrame(){
         if(document.getElementById('photoframe').style.visibility == ''){
               document.getElementById('photoframe').style.visibility = 'hidden';
         }
}

function openPicture(IDnr){
         var strLinks = '<table border=0 cellpadding=0 cellspacing=0 width="100%" height="100%"><tr valign="center" height="100%"><td width="30%" align="left" class="link">&nbsp;';
         if(IDnr > 0){
                 strLinks += '<a style="color:#FFFFFF;text-decoration:none;" href="#" onClick="setTimeout(function(){openPicture(' + (IDnr - 1) + ');},50);" class="link">&laquo; vorige</a>';
         }

         strLinks += '&nbsp;</td><td width="40%" align="center"><a style="color:#FFFFFF;text-decoration:none;" href="#" onClick="javascript:unloadFrame();return false;" class="link">venster sluiten</a></td><td width="30%" align="right"  class="link">&nbsp;'

         if(arrayImages.length-1 > IDnr){
                 strLinks += '<a style="color:#FFFFFF;text-decoration:none;" href="#" onClick="setTimeout(function(){openPicture(' + (IDnr + 1) + ');},50);" class="link">volgende &raquo;</a>';
         }
         strLinks += '&nbsp;</td></tr></table>'

         document.getElementById('imageLinks').innerHTML = strLinks;
         document.getElementById('imageLinks').width = "100%";
         document.getElementById('photoframe').style.visibility = '';
         document.getElementById("popupImage").src = arrayImages[IDnr];
         //document.getElementById("popupImage").alt =  String(IDnr+1) + "/" + String(arrayImages.length);
         document.getElementById("popupImage").alt =  '';


}

function setPhotoFrame(){
 unloadFrame();
 var pageTop = 0;
 pageTop = window.pageYOffset;
 if (document.documentElement && document.documentElement.scrollTop){
    pageTop = document.documentElement.scrollTop;
 }else if (document.body) {
    pageTop = document.body.scrollTop   }
  document.getElementById('photoframe').style.marginTop = pageTop + "px";
}

function OpenPopup(theURL,PopupName,PopupWidth,PopupHeight,PopupFeatures)
	    {
    	var Xcoor;
	    var Ycoor;
		var Popup;
		var FeaturesTotal;
		if (PopupHeight && PopupWidth)
			{
			if (window.screen.width > PopupWidth)
				Xcoor = (window.screen.width/2) - (PopupWidth/2);
			else
				Xcoor = 0;
		    if (window.screen.height > PopupHeight)
				Ycoor = (window.screen.height/2) - (PopupHeight/2);
			else
				Ycoor = 0;
			if (PopupFeatures)
				FeaturesTotal = PopupFeatures + ",width=" + PopupWidth + ",height=" + PopupHeight + ",left=" + Xcoor + ",top=" + Ycoor + ",screenX=" + Xcoor + ",screenY=" + Ycoor;
			else
				FeaturesTotal = "width=" + PopupWidth + ",height=" + PopupHeight + ",left=" + Xcoor + ",top=" + Ycoor + ",screenX=" + Xcoor + ",screenY=" + Ycoor;
			Popup = window.open(theURL,PopupName,FeaturesTotal);
			Popup.focus;
			}
		else
			{
			Popup = window.open(theURL,PopupName);
			Popup.focus;
			}
		}

