
// Allgemeines PopUp
function popup(page,x,y,s) {
  if (!s) { s = "1" }
  titel = x +""+ y;
  PopWindow=window.open(page,titel,"scrollbars="+s+",resizable=no,width="+x+",height="+y);
  PopWindow.focus();
}

function delcheck() {
    del_abfrage = confirm("Wirklich löschen?");

    if (del_abfrage == true) {
        return true;
    }
    else {
        return false;
    }
}

function lademarke() {
    nummer = document.form.card_marke[document.form.card_marke.selectedIndex].value;
    briefmarke2 = new Image;
    briefmarke2.src = "images/marken/"+ nummer +".gif";
    document.briefmarke.src = briefmarke2.src;
}

function adressbuch(mode) {
    url = "myaccount_adressbuch.php?popup=1";
    if (mode == "mobile") {
        url += "&mobile=1";
    }
    AdressWindow=window.open(url,"Adressbuch","scrollbars=yes,resizable=no,width=640,height=480");
    AdressWindow.focus();
}

function sprueche() {
    url = "/postcard/texte.php";
    SpruchWindow=window.open(url,"Sprueche","scrollbars=yes,resizable=no,width=800,height=500");
    SpruchWindow.focus();
}

function jukebox() {
    url = "/postcard/jukebox.php";
    JukeboxWindow=window.open(url,"Jukebox","scrollbars=yes,resizable=no,width=800,height=500");
    JukeboxWindow.focus();
}

function AjaxLoad(pane, url, options) {
    new Ajax.Updater(pane, url, options);
}

// Ajax Tabs
function AjaxTabs(pane, tabs, args) {
    for (id in tabs) {
        Event.observe(id, 'click', function(e) {
            if (typeof(args.onClick) == 'function')
                args.onClick(e);

            for (id in tabs) $(id).removeClassName('active');
            Event.element(e).addClassName('active');

            //AjaxLoad(pane, tabs[Event.element(e).id], $H({
            //        asynchronous: true,
            //        method: 'get'
            //    }).merge(args));

            new Ajax.Updater(pane, tabs[Event.element(e).id], $H({
                    asynchronous: true,
                    method: 'get'
                }).merge(args));

            Event.stop(e);
        });
    }
}

// Class wechseln
function changeClass(feld, klasse) {
    feld.className = klasse;
}

// Ajax Tooltipps
var newsAjax = null;

function load_tooltip(url) {
    newsAjax = new Ajax.Request(url, { method: 'get', onComplete: show_tooltip });
}

function show_tooltip(response) {
    overlib(response.responseText);
    newsAjax = null;
}

function clear_tooltip() {
    if (newsAjax != null) {
        try {
            newsAjax.transport.abort();
            newsAjax = null;
        }
        catch(e) {}
    }
    nd();
}

//function reportError() {
//    window.alert('Ajax error');
//}
