var aktiv;

/* Navigation */
function showHide(element) {
	var children = element.getElementsByTagName("DIV");
	if (children.length > 0) {
		var firstList=children[0];
		if (firstList.style.display == 'block') {
			firstList.style.display = 'none'
		} else {
			firstList.style.display = 'block'
		}
	}
	return true;
}

/* Sprache */
function selection_mouseOver(element) {
	element.getElementsByTagName("DIV")[0].style.display = "block";
}
function selection_mouseOut(element) {
	element.getElementsByTagName("DIV")[0].style.display = "none";
}

// Clean leading & trailing slashes
function cleanURL (url, end) {
	var url = url.toString();
	var urlLen = url.length;
	
	if (end) {
		if (url.charAt((urlLen-1))=='/')
			url = url.substring(0,(urlLen-1));
	}
	else {
		if (url.charAt(0)=='/')
			url = url.substring(1,urlLen);
	}
	return url;
}

//function maskEmail(name, domain) {
//	document.writeln('<a href="mailto:'+name+'@'+domain+'">'+name+'@'+domain+'</a>');
//}

function maskEmail(name, domain) {
 var email = name+'@'+domain;
 var url = cleanURL(window.location, true);
 var mail_path = '/virtual/mailto/'+url+'/'+email;
	document.writeln('<a href="mailto:'+name+'@'+domain+'" class="colorForPage" onclick="_gaq.push([\'_trackPageview\', \''+mail_path+'\']);">'+name+'@'+domain+'</a>');
}

function popUp1(wintype) {
  var nwl = (screen.width-1000)/2;
  var nwh = (screen.height-790)/2;
  popUp=window.open(wintype, 'PopUp','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=1000,height=790,left='+nwl+',top='+nwh+''); 
  popUp.window.focus(); 
}

// Popup Chairfinder
function popUp2(wintype) {
  var nwl = (screen.width-1050)/2;
  var nwh = (screen.height-800)/2;
  popUp=window.open(wintype, 'PopUp','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=1050,height=800,left='+nwl+',top='+nwh+''); 
  popUp.window.focus(); 
}

function popupFullscreen(url) 
{
 params  = 'width='+screen.width;
 params += ', height='+screen.height;
 params += ', top=0, left=0'
 params += ', fullscreen=yes';

 newwin=window.open(url,'windowname4', params);
 if (window.focus) {newwin.focus()}
 return false;
}

