var linktext=new Array()
linktext[0]="The Pub - Get knackered in The Florin"
linktext[1]="What's on the menu?"
linktext[2]="For meetings and more"
linktext[3]="Super English Pubquiz, hosted by Mr. Balls"
linktext[4]="Whack the duck and breakout"
linktext[5]="How to find us"

var ns6=document.getElementById&&!document.all
var ie=document.all

function Checkfrm() 
{ 
if (document.contactformulier.realname.value == "") { 
alert("Please fill in your name");
return false;
 }
if (document.contactformulier.email.value == "") { 
alert("Please fill in your email");
return false;
 }
}


function openquiz() {
LeftPosition = (screen.width) ? (screen.width-450)/2 : 0;
TopPosition = (screen.height) ? (screen.height-250)/2 : 0;
Eerste=open("/florin/inhoud/quiz/quiz.html",
"tweede", 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,top='+TopPosition+',left='+LeftPosition+',width=450,height=250');
}

function archief() {
LeftPosition = (screen.width) ? (screen.width-600)/2 : 0;
TopPosition = (screen.height) ? (screen.height-490)/2 : 0;
Eerste=open("/florin/inhoud/archief.html",
"tweede", 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,top='+TopPosition+',left='+LeftPosition+',width=600,height=530');
}

function totalranking() {
LeftPosition = (screen.width) ? (screen.width-400)/2 : 0;
TopPosition = (screen.height) ? (screen.height-400)/2 : 0;
Eerste=open("/florin/inhoud/totalranking.html",
"tweede", 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,top='+TopPosition+',left='+LeftPosition+',width=400,height=420');
}

function show_text(thetext, whichdiv){
if (ie) eval("document.all."+whichdiv).innerHTML=linktext[thetext]
else if (ns6) document.getElementById(whichdiv).innerHTML=linktext[thetext]
}


function reset(whichdiv){
if (ie) eval("document.all."+whichdiv).innerHTML=' '
else if (ns6) document.getElementById(whichdiv).innerHTML=' '
}

function openchantant() {
Eerste=open("/florin/inhoud/chantant.html",
"tweede", 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=549,height=375');
}
function opensnack() {
Eerste=open("/florin/images/menu_snack.jpg",
"tweede", 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=400,height=575');
}
function openmenu() {
Eerste=open("/florin/images/menu_main.jpg",
"tweede", 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=800,height=575');
}

function opengame() {
LeftPosition = (screen.width) ? (screen.width-625)/2 : 0;
TopPosition = (screen.height) ? (screen.height-425)/2 : 0;
Eerste=open("game1.html",
"tweede", 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,top='+TopPosition+',left='+LeftPosition+',width=625,height=425');
}
function opengame2() {
LeftPosition = (screen.width) ? (screen.width-425)/2 : 0;
TopPosition = (screen.height) ? (screen.height-525)/2 : 0;
Eerste=open("game2.html",
"tweede", 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,top='+TopPosition+',left='+LeftPosition+',width=425,height=525');
}

function MM_preloadImages() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { 
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() {
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function onSelectboxFocus(radiobutton)
{
	radiobutton.style.background='#DDDBB5';
	 
	for (i=0; i < radiobutton.length; i++)
	{
	   if (radiobutton[i].style)
		{
   	  		radiobutton[i].style.background='#DDDBB5';
		}
	}
}

function onSelectboxBlur(radiobutton)
{
	radiobutton.style.background='#FFFCC6';
	 
	for (i=0; i < radiobutton.length; i++)
	{
	   if (radiobutton[i].style)
   		{
    		radiobutton[i].style.background='#FFFCC6';
   		}
  	}
}	
	
function NewWindow(url,width,height)
{
	var hWnd = window.open(url,"PrintWindow","width=" + width + ",height=" + height + ",toolbar=no,resizable=no,scrollbars=yes");
}

function NewWindow(mypage, myname, w, h, scroll) 
{
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',menubar=no,status=no,location=no,resizable=no,toolbar=no'
	win = window.open('', myname, winprops)
	win.document.write('<html><head><title>' + myname + '</title></head><body topmargin=0 bottommargin=0 leftmargin=0 rightmargin=0><img onclick="window.close();" src="' + mypage + '"></body></html>');

	if (parseInt(navigator.appVersion) >= 4) 
	{ 
		win.window.focus(); 
	}
}

function doIt(url) {
var x = window.showModalDialog(url,"","dialogWidth:300px; dialogHeight:200px; center:yes");
}

function refresh()
{
	window.location.reload( false );
}

// ______________________________________________________________________________
// Formulier

var fout_email_adres = "Vul een geldig E-mail adres in graag."
var fout_getal = "Dit is geen geldig getal"
// Geef alert en focus
	function GetAlert(field,error)
	{
		alert(error);
		field.focus();
		field.select();
	}

// Check op inhoud
	function isLeeg(field)
	{
		if(field.value == ""){
			return false;
		}
		return true;
	}


// E-mail check
	function isEmailAdres(field)
	{
		if (field.value.indexOf("@") == -1) {
			return false;
		}
		return true;
	}
	
	// Functions
var veld_leeg = " ben je vergeten in te vullen."
var fout_email_adres = "Vul een geldig E-mail adres in graag."
var fout_cijfer = "Dit is geen geldig getal"

var cijfers= /\d{1,}/; // Alleen nummers en minimaal 1
var postcode = /\d{4}\D{2}/
var letters = /[a-zA-Z]{1,}/; //  Alleen letters en minimaal 1
var cijfers_letters = /[a-zA-Z\d]{1,}/; //  Alleen letters en minimaal 1
var aart = /(aart)/; // Checked 1 woord
var telefoon020 = /[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9][0-9]/; // Telefoon
var zit_woord_in = /(Aart*)/; //Checked of het woord Tom ergens voorkomt
var email = /[a-zA-Z0-9]@[a-zA-Z0-9](.)[a-zA-Z\d]{2,}/; //Check voor @
var keuze = /(023-|020-|030-|050-|045-)\d{7}/ //Telefoonnummer in de volgende kengetallen