execOnLoad = function() {
	an_StartList();
}
window.onload=execOnLoad;
function an_StartList() {
	if (document.all&&document.getElementById && !window.opera) {
		navRoot = document.getElementById("navigation");
		if (navRoot) {
			for (i=0; i<navRoot.childNodes.length; i++) {
				node1 = navRoot.childNodes[i];
				if (node1.nodeName=="UL") {
					for (j=0; j<node1.childNodes.length; j++) {
						node2 = node1.childNodes[j];
						if (node2.nodeName=="LI") {
							node2.onmouseover=function() {
								this.className+=" over";
							}
							node2.onmouseout=function() {
								this.className=this.className.replace(" over", "");
							}
						} 
					} 
				} 
			} 
		}
	}
}



function checkall(name, thestate){
var arrCheckboxes = document.getElementsByName(name);
  for(var i=0; i<arrCheckboxes.length; i++){
    arrCheckboxes[i].checked = thestate;
  }
}
function addcontact(){
	var cntContact = document.getElementsByName("contactname").length +1;
	var contact = document.getElementById("js_contact");
	var newContact = document.createElement("div");
	var newContactId = "js_contact"+cntContact+"";
	newContact.setAttribute("id", newContactId);
	newContact.innerHTML = "<fieldset><legend>"+cntContact+". Ansprechpartnerdaten bearbeiten</legend><br /><label for=\"label_contactname\" class=\"text\">Vor-, Nachname:</label><input type=\"hidden\" class=\"hide\" name=\"contactcount\" value=\""+cntContact+"\" /><input type=\"text\" name=\"contactname\" id=\"label_contactname\" class=\"field\" value=\"\" /><br /><label for=\"label_contactphone\" class=\"text\">Telefon:</label><input type=\"text\" name=\"contactphone\" id=\"label_contactphone\" class=\"field\" value=\"\" /><br /><label for=\"label_contactfax\" class=\"text\">Fax:</label><input type=\"text\" name=\"contactfax\" id=\"label_contactfax\" class=\"field\" value=\"\" /><br /><label for=\"label_contactfax\" class=\"text\">E-Mail:</label><input type=\"text\" name=\"contactfax\" id=\"label_contactfax\" class=\"field\" value=\"\" /><br /><label for=\"label_contactnewsletter\" class=\"text\">Newsletter empfangen:</label><input type=\"checkbox\" name=\"contactnewsletter\" id=\"label_contactnewsletter\" value=\"1\" class=\"check\" /><br class=\"clear\" /><br /><label for=\"label_contactdescription\" class=\"text\">Beschreibung:</label><textarea cols=\"10\" rows=\"7\" name=\"contactdescription\" id=\"label_contactdescription\"></textarea><br class=\"clear\"></fieldset>"
	contact.appendChild(newContact);
}

function removecontact(){
	var check = confirm("Soll der letzte Ansprechpartner wirklich entfernt werden?");
	if(check == true) {
		var cntContact = document.getElementsByName("contactname").length;
		var contact = document.getElementById("js_contact");
		var oldContact = document.getElementById("js_contact"+cntContact+"");
		contact.removeChild(oldContact);
	}
}
var abs = 0;
var empf = 0;
function checkForm () {

	if (abs == 1) 
	{
	  if (document.formular.mail.value.indexOf("@") == -1) 
	  {
	    document.formular.mail.style.backgroundColor="#FF0000";
	    document.formular.mail.focus();
	    abs = 0;
	    return false;
	  } else
	  {
	  	document.formular.mail.style.backgroundColor="";
	  }
	}
	
	if(empf == 1)
	{  
	  if (document.formular.email.value.indexOf("@") == -1) 
	  {
	    document.formular.email.style.backgroundColor="#FF0000";
	    document.formular.email.focus();
	    empf = 0;
	    return false;
	  } else
	  {
	  	document.formular.email.style.backgroundColor="";
	  }
	}
}	
function Foto(img){
  foto1= new Image();
  foto1.src=(img);
  Controlla(img);
}
function Controlla(img){
  if((foto1.width!=0)&&(foto1.height!=0)){
    viewFoto(img);
  }
  else{
    funzione="Controlla('"+img+"')";
    intervallo=setTimeout(funzione,20);
  }
}
function viewFoto(img){
  largh=foto1.width+20;
  altez=foto1.height+20;
  stringa="width="+largh+",height="+altez;
  finestra=window.open(img,"",stringa);
}
function setVisibility(divId) {
		
	var actualVisibility=document.getElementById(divId).style.visibility;

	if(actualVisibility=='' || actualVisibility=='visible') {
		document.getElementById(divId).style.visibility = "hidden";
		document.getElementById(divId).style.display = "none";
	} else {
		document.getElementById(divId).style.visibility = "visible";
		document.getElementById(divId).style.display = "block";
	}
}
function visibility(divId, name){
	
	var checked = false;
	var arrCheckboxes = document.getElementsByName(name);
  	for(var i=0; i<arrCheckboxes.length; i++){
    	if(arrCheckboxes[i].checked){
    		checked = true;
    	}
  	}
	if(checked){
		document.getElementById(divId).style.visibility = "visible";
		document.getElementById(divId).style.display = "block";
	}else{
		document.getElementById(divId).style.visibility = "hidden";
		document.getElementById(divId).style.display = "none";
	}
}

function imgprev(field, image) {
	var src = document.getElementById(field).value;
	var img = src.replace(/..\/..\//, "");
	document.getElementById(image).setAttribute("src", String(img));
}
function displayOff (id){
if (document.getElementById) {
	var mydiv = document.getElementById(id);
		mydiv.style.display = (mydiv.style.display=='none'?'block':'none');
	}
}
function displayOn (id){
if (document.getElementById) {
	var mydiv = document.getElementById(id);
		mydiv.style.display = (mydiv.style.display=='block'?'none':'block');
	}
}
function QuickJump(){
	var Formular = document.getElementById('js_factbook');
	var Element = Formular.target.selectedIndex;
	if (Formular.target.options[Element].value != 0){
		window.open(Formular.target.options[Element].value);
	}   
}

function tabOn(id) {
	var tab = document.getElementById(id);
	tab.style.display = 'block';
}
function tabOff(id) {
	var tab = document.getElementById(id);
	tab.style.display = 'none';
}