var pos = 580;
$(function(){
    try {
        $("#suchtext_ajax").autocomplete({
            source: "../../content_scripts/knauf_autocomplete_search.php"
        });
    }
    catch (e) {
    }
    try {
        $("ul.quicklink_box").css({
            "margin-top": function(){
                var height = $("#content_right h1").first().height() + 15; //15 = h1 margin-bottom
                return height + "px";
            }
        });
    }
    catch (e) {
    }
    try {
        $("a.extern").click(function(){
            window.open($(this).attr("href"));
            return false;
        });
    }
    catch (e) {
    }
    try {
        $("#logo_ticker").css({
            overflow: "hidden",
            width: 580,
            height: 95,
            position: "relative"
        }).append('<img src="../../assets/common/logos1.gif" alt="Logos" id="logo_img1" usemap="#map1"/><img usemap="#map1" src="../../assets/common/logos1.gif" alt="Logos" id="logo_img2" /><map id="ip_map1" name="map1"><area shape="rect" alt="Knauf Gips" title="Knauf Gips" coords="2,5,72,53" href="../../html/seiten/text2.phtml?nav=7&lang=de" target="_self" /><area shape="rect" alt="Knauf Marmorit" title="Knauf Marmorit" coords="85,6,147,50" href="../../html/seiten/text2.phtml?nav=7&lang=de" target="_self" /><area shape="rect" alt="Knauf Insulation" title="Knauf Insulation" coords="160,9,272,54" href="../../html/seiten/text2.phtml?nav=9&lang=de" target="_self" /><area shape="rect" alt="AMF" title="AMF" coords="282,4,394,56" href="../../html/seiten/text2.phtml?nav=3&lang=de" target="_self" /><area shape="rect" alt="Knauf D�mmstoffe" title="Knauf D�mmstoffe" coords="402,5,531,57" href="../../html/seiten/text2.phtml?nav=6&lang=de" target="_self" /><area shape="rect" alt="Richter System" title="Richter System" coords="540,5,688,56" href="../../html/seiten/text2.phtml?nav=14&lang=de" target="_self" /><area shape="rect" alt="Knauf Perlite" title="Knauf Perlite" coords="695,5,807,54" href="../../html/seiten/text2.phtml?nav=11&lang=de" target="_self" /><area shape="rect" alt="PFT" title="PFT" coords="818,6,885,54" href="../../html/seiten/text2.phtml?nav=12&lang=de" target="_self" /><area shape="rect" alt="Knauf Integral" title="Knauf Integral" coords="891,6,969,52" href="../../html/seiten/text2.phtml?nav=10&lang=de" target="_self" /><area shape="rect" alt="Marbos" title="Marbos" coords="978,5,1057,57" href="../../html/seiten/text2.phtml?nav=13&lang=de" target="_self" /><area shape="rect" alt="Knauf Bauprodukte" title="Knauf Bauprodukte" coords="1064,5,1148,58" href="../../html/seiten/text2.phtml?nav=5&lang=de" target="_self" /><area shape="rect" alt="Sakret" title="Sakret" coords="1152,3,1193,49" href="../../html/seiten/text2.phtml?nav=15&lang=de" target="_self" /></map>');
        $("#logo_img").ready(function(){
            setInterval(move, 25);
        });
    }
    catch (e) {
    }
});

function move(){
    if (pos <= -1225) {
        pos = 0;
    }
    $("#logo_img1").css({
        left: pos + "px",
        position: "absolute"
    });
    $("#logo_img2").css({
        left: pos + 1225 + "px",
        position: "absolute"
    });
    pos--;
}

function displaySWFMap(n){
    try {
        $("#standorte").flash({
            src: "../../assets/flash/deutschland_karte.swf",
            width: 189,
            height: 216,
            flashvars: {
                xml_file: "../../assets/flash/deutschland_karte.xml",
                nav: n
            }
        });
    }
    catch (e) {
    }
}

function log(){
    if (window && window.console && window.console.log) {
        for (var i = 0, len = arguments.length; i < len; i++) {
            console.log(arguments[i]);
        }
    }
}

