var current = "";

function show(name, pos)
{
current = name;
var tip = document.getElementById(name);

if (tip)
{
//var flyimg = eval('document.all.img' + name);
tip.style.top = pos;
tip.style.visibility = "visible";
}
}
function hide(name)
{
var tip = document.getElementById(name);
if (tip)
{
tip.style.visibility = "hidden";
current="";
}
}
function highlight(id){
var x = document.getElementById(id);
if (x)
{
x.style.color = "#FA9A00";
x.onmouseout = "";
x.onmouseover = "";
}
}

// Function from UtilityBar Layers
	function fire(obj_Form)
	{
		if(obj_Form.SearchInResult) obj_Form.SearchString.value = obj_Form.SearchString.value + ' ' + obj_Form.SearchInResult.value;
		if(obj_Form.SearchString.value=="")
		{
			alert('Bitte Suchbegriff eingeben.');
			return false;
		}
		
		if(obj_Form.SearchString.value.length<2)
		{
			alert('Bitte mindestens 2 Zeichen eingeben.');
			return false;
		}
		return true;
	}

	function firecontact(obj_Form)
	{
		if(obj_Form.comments.value=="")
		{ 
			alert('Bitte geben Sie Ihre Frage/Ihren Kommentar ein!');
			obj_Form.comments.focus();
			return false;
		}
		else
			return true;
	}

// vorgefertiget Funktionen
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
// Formular Selectbox verstecken
function ShowHideSelect(id, visibility, mode) {
    obj = document.getElementsByTagName("select");
    if (obj[id] != null)
        obj[id].style.visibility = visibility;
}

// Steuerung up&down der PopUp-Layer
actPopUp = '';
waiting = '';
function popUp(NAME) {
        if (NAME != actPopUp) {                        // schließe andere PopUps und öffne NAME
                if (actPopUp != '') {                // anderes PopUp ist offen
                        document.getElementById(actPopUp + 'FormLay').style.visibility = 'hidden';
                        rollPopUp(actPopUp,-1);
                        actPopUp = NAME;
                        waiting = NAME;
                } else {                                        // kein anderes PopUp ist offen
                        actPopUp = NAME;
                        document.getElementById(NAME).style.visibility = 'visible';
                        rollPopUp(NAME,1);
                }
		ShowHideSelect('g_ort','hidden');
		ShowHideSelect('g_titel','hidden');
        } else if (NAME == actPopUp) {        // schließe aktuelles PopUp
                actPopUp = '';
                document.getElementById(NAME + 'FormLay').style.visibility = 'hidden';
                rollPopUp(NAME,-1);
		ShowHideSelect('g_ort','visible');
		ShowHideSelect('g_titel','visible');
        }
        return;
}
// (07)
// up&down der PopUp-Layer
rollCount = 0;
function rollPopUp(NAME,DIRECTION) {
        rollCount += DIRECTION * 35;
	if (document.all) {
	document.getElementById(NAME).style.clip = "rect(0 " + document.getElementById(NAME).style.width + " " + rollCount + " 0)";
	} else {
        document.getElementById(NAME).style.clip = "rect(0px " + document.getElementById(NAME).style.width + "px " + rollCount + "px 0px)";
	}
        if (DIRECTION == 1) {                                // öffne NAME
                if (rollCount < parseInt(document.getElementById(NAME).style.height)) {
                        setTimeout('rollPopUp(\'' + NAME + '\',\'' + DIRECTION + '\')',1);
                } else {
                        document.getElementById(NAME + 'FormLay').style.visibility = 'visible';
                }
        } else if (DIRECTION == -1) {                // schließe NAME
                if (rollCount > 0) {
                        setTimeout('rollPopUp(\'' + NAME + '\',\'' + DIRECTION + '\')',1);
                } else {
                        document.getElementById(NAME).style.visibility = 'hidden';
                        if (waiting != '') {
                                popUp(waiting,1);
                                waiting = '';
                        }
                }
        }
        return;
}

// Fehlerbehandlung
function errorsuppressor(){
return true
}
window.onerror=errorsuppressor


