<!--
//// BEGINN von static/wo_lf_wom.js
//// benoetigt Hilfsfunktionen: addHandler, getCookie, isCookieValid, setFocusOrtsuche //////

// onload und onfocus handling für mapsteaser

// um den text unter dem maps teaser zu ändern, muss der default für linkText geändert werden.
// um dessen ziel-url zu ändern, muss ref in dieser function geändert werden.

addHandler (window,'load', function () {
    if (window.name == "WetterMaps" || window.name == "WetterOnlineMitgliedschaft") {
      window.name = '';
    }
    mapsLink = document.getElementById('mapslink');
    mapsTeaser = document.getElementById('mapsteaser');
    mapsMarketingLink = document.getElementById('mapsmarketing');
    //setFocusOrtssuche();

    addHandler(window, 'focus', function (event) {
        adjustMapsLink(isCookieValid());
        //setFocusOrtssuche();
    });
});


function getMapsLinkAttributes (section, hasValidCookie) {
    var link = [];
    link['alt'] = 'Informationen zu WetterMaps';
    link['target'] = 'WetterOnlineMitgliedschaft';

    if (hasValidCookie) {
        link['ref'] = 'maps.wetteronline.de';
        link['alt'] = 'WetterMaps öffnen';
        link['target'] = 'WetterMaps';
    } else {
        switch (section) {
            case 'start':
                link['ref'] = 'cnt.wetteronline.de/cgi-bin/goto?URL=http%3A%2F%2Fwom.wetteronline.de%2F%3Fmainmenu%3Dcontents%26submenu%3Dweathermaps&WERBUNG=click_wom_'+section;
                break;
            default:
                link['ref'] = 'cnt.wetteronline.de/cgi-bin/goto?URL=http%3A%2F%2Fwom.wetteronline.de%2F%3Fmainmenu%3Dcontents%26submenu%3Dweathermaps&WERBUNG=click_wom_'+section;
                break;
        }
        if ( false )
        {
            // für schnuppertage auf true setzten
            link['ref'] = 'cnt.wetteronline.de/cgi-bin/goto?URL=http%3A%2F%2Fwom.wetteronline.de%2F%3Fmainmenu%3Dtrialoffer%26submenu%3Doverview&WERBUNG=click_wom_'+section;
            link['alt'] = 'Mitgliedschaft testen';                      
        }
    }
    return link;
}


function getMapsLink (section) {
    var mapsLinkAttributes = getMapsLinkAttributes(section, isCookieValid());
    var mapsLink = '<a id="mapslink" href="http://' + mapsLinkAttributes['ref'] + '" target="'+mapsLinkAttributes['target']+'"><img id="mapsteaser" src="http://www.wetteronline.de/cgi-bin/img2www?URL=sat/vermarktung/wom/ha/teaser/wettermaps/wettermaps_www.gif&LANG=de" width="110" height="83" border="0" alt="' + mapsLinkAttributes['alt'] + '" title="' + mapsLinkAttributes['alt'] + '"></a><br>'; 
    return mapsLink;
}


function getMarketingLinkAttributes (section, hasValidCookie) {
    var link = [];
    link['linkText'] = 'Neue Satellitenbilder';
    link['target'] = 'WetterOnlineMitgliedschaft';

//    hasValidCookie ? link['style'] = 'style="display: none;"' : link['style'] = 'style="display: block;"';
    link['style'] = 'style="display: block;"';

    switch (section) {
        case 'start':
            link['ref'] = 'cnt.wetteronline.de/cgi-bin/goto?URL=http%3A%2F%2Fwom.wetteronline.de%2Fneues%2F&WERBUNG=click_wom_'+section;
            break;
        default:
            link['ref'] = 'cnt.wetteronline.de/cgi-bin/goto?URL=http%3A%2F%2Fwom.wetteronline.de%2Fneues%2F&WERBUNG=click_wom_' + section;
            break;
    }
    if ( false ){
            link['ref'] = link['ref'] = 'cnt.wetteronline.de/cgi-bin/goto?URL=http%3A%2F%2Fwom.wetteronline.de%2F%3Fmainmenu%3Dtrialoffer%26submenu%3Doverview&WERBUNG=click_wom_' + section;
            link['linkText'] = 'Mitgliedschaft testen';
    }
    return link;
}


function getMarketingLink(section) {
    var marketingLinkAttributes = getMarketingLinkAttributes(section, isCookieValid());
    var marketingLink = '<a id="mapsmarketing" href="http://' + marketingLinkAttributes['ref'] + '" target="' + marketingLinkAttributes['target'] + '" '+ marketingLinkAttributes['style'] +'><font color="#0000ff">' + marketingLinkAttributes['linkText'] + '</font></a>';
    return marketingLink;
}     


function adjustMapsLink (hasValidCookie) {
    // mapsteaser link und tooltip anpassen
    var mapsLinkAttributes = getMapsLinkAttributes(section, hasValidCookie);
    mapsLink.setAttribute('href', 'http://' + mapsLinkAttributes['ref']);
    mapsLink.setAttribute('target', mapsLinkAttributes['target']);
    mapsTeaser.setAttribute('alt', mapsLinkAttributes['alt']);
    mapsTeaser.setAttribute('title', mapsLinkAttributes['alt']);
    // marketing-link unter mapsteaser einblenden ausblenden
    //hasValidCookie ? mapsMarketingLink.style.display = 'none' : mapsMarketingLink.style.display = 'block';
    // 8.2.10.cl - markting soll immer erscheinen
    mapsMarketingLink.style.display = 'block';

}      
 //// ENDE von static/wo_lf_wom.js
//-->
