function loggedIn(state,key) {
/*        element1 = top.document.getElementById('Login');
        element2 = top.document.getElementById('Balkenmenu');
*/
        if (state == true) {
                if (top.Login.location.pathname != '/cs/logout.php') {
                        top.Login.location.replace('logout.php?key=' + key);
                        top.Balkenmenu.location.replace('balkenmenu.php'+self.location.search);

/*                if (element1.location.pathname != '/cs/logout.php') {

                        element1.location.replace('logout.php?key=' + key);
                        element2.location.replace('logout.php?key=' + key);
*/
                }
        }

        else {
                if (top.Login) {
            if (top.Login.location.pathname != 'login.php') {
                top.Login.location.replace('login.php');
                top.Balkenmenu.location.replace('balkenmenu.php');
    /*
            if (top.document.getElementById('Login').location.pathname != 'login.php') {
                top.document.getElementById('Login').location.replace('login.php');
                top.document.getElementById('Balkenmenu').location.replace('balkenmenu.php');
    */
            }
                }
        }
}

function clearspeedlogin() {
        document.speedlogin.mnr.value = document.speedlogin.Imnr.value;
        document.speedlogin.Imnr.value = '';
        document.speedlogin.passwd.value = document.speedlogin.Ipasswd.value;
        document.speedlogin.Ipasswd.value = '';
 }


function menu(menuID) {
/*
        try { x = top.location.host; }
        catch (y) { x = '[error]'; }
        finally {  }
        if (x == '[error]') { document.all.error.click(); }
        else {
                if (x != 'www.book-n-drive.de') {
                        top.location.href = 'http://www.book-n-drive.de/cs/?link=' + menuID;
                }
                else {
                        if ((top.location.href == self.location.href) || (self.name != 'Inhalt')) {
                                top.location.replace('/cs/?link=' + menuID);
                        }
                        else {
*/                                if (self.location.search != '') {
                                        parent.Auswahl.location.replace('process.php' + self.location.search + '&menu=' + menuID);
                                }
                                else {
                                        parent.Auswahl.location.replace('process.php?menu=' + menuID);
                                }
/*                        }
                }
        } */
}

function open_tarifrechner(url,title) {
        window.open(url,title,"dependent=yes,scrollbars=no,resizeable=no,width=460,height=525,top=10,left=10");
        //window.open("http://demobuchung.hal.dbrent.net/kundenbuchung/process.php?proc=login_form&f=5");
}


function open_menue (loc) {
        if (parent.Auswahl) {
                parent.Auswahl.location.replace(loc);
        }
}

function new_window (url,name_w,width,height) {
        option_string = "width="+width+",height="+height+",dependent=yes,scrollbars=no,resizeable=yes,top=10";
        window.open(url,name_w,option_string);
}

function new_window_scroll (url,name_w,width,height) {
        option_string = "width="+width+",height="+height+",dependent=yes,scrollbars=yes,resizeable=yes";
        window.open(url,name_w,option_string);
}

function load_inhalt(url) {
        parent.Inhalt.location=url;
}

function load_extern(url) {
        window.resizeTo(620,500);
        window.moveTo(screen.width-630,screen.height-550);
        window.location.href=url;
}