function ScrollToElement(theElement){

 var selectedPosX = 0;
 var selectedPosY = 0;
 while(theElement != null){
    selectedPosX += theElement.offsetLeft;
    selectedPosY += theElement.offsetTop;
    theElement = theElement.offsetParent;
 }
 window.scrollTo(selectedPosX,selectedPosY-50);
}

$(document).ready(function() {

    $(".showTransport").click(function() {
//        var s1 = new SWFObject("transport.swf", "line", "608", "400", "8");
//        s1.addParam("wmode", "transparent");
//        s1.write("transportBig");
        $("#transportLayout").show();
        $("#transportBig").show();
        $("#transportClose").show();
        $("#transportBig").append($("<div id=\"transportContent\"></div>"));
        $("#transportBig").css('width','608px');
        $("#transportBig").css('height','400px');
        $("#transportClose").css('width','604px');
        $("object, [name=animace]").hide();
        swfobject.embedSWF("/liebherr-shop/transport.swf", "transportContent", "608", "400", "9.0.0", "/liebherr-shop/js/expressInstall.swf");
        $("#transportContent").css('display','block');
        ScrollToElement(document.getElementById('transportContent'));
        return false;
    });
    
    $("#transportClose, #transportLayout").click(function() {
        $("#transportLayout").hide();
        $("#transportBig").hide();
        $("#transportClose").hide();
        $("object, [name=animace]").show();
    });

    $("#showSalat").click(function() {
//        var s1 = new SWFObject("salat.swf", "line", "720", "576", "8");
//        s1.addParam("wmode", "transparent");      
//        s1.write("transportBig");
        $("#transportLayout").show();
        $("#transportClose").show();
        $("#transportBig").append($("<div id=\"salatContent\"></div>"));
        $("#transportBig").css('width','720px');
        $("#transportBig").css('height','576px');
        $("#transportClose").css('width','718px');

        $("object, [name=animace]").hide();
        swfobject.embedSWF("/liebherr-shop/salat.swf", "salatContent", "720", "576", "9.0.0", "/liebherr-shop/js/expressInstall.swf");
        $("#transportBig").show();
        ScrollToElement(document.getElementById('salatContent'));
        
        return false;
    });

});

