var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function toggleDiv(id) {
	if( document.getElementById(id).style.display == 'none' ) {
		document.getElementById(id).style.display = 'inline';
		//document.getElementById(id).style.padding = '12px';
		document.getElementById("search_ext").innerHTML = '< Einfache Suche';
	} else {
		document.getElementById(id).style.display = 'none';	
		//document.getElementById(id).style.padding = '1px';
		document.getElementById("search_ext").innerHTML = 'Erweiterte Suche >';
	}
}

function checkSearch() {
	var strTemp = document.getElementById('search_query').value;
	var strText = strTemp.replace(/ /, "");
					
		if (strText == '') {
			alert("Sie haben vergessen, einen Suchbegriff anzugeben.");
		} else 	this.document.location = "?site=suche&search_query=" + strTemp;
}

// FLYOUT FUNCTIONS
var ni = -120;
var vis, active;
function flyOut(id, begin) {
	if (ni < 10) {
			document.getElementById("flyout").style.top = ni;
			ni+=10;
			active = setTimeout("flyOut()", 10);		
	}
	else {
		if(ni < 19) {
			document.getElementById("flyout").style.top = ni;
			ni+=1;
			active = setTimeout("flyOut()", 10);
		} else {
			/*if( document.getElementById("flyout_img").style.visibility == 'hidden') {
				document.getElementById("flyout_img").style.visibility = 'visible';
			} else {
				document.getElementById("flyout_img").style.visibility = 'hidden';
			}*/
			active = setTimeout("flyOut()", 1000);
		}
	}
		
}

function onFlyout() {
	document.getElementById('flyout').style.top = -120;
	//...
	document.getElementById('flyout_stat').value = 'OFF';
	clearTimeout(active);
	document.getElementById('flyout_text').innerHTML = '';
	ni = -120;
}

var fade_ni = 1;
function fadeOut(id) {/*
		if(ni > 0) {
			document.getElementById(id).style._moz_opacity = fade_ni;
			fade_ni -= 0.2;
			fade_active = setTimeout("fadeOut()", 10);
		} else {
			fade_active = setTimeout("fadeOut()", 1000);
		}*/
}

// Get hold of the anchor element and attach handlers

