// ++++++++++++++++++++++++++++++++++++++++++ //
// GERALATEERDE SITES JUMPMENU                // 
// ++++++++++++++++++++++++++++++++++++++++++ //

function jumpMenu(targ,selObj,restore){
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// ++++++++++++++++++++++++++++++++++++++++++ //
// OPEN NEW WINDOW IN CENTER OF SCREEN        // 
// ++++++++++++++++++++++++++++++++++++++++++ //

function NewWindow(mypage, myname, w, h, scroll) {

var winl = (screen.width - w) / 2;
var wint = ((screen.height - 50)- h) / 2;

winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',noresize'
win = window.open(mypage, myname, winprops)

if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

// ++++++++++++++++++++++++++++++++++++++++++ //
// SPAWN EXTERNAL LINK NOTICE WINDOW          // 
// ++++++++++++++++++++++++++++++++++++++++++ //

function extern(mypage) {
var w = 500;
var h = 350;
var winl = (screen.width - w) / 2;
var wint = ((screen.height - 50)- h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,noresize'
win = window.open(mypage, 'extern', winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

// sample link:
//<a href="http://kinderen.kennisnet.nl/extern.html?theLink=http://www.omroep.nl" onClick="extern(this.href);return false;">



// ++++++++++++++++++++++++++++++++++++++++++ //
// SEARCH APPLICATION				          // 
// ++++++++++++++++++++++++++++++++++++++++++ //

// This script provides the functions for the two forms (search and login) present on the homepage
// and on each section.
// 

// CONFIG
// where is the search/webmail server located?
var SS_submitFormlocation = "http://zoek.kennisnet.nl/compass";
var WS_submitFormlocation = "http://www.kennisnet.nl/cgi-bin/login.cgi";

// SEARCH ENGINE SCRIPTS

// The search engine expects the following values (get mode)
// ui, chunk-size, page, taxonomy, scope, view-template

function SS_submit() {
	NS4 = (document.layers) ? 1 : 0;
	IE4 = (document.all) ? 1 : 0;
	DOM = (document.getElementById) ? 1 : 0;

	if (!SS_validate()) {
		alert("U heeft geen zoekterm ingevuld...");

		if (IE4) document.SS_searchform.scope.focus();
		else if (NS4) document.forms["SS_searchform"].scope.focus();
		else if (DOM) document.forms["SS_searchform"].scope.focus();

		return false;
	} else {
	
		if (IE4)      document.SS_searchform.action          = SS_submitFormlocation;
		else if (NS4) document.forms["SS_searchform"].action = SS_submitFormlocation;
		else if (DOM) document.forms["SS_searchform"].action = SS_submitFormlocation;

		/*
		// appearently this piece is no longer required (stolen from the old search submit scripts)
		
		if (NS4 || DOM || IE4) {
			fl = document.forms["SS_searchform"].length;

			SS_searchlocation += '?';

		 	for(i=0; i<fl; i++) {
		      SS_searchlocation += document.SS_searchform.elements[i].name + '=' + document.SS_searchform.elements[i].value + '&';
			}
			top.window.location.href = SS_searchlocation;
		}
		*/
		
		return true;
	}
}

function SS_validate() {
	NS4 = (document.layers) ? 1 : 0;
	IE4 = (document.all) ? 1 : 0;
	DOM = (document.getElementById) ? 1 : 0;

	if (IE4)      vl = document.SS_searchform.scope.value;
	else if (NS4) vl = document.forms["SS_searchform"].scope.value;
	else if (DOM) vl = document.forms["SS_searchform"].scope.value;
	else          vl = document.SS_searchform.scope.value;
	
	if (typeof(vl) == "undefined" || vl == "") {
		return false;
	} else {
		return true;
	}
}

// WEBMAIL ENGINE SCRIPTS

// The web mail engine expects the following values (post mode)
// user & password

function WS_submit() {
	NS4 = (document.layers) ? 1 : 0;
	IE4 = (document.all) ? 1 : 0;
	DOM = (document.getElementById) ? 1 : 0;

	if (!WS_validate()) {
		alert("Vul zowel uw gebruikersnaam + password in...");

		if (IE4) document.WS_loginform.user.focus();
		else if (NS4) document.forms["WS_loginform"].user.focus();
		else if (DOM) document.forms["WS_loginform"].user.focus();

		return false;
	} else {
		if (IE4)      document.WS_loginform.action          = WS_submitFormlocation;
		else if (NS4) document.forms["WS_loginform"].action = WS_submitFormlocation;
		else if (DOM) document.forms["WS_loginform"].action = WS_submitFormlocation;
		
		return true;
	}
}

function WS_validate() {
	NS4 = (document.layers) ? 1 : 0;
	IE4 = (document.all) ? 1 : 0;
	DOM = (document.getElementById) ? 1 : 0;

	if (IE4)      {us = document.WS_loginform.user.value;pw = document.WS_loginform.password.value;}
	else if (NS4) {us = document.forms["WS_loginform"].user.value;pw = document.forms["WS_loginform"].password.value;}
	else if (DOM) {us = document.forms["WS_loginform"].user.value;pw = document.forms["WS_loginform"].password.value;}
	
	if (typeof(us) == "undefined" || typeof(pw) == "undefined" || us == '' || pw == '') {
		return false;
	} else {
		return true;
	}
}
