
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) {
    leftPos = (screen.width - 700)/2;
    topPos = (screen.height - 575)/2;
    var win = window.open(link, '', 'fullscreen = no, height = 1, toolbar = no, status = no, addresbar = no, resizable = no, width=1, screenX=0, left = ' + leftPos + ', top = ' + topPos);
    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;
}
