function resizeMe(width, height) {
	var NS = (navigator.appName=="Netscape")?true:false; 
	
	self.resizeTo(width, height);
	var iWidth = (NS)?window.innerWidth:document.body.clientWidth; 
	var iHeight = (NS)?window.innerHeight:document.body.clientHeight; 
	var iWidth = width - iWidth; 
	var iHeight = height - iHeight; 
	window.resizeBy(iWidth, iHeight); 
	
	var mijnbreedte = (window.screen.width/2) - (width/2);
    var mijnhoogte = (window.screen.height/2) - (height/2);
    self.moveTo(mijnbreedte, mijnhoogte);
    self.focus();
 	
}


function centerMe(width, height) {
	var mijnbreedte = (window.screen.width/2) - (width/2);
    var mijnhoogte = (window.screen.height/2) - (height/2);
    self.moveTo(mijnbreedte, mijnhoogte);
    self.focus();
}

function viewimage(welke)
{
	var mijnbreedte = (window.screen.width/2);
	var mijnhoogte = (window.screen.height/2);
 	window.open("image.php?id="+welke,"image","status=no,screenx="+mijnbreedte+",screeny="+mijnhoogte+",left="+mijnbreedte+",top="+mijnhoogte);
}


function colors()
{
	var mijnbreedte = (window.screen.width/2);
	var mijnhoogte = (window.screen.height/2);
 	window.open("color.php","colors","status=no,screenx="+mijnbreedte+",screeny="+mijnhoogte+",left="+mijnbreedte+",top="+mijnhoogte+",width=220,height=300,scrollbars=1");
}


function timetable()
{
	var mijnbreedte = (window.screen.width/2);
	var mijnhoogte = (window.screen.height/2);
 	window.open("timetable.php", "timetable", "status=no,screenx="+mijnbreedte+",screeny="+mijnhoogte+",left="+mijnbreedte+",top="+mijnhoogte+",width=800,height=500,scrollbars=1");
}

function delAlert() {
	kies = confirm('Weet je zeker dat je dit item wilt verwijderen?');
	if (kies == true)	{
		return true;		
	}
	else {
		return false;
	}
}


function showinfo(user,ValueShow)
{

var mousex = window.event.x;        // mouse location capture event
var mousey = window.event.y;        // mouse location capture event
user.style.visibility = ValueShow;  // show or hide respective Example
user.style.left = mousex + 5;       // place popup at the mouse X (left) location
user.style.top = mousey;            // place popup at the mouse Y (top) location

            
}


function Check() {
	if (document.formulier.naam.value == "")
	{
		alert ("Vul een naam in.");
		document.formulier.naam.focus();
		return false;
	}
	else if (document.formulier.wachtwoord1.value == "")
	{
		alert ("Kies een wachtwoord.");
		document.formulier.wachtwoord1.focus();
		return false;
	}
	else if (document.formulier.wachtwoord2.value == "")
	{
		alert ("Voer nogmaals het wachtwoord in.");
		document.formulier.wachtwoord2.focus();
		return false;
	}
	else if (document.formulier.wachtwoord1.value != document.formulier.wachtwoord2.value)
	{
		alert ("De wachtwoorden komen niet overeen!")
		document.formulier.wachtwoord2.focus();
		return false;
	}
	else
	{
		return true;
	}
}	
function CheckSignUp() {
	var exclude=/[^@\-\.\w]|^[@\.\-]|[\.\-]{2}|[@\.]{2}|(@)[^@]*\1/;
	var check=/@[\w\-]+\./;
	var checkend=/\.[a-zA-Z]{2,3}$/;
	
	if ((((document.newsletter.email.value.search(exclude) != -1)||(document.newsletter.email.value.search(check)) == -1)||(document.newsletter.email.value.search(checkend) == -1)))
	{
		alert ("Please submit a correct e-mailadress");
		document.newsletter.email.focus();
		return false;
	} else if (document.newsletter.name.value == "")
	{
		alert ("Please write a message before you send your email.");
		document.newsletter.name.focus();
		return false;
	}else
	{
		return true;
	}
	
}

