				
		IE = (navigator.userAgent.indexOf("MSIE") != -1 && navigator.userAgent.indexOf("Opera") == -1) ? true : false;
		OPERA = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
		AVALIBLEBANKS = "avalibleBanks";
		SELECTEDBANKS = "selectedBanks";
		
		function setSelectBanksIds(avalible, selected){
			AVALIBLEBANKS = avalible;
			SELECTEDBANKS = selected;
			sortListBox(getObj(AVALIBLEBANKS));
			sortListBox(getObj(SELECTEDBANKS));
		}
		
		function getObj(strId){
			return document.getElementById(strId); 
		}
		
		function init(){	
			// sets onclick ecents on the infoicon, infolinks and infoboxes if they are present
			var i=1;
			while(i!=-1){			

				if(getObj('infoicon'+i)){	

					getObj('infoicon'+i).onclick = onInfoIconClick;
					getObj('infoicon'+i).className = getObj('infoicon'+i).className + ' help';
					if(getObj('infobox'+i))
						getObj('infobox'+i).onclick = onInfoBoxClick;
					i++;
				}					
				else if(getObj('infolink'+i)){
					getObj('infolink'+i).onclick = onInfoLinkClick;
					if(getObj('infolink'+i).className.indexOf('help')==-1)
						getObj('infolink'+i).className = getObj('infolink'+i).className + ' help';						
					if(getObj('infobox'+i))
						getObj('infobox'+i).onclick = onInfoBoxClick;
					i++;
				}
				else
					i = -1;		
			}
			
				
			// sets onMouseOver and onMouseOut events on td's
			tables = getObj('page').getElementsByTagName('table');
			for(t=0; t<tables.length; t++){
				if(tables[t].className.indexOf('matrix')!=-1 && tables[t].className.indexOf('mouseover')!=-1){					
					cells = tables[t].getElementsByTagName('td');
					for(c=0; c<cells.length; c++){
						if(cells[c].className.indexOf('reg')!=-1 || cells[c].className.indexOf('alt')!=-1){
							cells[c].onmouseover = onColOver;
							cells[c].onmouseout = onColOut;
						}
					}						
				}
				else if(tables[t].className.indexOf('link-table')!=-1 && tables[t].className.indexOf('mouseover')!==1){				
					rows = tables[t].getElementsByTagName('tr');
					for(r=0; r<rows.length; r++){
						if(rows[r].className.indexOf('reg')!=-1 || rows[r].className.indexOf('alt')!=-1){
							rows[r].onmouseover = onRowOver;
							rows[r].onmouseout = onRowOut;
						}
					}							
				}
			}		
			
			// sets onChange on any selects of the class 'select-banks', and removes any option of the class 'dummyoption'
			/*
			selects = getObj('page').getElementsByTagName('select');
			for(s=0; s<selects.length; s++){				
				if(selects[s].className.indexOf('select-banks')!=-1){	
					selects[s].onchange = onSelectbanksChange;			
				}
				if(selects[s].className.indexOf('submitOnChange')!=-1){
					selects[s].onchange = submitOnChange;	
				}
				/*
				options = selects[s].getElementsByTagName('option');
				for(o=0; o<options.length; o++){					
					if(options[o].className.indexOf('dummyoption')!=-1){
						selects[s].options[o]=null;	
					}
				}
											
			}		
			*/	
			window.onscroll = onScroll;
			
		}
		//INIT END
		
				
		// onMouseOver for a row, sets appropriate classes
		function rowOver(row) {
			cells = row.getElementsByTagName('td');
			for(t=0; t<cells.length; t++) {
				cells[t].className = cells[t].className + ' over'; 
				if(t==cells.length-1)
					cells[t].className = cells[t].className + ' rightover'; 
			}
		}		
		
		// onMouseOut for a row, sets appropriate classes
		function rowOut(row) {
			cells = row.getElementsByTagName('td');
			for(t=0; t<cells.length; t++) {
				if(t==cells.length-1)
					cells[t].className = cells[t].className.replace('rightover', ''); 
				cells[t].className = cells[t].className.replace('over', ''); 
			}
		}
		
		// onMouseOver for columns, sets appropriate classes
		function colOver(cell) {
			var col = false;
			classes = cell.className.split(" ");
			for(c=0; c<classes.length; c++){
				if(classes[c].substr(0,3) == 'col')
					col = classes[c];
			}				
			cells = getObj('page').getElementsByTagName('td');
			for(c=0; c<cells.length; c++){
				if(cells[c].className.indexOf(col)!=-1){	
					cells[c].className = cells[c].className + ' over';
				}
			}
		}		
		
		// onMouseOut for columns, sets appropriate classes
		function colOut(cell) {
			var col = false;
			classes = cell.className.split(" ");
			for(c=0; c<classes.length; c++){
				if(classes[c].substr(0,3) == 'col')
					col = classes[c];
			}				
			cells = getObj('page').getElementsByTagName('td');
			for(c=0; c<cells.length; c++) {
				if(cells[c].className.indexOf(col)!=-1){
					cells[c].className = cells[c].className.replace('over', ''); 
				}
			}
		}

		// closes an infobox and set it's position, also handles the infoframe iframe in IE
		function infoOpen(icon, color, box) {
			infoCloseAll();		
			if (box == '' || !getObj(box)){
				box = icon.id.replace('infoicon', 'infobox').replace('infolink', 'infobox');
			}
			b = getObj(box);
			b.className = b.className + " infobox" +color;
			b.style.visibility = 'hidden';
			b.style.display = 'block';
			setLayer(icon,box);
			b.style.visibility = 'visible';
			if(IE){
				frameID = 'infoframe';
				writeIframeFix(frameID);		

				if(f = getObj(frameID))	{
					f.style.position = 'absolute';		
					f.style.top = b.style.top;
					f.style.left = b.style.left;
					f.style.height = b.offsetHeight;
					f.style.display = 'block';
				}
			}				
		}
		
		// closes an infobox and reset its position to 0px 0px, also handles the infoframe iframe in IE
		function infoClose(box) {
			box.style.display = 'none';
			box.style.top = box.style.left = '0px';
			if(IE){			
				frameID = 'infoframe';
				if(f =  getObj(frameID)){
					f.style.display = 'none';			
					f.style.top = f.style.left = '0px';
				}
			}
		}
		
		// flip
		function toggleVisible(id){
			var aObj = getObj(id);
			if (aObj.style.display == 'none' || aObj.style.display == '' ){
				aObj.style.display = 'block';
				aObj.style.paddingBottom = '20px';
			}
			else{
				aObj.style.display = 'none';			
			}
		}
	
		
		/* *** Helper functions *** */
		
		// positions the layer at the same position as obj (in this case 3px above and 4px to the left)
		function setLayer(obj,layer){
			var newX = findPosX(obj);
			var newY = findPosY(obj);
			var objLayer = getObj(layer);
			objLayer.style.top = newY - findPosY(objLayer) - 3 + 'px';
			objLayer.style.left = newX - findPosX(objLayer) - 4 + 'px';
		}
				
		// returns the X position of an element
		function findPosX(obj){
			var curleft = 0;
			if (obj.offsetParent){
				while (obj.offsetParent){
					curleft += obj.offsetLeft					
					obj = obj.offsetParent;
				}
			}
			else if (obj.x)
				curleft += obj.x;
			return curleft;
		}
		
		// returns the Y position of an element
		function findPosY(obj){
			var curtop = 0;
			if (obj.offsetParent){
				while (obj.offsetParent){
					curtop += obj.offsetTop
					obj = obj.offsetParent;
				}
			}
			else if (obj.y)
				curtop += obj.y;
			return curtop;
		}

		// does a simple replace on danish letters, so string-comparison
		// and sorting is done correct
		function encodeString(src){
			var dest = src.toLowerCase();
			dest = dest.replace(/\xE6/gi, String.fromCharCode(253)); 
			dest = dest.replace(/\xF8/gi, String.fromCharCode(254)); 
			dest = dest.replace(/\xE5/gi, String.fromCharCode(255)); 
			dest = dest.replace(/aa/gi, String.fromCharCode(255));

			return(dest);
		}
	
		function compareOptions(option1,option2)
		{
			var text1 = encodeString(option1.text);
			var text2 = encodeString(option2.text);
			
			if (text1 < text2) return -1;
			if (text1 >= text2) return 1;
			return 0;
		}
		
		// sorts any listbox (alpha)
		function sortListBox(listbox){
			var x;
			var temparr = new Array(listbox.options.length);
			for(x = 0; x < listbox.options.length; x++)
				temparr[x] = listbox.options[x];
			temparr.sort(compareOptions);
			for(x = 0; x < temparr.length; x++){
				listbox.options[x] = new Option(temparr[x].text,temparr[x].value);	
			}
		}	

		function updateHiddenSelectedBanks(listbox){
			var x;
			txtHidden = getObj("hiddenSelectedBanks");
			//listbox = getObj(SELECTEDBANKS);		
			txtHidden.value = '';	
			for(x = 0; x < listbox.options.length; x++)
				txtHidden.value += listbox.options[x].value +';';			
		}		
		
		// appends the page-div with an iframe used for covering select elements behind the popup dhtml-layer
		function writeIframeFix(frameID){
			if(!getObj(frameID)){
				var x = getObj("page");
				var y = document.createElement('iframe');
				y.id = frameID;
				y.className = frameID;
				y.src = "/blank.html";
				y.scrolling = "no";
				x.appendChild(y)
			}
		}
		
		// closes all info-layers that may be open by executing infoClose(box) for each box
		function infoCloseAll(){
			boxes = new getObj('page').getElementsByTagName('div');			
			for(i=0; i<boxes.length; i++){
				if(boxes[i].className.indexOf('infobox')!=-1){
					infoClose(boxes[i]);	
				}
			}
		}
		
		
		
		
		function toggleFilterCheckbox(checkboxName)
		{
			if (checkboxName == 'showAll')
			{
				getObj('IncludeContent_showYoung').checked = false;
				getObj('IncludeContent_showNotYoung').checked = false;
				getObj('IncludeContent_showShareholder').checked = false;
				getObj('IncludeContent_showNotShareholder').checked = false;
			}

			if (checkboxName == 'showYoung' && getObj('IncludeContent_showYoung').checked == true)
			{ 
				getObj('IncludeContent_showNotYoung').checked = false;
				getObj('IncludeContent_showAll').checked = false;
				getObj('IncludeContent_showNotShareholder').checked = false;
			}
			
			if (checkboxName == 'showNotYoung' && getObj('IncludeContent_showNotYoung').checked == true)
			{ 
				getObj('IncludeContent_showYoung').checked = false;
				getObj('IncludeContent_showAll').checked = false;
				getObj('IncludeContent_showShareholder').checked = false;				
			}
				
			if (checkboxName == 'showShareholder' && getObj('IncludeContent_showShareholder').checked == true)
			{ 
				getObj('IncludeContent_showNotShareholder').checked = false;
				getObj('IncludeContent_showAll').checked = false;
				getObj('IncludeContent_showNotYoung').checked = false;
				
			}	
			
			if (checkboxName == 'showNotShareholder' && getObj('IncludeContent_showNotShareholder').checked == true)
			{ 
				getObj('IncludeContent_showShareholder').checked = false;
				getObj('IncludeContent_showAll').checked = false;
				getObj('IncludeContent_showYoung').checked = false;
			}	
		}
		
		
		/* *** Events *** */		
		
		function onRowOver(){
			rowOver(this);
		}
		function onRowOut(){
			rowOut(this);
		}
		function onColOver(){
			colOver(this);
		}
		function onColOut(){
			colOut(this);
		}
		function onInfoIconClick(){
			infoOpen(this, 'red');
		}
		function onInfoLinkClick(){
			infoOpen(this, 'blue');
		}
		function onInfoBoxClick(){		
			infoClose(this);
		}
		function onScroll(){		
			infoCloseAll();
		}
		
		function submitOnChange(){
			this.form.submit();
		}
		
		function stopEvent(e)
		{
			if (!e) var e = window.event;
			alert(e);
			e.cancelBubble = true;
			if (e.stopPropagation) e.stopPropagation();
		}
		function onAvailablebanksChange(availableListBox, selectedListBoxId){
			if(availableListBox.selectedIndex != -1){
				var selectedListBox = document.getElementById(selectedListBoxId);
				var option = availableListBox.options[availableListBox.selectedIndex];
				if(!option.disabled)
					CopyBankOption(option, selectedListBox);
				updateHiddenSelectedBanks(selectedListBox);
				//availableListBox.selectedIndex = -1;
			}
		}		
		
		function onSelectedbanksChange(selectedListBox, availableListBoxId){
			if(selectedListBox.selectedIndex != -1){
				var option = selectedListBox.options[selectedListBox.selectedIndex];
				var availableListBox = document.getElementById(availableListBoxId);
				var optionValue = option.value;
				
				for(var i = 0; i < availableListBox.options.length; i++){
					if(optionValue == availableListBox.options[i].value){
						availableListBox.options[i].disabled = false;
						availableListBox.options[i].style.color = "menutext";
						break;
					}
				}
				availableList.EnableItem(optionValue);
				
				selectedListBox.options[selectedListBox.selectedIndex] = null;
				updateHiddenSelectedBanks(selectedListBox);
				sortListBox(selectedListBox);
				//selectBox.selectedIndex = -1;
			}
		}
		function CopyBankOption(option, targetListBox){
			if(targetListBox.options.length < 25){
				var newOption = new Option();
				newOption.text = option.text;
				newOption.value = option.value;
				try{
					targetListBox.add(newOption, null);
				}
				catch(ex){
					targetListBox.add(newOption);			
				}
				option.disabled = true;
				option.style.color = "graytext";
				sortListBox(targetListBox);
				updateHiddenSelectedBanks(targetListBox);				
			}
		}

