<!--
//hide script from old browsers

var mytim;
var menuhigh=0;
var benx;
var myflashobject;
var myinitdone = false;
var inittimer = null;
	

//======== listen to flash

function flashMouseleave(flashmousex) {
	if (flashmousex>10) {
		make_div_invisible();	//also clears timer
	} else {
		if (menuhigh==0) {	//check if there was a event to show the hilite just before the mouseleave
		mytim = setTimeout("suspendedunhilite()",200);	//risk of creating more than 1 timer?
		}
	}
}

function suspendedunhilite() {
	make_div_invisible();
}
function makeflashonepix() {
	//benx.style.visibility = "hidden"; //gives startup problem in FF
	myflashobject.width = 1;	//IE doesnot accept 0
	myflashobject.heigth = 1;
	clearTimeout(mytim);
}
function makeflashoriginalsize() {
	myflashobject.width = 740;	//original size?
	myflashobject.heigth = 300;
}
function make_div_invisible() {
	if (benx!=undefined){
	benx.style.top="-600px";	//invisible or offstage  gives startup problem in FF
	clearTimeout(mytim);
	}
}
function make_div_visible(posy) {
	benx.style.top= posy;
	//benx.style.visibility = "visible";
	clearTimeout(mytim);
}

function flashMouseact() {
	clearTimeout(mytim);
}

// ======= send to flash

function sendToFlash(tmpstrA,tmpstrB) {
	var callResult;		//returns a string
	// callResult sets the titel in flash and gets a value back (function returns string): "busy signal"	
	callResult = myflashobject.myFunction(tmpstrA,tmpstrB);
}


function sendToFlashpageURL() {
	// deze functie wordt alleen getriggerd door javascript bij init.
	var callResult;		//returns a string
	var pageurlq = location.search;	//the url from the question mark	

	//browser foutmeldingen voor devolgende regel kunnen veroorzaakt worden door:
	// - flash heeft (lokaal) geen permissie om te communiceren met de browser
	// http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04a.html
	// de externalInterface init is asynchroon:
	// - was de browser nog niet klaar en flash wel? 
	// - myflashobject bestaat nog niet (javascript nog niet klaar) // bijv flash in client-cache

	//send data to flash
	if (myinitdone && myflashobject.mypageURLfunction) {
		callResult = myflashobject.mypageURLfunction(pageurlq);	//without this call flash waits forever		
		makeflashonepix();	//make flash extreme small but not invisible or offstage
		if(inittimer){
			clearInterval(inittimer);
		}
	} else {
	inittimer = setTimeout("sendToFlashpageURL()",50);	//try again later, recursion
	}
}
//==============================
function vinddehref(initemhtm) {
	var retstr = "";
	var elarr = initemhtm.getElementsByTagName("a");
	retstr = elarr[0].getAttribute("href");
	if (retstr==null) {retstr=""} //might give null for FF
	if (retstr=="" && elarr.length>1 ) {retstr = elarr[1].getAttribute("href");}
	return retstr;
}
//==============================

function nav_init() {
	//check to do it only once
	if (myinitdone ==false) {
		benx = document.getElementById("benpop");

		var moviestr = "flashpop05";	// name and ID
		//--------------------
		// volgende code kan netter
		myflashobject = document.getElementById(moviestr);	//IE gebruik niet =window.flashpop05
		myinitdone = true;
		//FF
		if (myflashobject==null) {
			var y = document.getElementsByName(moviestr);
			myflashobject = y[0];	//FF	 is het 0?
			if (myflashobject!=null) {	// if still null user has flash unactivated
				//sendToFlashpageURL();		//communicate with flash - not ready yet first load
				inittimer = setTimeout("sendToFlashpageURL()",50);	//try again later
			}
		} else {
			//should work now
			sendToFlashpageURL();	//communicate with flash IE	
		}
	}
}

function nav_menu_hilite(evt,item) {	
	item.style.backgroundColor = '#E5E5E5';
	item.style.cursor='pointer';
	//-----------------------
	var evt = evt || window.event;	//IE and FF
	//if flash is not available do not cause errors
	if (myflashobject!=undefined){
		//benx.style.top= window.event.clientY;	//IE only
		makeflashoriginalsize();
		var topoff = window.pageYOffset || document.body.scrollTop;	//FF and IE
		make_div_visible(evt.clientY+topoff-60); //might fail bij scrolling
		//-------------------------
		var thehref = vinddehref(item);
		var thetitle = item.getElementsByTagName("font")[0].firstChild.nodeValue;//text node, might fail
		if (thetitle==null) {thetitle="leeg"};
	
		sendToFlash(thetitle,thehref);	//communicate with flash
	
		//overrule timeout
		clearTimeout(mytim);
		menuhigh = 1;
	} 
}
function nav_menu_unhilite(item,color) {
	item.style.backgroundColor = color;
	if (myflashobject!=undefined){
		mytim=setTimeout("suspendedunhilite()",200); //risk of creating more than 1 timer?, 200ms is very fast 
		menuhigh = 0;
	} 
}

// mouseover functions-------old onmouseover left menu ---
function nav_menu_hilite_old(item) {
	item.style.backgroundColor = '#E5E5E5';
	item.style.cursor='pointer';
}
function nav_menu_unhilite_old(item,color) {
	item.style.backgroundColor = color;
}

//the init to get a hook to flash
window.onload=nav_init;

//
//end hiding contents-->
