//var currenttime = '<!--#config timefmt="%B %d, %Y %H:%M:%S"--><!--#echo var="DATE_LOCAL" -->' //SSI method of getting server date
//reeds aangemaakt in top.php

///////////Stop editting here/////////////////////////////////

var montharray=new Array("Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December");


function padlength(what){
var output=(what.toString().length==1)? "0"+what : what
return output
}

function displaytime(){
serverdate.setSeconds(serverdate.getSeconds()+1)
var datestring=padlength(serverdate.getDate())+" "+montharray[serverdate.getMonth()]+" "+serverdate.getFullYear()
var timestring=padlength(serverdate.getHours())+":"+padlength(serverdate.getMinutes())+"</b>:"+padlength(serverdate.getSeconds())
document.getElementById("servertime").innerHTML=datestring+" <b>"+timestring
}


// firefox height="62"

//-------------------------------------------------------------------------------------------
function popUp(NAME,URL,TITLE,SCROLL,RESIZABLE,WIDTH,HEIGHT,LOCATION) {
if(!RESIZABLE)	{RESIZABLE=0;}
if(!HEIGHT)		{HEIGHT=500;}
if(!WIDTH)		{WIDTH=600;}
if(!LOCATION)	{LOCATION=0;}
day = new Date();
id = day.getTime();
msgWindow = window.open(URL,TITLE,'toolbar=0,scrollbars='+SCROLL+',location='+LOCATION+',statusbar=0,menubar=0,resizable='+RESIZABLE+',width='+WIDTH+',height='+HEIGHT+',left=50,top=50');
/*if (msgWindow.opener == null) msgWindow.opener = self;
*/
}
//-------------------------------------------------------------------------------------------
function messageWindow(title, msg,WID,HEI)

{
  var width=WID, height=HEI;
  var left = (screen.width/2) - width/2;
  var top = (screen.height/2) - height/2;
  var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;
  var msgWindow = window.open("","msgWindow", styleStr);
  var head = '<head><title>'+title+'</title></head>';
  var body = '<center>'+msg+'<br><p><form><input type="button" value="   Sluiten   " onClick="self.close()"></form>';
  msgWindow.document.write(head + body);
}



//------------------------------------------------------------------------------------------- divs laten megaan met scrollen
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function JSFX_FloatDiv(id, sx, sy)
{
	var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
	var px = document.layers ? "" : "px";
	window[id + "_obj"] = el;
	if(d.layers)el.style=el;
	el.cx = el.sx = sx;el.cy = el.sy = sy;
	el.sP=function(x,y){this.style.left=x+px;this.style.top=y+px;};

	el.floatIt=function()
	{
		var pX, pY;
		pX = (this.sx >= 0) ? 0 : ns ? innerWidth : 
		document.documentElement && document.documentElement.clientWidth ? 
		document.documentElement.clientWidth : document.body.clientWidth;
		pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? 
		document.documentElement.scrollTop : document.body.scrollTop;
		
		if(this.sy<0) 
		pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ? 
		document.documentElement.clientHeight : document.body.clientHeight;
		this.cx += (pX + this.sx - this.cx)/8;this.cy += (pY + this.sy - this.cy)/8;
		this.sP(this.cx, this.cy);
		setTimeout(this.id + "_obj.floatIt()", 40);
	}
	return el;
}
//----------------------------------------------------------------------
//-------------------
function hide(id){
	document.getElementById(id).style.display  = "none";
}
function show(id){
	document.getElementById(id).style.display  = "block";
}
function inner(id,text){
	document.getElementById(id).innerHTML= text;
}
function innerform(form,value) {
	document.getElementById(form).value = value;
}
// Iframes page, show element hide all other iframes
function selectedclass(id){
	document.getElementById(id).className  = "selected_item";
}
function noclass(id){
	document.getElementById(id).className  = "";
}


function iframe_show(showpage){
	var pages = this.iframepages;	
	for (var j = 0; j < pages.length; j++) {
		var page = pages[j];
		if(page==showpage){
			show(page);
			selectedclass("text_"+page);
		} else {
			hide(page);
			noclass("text_"+page);
		}
				
	}
}
					 
					 
//------------------------------------------------
function calendar(FORM,FIELD) {
	window.open('/functions/calender/calendar.php?form='+FORM+'&field='+FIELD,'','top=50,left=400,width=175,height=140,menubar=no,toolbar=no,scrollbars=no,resizable=no,status=no'); 
}
function deleteMessage(text,url){
	if(confirm(text))
		this.location.href = url; 
}
