<!-- 
// JavaScript Basics
function preloadImages() {
	var arr_Bilder = new Array(
		'fileadmin/template/main/images_templates/abstand22.gif',
		'fileadmin/template/main/images_templates/bg.gif',
		'fileadmin/template/main/images_templates/button_suchen_on.gif',
		'fileadmin/template/main/images_templates/button_suchen_akt.gif',
		'fileadmin/template/main/images_templates/bg_a_externer_link.gif',
		'fileadmin/template/main/images_templates/bg_a_externer_link_on.gif',
		'fileadmin/template/main/images_templates/bg_a_mail_link.gif',
		'fileadmin/template/main/images_templates/bg_a_mail_link_on.gif',
		'fileadmin/template/main/images_templates/bg_a_pdf_link.gif',
		'fileadmin/template/main/images_templates/bg_a_pdf_link_on.gif',
		'fileadmin/template/main/images_templates/bg_a_lupe_link.gif',
		'fileadmin/template/main/images_templates/bg_a_lupe_link_on.gif',
		'fileadmin/template/main/images_templates/bg_dfn.gif');
	
	var arr_Images = new Array();
	
	var int_PicsZaehler = 0;
	for (int_PicsZaehler; int_PicsZaehler < arr_Bilder.length; int_PicsZaehler++) {
		arr_Images[int_PicsZaehler] = new Image();
		arr_Images[int_PicsZaehler].src = arr_Bilder[int_PicsZaehler];
	}

}

function clearSearchstring() {
	if (document.a2d8606a395dab5f9e765fbeb18f0294f.sword.value == "Search") {
		document.a2d8606a395dab5f9e765fbeb18f0294f.sword.value="";
	}
}

function clearUserstring() {
	if (document.Anmeldung.benutzer.value == "Username/Password") {
		document.Anmeldung.benutzer.value="";
	}
}

function checkformAnmeldung() { 
	flg_SubmitErlaubt = false;
	if(document.Anmeldung.benutzer.value == "")  { 
		alert("Please enter your username first."); 
		document.Anmeldung.benutzer.focus(); 
		return false; 
	} else if(document.Anmeldung.benutzer.value == "Username/Password")  { 
		alert("Please enter your username first."); 
		document.Anmeldung.benutzer.focus(); 
		return false; 
	} else {
		flg_SubmitErlaubt = true;
	}
	if(document.Anmeldung.zugangswort.value == "")  { 
		alert("Please enter your password first."); 
		document.Anmeldung.zugangswort.focus(); 
		return false; 
	} else if(document.Anmeldung.zugangswort.value == "Password")  { 
		alert("Please enter your password first."); 
		document.Anmeldung.zugangswort.focus(); 
		return false; 
	} else {
		flg_SubmitErlaubt = true;
	}
	
	if (flg_SubmitErlaubt == true) {
		//document.Anmeldung.submit(); 
		return true;
	}
} 

var CookiesErlaubt = false;
function CookieTest() {
	if(navigator.cookieEnabled == true)
		CookiesErlaubt = true;
	else if(navigator.cookieEnabled == false) 
		CookiesErlaubt = false;
	else 
		CookiesErlaubt = true;
}
function getCookie(name) { // use: getCookie("name");
	var bikky = document.cookie;
	var index = bikky.indexOf(name + "=");
	if (index == -1) return null;
	index = bikky.indexOf("=", index) + 1;
	var endstr = bikky.indexOf(";", index);
	if (endstr == -1) endstr = bikky.length;
	return unescape(bikky.substring(index, endstr));
}

var today = new Date();
var expiry = new Date(today.getTime() + 28 * 24 * 60 * 60 * 1000); // plus 28 days
function setCookie(name, value) { // use: setCookie("name", value);
	if (value != null && value != "")
	  document.cookie=name + "=" + escape(value) + "; expires=" + expiry.toGMTString();
	bikky = document.cookie; // update bikky
}

function getMemberName() { 
	CookieTest();
	if(CookiesErlaubt == true) {
		var strCookieMerken = getCookie("UserOfAgribenchmark");
		if (strCookieMerken != null) {
			var arrCookieMerken = explode("#", strCookieMerken);
			var intAnzahl = arrCookieMerken.length - 1;
			if (intAnzahl >= 1) {
				//var strUserFullName = arrCookieMerken[6];   ALT
				var strUserFullName = arrCookieMerken[8];
				//Leerzeichen (+) ersetzen
				strUserFullName = StringChange(strUserFullName, "+", " ");
				document.write('| User: ' + strUserFullName + ' | <a title="Log out" href="fileadmin/do_memberlogout.php">Log out</a>');
			}
		} else {
			document.write('| User: Guest');
		}
	}
}