// Satelliten-Fenster
satellitStatus = false;
function openSatellit(URL,SORT,WINDOWX,WINDOWY) {
	var sort = new Array ();	// Container für Fensterhöhe und Breite

	// URL:     URL der Datei
	// SORT:    Zuordnung von Fensterhöhe und Breite entsprechend der Zugehörigkeit der angeforderten Datei:
	//          - ap (Ansprechpartner)
				  sort['ap'] = new Array (455,500);
	//          - bin (Word, Excell, PDF etc.)
				  sort['bin'] = new Array (455,500);
	//          - events
				  sort['events'] = new Array (542,500);
	//          - image
				  sort['image'] = new Array (455,500);
	//          - news
				  sort['news'] = new Array (542,500);
	//          - press
				  sort['press'] = new Array (542,500);
	//          - table
				  sort['table'] = new Array (455,500);
	//          - schlagwortkatalog
				  sort['schlagwortkatalog'] = new Array (340,360);
	//	    - 800x600
				  sort['800x600'] = new Array (802,620);
	// WINDOWX: Fensterbreite
	// WINDOWY: Fensterhöhe

	if (satellitStatus) {
		if (!satellit.closed) {
			satellit.close();
		}
		satellitStatus = false;
	}
	if (openSatellit.arguments.length == 2) {
		var x = sort[SORT][0];
		var y = sort[SORT][1];
	} else if (openSatellit.arguments.length == 4) {
		var x = WINDOWX;
		var y = WINDOWY;
		if (SORT == 'image' && navigator.appName.indexOf("etscape") != -1) {
			x += 20;
			y += 20;
		} else {
			x += 50;
			y += 100;
		}
	}
	if (SORT == 'news' || SORT == 'press') {
		var tools = 1;
		var menubar = 1;
	} else if (SORT == 'schlagwortkatalog' || SORT == '800x600') {
		var tools = 0;
		var menubar = 0;
	} else {
		var tools = 0;
		var menubar = 1;
	}
	var parameter = "WIDTH=" + x + ",HEIGHT=" + y + ",RESIZABLE=1,SCROLLBARS=1,MENUBAR=" + menubar + ",TOOLBAR=" + tools + "";
	satellit = window.open(URL,"satellit",parameter);
	satellit.focus();
	if (parseInt(navigator.appVersion) >= 4) {
		if (SORT == 'schlagwortkatalog') {
			satellit.moveTo((screen.availWidth-sort['schlagwortkatalog'][0]),((screen.availHeight-y)/2));
		} else {
			satellit.moveTo((screen.availWidth-x)/2,(screen.availHeight-y)/2);
		}
		satellit.resizeTo(x,y);
	}
	satellitStatus = true;
	return;
}
function checkform_de (email_de)
{
    if (email_de.vorname.value == "") {
        alert( "Bitte geben Sie Ihren Vornamen ein!" );
        email_de.vorname.focus();
        return false ;
    }
    if (email_de.nachname.value == "") {
        alert( "Bitte geben Sie Ihren Nachnamen ein!" );
        email_de.nachname.focus();
        return false ;
    }
    if (email_de.contact.value == "" || 
email_de.contact.value.indexOf('@') == -1 ||
      email_de.contact.value.indexOf('.') == -1 ||
      email_de.contact.length<6) {
        alert( "Bitte geben Sie eine gültige e-mail Adresse ein!" );
        email_de.contact.focus();
        return false ;
    }
    if (email_de.nachricht.value == "") {
        alert( "Bitte geben Sie einen Nachricht ein!" );
        email_de.nachricht.focus();
        return false ;
    }
    return true ;
}   
// texte für das englische Kontaktformular   
function checkform_en (email_en)
{
    if (email_en.vorname.value == "") {
        alert( "Please enter your first name!" );
        email_en.vorname.focus();
        return false ;
    }
    if (email_en.nachname.value == "") {
        alert( "Please enter your surname!" );
        email_en.nachname.focus();
        return false ;
    }
    if (email_en.contact.value == "" || 
email_en.contact.value.indexOf('@') == -1 ||
      email_en.contact.value.indexOf('.') == -1 ||
      email_en.contact.length<6) {
        alert( "Please enter a valid e-mail adress!" );
        email_en.contact.focus();
        return false ;
    }
    if (email_en.nachricht.value == "") {
        alert( "Please enter message!" );
        email_en.nachricht.focus();
        return false;
    }
    // ** END **
    return true ;
    //return true ;
}
