function imageOn(image)
{
        if (document.images)
        {
                imgOn = eval(image + "_on.src");
                document [image].src = imgOn;
        }
}

function imageOff(image)
{
        if (document.images && section != image)
        {
                imgOff = eval(image + "_off.src");
                document [image].src = imgOff;
        }
}       

function imageOffold(image)
{
        if (document.images && section != 'dummy')
        {
                imgOff = eval(image + "_off.src");
                document [image].src = imgOff;
        }
}

function imageOffoldsub(image)
{
        if (document.images && subsection != 'dummy')
        {
               imgOff = eval(image + "_off.src");
               document [image].src = imgOff;
        }
}



/* scripting nav pagina */

section="dummy"
if(document.images){

		terug2_on = new Image ();
		terug2_on.src = '/en/images/knop_terug2_on.gif';
		terug2_off = new Image ();
		terug2_off.src = '/en/images/knop_terug2_off.gif';
	
		verder2_on = new Image ();
		verder2_on.src = '/en/images/knop_verder2_on.gif';
		verder2_off = new Image ();
		verder2_off.src = '/en/images/knop_verder2_off.gif';
		
		zoeken2_on = new Image ();
		zoeken2_on.src = '/en/images/knop_zoek_on.gif';
		zoeken2_off = new Image ();
		zoeken2_off.src = '/en/images/knop_zoek_off.gif';
/*
		over_dtz_on = new Image ();
		over_dtz_on.src = '/cust/images/over_dtz_on.gif';
		over_dtz_off = new Image ();
		over_dtz_off.src = '/cust/images/over_dtz_off.gif';
		over_dtz_active = new Image ();
		over_dtz_active.src = '/cust/images/over_dtz_active.gif';
		
		aanbod_on = new Image ();
		aanbod_on.src = '/cust/images/aanbod_on.gif';
		aanbod_off = new Image ();
		aanbod_off.src = '/cust/images/aanbod_off.gif';
		aanbod_active = new Image ();
		aanbod_active.src = '/cust/images/aanbod_active.gif';
		
		kenniscentrum_on = new Image ();
		kenniscentrum_on.src = '/cust/images/kenniscentrum_on.gif';
		kenniscentrum_off = new Image ();
		kenniscentrum_off.src = '/cust/images/kenniscentrum_off.gif';
		kenniscentrum_active = new Image ();
		kenniscentrum_active.src = '/cust/images/kenniscentrum_active.gif';
		
		uwgegevens_on = new Image ();
		uwgegevens_on.src = '/cust/images/uwgegevens_on.gif';
		uwgegevens_off = new Image ();
		uwgegevens_off.src = '/cust/images/uwgegevens_off.gif';
		uwgegevens_active = new Image ();
		uwgegevens_active.src = '/cust/images/uwgegevens_active.gif';

		diensten_on = new Image ();
		diensten_on.src = '/cust/images/diensten_on.gif';
		diensten_off = new Image ();
		diensten_off.src = '/cust/images/diensten_off.gif';
		diensten_active = new Image ();
		diensten_active.src = '/cust/images/diensten_active.gif'; */
}

function goback(){
			browser = navigator.appName
			if (browser.indexOf("etscape") > 0 ) explorer = false
			else explorer = true
			
			if (explorer) {
				history.back()
			}	
			else {
				window.back()
			}
		}


/* popup openen */		
	var newWindow
	function New_Window(url) {
		if (!newWindow || newWindow.closed) {
			newWindow = window.open(url,'New_Window','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,noresize,resizable=0,width=535,height=405'); 
			if (!newWindow.opener) {
			newWindow.opener = window
			} 
		} else {
			newWindow.location.href = url
			newWindow.focus()
		}
	}
		
		
/* --------------- HOOFDNAVIGATIE ---------------- */


//section is voor de images op actief te houden
var section='off';
//div_on is om de actieve laag visible te houden
var div_on=false;
var td_active=false;