function checkform() { 
	if(document.newslettereintragen.email.value == "")  { 
		alert("Bitte tragen Sie zuerst Ihre E-Mail Adresse ein."); 
		document.newslettereintragen.email.focus(); 
		return false; 
	} 
} 

function callnewsletterabo() { 
	if(document.newslettereintragen.email.value == "")  { 
		alert("Bitte tragen Sie zuerst Ihre E-Mail Adresse ein."); 
		document.newslettereintragen.email.focus(); 
	} 
	else { 
		document.newslettereintragen.submit(); 
	} 
} 

function opennewsletterabo() { 
	var uri = 'newsletterabo.php?email=' + document.newslettereintragen.email.value; 
	fenster = window.open(uri,'newsletterabo','width=600,height=490,resizable=yes,scrollbars=no,toolbar=no,location=no,directorie=no,status=no,menubar=no'); 
	fenster.focus();
} 

function imgon(image) {
        if (document.images) {
             var src = image.src;
             var offstring = src.lastIndexOf("off");
             if (offstring != -1) {
                var newsrc = src.substring(0,offstring) + "on";
                image.src = newsrc + ".gif";
               }
         }
}

function imgoff(image) {
         if (document.images) {
              var src = image.src;
              var onstring = src.lastIndexOf("on");
              var aktstring = src.lastIndexOf("_akt");
              if (onstring != -1) {
                 var newsrc = src.substring(0,onstring) + "off";  
                 image.src = newsrc + ".gif"; 
             }
              if (aktstring != -1) {
                 var newsrc = src.substring(0,aktstring) + "_off";  
                 image.src = newsrc + ".gif"; 
             }
        }
}

function jpgon(image) {
        if (document.images) {
             var src = image.src;
             var offstring = src.lastIndexOf("off");
             if (offstring != -1) {
                var newsrc = src.substring(0,offstring) + "on";
                image.src = newsrc + ".jpg";
               }
         }
}

function jpgoff(image) {
         if (document.images) {
              var src = image.src;
              var onstring = src.lastIndexOf("on");
              var aktstring = src.lastIndexOf("_akt");
              if (onstring != -1) {
                 var newsrc = src.substring(0,onstring) + "off";  
                 image.src = newsrc + ".jpg"; 
             }
              if (aktstring != -1) {
                 var newsrc = src.substring(0,aktstring) + "_off";  
                 image.src = newsrc + ".jpg"; 
             }
        }
}

function imgakt(image) {
        if (document.images) {
             var src = image.src;
             var onstring = src.lastIndexOf("on");
             if (onstring != -1) {
                var newsrc = src.substring(0,onstring) + "akt";
                image.src = newsrc + ".gif";
               }
         }
}

function popup(ziel,fenstername,w,h) {
	fenster = window.open(ziel,fenstername,'width=' + w + ',height=' + h + ',resizable=yes,scrollbars=yes,toolbar=no,location=no,directorie=no,status=no,menubar=no');
	fenster.focus();
}

function popupallbars(ziel,fenstername,w,h) {
	fenster = window.open(ziel,fenstername,'width=' + w + ',height=' + h + ',resizable=yes,scrollbars=yes,toolbar=yes,location=yes,directorie=no,status=yes,menubar=yes');
	fenster.focus();
}

function popupnobars(ziel,fenstername,w,h) {
	fenster = window.open(ziel,fenstername,'width=' + w + ',height=' + h + ',resizable=yes,scrollbars=no,toolbar=no,location=no,directorie=no,status=no,menubar=no'); 
	fenster.focus();
}

function highlightmenu(ElementById) {
	if (document.getElementById) {
		oldColor = document.getElementById(ElementById).bgColor;
		document.getElementById(ElementById).bgColor = '#3C6FA2';
		document.getElementById(ElementById).style.cursor = 'pointer';
	}
}

function oldmenu(ElementById) {
	if (document.getElementById) {
		document.getElementById(ElementById).bgColor = oldColor
//		document.getElementById(ElementById).bgColor = '#003366'
	}
}

