﻿


function getPosition(obj) {
    var pos = { x: 0, y: 0 };

    do {
        pos.x += obj.offsetLeft;
        pos.y += obj.offsetTop;
    } while (obj = obj.offsetParent);

    return pos;
}

function MM_goToURL() { //v3.0
    var i, args = MM_goToURL.arguments; document.MM_returnValue = false;
    for (i = 0; i < (args.length - 1); i += 2)
        eval(args[i] + ".location='" + args[i + 1] + "'");
}


function fenster_oeffnen(tmp) {
    window.open(tmp, "", "toolbar=no,directories=no,location=no,resizable=yes,menuBar=no,scrollbars=yes,width=930,height=700;")
}


function BildZeigen(bild, typ, welches) {
    document.getElementById(welches).src = bild;
    tmp_test = typ
}


function BildZeigen(bild, typ, welches) {
    document.getElementById(welches).src = bild;
    tmp_test = typ
}



function MM_findObj(n, d) { //v4.01
    var p, i, x; if (!d) d = document; if ((p = n.indexOf("?")) > 0 && parent.frames.length) {
        d = parent.frames[n.substring(p + 1)].document; n = n.substring(0, p);
    }
    if (!(x = d[n]) && d.all) x = d.all[n]; for (i = 0; !x && i < d.forms.length; i++) x = d.forms[i][n];
    for (i = 0; !x && d.layers && i < d.layers.length; i++) x = MM_findObj(n, d.layers[i].document);
    if (!x && d.getElementById) x = d.getElementById(n); return x;
}
function getPosition(element)
/* der Aufruf dieser Funktion ermittelt die absoluten Koordinaten
des Objekts element */
{
    var elem = element, tagname = "", x = 0, y = 0;

    /* solange elem ein Objekt ist und die Eigenschaft offsetTop enthaelt
    wird diese Schleife fuer das Element und all seine Offset-Eltern ausgefuehrt */
    while ((typeof (elem) == "object") && (typeof (elem.tagName) != "undefined")) {
        y += elem.offsetTop;     /* Offset des jeweiligen Elements addieren */
        x += elem.offsetLeft;    /* Offset des jeweiligen Elements addieren */
        tagname = elem.tagName.toUpperCase(); /* tag-Name ermitteln, Grossbuchstaben */

        /* wenn beim Body-tag angekommen elem fuer Abbruch auf 0 setzen */
        if (tagname == "BODY")
            elem = 0;

        /* wenn elem ein Objekt ist und offsetParent enthaelt
        Offset-Elternelement ermitteln */
        if (typeof (elem) == "object")
            if (typeof (elem.offsetParent) == "object")
            elem = elem.offsetParent;
    }

    /* Objekt mit x und y zurueckgeben */
    position = new Object();
    position.x = x;
    position.y = y;
    return position;
}

function alertPosition(elementId)
/* gibt eine Meldung mit x und y des zu elementId gehoerenden Elements aus */
{
    var a, element;

    /* Element-Objekt zur ID ermitteln */
    element = document.getElementById(elementId);

    /* Position bestimmen und melden */
    a = getPosition(element);
    window.alert("Position " + elementId + ": (" + a.x + "," + a.y + ")");
}

var theForm = document.forms['aspnetForm'];
if (!theForm) {
    theForm = document.aspnetForm;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}


function show_div(div, objekt) {
    document.getElementById(div).style.visibility = 'visible'
    getPosition(objekt);
    document.getElementById(div).style.left = position.x
    if (navigator.appName == "Netscape") {
        document.getElementById(div).style.top = position.y + 10
    }
    else {
        document.getElementById(div).style.top = position.y + 25
    }
}
function MM_preloadImages() { //v3.0
    var d = document; if (d.images) {
        if (!d.MM_p) d.MM_p = new Array();
        var i, j = d.MM_p.length, a = MM_preloadImages.arguments; for (i = 0; i < a.length; i++)
            if (a[i].indexOf("#") != 0) { d.MM_p[j] = new Image; d.MM_p[j++].src = a[i]; }
    }
}
function MM_swapImgRestore() { //v3.0
    var i, x, a = document.MM_sr; for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++) x.src = x.oSrc;
}

function MM_swapImage() { //v3.0
    var i, j = 0, x, a = MM_swapImage.arguments; document.MM_sr = new Array; for (i = 0; i < (a.length - 2); i += 3)
        if ((x = MM_findObj(a[i])) != null) { document.MM_sr[j++] = x; if (!x.oSrc) x.oSrc = x.src; x.src = a[i + 2]; }
}




function easy_click_suchen(welche, e) {

        //alert(welche);
        var string;
        string = "easy_click_liste.aspx?";
        if (welche == 1) {
            if (document.all.ctl00$ContentPlaceHolder1$suchwort_1.value != '') {
                string = string + "suchwort=" + document.all.ctl00$ContentPlaceHolder1$suchwort_1.value;
            }
            if (document.all.volltext_1.checked == true) {
                string = string + "&volltext=true"
            }
            if (document.all.lager_1.checked == true) {
                string = string + "&lager=true"
            }
            if (document.all.order_1.checked == true) {
                string = string + "&order1=true"
            }
            string = string + "&suche=" + document.all.ctl00$ContentPlaceHolder1$suche.value;
        }
        else if (welche == 2) {
            if (document.all.ctl00$ContentPlaceHolder1$suchwort_2.value != '') {
                string = string + "suchwort=" + document.all.ctl00$ContentPlaceHolder1$suchwort_2.value;
            }

            if (document.all.volltext_2.checked == true) {
                string = string + "&volltext=true"
            }
            string = string + "&suche=mieter";
        }
        else if (welche == 3) {

            if (document.all.ctl00$ContentPlaceHolder1$suchwort_3.options[document.all.ctl00$ContentPlaceHolder1$suchwort_3.selectedIndex].value != 'Alle Warengruppen') {
                string = string + "suchwort=" + document.all.ctl00$ContentPlaceHolder1$suchwort_3.options[document.all.ctl00$ContentPlaceHolder1$suchwort_3.selectedIndex].value;
            }
            string = string + "&suche=produktgruppen";
        }
        else if (welche == 4) {
            string = string + "modecentrum=Eschborn"; 
            if (document.all.ctl00$ContentPlaceHolder1$haus.options[document.all.ctl00$ContentPlaceHolder1$haus.selectedIndex].value != 'Alle Häuser') {
                string = string + "&haus=" + document.all.ctl00$ContentPlaceHolder1$haus.options[document.all.ctl00$ContentPlaceHolder1$haus.selectedIndex].value;
            }
            if (document.all.ctl00$ContentPlaceHolder1$etage.options[document.all.ctl00$ContentPlaceHolder1$etage.selectedIndex].value != 'Alle Etagen') {
                string = string + "&etage=" + document.all.ctl00$ContentPlaceHolder1$etage.options[document.all.ctl00$ContentPlaceHolder1$etage.selectedIndex].value;
            }
            string = string + "&suche=showroom";
        }
        listung_fenster.location.href = string;

}




    



