//==show status===================================================

function showStatus() {
        self.status = 'Jongeren Informatie Punt';
        return true;
}

//--image flip-----------------------------------------------------
/*
if (document.images){

        function goIn (i, which) {
        document.images[i].src = "../images/buttons-" + i + "x1on.gif";
	}


        function goOut (i, which) {
        document.images[i].src = "../images/buttons-" + i + "x1.gif";
        }
}
*/
//=================================================================
// force frameset to load into frameset
//
/*
if (top.location == self.location) {
	top.location = "../index.html"
}
*/

//--OF DEZE-------------------------------------------------------

/*
if (top.frames.length != 3)
  {
    top.location="plaats hier je start pagina.html";
  }
// -->

*/
//==============================================================
// focus het email adres
//
/*
function giveFocus(){
        document.myForm.email.focus();
}
*/
//==================================================================
// Email adres validatie
//
/*
function search(string){
        var where=string.indexOf('@','0') + 1;
        var dot=string.indexOf('.','0') + 1;

        if (dot == 0 || where == 0){
        alert("Je email adres bevat fouten, verbeter het adres en stuur opnieuw")
        document.myForm.email.focus();
        }
        else {
        document.myForm.submit();
        }
}
*/
//=================================================================
// popup voor kaartje nederland
// save for now==function Popup(page,w,h,s) {

function PopRegio() {

//var base = "http://www.jip.org/lan/docs/" ;
//var base = 'D:\www\projecten\jiplandelijk_project\site\docs\';
//base= "file:///D|/www/projecten/jiplandelijk_project/site/docs/";

//newWin ="width=10,height=10,location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes";
var pageRegio="../popup/base_pop_regio.html"
var regioWin = window.open(pageRegio,"winPopRegio","width=290,height=430,location=no,"+
"toolbar=no,menubar=no,screenX=1,screenY=1,scrollbars=no,resizable=no");
regioWin.focus();
}

//===================================================================
// popup voor texten

function PopText(pageT,w,h,s) {

var textWin = window.open(pageT,"winPopText","width="+w+
",height="+h+",location=no,toolbar=no,menubar=no,screenX=10,screenY=10,scrollbars="+s+",resizable=yes");
textWin.focus();

}
//===================================================================
// popup voor smsvraag

function Popsms() {
var pageMail="../popup/base_pop_sms.html";

var mailWin =window.open(pageMail,"winPopMail","width=425,height=400,location=no,"+
"toolbar=no,menubar=no,screenX=10,screenY=10,status=no,scrollbars=no,resizable=no");
mailWin.focus();

}

//===================================================================
// popup voor peiling

function PopPeiling(w,h,s) {

var pageP="../poll/poll_it.cgi"

var peilingWin = window.open(pageP,"winPopPeiling","width="+w+
",height="+h+",location=no,toolbar=no,menubar=no,screenX=150,screenY=150,scrollbars="+s+",resizable=yes");
peilingWin.focus();

}

//===================================================================
// popup voor adressen

function PopAdressen() {
//old var
//var pageAdressen="../popup/base_pop_adressen.html";

//new var
var pageAdressen="../popup/adressen.php"

var adressenWin = window.open(pageAdressen,"winPopAdressen","width=525,height=425,location=no,"+
"toolbar=no,menubar=no,screenX=100,screenY=100,scrollbars=yes,resizable=no");
adressenWin.focus();

}

//===================================================================
// popup voor sms

function PopSms() {
var pageSms="../sms/index.html";

var smsWin =window.open(pageSms,"winPopSms","width=350,height=375,location=no,"+
"toolbar=no,menubar=no,screenX=10,screenY=10,scrollbars=no,resizable=no");
smsWin.focus();

}

//===================================================================
// popup voor colofon [doorwie]

function PopColofon() {
var pageColofon="../popup/base_pop_colofon.html";

var colofonWin =window.open(pageColofon,"winPopColofon","width=475,height=420,location=no,"+
"toolbar=no,menubar=no,screenX=10,screenY=10,scrollbars=no,resizable=no");
colofonWin.focus();

}

//===================================================================
// popup voor email

function PopMail() {
var pageMail="../popup/base_email.html";

var mailWin =window.open(pageMail,"winPopMail","width=425,height=400,location=no,"+
"toolbar=no,menubar=no,screenX=10,screenY=10,status=no,scrollbars=no,resizable=no");
mailWin.focus();

}

//===================================================================
// popup voor interviews

function PopIntv(pageIntv) {
//var IntvWin=loc;

var IntvWin =window.open(pageIntv,"winPopIntv","width=475,height=420,location=no,"+
"toolbar=no,menubar=no,screenX=10,screenY=10,scrollbars=yes,resizable=no");
IntvWin.focus();

}

//===================================================================
// update parent

function UpdParent(loc)
{
opener.location.href=(loc);
}

