if (top!=self) top.location.href='default.asp';

var breedte=790;  // 20px te breed ivm evt. verticale scrollbalk...

function objRef(id) {return document.getElementById(id)}
function styleRef(id) {return this.objRef(id).style}

function getX(id) {return getOffsetLeft(id)}
function getY(id) {return getOffsetTop(id)}

function setX(id, xPos) {styleRef(id).left=xPos}
function setY(id, yPos) {styleRef(id).top=yPos}

function clipLayer(layer,w,h) {styleRef(layer).clip='rect(0px,'+w+'px,'+h+'px,0px)'}

function loadPage() {location.reload()}

function findPos(obj){
	var posX=obj.offsetLeft;
	var posY=obj.offsetTop;
	while(obj.offsetParent){
		posX=posX+obj.offsetParent.offsetLeft;
		posY=posY+obj.offsetParent.offsetTop;
		if(obj==document.getElementsByTagName('body')[0]){break}
		else{obj=obj.offsetParent;}
	}
	return [posX,posY]
}

var sw,sh // ,xNav;
var opera=false; 

if (navigator.userAgent && (navigator.userAgent.indexOf("Opera") >= 0)) opera=true;

function loadHandler(){
	if (opera){
		origWidth  = this.innerWidth;
		origHeight = this.innerHeight;
		resizeHandler();
	}
	if (objRef('frameC')) {
		inith4('kolom1');
		if (objRef('frameC').innerHTML.length==0) objRef('kolom1').innerHTML='&nbsp;';
	}
	if (objRef('frameD')) {
		inith4('kolom3');
		if (objRef('frameD').innerHTML.length==0) objRef('kolom3').innerHTML='&nbsp;';
	}
}

function resizeHandler(){
	if (this.innerWidth != origWidth  || this.innerHeight != origHeight) location.reload();
	setTimeout('resizeHandler()',500);
}


function getScreenDim(){
	if (document.all && !opera){
		sh=document.body.offsetHeight;
		sw=document.body.offsetWidth;
	} else {
		sh=window.innerHeight;
		sw=window.innerWidth;		
	}
	if (sw/sh > breedte/480){
		imageHeight=parseInt((sw/breedte)*480);
		imageWidth=sw;
	} else {
		imageWidth=parseInt((sh/480)*breedte);
		imageHeight=sh;
	}
}	

function showPage(marges){
	// marges=130;
	if (objRef('frameC')) {
		pos=findPos(objRef('kolom1bottom'));
		if (pos[1]>sh-marges) styleRef('kolom1container').height=(sh-marges)+'px'
		styleRef('kolom1container').visibility='visible';
	}
	if (objRef('frameD')) {
		pos=findPos(objRef('kolom3bottom'));
		if (pos[1]>sh-marges) styleRef('kolom3container').height=(sh-marges)+'px'
		styleRef('kolom3container').visibility='visible';
	}
//	setTimeout('alert();window.location.hash="#spllst"',2000)
//	alert('test');
//	window.location.hash='#spllst'
//	window.location="#spllst"
}	

function hl(id){
	b=id.src;
	s=(b.substring(b.length-4,b.length-5)==0)?'1':'0';
	id.src=(b.substring(b.length-5,0)+s+b.substring(b.length,b.length-4));
}

function hlhm(nr,s){
	objRef('hmenu'+nr).src=(s==1)?'grafisch/mnu_'+nr+'_1.png':'grafisch/mnu_'+nr+'_0.png'
	styleRef('hmenut'+nr).visibility=(s==1)?'visible':'hidden'
}

function inith4(id) {
	var titel='';
	var tags=objRef(id).getElementsByTagName('h4')
	for (count=0;count<tags.length;count++){
		if (titel!='') titel+=' - ';
		titel+='<a href="javascript:showh4(\''+id+'\','+count+')">'+tags[count].innerHTML+'</a>'
		// if (count>0) tags[count].innerHTML=tags[count].innerHTML+'<a href="javascript:showtop();"><img src="images/up.gif" width="13" height="13" alt="naar boven" border="0"></a>'
	}
	document.getElementById(id+'kopjes').innerHTML=titel;
}

function showh4(id,n) {
	objRef(id+'container').scrollTop=findPos(objRef(id).getElementsByTagName('h4')[n])[1]-60
}


// browserdetectie
var d, dom, ie, ie4, ie5x, moz, mac, win, lin, old, ie5mac, ie5xwin, op;
d = document;
n = navigator;
na = n.appVersion;
nua = n.userAgent;
win = ( na.indexOf( 'Win' ) != -1 );
mac = ( na.indexOf( 'Mac' ) != -1 );
lin = ( nua.indexOf( 'Linux' ) != -1 );

if ( !d.layers ){
	dom = ( d.getElementById );
	op = ( nua.indexOf( 'Opera' ) != -1 );
	konq = ( nua.indexOf( 'Konqueror' ) != -1 );
	saf = ( nua.indexOf( 'Safari' ) != -1 );
	moz = ( nua.indexOf( 'Gecko' ) != -1 && !saf && !konq);
	ie = ( d.all && !op );
	ie4 = ( ie && !dom );

	/*
	ie5x tests only for functionality. ( dom||ie5x ) would be default settings. 
	Opera will register true in this test if set to identify as IE 5
	*/

	ie5x=( d.all && dom );
	ie5mac=( mac && ie5x );
	ie5xwin=( win && ie5x );
	ie6win = ( win && nua.indexOf('MSIE 6.0') != -1 );
	ie7win = ( win && nua.indexOf('MSIE 7.0') != -1 );
}