function CreateList(id) {
	this.id = id;
	this.search="";
	this.nb=0; 
	this.options = new Array();
	this.Add=AddListItem;
	this.PopulateSelectBox = PopulateSelectBox;
	this.Update = UpdateList;
	this.EnableItem = EnableListItem;
}

function EnableListItem(optionValue){
	for(var i = 0; i < this.options.length; i++){
		var option = this.options[i];
		if(option.value == optionValue){
			option.style.color = "menutext";
			option.disabled = false;
		}
	}
}

function AddListItem(item, disabled) {
	if(disabled == 'true')
		item.disabled = true;
	this.options[this.nb]=item
	this.nb++;
}

function PopulateSelectBox(selectedListBoxId) {
	var selectedListBox = document.getElementById(selectedListBoxId);
	for(var i = 0; i<selectedListBox.options.length; i++){
		selectedListBox.options[i] = null;
	}

	this.listbox = document.getElementById(this.id);
	if(this.listbox != null){
		for(var i = 0; i<this.listbox.options.length; i++){
			this.listbox.options[i] = null;
		}
		
		for (var i=0; i<this.nb; i++) {
			var option = this.options[i];
			if(option.disabled == true){
				option.style.color = "graytext";
				CopyBankOption(option, selectedListBox);		
			}
			try{
				this.listbox.add(option, null);
			}
			catch(ex){
				this.listbox.add(option);			
			}
		}
	}
	else{
		alert('not found');
	}
}

function UpdateList(txt,f) {
//alert('Update');
	if (txt!=this.search) {
		this.search=txt;
		this.listbox.options.length=0; 
		for (var i=0; i<this.nb; i++) {
			if (this.options[i].text.substring(0,txt.length).toUpperCase()==txt.toUpperCase() ) {
				try{
					this.listbox.add(this.options[i], null);
				}
				catch(ex){
					this.listbox.add(this.options[i]);			
				}
			}
		}
		this.listbox.selectedIndex=-1;
	}
}


