 function webmailpopup()
 {
  if (window.document.getElementById('account').value == '' || window.document.getElementById('pwd').value == '') {    alert('Bitte geben Sie einen E-Mail Account und das zugehoerige Passwort ein.');return;
  }
  lp = (screen.width) ? (screen.width-800)/2 : 0;
  tp = (screen.height) ? (screen.height-550)/2 : 0;
  settings ="height=550,width=800,top=" + tp + ",left="+lp+",scrollbars=yes,status=yes,resizable=yes";
  var seite="http://domain.freenet.de/cgi-bin/lifesales/life-webmail.cgi?tld=.de&sld=disciples&account="+window.document.getElementById('account').value+"&pwd="+window.document.getElementById('pwd').value+"&mandant=freenet&";
  webmail = window.open(seite,"webmail",settings);
  if (window.document.getElementById('account')) { window.document.getElementById('account').value=''; }
  if (window.document.getElementById('pwd')) { window.document.getElementById('pwd').value=''; }
  webmail.focus();
 }





 /*  Statehandler */
    function statehandler(){
	// Pruefen Status
		if (div_input_object_show4.readyState == 4){
			var dom_baum = div_input_object_show4.responseText;
            alert(dom_baum);
		}
	}


 /* Funktionen für AJAX */
    function getDivInputObject(){
		var ro;

		//Mozilla Kompatibel
		if (window.XMLHttpRequest){
			try {
				ro = new XMLHttpRequest();
			}
			catch(e){
				ro = null;
			}
		}
		else {
			try {
				ro = new ActiveXObject("Msxml2.Xmlhttp");
			}
			catch(e) {
				try {
					ro = new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch (e){
					ro = null;
				}
			}
		}

		if (ro == null){
			alert('Ihr Browser unterstütz leider kein AJAX');
		}
		return ro;
	}



ump_sco_input = getDivInputObject();


/*Funktion zum anzeigen eines Divs*/
function updateUmpEins(element,spiel_id){
    //Verschiebung in DB
        // ump_sco_input.onreadystatechange = statehandler;
        // Abfrage initialisieren
        var sendMsg = "http://www.disciples.de/intern/ump_sco/update.php?action=ump1_update&ump_1="+element.value+"&spiel_id="+spiel_id;
        ump_sco_input.open('post',sendMsg);

        //Anfrage senden
        ump_sco_input.send(null);
}


function updateUmpZwei(element,spiel_id){
    //Verschiebung in DB
        // ump_sco_input.onreadystatechange = statehandler;
        // Abfrage initialisieren
        var sendMsg = "http://www.disciples.de/intern/ump_sco/update.php?action=ump2_update&ump_2="+element.value+"&spiel_id="+spiel_id;
        ump_sco_input.open('post',sendMsg);

        //Anfrage senden
        ump_sco_input.send(null);
}

function updateSco(element,spiel_id){
    //Verschiebung in DB
        // ump_sco_input.onreadystatechange = statehandler;
        // Abfrage initialisieren
        var sendMsg = "http://www.disciples.de/intern/ump_sco/update.php?action=sco_update&sco="+element.value+"&spiel_id="+spiel_id;
        ump_sco_input.open('post',sendMsg);

        //Anfrage senden
        ump_sco_input.send(null);
}


function updateNR(element,spiel_id){
    //Verschiebung in DB
        // ump_sco_input.onreadystatechange = statehandler;
        // Abfrage initialisieren
        var sendMsg = "http://www.disciples.de/intern/ump_sco/update.php?action=nr_update&nr="+element.value+"&spiel_id="+spiel_id;
        ump_sco_input.open('post',sendMsg);

        //Anfrage senden
        ump_sco_input.send(null);
}

































// Funktion fügt die Disciples-Seite zu den Favoriten hinzu
function addbookmark(){
    var bookmarkurl="http://www.disciples.de"
    var bookmarktitle="Disciples München-Haar e.V."
    if (document.all)
        window.external.AddFavorite(bookmarkurl,bookmarktitle)
}








function sprung(form){
 var wert=form.zielform.selectedIndex
 var inhalt=form.zielform.options[wert].value;
 var posanhang=inhalt.lastIndexOf("?");
 var anhang=new String(inhalt.substring(posanhang+1,posanhang+2));
 var ziel=inhalt.slice(0,posanhang);
	if (form.zielform.options[wert].value != "0"){
 		if(anhang==1){location=ziel;}
 		if(anhang==2){window.open(ziel,"Fenster");}
 		if(anhang==3){parent.Framename.location.href=ziel;}
	}
}


function pwv_pw_loeschen(ID){
if (confirm("Wollen Sie diesen Benutzer wirklich löschen?")){
	open("http://www.disciples.de/intern/pwv/pwvloesch.php?mainframe=pwv&pwv_loeschen_id="+ID+"","_self");
}
}

function gaestebucheintrag_loeschen(ID){
if (confirm("Wollen Sie diesen Eintrag wirklich löschen?")){
	open("http://www.disciples.de/intern/gaestebuch/gaestebuch_update.php?mainframe=gaestebuch&gaestebucheintrag_id="+ID+"","_self");
}
}

function kontakt_loeschen(ID){
if (confirm("Wollen Sie diesen Kontakt wirklich löschen?")){
	open("http://www.disciples.de/intern/ansprechpartner/kontaktloesch.php?mainframe=ansprechpartner&kontakt_loeschen_id="+ID+"","_self");
}
}

function mitglied_loeschen(ID){
if (confirm("Wollen Sie dieses Mitglied wirklich löschen?")){
	open("http://www.disciples.de/intern/index2.php?mainframe=mitglied&mitglied_loeschen=1&mitglied_id="+ID+"","_self");
}
}

function termin_loeschen(ID){
if (confirm("Wollen Sie diesen Termin wirklich löschen?")){
	open("http://www.disciples.de/intern/index2.php?mainframe=trainingszeiten&termin_loeschen=1&termin_id="+ID+"","_self");
}
}

function bat_stats_loeschen(ID,Player_ID){
if (confirm("Wollen Sie diese Statistiken wirklich löschen?")){
	open("http://www.disciples.de/intern/index2.php?mainframe=statistiken&bat_stats_loeschen=1&player_id_loeschen="+ID+"&player_id="+Player_ID+"","_self");
}
}

function liga_loeschen(ID){
if (confirm("Wollen Sie diese Liga wirklich löschen?")){
	open("http://www.disciples.de/intern/index2.php?mainframe=liga_hinzufuegen&liga_loeschen=1&liga_id_loeschen="+ID+"","_self");
}
}

function spiel_loeschen(ID,LIGA_ID){
if (confirm("Wollen Sie diese Spiel wirklich löschen?")){
	open("http://www.disciples.de/intern/index2.php?mainframe=spiele_hinzu&liga_loeschen=1&liga_id_loeschen="+ID+"&liga_id_anzeigen="+LIGA_ID+"","_self");
}
}

function pitch_stats_loeschen(ID,Player_ID){
if (confirm("Wollen Sie diese Statistiken wirklich löschen?")){
	open("http://www.disciples.de/intern/index2.php?mainframe=statistiken&pitch_stats_loeschen=1&player_id_loeschen="+ID+"&player_id="+Player_ID+"","_self");
}
}


function gallery_bilder_loeschen(ID,Gallery_ID,Bild_Gr,Bild_Kl,PW){
if (confirm("Wollen Sie dieses Bild wirklich löschen?")){
	open("http://www.disciples.de/intern/index2.php?mainframe=gallery_delete&gallery_bilder_loeschen&bilder_id_loeschen="+ID+"&gallery_uebergabe_bildindex="+Gallery_ID+"&gallery_show","_self");
	open("http://disciples.beyond-infinity.org/gallery_delete2.php?bild_gr="+Bild_Gr+"&bild_kl="+Bild_Kl+"&"+PW+"","_blank");
}
}

function gallery_loeschen(Gallery_ID,PW){
if (confirm("Wollen Sie diese Gallery wirklich löschen?")){
	open("http://www.disciples.de/intern/gallery/gallery_delete3.php?gallery_uebergabe_bildindex="+Gallery_ID+"&"+PW+"","_blank");
}
}


function sponsoren_update(ID,Anzeigen,Rotator){
	open("http://www.disciples.de/intern/index2.php?mainframe=sponsoren&ID_Anzeigen="+ID+"&update=1&anz_eintragen="+Anzeigen+"&rot_eintragen="+Rotator+"","_self");
}

function tel_hidden(ID,bereich,name,vorname,tel,tel_hidden,email){
	document.Ansprechpartner.bereich1 = bereich;
	document.Ansprechpartner.name1 = name;
	document.Ansprechpartner.vorname1 = vorname;
	document.Ansprechpartner.tel1 = tel;
	document.Ansprechpartner.email1 = email;
	open("http://www.disciples.de/intern/index2.php?mainframe=ansprechpartner&ansprechpartner_UPDATE=1&ansprech_tel_hidden="+tel_hidden+"&ansprech_ID="+ID+"&ansprech_bereich="+document.Ansprechpartner.bereich1.value+"&ansprech_name="+document.Ansprechpartner.name1.value+"&ansprech_vorname="+document.Ansprechpartner.vorname1.value+"&ansprech_tel="+document.Ansprechpartner.tel1.value+"&ansprech_email="+document.Ansprechpartner.email1.value+"","_self");
}




function changeBanner(id){
	$('homer').style.display = 'none';
	$('optik').style.display = 'none';
    $('lehmann').style.display = 'none';
	$('forelle').style.display = 'none';
	$('keck').style.display = 'none';
	
	$(id).style.display = 'inline';
	
    a = 0;
	a = 1 + 4 * (Math.random());
    a = Math.floor(a);

    var timeframe = 7500;
    
    //alert(a);
	
	if (id == 'homer'){
		if (a == 3){
            window.setTimeout("changeBanner('optik')", timeframe);
        }    
        if (a == 2){
            window.setTimeout("changeBanner('lehmann')", timeframe);
        }
        if (a == 1){
            window.setTimeout("changeBanner('forelle')", timeframe);
        }
        if (a == 4){
            window.setTimeout("changeBanner('keck')", timeframe);
        }        
	}
	
	if (id == 'optik'){
		if (a == 2){
            window.setTimeout("changeBanner('homer')", timeframe);
        }    
        if (a == 1){
            window.setTimeout("changeBanner('lehmann')", timeframe);
        }
        if (a == 3){
            window.setTimeout("changeBanner('forelle')", timeframe);
        }  
        if (a == 4){
            window.setTimeout("changeBanner('keck')", timeframe);
        }        
	}
    
	if (id == 'lehmann'){
		if (a == 1){
            window.setTimeout("changeBanner('homer')", timeframe);
        }    
        if (a == 3){
            window.setTimeout("changeBanner('optik')", timeframe);
        }
        if (a == 2){
            window.setTimeout("changeBanner('forelle')", timeframe);
        }
        if (a == 4){
            window.setTimeout("changeBanner('keck')", timeframe);
        }
	}   

	if (id == 'forelle'){
		if (a == 3){
            window.setTimeout("changeBanner('homer')", timeframe);
        }    
        if (a == 2){
            window.setTimeout("changeBanner('optik')", timeframe);
        }
        if (a == 1){
            window.setTimeout("changeBanner('lehmann')", timeframe);
        }
        if (a == 4){
            window.setTimeout("changeBanner('keck')", timeframe);
        }
	}   
    

	if (id == 'keck'){
		if (a == 3){
            window.setTimeout("changeBanner('homer')", timeframe);
        }    
        if (a == 2){
            window.setTimeout("changeBanner('optik')", timeframe);
        }
        if (a == 1){
            window.setTimeout("changeBanner('lehmann')", timeframe);
        }
        if (a == 4){
            window.setTimeout("changeBanner('forelle')", timeframe);
        }
	}       
    
}



