sfHover = function() {
	var sfEls = document.getElementById("navigation").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

//auswahlliste login-seite
function showHideDropDown () {
	var box = document.getElementById('dropdownbox');
	box.style.display = box.style.display == "block" ? "none" : "block";
}

function changeLang(lang) {
	document.location.href = lang;	
}

// register, precard detail
function showPreDetail(name) {
	var pics = new Array('card','detailNr','detailPin');
	for (var i = 0; i < pics.length; i++) {
		document.getElementById(pics[i]).style.display='none';
	}
	document.getElementById(name).style.display='block';
}

function linkto(target, link_type)
{
	if (link_type == 'external') {
		window.open(target);
	}
	else {
		document.location.href = target;	
	}
}

function changeCountyimg(countrycode) {
		document.getElementById('country_selection_effects').style.backgroundImage="url(/_bib_edc/img/default/bg_ul_countryselect_"  + countrycode +  ".gif)";
}

function entsub(myevent, myform)
{
	if (myevent && myevent.which) {
		characterCode = myevent.which;
	}
	else {
	characterCode = myevent.keyCode
	}

	if (characterCode == 13) {
		myform.submit();
		return false;
	}
	else {
		return true;
	}
}

/**
* Pops up a new window in the middle of the screen
*/
function popupWindow(mypage, myname, w, h, scroll) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function toggleTransactionTable()
{
	if ( $('transaction_table').getStyle('display') == 'none' ) {
		$('transaction_table').setStyles({display: 'block', visibility: 'visible'});
		$('transcat_toggle').setText('ausblenden');
	}
	else {
		$('transaction_table').setStyles({display: 'none', visibility: 'hidden'});
		$('transcat_toggle').setText('einblenden');
	}
}