function clickmenu(ElementById) {
	if (document.getElementById) {
		document.getElementById(ElementById).bgColor = '#99CCFF';
	}
}

function highlightlink(ElementById) {
	if (document.getElementById) {
		oldColor = document.getElementById(ElementById).style.color;
		document.getElementById(ElementById).style.color = '#ff9933';
		document.getElementById(ElementById).style.textDecoration = 'underline';
	}
}

function unhighlightlink(ElementById) {
	if (document.getElementById) {
		document.getElementById(ElementById).style.color = oldColor;
		document.getElementById(ElementById).style.textDecoration = 'none';
	}
}

function showdiv(ElementById) {
	if (document.getElementById) {
		document.getElementById(ElementById).style.visibility = 'visible';
	} else {
	if (document.all) {
		document.all(ElementById).style.visibility = 'visible';
	}
	}
}

function hidediv(ElementById) {
	if (document.getElementById) {
		document.getElementById(ElementById).style.visibility = 'hidden';
	}
}

function getemail(csrambledmail) {
	var emailadress = "";
	emailadress = csrambledmail;
	emailadress = emailadress.replace(/#at#/,"@");
	emailadress = emailadress.replace(/#dot#/,".");
	return emailadress;
}

function hnav(ElementById) {
	if (document.getElementById) {
		oldColor = document.getElementById(ElementById).bgColor;
		document.getElementById(ElementById).style.backgroundColor = '#C7E4FD';
		document.getElementById(ElementById).style.borderColor = '#0066CC';
		document.getElementById(ElementById).style.cursor = 'pointer';
	}
}

function onav(ElementById) {
	if (document.getElementById) {
		document.getElementById(ElementById).style.backgroundColor = oldColor;
		document.getElementById(ElementById).style.borderColor = '#D2EBFF';
	}
}

function hnavmousedown(ElementById) {
	if (document.getElementById) {
		//oldColor = document.getElementById(ElementById).bgColor
		//document.getElementById(ElementById).bgColor = '#A7CEF5';
		document.getElementById(ElementById).style.backgroundColor = '#A7CEF5';
		document.getElementById(ElementById).style.cursor = 'pointer';
	}
}

function hnavmouseup(ElementById) {
	if (document.getElementById) {
		//oldColor = document.getElementById(ElementById).bgColor
		document.getElementById(ElementById).style.backgroundColor = '#F3FBFF';
		document.getElementById(ElementById).style.cursor = 'pointer';
	}
}

function StringChange(str_Inputstring, str_StringToChange, str_ChangeString) {
	var str_Output = str_Inputstring;
	var Zaehler = 1;
	do {
		str_Output = str_Output.replace(str_StringToChange,str_ChangeString);
		Zaehler++;
	}
	while (str_Output.indexOf(str_StringToChange) != -1 && Zaehler <= 10000);

	return str_Output;
}

function explode(str_Trennzeichen, str_String) {
	//Wandelt eine Zeichenkette in ein Array um. Trennung anhand von str_Trennzeichen
	var str_Output = str_String;
	str_Output = str_String.split(str_Trennzeichen);
	return str_Output;
}

function implode(str_Trennzeichen, arr_Array) {
	//Wandelt ein Array in eine Zeichenkette um. Trennung anhand von str_Trennzeichen
	//Wenn der Parameter arr_Array kein Array sondern ein String ist wird dieser wieder zurückgegeben
	var str_Output = "";
	if (typeof arr_Array == "string") {
		str_Output = arr_Array;
	} else {
		str_Output = arr_Array.join(str_Trennzeichen);
	}
	return str_Output;
}

function einblenden(div) {
  with(document.getElementById(div).style){
    if(display=="none"){
      display="block";
    }
    else{
      display="none";
    }
  }
}

function changeCSSClass(ID,newClass) {
	if (document.getElementById) {
		document.getElementById(ID).className = newClass;
	}
}

 
function ShowHide(id) {
	
	if (document.getElementsByName) {
		var temp;
		var newarray= id.split(' ');
	
		for (var j= 0;  j <  newarray.length; j++) {
			temp=newarray[j];
			
			var divs = document.getElementsByName( temp );

			if (divs && divs.length > 0) {	
				for (i=0;i<divs.length;i++) {		
					if (divs[i].style.display == "none") {
						divs[i].style.display = "block";
					}
					else
					{
						divs[i].style.display = "none"; 	
					}
				}
			}	
		}	
	}
}
// -->
