window.defaultStatus = 'www.reblandtour.de';
window.onload = stripe;
onerror = stopError;

function fenster(url, width, height)
{
  F1 = open(url,"Fenster1","width=" + width + ",height=" + height + ",resizable=no,scrollbars=yes");
  F1.focus();
}

function stopError()
{
    return true;
}

function stripe() {
    var table = document.getElementById("zebratable");
        var tbodies = table.getElementsByTagName("tbody");

        for (var h = 0; h < tbodies.length; h++) {
            var even = false;
            var trs = tbodies[h].getElementsByTagName("tr");

            for (var i = 0; i < trs.length; i++) {
                trs[i].onmouseover=function(){
                    this.className += " ruled"; return false
                }
                trs[i].onmouseout=function(){
                    this.className = this.className.replace("ruled", ""); return false
                }
                if(even)
                    trs[i].className += " even";
                even = !even;
            } // for trs
        } // for bodies
} // function

function reloc(loc){
    loc = '../index.php?frame='+loc;
    if(self.name!="main") self.parent.location=loc;
}

function Fenster(Bild,breit,hoch){
    var bild = window.open(Bild,'_splash','fullscreen=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
    bild.resizeTo(breit,hoch);
    bild.moveTo((window.screen.width-breit)/2,(window.screen.height-hoch)/2);
    bild.focus();
}

//Markieren im Menü
function mark(ii){
  //  if(self.name!="main") self.parent.location="../frame.php";
    for(var i = 0; i < parent.navi.document.getElementsByTagName("td").length; i++)
    {   parent.navi.document.getElementsByTagName("td")[i].style.setAttribute("background")
        parent.navi.document.getElementById(ii).style.setAttribute("background", "url(../control/pix/bg-mark.bmp)", "true");
    }
}

// Funktionen für Seitenfuss
function zurueck(){
    var pos=5000;
    do{
    pos=pos-pos/50;
    window.scrollTo(0,pos);
    window.defaultStatus = 'www.reblandtour.de';
    }
    while(pos > 1);
}

function drucken(){
    javascript:self.print();
}

//Funktionen für die Steuerung der Anmeldung
function checksubscribeform(){
    var fehler = 0;
    if(document.meldung.vorname.value == "") {
        document.meldung.vorname.style.setAttribute("background", "red", "true");
        fehler++;}
    else document.meldung.vorname.style.setAttribute("background", "white", "true");

    if(document.meldung.nachname.value == "") {
        document.meldung.nachname.style.setAttribute("background", "red", "true");
        fehler++;}
    else document.meldung.nachname.style.setAttribute("background", "white", "true");

    if(document.meldung.team.value == "") {
        document.meldung.team.style.setAttribute("background", "red", "true");
        fehler++;}
    else document.meldung.team.style.setAttribute("background", "white", "true");

    if (document.meldung.rennen.selectedIndex == 0 && document.meldung.kat.selectedIndex == 0) {
        document.meldung.kat.style.setAttribute("background", "red", "true");
        fehler++;}
    else document.meldung.kat.style.setAttribute("background", "white", "true");

    if (document.meldung.email.value != "butti" && (document.meldung.email.value == "" || document.meldung.email.value.length < 5 || document.meldung.email.value.indexOf("@") ==-1 || document.meldung.email.value.indexOf(".")==-1)) {
        document.meldung.email.style.setAttribute("background", "red", "true");
        fehler++;}
    else document.meldung.email.style.setAttribute("background", "white", "true");

    if (fehler==0) return true;
    else {
        alert("Bitte füllen Sie die rot gekennzeichnete Felder richtig aus!");
        return false;
        }
}

function changesubscribe(){
    if(document.meldung.rennen.selectedIndex != 1) {
    document.meldung.kat.selectedIndex = 0;
    document.meldung.u23.checked = false;
    document.meldung.kat.setAttribute('disabled', 'disabled');
    document.meldung.u23.setAttribute('disabled', 'disabled');
    }
    else {
    document.meldung.kat.setAttribute('disabled', '');
    document.meldung.u23.setAttribute('disabled', '');
    }
    return true;
}