//==================================================================
// nieuwe showpopup
// Designed by Mike Morgan (michmor@regent.edu)
// 30 Apr 99
function showPopup(theWord, theMessage)
{
   // Note: Be sure there are no spaces in the option parameter of window.open. For
   //   example, don't write "width=400, height=50"
   // Note: Don't trust browser defaults. If you're going to set any option, set them all.

   // Make a new, empty window
   thePopupWindow =
     self.open("", "popup", "toolbar=no,location=no,directories=no,status=no," +
                              "menubar=no,scrollbars=no,resizable=no," +
                              "width=350,height=10");

   // Write a simple Web page into the document of the new Window

  thePopupWindow.document.write("<HTML><HEAD></HEAD>");
  thePopupWindow.document.write("<BODY BGCOLOR='navy' TEXT='yellow'><BIG><P>");
  thePopupWindow.document.write(theWord + theMessage);
  thePopupWindow.document.write("</BIG></BODY></HTML>");

  // Close the document, making the contents visible.
  thePopupWindow.document.close();
}

function hidePopup()
{
  // Close the window
  thePopupWindow.close();
}

//============================================================================
// open jabberchat window

    function PopChat() {
        //jabber_url = "http://www.jip.org/lan/chat/login.html";
        jabber_url = "../chat/login.html"; //See the above line for an example
        if (!document.images) {
            msg = "Sorry, je browser kan deze chatfunctie niet aan. ";
            msg = msg + "Gebruik netscape of explorer versie, ";
            msg = msg + "4.0 of nieuwer. (Beschikbaar op www.netscape.com).";
            window.alert(msg); return;
        }
        lchatwin=window.open(jabber_url,"LCHATWINDOW",
        "status=no,toolbar=no,location=no,menu=no,screenX=10,screenY=10,resizable=no,width=620,height=412");
    }

//================================================================
// opent popup met definitie's
// Geen base url omdat adressen.html in dezelfde dir staat als de doc's die hem aanroepen.
// Dit script werkts samen met een klein script in adressen.html
// Met dank aan acdhirr@trielobiet.nl
//

function openDef(index)
{

  //clearTimout(timer)
  var nWidth = screen.width-60;
  var yOffset = screen.height - 190;
  footwin= window.open("base_def.html#" + index, "newwin2", "width=" + nWidth  + ",height=20,location=no,toolbar=no,menubar=no,scrollbars=yes,screenX=30,screenY=" + yOffset + ",left=30,top=" + yOffset);
  footwin.focus();
}

/*
  var nWidth = screen.width-215;
  var yOffset = screen.height - 190; misschien voor later gebruiken
  footwin= window.open("base_def.html#" + index, "newwin2", "width=500,height=25,location=no,toolbar=no,menubar=no,scrollbars=no,screenX=30,screenY=30,left=" + nWidth + ",top=" + yOffset + ");
  footwin.focus();

//footwin.onBlur=footwin.close(); werkt om een of andere reden niet
*/

/*
function sluiten()
{
var timer=setTimeout("window.close()",1000);
}

}
*/
//=============================================================================

//=========================================begin kwis===========================
/* GameQuiz v1.0 by Monichar.
   Copyright (c) of Monichar, 1997.
   Permission to use, edit, etc. granted as long as the head section is intact!
*/

var ans = new Array;
var done = new Array;
var score = 0;
// slimmerik, zo is het wel heel erg makkelijk!

ans[1] = "g";
ans[2] = "g";
ans[3] = "g";
ans[4] = "g";
ans[5] = "g";
ans[6] = "g";
ans[7] = "g";
ans[8] = "g";
//ans[9] = "g";
//ans[10] = "g";
//ans[11] = "g";
//ans[12] = "g";
//ns[13] = "g";
//ans[14] = "g";


function Engine(question, answer) {

	if (answer != ans[question]) {
		if (!done[question]) {
			done[question] = -1;
			alert("Fout\nje score is nog steeds: " + score);
		    	}
		else {
			alert("zonde! je mag geen per vraag maar een antwoord geven");
			}
		}
	else {
		if (!done[question]) {
			done[question] = -1;
			score++;
			alert("geweldig antwoord\neh even optellen: " + score);
		    	}
		else {
			alert("zonde! je mag per vraag maar een antwoord geven");
			}
		}

}

function NextLevel () {
	if (score >= 7 && score <= 8) {
                alert ("Met zo'n score kan je zo bij het JIP gaan werken !")
		}

        else {
		if (score >=2 && score <8){
		alert("Het gaat lekker \nJe score is: " + score + "!");
		}
		else
		alert("je hebt slecht ... dan krijg je slechter .... en dan pas krijg je jouw prestatie .... het is een schande!");
	}

}

function verstuur() {
	if (score == 8) {
		document.myForm.submit()
	}
	else{
		alert("je hebt niet alle vragen goed")
	}
}
//==========================einde kwis===================================================>
