// ++++++++++++++++++++++++++++++++++++++++++ //
// NIPO ENQUETE                               // 
// ++++++++++++++++++++++++++++++++++++++++++ //

/*
var docNIPOcookie = document.cookie;

var excluded_urls = new Array('http://wwwstaging.kennisnet.nl','http://www.kennisnet.nl/po/','http://www.kennisnet.nl/vo/docent','http://thinkquest.kennisnet.nl','http://www.thinkquest.nl');

function getNIPOCookie(name) {
  var index = docNIPOcookie.indexOf(name + '=');
  if (index == -1) {
    return '';
  }
  index = docNIPOcookie.indexOf('=', index) + 1;
  var endstr = docNIPOcookie.indexOf(';', index);
  if (endstr == -1) {
    endstr = docNIPOcookie.length;
  }
  return unescape(docNIPOcookie.substring(index, endstr));
}

function setNIPOCookie(name, value) {
  var today = new Date();
  var expiry = new Date(today.getTime() + (15 * 60 * 1000)); // cookie expires after 15 minutes
  if (value != null && value != '') {
    document.cookie=name + '=' + escape(value) + '; expires=' + expiry.toGMTString() + '; path=/';
  }
  docNIPOcookie = document.cookie;
}

function startNIPOQuestionnaire() {
  PopUpWidth = 750;
  PopUpHeight = 550;
  URL = 'http://survey.nipo.nl/B6783A/';
  Top = (Math.round((screen.height / 2) - (PopUpHeight / 2))) - 15;
  Left = Math.round((screen.width / 2) - (PopUpWidth / 2));
  newWindow = window.open(URL,'KennisNet_Survey_2003','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,dependent=no,screenX=0,screenY=0,width=' + PopUpWidth + ',height=' + PopUpHeight + ',top=' + Top + ',left=' + Left);
}

if (excluded_urls) {
  var found = false;
  for (i=0; i<excluded_urls.length; i++) {
    if (self.location.href.toLowerCase().indexOf(excluded_urls[i]) != -1) {
      found = true;
    }
  }
}
if (!found) {
  if (getNIPOCookie('nipo_lastvisit') == '') {
    setNIPOCookie('nipo_lastvisit', new Date());
    startNIPOQuestionnaire();
  }
}
*/

// ++++++++++++++++++++++++++++++++++++++++++ //
// 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(); }
}

// ++++++++++++++++++++++++++++++++++++++++++ //
// OPEN NEW WINDOW FOR IMAGES                 // 
// ++++++++++++++++++++++++++++++++++++++++++ //

var newWindow;
 
function NewImgWindow(newURL, newTitle, w, h) {
var baseURL = '/js/imgwindow.html?';
baseURL += escape(newURL);
baseURL += "&" + escape(newTitle);

var winLeft = (screen.width - w) / 2;
var winTop = ((screen.height - 50)- h) / 2;

if(newWindow && !newWindow.closed) {
newWindow.close();
}
 
newWindow = window.open(baseURL,'imgWindow','width='+w+',height='+h+',top='+winTop+',left='+winLeft+',scrollbars=no');
if (parseInt(navigator.appVersion) >= 4) { newWindow.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;
	}
}

function xpln (zoekwoord) {
	window_width 	= 420;
	window_height 	= 350;
	window_left		= 0;
	window_top 		= 0;
		
	if ( typeof(screen) == "object" ) {
		window_left		= (screen.availWidth / 2) - (window_width / 2);
		window_top		= (screen.availHeight / 2) - (window_height / 2);
	}
	
	window.open('/look2/show.asp?i=popup&qu='+zoekwoord, 'InternetWoordenboek', 'height='+window_height+',width='+window_width+',menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,left='+window_left+',top='+window_top);
}
function popen (site) {
	window_width 	= 800;
	window_height 	= 600;
	window_left		= 0;
	window_top 		= 0;
		
	if ( typeof(screen) == "object" ) {
		window_left		= (screen.availWidth / 2) - (window_width / 2);
		window_top		= (screen.availHeight / 2) - (window_height / 2);
	}
	
	window.open(site, 'InternetWoordenboek', 'height='+window_height+',width='+window_width+',menubar=0,resizable=1,scrollbars=1,status=0,titlebar=0,toolbar=0,left='+window_left+',top='+window_top);
}