function clear()
{
var counter = 5
for(x=1;x<=counter;x++)
{
document.getElementById('menu_'+x).style.display="none";
}
}
function toggle(id)
{
if(document.getElementById('menu_'+id).style.display!="block")
{
clear()
document.getElementById('menu_'+id).style.display="block";
}
else
{
document.getElementById('menu_'+id).style.display="none";
}
}
function label_toggle(type,text,size)
{
label=document.getElementById('ucp-label');
label.innerHTML=text;
label.style.width=size+"px";
label.style.display="block";
}
function label_hide()
{
label=document.getElementById('ucp-label');
label.style.display="none";
}


function frame_setup(title,width,height,url,close,fullscreen)
{
if(close==undefined)
{
close=true;
}
var button='<a href="javascript:frame_close()"></a>'
if(close==false)
{
button="";
}
popcontainer=document.getElementById('pop-container');
popcontainer.style.width=width+"px"
popcontainer.style.height=height+"px"
popcontainer.style.marginLeft="-"+(width/2)+"px"
popcontainer.style.marginTop="-"+(height/2)+"px"
popcontainer.style.display="block";
document.getElementById('pop-tcenter').innerHTML=button+title;
document.getElementById('pop-frame').setAttribute('src',url);
document.getElementById('popframe-bg').style.display="block";
if(fullscreen==true)
{
frame_fullscreen()
}
}

function frame_fullscreen()
{
if(confirm('Deze applicatie will in fullscreen draaien, geeft u toestemming?'))
{
//zoek de window size informatie op
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    width = window.innerWidth;
    height= window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    width = document.documentElement.clientWidth;
    height= document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    width = document.body.clientWidth;
    height= document.body.clientHeight;
  }
popcontainer=document.getElementById('pop-container');
popcontainer.style.width=width+"px"
popcontainer.style.height=height+"px"
popcontainer.style.marginLeft="-"+(width/2)+"px"
popcontainer.style.marginTop="-"+((height/2)-25)+"px"
}
}
function frame_close()
{
document.getElementById('pop-frame').setAttribute('src','about:blank');
document.getElementById('pop-container').style.display="none";
document.getElementById('popframe-bg').style.display="none";
}

/*
function frame_setup(title,width,height,url,close)
{
if(close==undefined)
{
close=true
}
var button='<a href="javascript:frame_close()" id="popframe-close">X</a>';
if(close==false)
{
button="";
}
popcontainer=document.getElementById('popframe-container');
popcontainer.style.width=(width+2)+"px"
popcontainer.style.height=(height+22)+"px"
popcontainer.style.marginLeft="-"+((width+2)/2)+"px"
popcontainer.style.marginTop="-"+((height+22)/2)+"px"
popcontainer.style.display="block";
document.getElementById('popframe-title').innerHTML=button+title;
document.getElementById('popframe-body').setAttribute('src',url);
document.getElementById('popframe-body').style.height=height+"px";
document.getElementById('popframe-body').style.width=width+"px";
document.getElementById('popframe-bg').style.display="block";
}
function frame_close()
{
document.getElementById('popframe-body').setAttribute('src','about:blank');
document.getElementById('popframe-container').style.display="none";
document.getElementById('popframe-bg').style.display="none";
}
*/
var lastedit
var first=true
var curMS
function keeper_send()
{
tim=new Date();
curMS=tim.getTime();
ajaxpack.getAjaxRequest("scripts/clock.php", 'ran='+curMS, keeper_return, "txt")
}
function keeper_return()
{
	var myajax=ajaxpack.ajaxobj
	var myfiletype=ajaxpack.filetype
	if (myajax.readyState == 4)
	{
		if (myajax.status==200 || window.location.href.indexOf("http")==-1)
		{
		var temp=myajax.responseText
		document.getElementById('clock').innerHTML=temp.replace('-',':')
		tim = new Date();
		var thistime=tim.getTime();
		thistime=thistime-curMS
		conn=document.getElementById('connection')
		if(thistime<100)     	{conn.className="connection-5";}
		else if(thistime<500)	{conn.className="connection-4";}
		else if(thistime<1000)	{conn.className="connection-3";}
		else if(thistime<1500)	{conn.className="connection-2";}
		else if(thistime<2000)	{conn.className="connection-1";}
		else								 {conn.className="connection-0";}
		pinglogdata=document.getElementById('pinglog')
		percent=Math.floor(thistime/2000*100)
		if(thistime>2000)
		{
		pinglogdata.innerHTML='<div style="height:22px;margin-bottom:1px;width:500px;overflow:hidden;"><div style="border:1px dotted #000000;height:20px;width:498px">'+percent+'%<br>['+thistime+']</div></div>'+pinglogdata.innerHTML;
		}
		else if(thistime>1500)
		{
		pinglogdata.innerHTML='<div style="height:22px;margin-bottom:1px;width:500px;overflow:hidden;"><div style="background-color:#FF0000;height:22px;width:'+thistime/4+'px">'+percent+'%<br>['+thistime+']</div></div>'+pinglogdata.innerHTML;
		}
		else if(thistime>1000)
		{
		pinglogdata.innerHTML='<div style="height:22px;margin-bottom:1px;width:500px;overflow:hidden;"><div style="background-color:#FF8000;height:22px;width:'+thistime/4+'px">'+percent+'%<br>['+thistime+']</div></div>'+pinglogdata.innerHTML;
		}
		else if(thistime>500)
		{
		pinglogdata.innerHTML='<div style="height:22px;margin-bottom:1px;width:500px;overflow:hidden;"><div style="background-color:#FFC200;height:22px;width:'+thistime/4+'px">'+percent+'%<br>['+thistime+']</div></div>'+pinglogdata.innerHTML;
		}
		else if(thistime>100)
		{
		pinglogdata.innerHTML='<div style="height:22px;margin-bottom:1px;width:500px;overflow:hidden;"><div style="background-color:#80FF00;height:22px;width:'+thistime/4+'px">'+percent+'%<br>['+thistime+']</div></div>'+pinglogdata.innerHTML;
		}
		else
		{
		pinglogdata.innerHTML='<div style="height:22px;margin-bottom:1px;width:500px;overflow:hidden;"><div style="background-color:#00FF00;height:22px;width:'+thistime/4+'px">'+percent+'%<br>['+thistime+']</div></div>'+pinglogdata.innerHTML;
		}
		setTimeout('keeper_send()',30000);
		}
	}
}
function pinglog()
{
	el=document.getElementById('pinglog')
	if(el.style.display=="block")
	{
		el.style.display="none"
	}
	else
	{
		el.style.display="block"
	}
}
window.onload = function() {
  var element = document.getElementById('barcontainer');
  element.onselectstart = function () { return false; } // ie
  element.onmousedown = function () { return false; } // mozilla
}
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=345px,height=210px');");
}