	// menu functie gebruikt voor dropdown in top-navigatie
function jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// functie om new window te openen met scrollbars : o.a. disclaimer
function openwindowscroll(loc, winsizew,winsizeh) {
 var top = (screen.height / 2) - (winsizeh / 2);
 var left = (screen.width / 2) - (winsizew / 2);
 window.open(loc, "_blank", "toolbar=no,location=no,status=no,directories=no,menubar=no,scrollbars=1,resizable=no,width="+winsizew+",height="+winsizeh+",top="+top+",left="+left);
}

// functie om new window te openen zonder disclaimers : o.a. "live applicaties" 
function openwindow(loc, winsizew,winsizeh) {
 var top = (screen.height / 2) - (winsizeh / 2);
 var left = (screen.width / 2) - (winsizew / 2);
 window.open(loc, "_blank", "toolbar=no,location=no,status=no,directories=no,menubar=no,scrollbars=0,resizable=no,width="+winsizew+",height="+winsizeh+",top="+top+",left="+left);
}


// functie opgeroepen door setContentHeight();
function getWindowHeight() {
			var windowHeight = 0;
			if (typeof(window.innerHeight) == '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;
}

// functie die de hoogte van div "middenframe" wijzigt indien niet schermvullend
function setContentHeight(vDivName) {
  if(document.getElementById) {
		  var windowHeight = getWindowHeight();
				if(windowHeight > 0) {
				  var topElement = document.getElementById('border');
						var topHeight = topElement.offsetHeight;
						
						if(vDivName == 'g11') {
							  var middenElement = document.getElementById('gspFrameMidden');
						}
						else {
            				  var middenElement = document.getElementById('gspFrameMidden');						  
						}

						var middenHeight = middenElement.offsetHeight;

						var delta = windowHeight - topHeight;

						if(delta>0) {

 							var frametopElement = document.getElementById('gspFrameTop');
	 						var frametopHeight = frametopElement.offsetHeight;
		 					var disclaimerElement = document.getElementById('hlnFrameFooter');
			 				var disclaimerHeight = disclaimerElement.offsetHeight;
							var newMiddenHeight = windowHeight - (frametopHeight + disclaimerHeight) + 180;
                            middenElement.style.height = newMiddenHeight + 'px';							
							
						}
				}
				
		}
}  

// functie DIE WEG MAG ????
function cssHorScrolls(val) {
  document.body.style.overflowX = val
}

// functie DIE WEG MAG ????
function MM_swapImgRestore() //v3.0 
{ 
 var i, x, a = document.MM_sr; 
 for(i=0; a && i < a.length && (x=a[i]) && x.oSrc; i++)
    {
     x.src = x.oSrc;
    }
 }

// functie DIE WEG MAG ????
function MM_preloadimages()  //v3.0
{
 var d = document;
 if (d.images) {
   if (!d.MM_p)
   {
    d.MM_p=new Array()
   }
 var i, j=d.MM_p.length, a=MM_preloadimages.arguments; 
 for(i=0; i<a.length; i++)
 {
   if (a[i].indexOf("#") != 0)
     {
       d.MM_p[j]=new Image;
       d.MM_p[j++].src=a[i];
      }
    }
 }
}

// functie DIE WEG MAG ????
function MM_findObj(n, d) //v4.0
{
 var p,i,x;
 
	if (!d) {
  d=document;
 }
 
	if ((p=n.indexOf("?")) > 0 && parent.frames.length) {
  d=parent.frames[n.substring(p+1)].document;
  n=n.substring(0,p);
 }
 
	if (!(x=d[n]) && d.all) {
  x = d.all[n];
 }
 
	for (i=0; !x && i<d.forms.length; i++) 
 {
   x = d.forms[i][n];
 }
 for (i=0; !x && d.layers && i<d.layers.length; i++)
 {
   x = MM_findObj(n,d.layers[i].document);
 }
 if (!x && document.getElementById) 
 {
   x = document.getElementById(n);
 }       
 return x;
}

// functie DIE WEG MAG ????
function MM_swapImage() //v3.0
{
  var i, j=0, x, a=MM_swapImage.arguments;
  document.MM_sr = new Array;
  for (i=0;i <(a.length-2); i+=3)
  {
     if ((x=MM_findObj(a[i])) != null)
     {
       document.MM_sr[j++]=x;
       if (!x.oSrc)
           {
             x.oSrc=x.src; 
           }
       x.src=a[i+2];
     }
  }
}

// functie die een pop-up window opent
function MM_openBrWindow(theURL,winName,features)  //v2.0
{
   window.open(theURL,winName,features);
}

//functie die hidden fields van een form invult om link te maken naar andere pagina
//function gaNaar(spelnr,spelnaam) {
//   document.form1.p_speler_nr.value = spelnr;
//   document.form1.p_speler_naam.value = spelnaam;
//   document.form1.submit();
//}

// functie die voornaam en naam van gekende gebruiker gaat lezen uit cookie
function gspid(url,url2,voornaam,paswoord) {
//var voornaam = unescape(getCookie("GSP_NAAM"));
//var paswoord = unescape(getCookie("GSP_PW"));
var tekst;

if (voornaam==null || voornaam=="") 
{
  if(taal==("NL"))
  {
    document.write(url+'Aanmelden</a>');
  }
  else
  {
    document.write(url+'Se connecter</a>');
  }
}
else 
{
   tekst = url + voornaam + '</a>';
   if (url2 != null && url2 !=("") && paswoord != null)
   {
     tekst = tekst + ' - ' + url2 + 'Logout</a>';
   }
   if(taal==("NL"))
  {
    document.write('Welkom '+tekst);
  }
  else
  {
    document.write('Bienvenue '+tekst);
  }
}
}

//deze functie gaat een gegeven waarde uit een cookie halen
function getCookie(name)  { 
	var bikky = document.cookie;
    var index = bikky.indexOf(name + "=");
    if (index == -1) return null;
    index = bikky.indexOf("=", index) + 1; 
    var endstr = bikky.indexOf(";", index);
    if (endstr == -1) endstr = bikky.length; 
    return unescape(bikky.substring(index, endstr));
}

//deze functie schrijft een cookie weg
function setCookie(NameOfCookie, value, expiredays) {
var ExpireDate = new Date ();
ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));

  document.cookie = NameOfCookie + "=" + escape(value) + 
  ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
}

// functions for buttons
function relBtn(o,size) { 
	o.className = "btn"+size;  
}
function pressBtn(o,size) {	
	o.className = "btn"+size+"On"; 
}

//this function calculates the height of an iframed page and will adjust the heigth of the iframe
var isNetscape = (navigator.appName.indexOf('Netscape') != -1);
function calcHeight(srcId,srcBody) 
{
    if(isNetscape)
	{
		document.getElementById(srcId).style.height = document.getElementById(srcId).contentDocument.body.scrollHeight;
	}
	else
	{
    	var oBody = srcBody;
      	//var oFrame = document.all(srcId);
      	var oFrame = document.getElementById(srcId);
      	oFrame.style.height = oBody.scrollHeight + (oBody.offsetHeight - oBody.clientHeight);
    } 
}
function calcHeightOverzicht(srcId,srcBody) 
{
	var oBody = srcBody;
   	var oFrame = document.getElementById(srcId);
	var hoogte = oBody.scrollHeight + (oBody.offsetHeight - oBody.clientHeight);
    oFrame.style.height = hoogte + "px";
}