//functie om eerst alles te sluiten, div_lagen en images
function nav_close_all() {
	section='off';	
	document.getElementById('div_over_dtz').style.visibility='hidden';
	document.getElementById('div_aanbod').style.visibility='hidden';
	document.getElementById('div_diensten').style.visibility='hidden';
	document.getElementById('div_kenniscentrum').style.visibility='hidden';
	//document.getElementById('div_contact').style.visibility='hidden';
	document.getElementById('div_uwgegevens').style.visibility='hidden';

	/* reset de navigatie naar initiële staat */
	initNavBar();

	// Code bij gebruik van preloaden van plaatjes	
/*	document.getElementById('over_dtz').src = over_dtz_off.src;
	document.getElementById('aanbod').src = aanbod_off.src;
	document.getElementById('diensten').src = diensten_off.src;
	document.getElementById('kenniscentrum').src = kenniscentrum_off.src;
	//document.getElementById('contact').src='/cust/images/contact_off.gif';
	document.getElementById('uwgegevens').src = uwgegevens_off.src;	 
*/
	
}

//functie voor sluiten (eerste) dropdownmenu, wordt vertraagd aangeroepen in close_div
function nav_close_div(div_id) {
	if(div_on==false) {
		if(section==div_id) {
			document.getElementById('div_' + div_id).style.visibility='hidden';
			switch (div_id) {
			  case 'over_dtz' : section='off';nav_out(div_id); break ;
			  case 'diensten' : section='off';nav_out(div_id); break ;	
			  case 'kenniscentrum' : section='off';nav_out(div_id); break ;	
		      case 'aanbod' : section='off';nav_out(div_id); break ;	
			  //case 'contact' : section='off';nav_out(div_id); break ;	
			  case 'uwgegevens' : section='off';nav_out(div_id); break ;				    
			}
		}
	}
}
//functie voor sluiten subdropdownmenu
function nav_close_subdiv(id_nr) {
		div=document.getElementById('div_' + id_nr);
		div.style.visibility='hidden';
	}
	
//functie voor sluiten (eerste) dropdownmenu
function close_div(name) {
	div_id=name;
	setTimeout("nav_close_div(div_id)",2000);		
	cell_reset( name );
}

//functie voor openen (eerste) dropdownmenu
function show_nav_div(name) {
	div=document.getElementById('div_' + name);
	div.style.visibility="visible";
}

function cell_on(name)	{
	cell = document.getElementById( name );
	cell.style.backgroundColor='#E4ECEC';
}

function cell_reset(name)	{
	if( section != name ) {

		cell = document.getElementById( name );
		cell.style.backgroundColor='#B8C8D9';
	
		cell.style.borderTopColor='#FFFFFF';
		cell.style.borderTopStyle='solid';
		cell.style.borderTopWidth='1px';	
	
		cell.style.borderLeftColor='#FFFFFF';
		cell.style.borderLeftStyle='solid';
		cell.style.borderLeftWidth='1px';		
		
		cell.style.borderBottomColor='#86A2BF';
		cell.style.borderBottomStyle='solid';
		cell.style.borderBottomWidth='1px';
		
		cell.style.borderRightColor='#86A2BF';
		cell.style.borderRightStyle='solid';
		cell.style.borderRightWidth='1px';
		 
		cell.style.borderRightColor='#FFFFFF';
	    cell.style.borderRightStyle='solid';
	    cell.style.borderRightWidth='1px';	
	}
}

function setSection( sectionName )	{
	section = sectionName;
}

function cell_off(name)	{
	cell = document.getElementById( name );
	cell.style.backgroundColor='#B8C8D9';
	
/*	cell.style.borderTopColor='#FFFFFF';
	cell.style.borderTopStyle='solid';
	cell.style.borderTopWidth='1px';	

	cell.style.borderLeftColor='#FFFFFF';
	cell.style.borderLeftStyle='solid';
	cell.style.borderLeftWidth='1px';		
	
	cell.style.borderBottomColor='#86A2BF';
	cell.style.borderBottomStyle='solid';
	cell.style.borderBottomWidth='1px';
	
	cell.style.borderRightColor='#86A2BF';
	cell.style.borderRightStyle='solid';
	cell.style.borderRightWidth='1px'; */
}

