function ShowHideDownload(area, row)
{
	var elem = document.getElementById('fund' + area);
	var tableElem = document.getElementById('fundrow' + area);

	if(elem != null){
		if(elem.style.display == 'block'){
			elem.style.display = 'none';
			
			if(row == '1'){
				tableElem.style.background = '#F4F4F4';
			}else{
				tableElem.style.background = '#E3E3E3';
			}
		}else{
			elem.style.display = 'block';
			tableElem.style.background = '#D4E7F7';
		}
	}
}

function showWaitBox(top)
{
	var waitBox = document.getElementById('waitBox');
	
	if (document.documentElement && document.documentElement.scrollTop)
		theTop = document.documentElement.scrollTop;
	else if (document.body)
		theTop = document.body.scrollTop;
	else
		theTop = 0;

	if(waitBox)
	{
		if(top > 0)
			waitBox.style.top = top + "px";
		else
			waitBox.style.top = (300 + theTop) + "px";

		waitBox.style.left = "410px";
	}
}

function hideWaitBox()
{
	var waitBox = document.getElementById('waitBox');
	if(waitBox)
	{
		waitBox.style.left = "-410px";
	}
}

checkReload=
{
	checker: function(x){           
		if (x && !this.ignorer && new Date().getTime()-x>1000){this.reloader()};           
		this.ignorer=false;
		setTimeout("checkReload.checker("+new Date().getTime()+")",800)
	},
	init: function(x){
		this.reloader=x;
		this.checker()
	},
	ignore: function(){
		this.ignorer=true
         } 
}; 

function __preload()
{
	var waitBox = document.createElement("div");
	waitBox.setAttribute("id", "waitBox");
	var body = document.getElementsByTagName("body").item(0);
	body.appendChild(waitBox);
	checkReload.ignore();
}

addEvent(window, "load", __preload);

checkReload.init(hideWaitBox);


function concatFields(){
		
		var i=0;
		var counter=0;
		var myArray=new Array()
		
		for (i=0;i<=100;i++)
		{
			if (document.getElementById('item' + i)) 
			{
				if(document.getElementById('item' + i).value != ""){
					myArray[counter]= document.getElementById('item' + i).value; // store text field value in variable
					counter++;
				}
			}		
		}
		
		document.getElementById('7cef805c-6110-4a2b-85d9-6ed92ae36696').value = myArray.toString()							
}

function getCompanyInfo(value)
{
	if(value == '- ALL')
	{
		window.location= "http://www-uk-new.kaupthing.com/?pageid=2566";
	}
	else
	{
		window.location= "http://www-uk-new.kaupthing.com/?pageid=2579&company="+value.replace(/&/, "%26");
	}
	
}


