window.onload = doen;
var zoz = '';
var p = 2;
var max;
var nr;
var isIE = (navigator.appName.indexOf("Microsoft") != -1)+1-1;
var hasFlash = hf();
if (isIE) document.execCommand("BackgroundImageCache", false, true);
document.write('<style type="text/css">#ww{visibility:visible !important}</style>');

function hf(){
	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;
}



function doen(){

	if (document.getElementById("banner") && hasFlash){
		document.getElementById("banner").innerHTML = flash("/doorn/slide/slide.swf", "500", "250", '#000000', '', "")
	}
	if (document.getElementById("zoekvelden") || document.getElementById("banner")) {leegCookies();} 
	if (eId("beeld") && hasFlash){
		eId("beeld").innerHTML = flash("/doorn/zoom.swf", "100%", "100%", '#FFFFFF', 'opaque', "pad=/_zoom/" + eId("beeld").title + "&zoz=" + zoz + "&Klaar=1");
		eId("beeld").title ='';
	}
	if (eId("ww")){
		//eId("ww").innerHTML = '<span>in winkelwagen:</span><span id="PixxerBestelknop"><a href="javascript:gaWw()">uw winkelwagen</a></span>' + eId("ww").innerHTML;
	}
	if (eId("PixxerSelection")) eId("PixxerSelection").onclick=function() {location.href='winkelwagen'};
}

function bb(){if (hasFlash) document.write('<script>//')}
function eb(){if (hasFlash) document.write('</script'  + '>')}

function gaWw(){document.location='http://www.oypo.nl/winkelwagen/?cart=' + winkelwagen + '&amp;retourlink=http://fotocollectie.huisdoorn.nl';}

function eId(w){return document.getElementById(w);}
	
function leegCookies(){
	document.cookie = "map_zoom=; path=/";
	document.cookie = "map_lat=; path=/";
	document.cookie = "map_lng=; path=/";
}

function bladeren(n){
	p = p + n;
	if (p > max) p=0;
	if(p < 0) p=max;
	verzetp(p);
}


function verzetp(w){
		eId('bl1').href = "/lijst?objectnummer=" + nr + "&pagina=" + w;
		eId('bl2').href = "/lijst?objectnummer=" + nr + "&pagina=" + (w+1);
		eId('bl1').title = "Ga naar foto's p. " + p; eId('bl2').title = "Ga naar foto's p. " + (p+1);
		eId('pagnr').innerHTML = 'pagina ' + p + '-' + (p+1) + ' van ' + max;
		eId('spread').style.backgroundImage = "url('/beeld/_670/" + nr + " pag." + w + "_" + (w + 1) + ".jpg')"
}


function flash(movie, w, h, bg, wm, flashvars){
	if (isIE){
		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 + '" /><param name="FlashVars" value="' + flashvars + '" /><param name="quality" value="high" /><param name="menu" value="false" /><param name="wmode" value="' + wm + '" /><param name="bgcolor" value="' + bg + '" /></object>';
	} else {
		return '<embed src="' + movie + '" quality="high" wmode="' + wm + '" bgcolor="' + bg + '" menu="false" width="'+ w + '" height="'+ h + '" FlashVars="' + flashvars + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';}
}