function CheckContact() {
	var exclude=/[^@\-\.\w]|^[@\.\-]|[\.\-]{2}|[@\.]{2}|(@)[^@]*\1/;
	var check=/@[\w\-]+\./;
	var checkend=/\.[a-zA-Z]{2,3}$/;
	
	if ((((document.contact.email.value.search(exclude) != -1)||(document.contact.email.value.search(check)) == -1)||(document.contact.email.value.search(checkend) == -1)))
	{
		alert ("Please submit a correct e-mailadress");
		document.contact.email.focus();
		return false;
	} else if (document.contact.message.value == "")
	{
		alert ("Please write a message before you send your email.");
		document.contact.message.focus();
		return false;
	} else if (document.contact.name.value == "")
	{
		alert ("Please fill in your name.");
		document.contact.name.focus();
		return false;
	} else if (document.contact.to.value == "")
	{
		alert ("Please choose a adres to send to.");
		document.contact.to.focus();
		return false;
	} else
	{
		return true;
	}
	
}

function CheckEmail() {
	var exclude=/[^@\-\.\w]|^[@\.\-]|[\.\-]{2}|[@\.]{2}|(@)[^@]*\1/;
	var check=/@[\w\-]+\./;
	var checkend=/\.[a-zA-Z]{2,3}$/;
	if ((((document.formulier.emailsub.value.search(exclude) != -1)||(document.formulier.emailsub.value.search(check)) == -1)||(document.formulier.emailsub.value.search(checkend) == -1)))
	{
		alert ("Please submit a correct e-mailadress");
		document.formulier.emailsub.focus();
		return false;
	}
	else
	{
		return true;
	}
	
}

function CheckAuth() {
	
	if (document.formulier.authorization.value == "")
	{
		alert ("Please submit your authorization code.");
		document.formulier.authorization.focus();
		return false;
	} else 	{
		return true;
	}
}


function Goto(url) {
	document.location.href=url;
}

function Uscroll(IDdiv,Umsgs,Uheight,Uspeed,Udelay,Ufirst) {

	ttxt = document.getElementById(IDdiv);
	Ustep=eval(Ufirst);
	if (ttxt.style.pixelTop>0&&ttxt.style.pixelTop<=5){
		ttxt.style.pixelTop=0;
		setTimeout("Uscroll(IDdiv,Umsgs,Uheight,Uspeed,Udelay,Ustep)",Udelay);
		return
	}
	else {
		if (ttxt.style.pixelTop>=ttxt.offsetHeight*-1){
			ttxt.style.pixelTop-=5
			setTimeout("Uscroll(IDdiv,Umsgs,Uheight,Uspeed,Udelay,Ustep)",Uspeed);
			return
		} else {
			ttxt.style.pixelTop=Uheight;
			if (Ustep>=Umsgs.length-1)
				Ustep=0
			else		
				Ustep++;
			ttxt.innerHTML=Umsgs[Ustep];
			Uscroll(IDdiv,Umsgs,Uheight,Uspeed,Udelay,Ustep);
		}
	}
}

function verticScroll(div,txt,height,speed,delay,start) {
	obj = document.getElementById(div);
	next=eval(start);
	
	if (obj.style.pixelTop>8 && obj.style.pixelTop<=13){
		obj.style.pixelTop=8;
		setTimeout("verticScroll(div,txt,height,speed,delay,next)",delay);
		return
	} else {
		if (obj.style.pixelTop>=obj.offsetHeight*-1){
			obj.style.pixelTop-=5
			setTimeout("verticScroll(div,txt,height,speed,delay,next)",speed);
			return
		} else {
			obj.style.pixelTop=height;
			if (next>=txt.length-1) {
				next=0;
			} else {
				next++;
			}
			obj.innerHTML=txt[next];
			verticScroll(div,txt,height,speed,delay,next);
		}
	}
}