//Onderstaande functies worden gebruikt door de applicatie, veranderingen aan deze code kan een correcte werking van de applicatie verhinderen

//verkrijg base href als deze aanwezig is voor het corrigeren van iexplorer javascript links

var baseAdres = "";

if( document.getElementsByTagName ) {

	var elems = document.getElementsByTagName('base');

	if( elems.length ) {

		baseAdres = elems[0].href;

	}

}



function printPagina(){

	printVenster = open("","printWindow","width=800,height=400,left=10,top=10,resizable=yes");

	var printTekst = document.getElementById("mainContentDiv").innerHTML;

	printTekst = printTekst.replace(/<div class="etalageAfbeelding".*url\((.*)\).* .*<\/div>/ig,'<img src="$1" alt="" style="float:left;margin-right:10px;"/>');

	printTekst = printTekst.replace(/<div class="paginaAfbeeldingen".*url\((.*)\).* .*<\/div>/ig,'<img src="$1" alt="" style="float:left;"/>');

	printTekst = printTekst.replace(/<div class="etalageAfbeeldingen".*url\((.*)\).* .*<\/div>/ig,'<img src="$1" alt="" style="float:left;"/>');

	printTekst = printTekst.replace(/<div style="width.*url\((.*)\).* no-repeat.*<\/div>/ig,'<img src="$1" alt="" style="float:left;"/>');



	var printHTML = '<HTML><HEAD><TITLE>' + document.title + '</TITLE>';

	if(baseAdres != ""){printHTML += '<base href="' + baseAdres +  '/" />'} 

	printHTML += '<LINK HREF="basic.css" REL="stylesheet" TYPE="text/css"></HEAD><BODY onload="window.print()">'

	printHTML += printTekst;

	printHTML += '</BODY></HTML>'

	printVenster.document.open();

	printVenster.document.write(printHTML);

	printVenster.document.close();

}


var currentNr = 0;
function registerEvents() {

	for(var i=0;i<totalMenu;i++){

		currentNr ++;

		if(document.getElementById('subMenu' + i)){

			document.getElementById('menu' + i).onmouseover = function(){

				document.getElementById('subMenu' + this.id.substring(4)).style.display = 'block';

			}

			document.getElementById('menu' + i).onmouseout = function(i){

				document.getElementById('subMenu' + this.id.substring(4)).style.display = 'none';

			}

			document.getElementById('subMenu' + i).style.display = 'none';

		}

	}

}





//Einde applicatie functies



//voorkom lelijke omlijning van a elementen door indrukken van tab in sommige browsers

var theahrefs = document.getElementsByTagName('a'); for(var x=0;x!=theahrefs.length;x++){theahrefs[x].onfocus = function stopLinkFocus(){this.hideFocus=true;};}



var albumActive = false;



//functie om externe links automatisch in nieuw venster te tonen

window.onload = externeLinks;

function externeLinks (){

	var hostname = window.location.hostname;

	hostname = hostname.replace("www.","").toLowerCase();

	var a = document.getElementsByTagName("a");

	this.check = function(obj){

		var href = obj.href.toLowerCase();

		return (href.indexOf("http://")!=-1 && obj.target == "" && href.indexOf("javascript")==-1 && href.indexOf(hostname)==-1) ? true : false;

	};

	this.set = function(obj){

		obj.target = "_blank";

	};

	for (var i=0;i<a.length;i++){

		if(check(a[i])) set(a[i]);

	};

};