function cell_active(name)	{
	if( section != name ) {
		nav_close_all();
	}

	cell = document.getElementById( name );
	cell.style.backgroundColor='#B8C8D9';

	cell.style.borderTopColor='#86A2BF';
	cell.style.borderTopStyle='solid';
	cell.style.borderTopWidth='1px';	

	cell.style.borderLeftColor='#86A2BF';
	cell.style.borderLeftStyle='solid';
	cell.style.borderLeftWidth='1px';		
	
	cell.style.borderBottomColor='#FFFFFF';
	cell.style.borderBottomStyle='solid';
	cell.style.borderBottomWidth='1px';
	
	cell.style.borderRightColor='#FFFFFF';
	cell.style.borderRightStyle='solid';
	cell.style.borderRightWidth='1px';	
	
	cell.style.borderRightColor='#FFFFFF';
	cell.style.borderRightStyle='solid';
	cell.style.borderRightWidth='1px';		
	
	section=name;
	show_nav_div(name)
}

function initNavBar ()	{
	//cell_reset('home');	
	cell_reset('over_dtz');
	cell_reset('aanbod');
	cell_reset('diensten');	
	cell_reset('kenniscentrum');
	cell_reset('uwgegevens');	
}

//functie voor het aanhouden van het actieve navigatie-item
function nav_active(name)	 {
/*	nav_close_all();
	id=document.getElementById(name);
	
//	imgActive = eval( name + "_active.src" );
//	id.src = imgActive;
	
	// id.src='/cust/images/' + name + '_active.gif';
	section=name;
	show_nav_div(name)
*/
}	

//onmouseover functie voor image
function nav_on(name)	 {
/*
	if(section!=name){
		id=document.getElementById(name);
	
		imgOn = eval( name + "_on.src" );
		id.src = imgOn;	
		
		// id.src='/cust/images/' + name + '_on.gif';
		// alert(name.src);
	}
*/
}	

//onmouseout functie voor image
function nav_out(name)	 {
/*
	if(section!=name){
	
		id=document.getElementById(name);

		imgOff = eval( name + "_off.src" );
		id.src = imgOff;			
		
		// id.src='/cust/images/' + name + '_off.gif';
	}
*/
	initNavBar();
}	


/* --------- object georienteerd voor subdropdownmenu's. Lijkt ingewikkeld en dat is het ook ---------- */

	subflag=false;

	function div(id,top,left,width,visibility,border,onmouseover,onmouseout,content,position) {
		this.id=id;
		this.top=top
		this.left=left;
		this.width=width;
		this.visibility=visibility;
		this.border=border;
		this.onmouseover=onmouseover;
		this.onmouseout=onmouseout;
		this.content=content;
		this.position=position;
		
	}
	
	div.prototype.writediv=function() {
		string='<div ';
		string+='id="' + this.id + '"';
		string+='style="';
		string+='position:' + this.position + ';';
		string+='top:' + this.top + ';';
		string+='left:' + this.left + ';';
		string+='width:' + this.width + ';';
		string+='visibility:' + this.visibility + ';';
		string+='border:' + this.border + ';" ';
		string+='onmouseover="' + this.onmouseover + '" ';
		string+='onmouseout="' + this.onmouseout + '"';
		string+='>';
		string+=this.content;
		string+='</div>';
		document.write(string);
	}
	
	/*div.prototype.gettop=function() {
		id=document.getElementById(this.id);
		alert(id.offsetTop);
		alert(id.offsetLeft);	
	}
	div.prototype.getid=function() {
		id=document.getElementById(this.id);
		alert(id.id);
	}*/
	
	div.prototype.visible=function() {
		a_on=true;
		id=document.getElementById(this.id);
		id.style.visibility="visible";	
	}
	
	div.prototype.hidden=function() {
		if(subflag==false) {			
			id=document.getElementById(this.id);
			id.style.visibility="hidden";
		}	
	}
	
	function nav_color_on(td_id) {
		document.getElementById(td_id).style.backgroundColor='#FFFFFF';
	}
	
	function nav_color_off(td_id) {
		document.getElementById(td_id).style.backgroundColor='#E4ECEC';
	}	
