
ns6=(navigator.userAgent.indexOf("Gecko")!=-1)?true:false
opera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false

open_menu = "menu1"

<!-- Mouseover menu -->
function menu_over(menu,farbe){

		new_menu = menu;
		
		if(document.all){

			var thestyle= eval ('document.all.' + new_menu +'.style');
			old_col = thestyle.backgroundColor;
			menu_out();
			
			thestyle.backgroundColor = farbe;
			open_menu = new_menu
		}
		
		else if(opera || ns6){
			
			var thestyle = document.getElementById(menu).style;
			old_col = document.getElementById(menu).style.backgroundColor;
			menu_out();
			
			thestyle.backgroundColor = farbe;
			open_menu = new_menu;
		}
		
		
}

<!-- Mouseout menu -->
function menu_out(){
	if(document.all) {
		
		var thestyle= eval ('document.all.'+ open_menu + '.style');
		thestyle.backgroundColor = old_col;
	}
	
	else if(opera || ns6) {
		
		var thestyle = document.getElementById(open_menu).style;
		thestyle.backgroundColor = old_col;
	}
	
	
}

<!-- Kontaktformular überprüfen -->
function formularCheck()
{
        var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
        var check=/@[\w\-]+\./;
        var checkend=/\.[a-zA-Z]{2,3}$/;
        
        go = true;
        hinweis = "Ihre Angaben sind noch nicht vollständig oder fehlerhaft\n\nBitte überprüfen Sie folgende Angaben:\n\n";
        

        if(document.forms[0].elements["name"]) {
        	name = document.forms[0].elements["name"].value;
        
        	if (name == "") {
                        go = false;
                        hinweis = hinweis + "- Name: fehlt\n";

        	}
        }
        
        if(document.forms[0].elements["vorname"]) {
        	vorname = document.forms[0].elements["vorname"].value;
        	
        	if (vorname == "") {
                        go = false;
                        hinweis = hinweis + "- Vorname: fehlt\n";

        	}
        }
        	
        if(document.forms[0].elements["plz"]) {
        	plz = document.forms[0].elements["plz"].value;
        
        	if (plz == "") {
                        go = false;
                        hinweis = hinweis + "- Plz: fehlt\n";

        	}
        }
        	
        if(document.forms[0].elements["ort"])	{
        	ort = document.forms[0].elements["ort"].value;
        
        	if (ort == "") {
                        go = false;
                        hinweis = hinweis + "- Ort: fehlt\n";

        	}
        }
        
        if(document.forms[0].elements["faqVorschlag"])	{
        	ort = document.forms[0].elements["faqVorschlag"].value;
        
        	if (ort == "") {
                        go = false;
                        hinweis = hinweis + "- Verbesserungsvorschlag: fehlt\n";

        	}
        }
        	
        if(document.forms[0].elements["email"]) {
        	email = document.forms[0].elements["email"].value;
        
        	if(((email.search(exclude) != -1)||(email.search(check)) == -1)||(email.search(checkend) == -1)) {
                        go = false;
                        hinweis = hinweis + "- Emailadresse: fehlerhaft\n";

        	}
        }
        	
        
        if (go) {
                        return true;
        }
        else {
                        alert(hinweis);
                        return false;
        }
}

//PopUp für Verbesserungsvorschlag FAQ
function faqAntwort(nr) {

	window.open("FAQVorschlag.php?id="+nr,"Vorschlag","width=480,height=300");
}

// PopUp für Druckformat
function printPage(nr) {

	window.open("includes/elemente/printPage.php?pg="+nr, "SeiteDrucken", "width=650,height=600,scrollbars=yes");
}

// Cookie Funktion für PopUp auf Startseite
function cookie() {

	cookie_name = "atopet_welcome";
	
	if(document.cookie) {
	
		index = document.cookie.indexOf(cookie_name);
	}
	
	else {
		
		index = -1;
	}
	
	if(index==-1) {

		document.cookie = cookie_name;

	}
	
	else {}
}

// PopUp für Teilnahme an Umfragen
function umfrage(nr, pg) {

	if(pg) {
	
		window.open("abstimmen.php?id="+nr+"&pg="+pg, "Umfrage", "width=500,height=400,scrollbars=yes");
	}
	else {
	
		window.open("results.php?id="+nr, "Umfrage", "width=500,height=400,scrollbars=yes");
	}
}

// PopUp für Teilnahme an Umfragen Frontseite

function umfrage_front(nr, vote) {

	

	
	if(vote) {
	
		window.open("umfrage/abstimmen.php?id="+nr, "Umfrage", "width=500,height=400,scrollbars=yes");
	}
	else {
	
		window.open("umfrage/results.php?id="+nr, "Umfrage", "width=500,height=400,scrollbars=yes");
	}
}
