var Opera = window.opera ? true : false;

// ----------------------- CLIENT-CHECK
function getClient() {
	// convert all characters to lowercase to simplify testing
	var agt=navigator.userAgent.toLowerCase()
	var apv=navigator.appVersion.toLowerCase()
	this.major = parseInt(navigator.appVersion)
	// browserversion
	this.ns  = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1)))
	this.gecko = (this.ns && (this.major >= 5))
	this.ie   = (agt.indexOf("msie") != -1)
	this.ie4  = (this.ie && (this.major == 3))
	this.ie45 = (agt.indexOf('msie 4.5') != -1);
	this.ie5  = (this.ie && (this.major == 4))
	// IE 5 or 5.5
	this.ie555 = (agt.indexOf('msie 5.5') != -1);
	//Safari
	this.isSafari = (agt.indexOf('safari') != - 1);
	this.versionMinor = parseFloat(navigator.appVersion); 
	this.isSafari10 = ((this.isSafari) && (this.versionMinor < 87));
	//Mozilla
	this.moz = ((agt.indexOf('mozilla') != -1)&& (agt.indexOf('gecko') != -1) && (agt.indexOf('netscape') == -1));
	// platform
	this.mac = (apv.indexOf("macintosh")>0);
	// compatible browsers
	this.ie4comp = ((this.ie4 && !this.mac) || this.ie45 || this.ie5)
	this.comp = (this.ie4comp || this.gecko);
	return (this)
}

var is = new getClient();

// Scroll when mousewheel is moved.
function Wheel(iDelta)
{
	iDelta *= 20;
  	window.scrollBy(0,iDelta)
};

// Local Connection ID
var iConnectionID = Math.floor(Math.random()*11);

// flash detection
is.flash=0;
is.flashsub=0;
is.maxflashver=10;

is.cap = new Object();
if (is.ie && !is.mac) is.cap.object = 1;
if (is.cap.object) is.cap.fscommand = 1;

