var isIE = (navigator.appName.indexOf("Microsoft") != -1 && navigator.appVersion.indexOf("Windows") > -1)+1-1;
window.onload = zetHeader;
window.onresize = menuBg;
window.name = 'mswindow';
var hooft

function  zet(str){document.write(str)}

function gedicht(nr){
	if (eId('gedicht' + nr).style.display == 'block') {eId('gedicht' + nr).style.display = 'none'} else {eId('gedicht' + nr).style.display='block'}
	for (var i=1; i<4; i++){
		if (i != nr) eId('gedicht' + i).style.display = 'none'
	}
	location.hash='#gedichten';
}

function zetHeader(){
	if (eId("hooftani")) {
		if (hasFlash) {eId("hooftani").innerHTML = flash("hooft_animatie", 600, 514, '')}
		else {eId("hooftani").innerHTML = '<a href="hooft.aspx"><img src="gif/hooftophol.png" alt="Hooft op Hol"/></a>'}
		}
	else {
	hooft = eId("hooftlogo");
	menuBg(); kopje();
	if (eId("header") && hasFlash) { 
	
			if (!hooft) {
				eId("header").innerHTML = flash("boven","100%","150", "img=" + strook);}
			else {
				eId("header").innerHTML = flash("boven_hooft","100%","160", "img=" + strook);}
	}
	
	var anchors = eId('tekst').getElementsByTagName('a');
	for (var i=0; i<anchors.length; i++){
			if (anchors[i].href.toLowerCase().indexOf('.jpg') > 1 ) {
				anchors[i].onclick = function () {return groot(this.href);}
			}
			if (anchors[i].href.toLowerCase().indexOf('clipframe') > 1 ) {
				anchors[i].onclick = function () {return popup(this.href);}
			}			
		}			
	}
}
function kopje(){if (eId("kopje") && !hooft){
	txt = eId("kopje").innerHTML;
	txt = txt.replace("?","");
	txt = txt.replace("/","");
	eId("kopje").innerHTML = '<img src="gif/kopjes/' + txt + '.gif" alt="' + txt + '" />';}
}

function menuBg(){
	if (!eId("hooftani")) {
		if (document.body.offsetWidth < 1000 )	{
		eId("menu").className = "bg";	
		} else {eId("menu").className = "";	}
	}
}


function groot(url){
	grootWindow = window.open('groot.aspx?img=' + url,'venster','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=500,height=500,copyhistory=0,left=50,top=50,screenX=50,screenY=50');
	if (grootWindow != null) grootWindow.focus();
	return false;}
	
function popup(url){
	grootWindow = window.open(url,'venster','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=340,height=280,copyhistory=0,left=50,top=50,screenX=50,screenY=50');
	if (grootWindow != null) grootWindow.focus();
	return false;}	
	

function locares(url){
	window.open('http://www.locares-muiderslot.nl/' + url,'_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,width=850,height=550,screenX=75,screenY=75,left=75,top=75,align=center');
}

function flash(movie, w, h, flashvars){
	return '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" id="'+movie+'" width="'+ w + '" height="' + h + '"><param name="movie" value="' + movie + '.swf" /><param name="FlashVars" value="' + flashvars + '" /><param name="quality" value="high" /><param name="menu" value="false" /><param name="wmode" value="transparent" /><embed src="' + movie + '.swf" quality="high" wmode="transparent" menu="false" width="'+ w + '" height="'+ h + '" FlashVars="' + flashvars + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';

}

function eId(id){
	return document.getElementById(id);
}


var hasFlash = function(){
	var nRequiredVersion = 7;
	if(isIE){
		document.write('<script language="VBScript"\> \non error resume next \nhasFlash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & ' + nRequiredVersion + '))) \n</script\> \n');
		if(window.hasFlash != null){ return window.hasFlash;};
	};
	if(navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){
		var flashDescription = (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description;
		var vr = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1)); if (vr < 4) vr += 10;	
		return vr >= nRequiredVersion;
	};
	return false;
}();