function showElement(id)
{
	element = document.getElementById(id);
	if (element)
	{
		element.style.display = "block";
	}
}

function hideElement(id)
{
	element = document.getElementById(id);
	if (element)
	{
		element.style.display = "none";
	}
}

/* INVESTIR KIT FUNCTIONS */
function submitInvestorKit(poId, lng)
{
	document.investorKitForm.poId.value = poId;
	document.investorKitForm.lng.value = lng;
	document.investorKitForm.submit();	
}

// adds a new item to the investorkit
function addInvestorKitItem(poId, lng)
{
	document.investorKitForm.addInvestorKitItem.value = "true";
	submitInvestorKit(poId, lng);
}

// removes a item from the investor kit
function removeInvestorKitItem(poId, lng)
{
	document.investorKitForm.removeInvestorKitItem.value = "true";
	submitInvestorKit(poId, lng);
}

// moves a item 1 position down in the investor kit item list
function moveDownInvestorKitItem(poId, lng)
{
	document.investorKitForm.moveDownInvestorKitItem.value = "true";
	submitInvestorKit(poId, lng);
}

// moves a item 1 position up in the investor kit item list
function moveUpInvestorKitItem(poId, lng)
{
	document.investorKitForm.moveUpInvestorKitItem.value = "true";
	submitInvestorKit(poId, lng);
}

/* FONT SIZE TOOL */
const_size = 70;
const_size_step = 10;
max_size = 300;
min_size = 40;

window.onload = InitStartSize;

function InitStartSize()
{
	size = parseInt(readCookie("size"));
	if(!size)
	{
		setCookie("size", const_size, 30);
		size = const_size;
	}
	
	document.body.style.fontSize = size+"%";
}

function textVerkleinern()
{
	size = parseInt(readCookie("size"));
	if(!size || size>min_size)
		size = (!size) ? const_size : (size - const_size_step);
	setCookie("size", size, 30);
	
	document.body.style.fontSize = size + "%";
}

function textVergrossern()
{
	size = parseInt(readCookie("size"));
	
	if(!size || size<max_size)
		size = (!size) ? const_size : (size + const_size_step);
	setCookie("size", size, 30);
	
	document.body.style.fontSize = size + "%";
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var cookieValue = null;
	var search = name + "=";
		if(document.cookie.length > 0)
		{ 
			offset = document.cookie.indexOf(search);
			if (offset != -1)
			{ 
				offset += search.length;
				end = document.cookie.indexOf(";", offset);
				if (end == -1) end = document.cookie.length;
				cookieValue = unescape(document.cookie.substring(offset, end))
			}
		}
	return cookieValue;
}

function setCookie(name,value,days)
{
	eraseCookie(name);
	createCookie(name,value,days);
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

/* VOLLTEXTSUCH STUFF */
function doSearch()
{
	document.searchForm.submit();
}

function doSearchFromPage()
{
	objPageInput = document.getElementById('searchString');
	if (objPageInput)
	{
		document.searchForm.s.value = objPageInput.value;
		doSearch();
	}
}

function setSearchString(input)
{
	if (input.value == "Suchbegriff")
		input.value = "";
	else if (input.value == "")
		input.value = "Suchbegriff";
}

/* PNG TRANSPARENZ IE6 STUFF */
var iePNGLoader = 
{
	loadThis: function(img)
	{
		/*
		if (navigator.userAgent.indexOf("MSIE") >-1 && parseInt(navigator.appVersion) <= 6)
		{
			var pSrc = img.src;
			img.onload = null;
			img.src = "/aba/images/empty.gif";
			img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, src='" + pSrc + "')";
		}
		*/
	} 
};

function encryptAddress(user, domain) {
	/*
	document.write('<a href=\"mailto:' + user + '@' + domain + '\">');
	document.write(user + '(at)' + domain);
	document.write('<\/a>');
	*/
}