if (is.ie && !is.mac) {
	for (sys_i=2;sys_i<=is.maxflashver;sys_i++) { eval('var sys_fl'+sys_i+'=false'); }
	document.write('<SCR'+'IPT LANGUAGE=VBScript\>\n');
	document.write('on error resume next \n');
	for (sys_i=2;sys_i<=is.maxflashver;sys_i++) { document.write('sys_fl'+sys_i+'=(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+sys_i+'")))\n'); }
	document.write('</SCR'+'IPT\>\n');
	for (sys_i=2;sys_i<=is.maxflashver;sys_i++) { if (eval('sys_fl'+sys_i)==true) is.flash=sys_i; }
} else if (navigator.mimeTypes && navigator.mimeTypes['application/x-shockwave-flash'] && navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin) {
	var sys_plugname=navigator.plugins['Shockwave Flash'].description;
	is.flash=parseInt(sys_plugname.substring(sys_plugname.indexOf('.')-1));
	is.flashsub=parseInt(sys_plugname.substring(sys_plugname.indexOf('r')+1));
}

is.flash=parseFloat(is.flash+'.'+is.flashsub);

function GetObj( sys_id ) {
	if (typeof(sys_id)=='string') {
		if (is.moz) return document.getElementById(sys_id);
		else return document.all[sys_id];
	} else return (sys_id);
}

function IsSet( anything ) {
	if ((typeof(anything) != 'undefined') && (anything != '')) return (true); else return (false);
}

function AddArgs( sUrl, sArgs ) {	
	if (sUrl.indexOf('?')>0) return(sUrl+'&'+sArgs); else return(sUrl+'?'+sArgs); 
}

function getAbsX( sDiv ) {
	id = GetObj(sDiv);
	var curleft = 0;
	while (scr_id) {
		curleft += id.offsetLeft;
		id = id.offsetParent;
	}
	return curleft;
}
function getAbsY( sDiv ) {
	id = GetObj(sDiv);
	var curtop = 0;
	while (id) {
		curtop += id.offsetTop;
		id = id.offsetParent;
	}
	return curtop;
}

function setFold( sDiv, iHeight) {
	//alert("get here" + sDiv + " height " + iHeight);
	if (is.moz) {
		GetObj(sDiv).style.height = iHeight+'px';
	} else {
		GetObj(sDiv).style.pixelHeight = iHeight;
	}
}

function scrollIntoView( sDiv, iOffset )
{
	self.scrollTo(0, getAbsY(sDiv)+iOffset );
}

function swfCommand( sAction, sArgs )
{
	//alert("test");
	if (sArgs.indexOf(',') >= 0)
	{
		args = sArgs.split(',');
	}
	else
	{
		args = new Array();
		args[0] = sArgs;
	}
	
	switch (sAction)
	{
		case 'fold':
			setFold(args[0], parseInt(args[1]));
			break;
		case 'scroll':
			if (typeof(args[1]) == 'undefined')
				args[1] = 0;
			scrollIntoView(args[0], parseInt(args[1]));
			break;
	}
	
	if(document.getElementById('rNav_dezepagina')){
		placeDezeDiv();
	}
}


// BEGIN NIEUWE FUNCTIE MET ALLOWSCRIPTACCES OP ALWAYS

function swfWrite( sRefstr, sSrc, sArgs, iWidth, iHeight, sWmode, sScale, sSalign, sFunction ) {

                if (!IsSet(sWmode)) sWmode='opaque';

                if (!IsSet(sScale)) sScale='noScale';

                if (!IsSet(sSalign)) sSalign='LT';

                

                if (!IsSet(sRefstr)) sRefstr='ref'+(new Date()).getTime();

                

                if (IsSet(sArgs)) sArgs+='&'; else sArgs='';

                sArgs+='sys_host='+location.host;

                sArgs+='&sys_method='+((is.cap.fscommand)?'fs':'js');

                sArgs+='&sys_refstr='+sRefstr;

                sArgs+='&connectionID='+iConnectionID;

                

                // write javascript incomming communicator

                if (!is.cap.fscommand && IsSet(sFunction)) eval(sRefstr+'_command=function(sAction,sArgs){'+sFunction+'(sAction,sArgs);}');

 

                var s_tag = '';

 

                if (is.cap.object) {

                               s_tag+='<object id="'+sRefstr+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="https://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" width="'+iWidth+'" height="'+iHeight+'">';

                               if (is.cap.flash >= 6) {

                                               s_tag+='<param name="movie" value="'+sSrc+'"><param name="flashvars" value="'+sArgs+'">';

                               } else {

                                               s_tag+='<param name="movie" value="'+AddArgs(sSrc,sArgs)+'">';

                               }

                               s_tag+='<param name="menu" value="false"><param name="quality" value="high"><param name="wmode" value="'+sWmode+'"><param name="salign" value="'+sSalign+'"><param name="scale" value="'+sScale+'"><param name="allowScriptAccess" value="always"></object>';


                               

                               // write IE fscommand incomming cummunicator

                               if (is.cap.fscommand && IsSet(sFunction)) s_tag+='<scr'+'ipt for="'+sRefstr+'" event="FSCommand(sAction,sArgs)">'+sFunction+'(sAction,sArgs);</scr'+'ipt>';

                } else {

                               if (is.cap.flash >= 6) {

                                               s_tag+='<embed src="'+sSrc+'" flashvars="'+sArgs+'"';

                               } else {

                                               s_tag+='<embed src="'+AddArgs(sSrc,sArgs)+'"';

                               }

 

                               s_tag+=' scale="'+sScale+'" salign="'+sSalign+'"';

 

                               s_tag+=' quality="high" wmode="'+sWmode+'" width="'+iWidth+'" height="'+iHeight+'" id="'+sRefstr+'" name="'+sRefstr+'" swLiveConnect="true" menu="false" type="application/x-shockwave-flash" allowScriptAccess="always"></embed>';

                               

                               // write non IE fscommand incomming cummunicator

                               if (is.cap.fscommand && IsSet(sFunction)) eval(sRefstr+'_DoFSCommand=function(sAction,sArgs){'+sFunction+'(sAction,sArgs);}');

                }

                //prompt("title", s_tag);

                document.write(s_tag);

 

}

// EINDE NIEUWE FUNCTIE MET ALLOWSCRIPTACCES OP ALWAYS

