
function wOpen(link) {
    leftPos = (screen.width - 800)/2;
    topPos = (screen.height - 560)/2;

    var height = '575';

    if (screen.height <= 600)
    	height = '500';

    var win = window.open(link, 'edit', 'directories = no, fullscreen = no, height = '+height+', menubar = no, resizable = yes, status = no, titlebar = no, toolbar = no, width=750, screenX=0, hotkeys=no, left = ' + leftPos + ', top = ' + topPos);
    win.focus();
}

function wOpenScroll(link) {
    leftPos = (screen.width - 700)/2;
    topPos = (screen.height - 575)/2;
    leftPos = 0;
    topPos = 0;
    var win = window.open(link, 'edit', 'directories = no, fullscreen = no, height = 575, menubar = no, resizable = no, status = no, titlebar = no, toolbar = no, width=700, screenX=0, scrollbars=1, hotkeys=no, left = ' + leftPos + ', top = ' + topPos);
    win.focus();
}


function wOpenSmall(link, name) {
		// hier was met opzet geen naam opgegeven om een popup vanuit een popup te kunnen openen?
		// nu is name een "optionele" parameter
    leftPos = (screen.width - 700) / 2;
    topPos = (screen.height - 575) / 2;
    var win = window.open(link, name?name:'', 'left=' + leftPos + ',top= ' + topPos + ',width=1,height=1,menubar=no,toolbar=no,location=no,status=no,resizable=no,fullscreen=no,directories=0');
    win.focus();
}


function wOpenImage(link)
{
    leftPos = (screen.width  - 700) / 2;
    topPos  = (screen.height - 575) / 2;
    var win = window.open(link, '_hw_image', 'fullscreen = no, height = 200, toolbar = no, status = no, addresbar = no, resizable = no, width=200, screenX=0, left = ' + leftPos + ', top = ' + topPos );
    win.focus();
}


function wPrint(link) {
    leftPos = (screen.width - 700)/2;
    topPos = (screen.height - 575)/2;
    var win = window.open(link, '', 'fullscreen = no, height = 450, toolbar = no, addresbar = no, resizable = no, width=600, screenX=0, left = ' + leftPos + ', top = ' + topPos);
		win.setTimeout('window.print()', 1000);
		win.setTimeout('self.close()', 3000);
}

function wPrint2() {
    leftPos = (screen.width - 700)/2;
    topPos = (screen.height - 575)/2;
    var win = window.open('print.asp', '', 'fullscreen = no, height = 450, toolbar = no, addresbar = no, resizable = no, width=600, screenX=0, left = ' + leftPos + ', top = ' + topPos);
}


function wOpenHelp(link) {
    leftPos = (screen.width - 800)/2;
    topPos = (screen.height - 600)/2;
    var win = window.open(link, 'help', 'fullscreen = no, height = 600, toolbar = no, addresbar = no, resizable = yes, scrollbars = 1, width=850, screenX=0, left = ' + leftPos + ', top = ' + topPos);
    win.focus();
}

function wDialog(link)
{
	var WinSettings = 'center:yes;resizable:no;status:no;';
	var win    =  window.showModalDialog( link, window, WinSettings );
}

function enter(){
	if (event.keyCode !=13) {return false;}
		return true;
}

function sizecheck(){
		if (navigator.appName=="Netscape") {
	  	if ( (self.innerWidth < 750) || (self.innerHeight < 400) ) {
		  	self.resizeTo( self.screen.width,  self.screen.height );
				self.moveTo(1,1);
	  	}
	  }
	  else if (navigator.appName.indexOf("Microsoft")!=-1) {
			if ((document.body.clientWidth < 750 ) || (document.body.clientHeight < 400)) {
				window.moveTo( 0, 0 );
		  	window.resizeTo( window.screen.availWidth, window.screen.availHeight );
			}
		}
 }

function imgOver(thisImg) {
		document[thisImg].src = thisImg + "3.gif";
}

function imgOut(thisImg) {
	document[thisImg].src = thisImg + "1.gif";
}
function checkDate (day,month,year)
{
  //alert( day + month+ year);
	if (isEmpty(year) || year < 1920 || year > 2020)
		return "Jaar moet tussen 1920 en 2020 liggen";
  var maxday = 0;
	var monthName = "";

	switch (month) {
		case "1":
			monthName = "januari";
			break;
		case "2":
			monthName = "februari";
			break;
		case "3":
			monthName = "maart";
			break;
		case "4":
			monthName = "april";
			break;
		case "5":
			monthName = "mei";
			break;
		case "6":
			monthName = "juni";
			break;
		case "7":
			monthName = "juli";
			break;
		case "8":
			monthName = "augustus";
			break;
		case "9":
			monthName = "september";
			break;
		case "10":
			monthName = "oktober";
			break;
		case "11":
			monthName = "november";
			break;
		case "12":
			monthName = "december";
			break;
	}


	switch (month) {
		case "1":
		case "3":
		case "5":
		case "7":
		case "8":
		case "10":
		case "12":
			maxday = 31;
			break;
		case "2":
			if (LeapYear(year))
				maxday = 29
			else
				maxday = 28;
			break;
		case "4":
		case "6":
		case "9":
		case "11":
			maxday = 30;
			break;
	}

	if ((maxday < day) || (day < 1))
	{
		if (maxday < 30)
		{
		  return ("De maand " + monthName + " heeft maar " + maxday + " dagen in " + year + ".");
		}
		else
		  return ("De maand " + monthName + " heeft maar " + maxday + " dagen" + ".");
	}
	return "";
}

function LeapYear(intYear)
{
	if (intYear % 100 == 0)
	{
		if (intYear % 400 == 0) { return true; }
	}
	else
	{
		if ((intYear % 4) == 0) { return true;	}
	}
	return false;
}

function StartReadSpeaker()
{
    document.rs_form.selectedtext.value = '<!-- RSPEAK_STOP -->' + document.body.innerHTML; // In plaats van meteen beginnen met lezen eerst 
                                                                                            // wachten op '<!-- RSPEAK_START -->'-comment 
    if (document.rs_form.url) 
    {
        if (!document.rs_form.url.value) 
        {
            if (window.location.href)
            {
                document.rs_form.url.value=window.location.href;
            }
            else if (document.location.href)
            {
                document.rs_form.url.value=document.location.href;
            }
        }
    }
    window.open('','rs','width=380,height=180,toolbar=0');
    setTimeout("document.rs_form.submit();",500);
}
// getElementsByName werkt niet goed binnen IE, vandaar deze omzeil-functie.
// Zie: http://www.dreamincode.net/code/snippet293.htm
/*function getElementsByName_IEFix(tag, name)
{
     var elem = document.getElementsByTagName(tag);
     var arr = new Array();
     
     for (i = 0, iarr = 0; i < elem.length; i++)
     {
          att = elem[i].getAttribute("name");
          
          if (att == name)
          {
               arr[iarr] = elem[i];
               iarr++;
          }
     }
     
     return arr;
}*/

