//Copyright 2001 AIT by Roland Koch// 
//All rights reserved. The duplication of this script //
//in any form is strictly prohibited for private//
// and commercial use.//
	var items = 0;
	var counter = 0;
	var loaded = false;
	var timer1 = false;
	var p_top = 1;
	var p_left = 3;
	var table = "";
	
	function sayNo(){
		return true;
	}
	window.onerror=sayNo;	
	
	function browserCheck() {
		var agt = navigator.userAgent.toLowerCase();
		this.major=parseInt(navigator.appVersion);
		this.minor=parseFloat(navigator.appVersion);
		this.nav=((agt.indexOf('mozilla')!=-1)&&((agt.indexOf('spoofer')==-1)&&(agt.indexOf('compatible')==-1)));	
		this.dom = (document.getElementById) ? 1 : 0;	
		this.ie = (document.all || this.dom && document.all) ? 1 : 0;
		this.ie4 = (document.all && !this.dom) ? 1 : 0;
		this.ie5 = (this.ie && (agt.indexOf("5") != -1)) ? 1 : 0;
		this.ie6 = (this.ie && (agt.indexOf("6") != -1)) ? 1 : 0; 
		this.ns4 = (document.layers) ? 1 : 0;
		this.ns6 = (this.dom && (navigator.appName.indexOf("Netscape") != -1)) ? 1 : 0;
		this.mac = (agt.indexOf('mac') != -1) ? 1 : 0;
		this.op = (agt.indexOf("opera") != -1) ? 1 : 0;
		this.op3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1) ? 1 : 0;
		this.op4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1) ? 1 : 0;
   		this.op5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1) ? 1 : 0;
   		this.op6 = (agt.indexOf("opera 6") != -1 || agt.indexOf("opera/6") != -1) ? 1 : 0;
		this.op6up = (this.op && !this.op3 && !this.op4 && !this.op5) ? 1 : 0;
	}
	
	var is = new browserCheck();
	
	var menu = new Array();	
	menu[0] = new Array();
	menu[0][0] = new Array("interactivemap.html","Interactive Map");	
	menu[0][1] = new Array("consortium.html","All Members");
	menu[0][2] = new Array("contentproviders.html","Content Providers");
	menu[0][3] = new Array("developers.html","Developers");
	menu[0][4] = new Array("regionalpoles.html","Regional Poles");
	menu[0][5] = new Array("developerspoles.html","Developers/Poles");
	
	
	menu[1] = new Array();
	menu[1][0] = new Array("factsheets.html","Fact Sheets");
	menu[1][1] = new Array("projecthandout.html","Project Handout");	
	menu[1][2] = new Array("poster.html","Poster");
	menu[1][3] = new Array("workpackages.html","Workpackages");
	menu[1][4] = new Array("buldescription.html","Bulgarian Description");
	menu[1][5] = new Array("catdescription.html","Catalan Description");
	menu[1][6] = new Array("dutdescription.html","Dutch Description");
              menu[1][7] = new Array("fredescription.html","French Description");
         	menu[1][8] = new Array("gerdescription.html","German Description");
	menu[1][9] = new Array("rudescription.html","Russian Description");
	menu[1][10] = new Array("spandescription.html","Spanish Description");
		
	
	var m_pos = new Array();	
	m_pos[0] = new Array(149,85);
	m_pos[1] = new Array(260,85);
	
	//window.onload = init;
			
	function activateMenu(id) {
		var obj = "";
		if (!loaded || is.op) return;		
		obj  = (is.ns4) ? eval("document.container" + id) : ((is.dom) ? eval("document.getElementById('container"+id+"')"): eval("document.all.container" + id));		
		clearTimeout(timer1);
		hideMenu();
		if (!is.ns4)
			obj.style.visibility = "visible";
		else if (is.ns4)
			obj.visibility = "show";
	}
	
	function inactivateMenu() {
		if (!loaded || is.op) return;
		timer1 = setTimeout("hideMenu()",30);		 
	}
	
	function init() {
		if (is.op) return;
		var height = 19;
		var width = 165;
		var xpos = 0;		
		var ypos = 0;
		var m_len = menu.length;
		var rows = 0;
		var id = "";
		for (var i=0; i<m_len; i++) {
			var cheight = 0;			
			rows = 0;
			id = "container" + i;
			if (!is.ns4) {
				if (is.ie4) {
					var HTML = "<div id=" + id + " class='vis'></div>";
					window.document.body.insertAdjacentHTML("BeforeEnd", HTML);
				}
				else if (is.dom) {
					var el = document.createElement("div");
					el.id = id;
					el.className = "vis";
					document.body.appendChild(el);
				}
			}			
			for (var k=0; k<menu[i].length; k++) {
				rows++;
			}			
			xpos = m_pos[i][0];
			ypos = m_pos[i][1];
			cheight = parseInt(rows * height);
			//if (is.dom==2) xpos += 0;
			//if (is.ie) xpos += 0;
			id.createMenu = createMenu(id, null,null, null, xpos, ypos, cheight+1, width, "", "#003366", "hidden", 1);						
			ypos = 0;			
			if (is.ns6) xpos += 3;
			for (var j=0; j<menu[i].length; j++) {				
				item_id = "item" + items++;
				menu_url = menu[i][j][0];
				menu_link = menu[i][j][1];
				if (!is.ns4) {
					if (is.ie4) {
						var HTML = "<div id=" + item_id + " class='linkout'>" + menu_link + "</div>";
						document.all[id].insertAdjacentHTML("BeforeEnd", HTML);
					}					
					else if (is.dom) {
						var el = document.createElement("div");
						el.id = item_id;
						el.className = "linkout";
						el.innerHTML = menu[i][j][1];
						document.getElementById(id).appendChild(el);							
					}
				var corr2 = 0;
				if (is.ns6) {
					corr2 = -3; //cause of style-def.
				}
				item_id.createMenu = createMenu(item_id, j, id, menu_url, 0, ypos, height+1 +corr2, width, null, "#000000", "inherit", 0);														
				}
				if(is.ns4){
					item_id.createMenu = createMenu(item_id, j, id, menu_url, xpos, ypos+1, height-1, width-2, menu_link, "#6699CC", "inherit", 0);
				}				
			ypos += height;
			}									
		}
		loaded = true;				
	}
	function createMenu(id, arraycounter, nestref, url, left, top, height, width, content, bgColor, visibility, zIndex) {
	if(is.ns4){
		if(nestref){
			var elm = eval("document."+nestref+".document."+id+" = new Layer(width, document."+nestref+")");
		}
		else{
			var elm = document.layers[id] = new Layer(width);
			eval("document."+id+" = elm");
		}
		elm.name = id;
		
		if(!nestref) elm.left = left;
		if( nestref) elm.left = 1;

		elm.top = top;

		elm.clip.top = 0;
		elm.clip.right = width;
		elm.clip.bottom = height;
		elm.clip.left = 0;

		elm.bgColor = bgColor;
		if (visibility.indexOf("hidden")!=-1) visibility = "hide";
		elm.visibility = visibility;

		if(nestref){
			if(id.indexOf("item")!=-1){
			elm.parent = document.layers[nestref];
			celm = new Layer(width,elm);
			celm.top = p_top;
			celm.left = p_left;
			celm.clip.top = elm.clip.top;
			celm.clip.right = elm.clip.right;
			celm.clip.bottom = elm.clip.bottom;
			celm.clip.left = elm.clip.left;			
			celm.visibility = "inherit";
			celm.display = menu_link;

			table = "<table cellpadding='0' cellspacing='0' border='0'><tr><td><font face='Verdana, Arial, Helvetica, sans-serif' size='2' color='#FFFFFF'>" + content + "</font></td></tr></table>";

			celm.document.open();
			celm.document.write (table);
			celm.document.close();

			dummy = new Layer(width,elm);
			dummy.clip.top = elm.clip.top;
			dummy.clip.right = elm.clip.right;
			dummy.clip.bottom = elm.clip.bottom;
			dummy.clip.left = elm.clip.left;
			dummy.visibility = "show";
			dummy.item = celm;
			dummy.bgelm = elm;
			dummy.url = url;
			dummy.captureEvents(Event.MOUSEUP | Event.MOUSEDOWN | Event.MOUSEOVER |Event.MOUSEOUT);
			dummy.onmouseover = menuOver;
			dummy.onmouseout = menuOut;
			dummy.onmouseup = getLink;
			}
			}
	}		
		if (!is.ns4) {
			if (is.dom) 
					elm = this.document.getElementById(id);
				else if (is.ie4)
					elm = this.document.all[id];
				elm.style.left = left;			
				elm.style.top = top;
				elm.style.width = width;
				elm.style.height = height;
				elm.style.visibility = visibility;			
				elm.url = url;	
				if (id.indexOf("item")!=-1) {			
					elm.onmouseover = menuOver;
					elm.onmouseout = menuOut;
					elm.onmouseup = getLink;
				}
			}
		}
	
	function hideMenu() {
		for (i=0; i<menu.length; i++) {
			id = (is.ns4) ? eval("document.container" + i) : ((is.dom) ? eval("document.getElementById('container"+i+"')"): eval("document.all.container" + i));
			if (is.ns4)
				id.visibility = "hide";
			if (is.dom||is.ie4)	
				id.style.visibility = "hidden";
		}
	}		
	
	function menuOver() {
		clearTimeout(timer1);
		window.status = this.url;
		if (is.ns4)
			changeLayer(this.bgelm,this.item,this.item.display,"#336699");
		if (!is.ns4)
			this.className = "linkover";
	}
	
	function menuOut() {
		timer1 = setTimeout("hideMenu()", 30);
		if (is.ns4)
			changeLayer(this.bgelm,this.item,this.item.display,"#6699CC");
		else if (!is.ns4)		
			this.className = "linkout";	
	}
	
	function getLink() {
		window.location.href = this.url;	
	}
	
	function changeLayer(id1,id2,content,bgcolor){
		id1.document.bgColor = bgcolor;
		elm = id2.document;	
		table = "<table cellpadding='0' cellspacing='0' border='0'><tr><td><font face='Verdana, Arial, Helvetica, sans-serif' size='2' color='#FFFFFF'>" + content + "</font></td></tr></table>";
		elm.open ();
		elm.write (table);
		elm.close ();
	}
