$(function(){

     $('a[href*=#]').click(function() {

     if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
         && location.hostname == this.hostname) {

             var $target = $(this.hash);

             $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
             document.getElementById("film_m").className="mmove";
             document.getElementById("post_m").className="mmove";
             document.getElementById("immobilien_m").className="mmove";
             document.getElementById("uber_m").className="mmove";
             document.getElementById("kuden_m").className="mmove";
             document.getElementById("kontakt_m").className="mmove";
             document.getElementById(this.hash.slice(1)+"_m").className="selected";
             if ($target.length) {

                 var targetOffset = $target.offset().top;

                 $('html,body').animate({scrollTop: targetOffset}, 1000);

                 return false;

            }

       }

   });

});
///////////////////
$(function() {
            var offset = $("#menumove").offset();
            $(window).scroll(function() {
                if ($(window).scrollTop() > 400) {
                    $("#menumove").css("visibility", "visible");					
					$("#menumove").animate({ height:'50px'}, 100 );
					$("#menumove").stop().animate({marginTop:0});
                } else{
                     $("#menumove").css("visibility", "hidden");	
                };
            });
        });
//////////


var aImg = new Array();
var idImg;
var timer1;
var timer2;
function alternaImg(id,imagen1,imagen2,imagen3)
{
    aImg[0] = imagen1;
    aImg[1] = imagen2;
    aImg[2] = imagen3;
    idImg = id;
    if (aImg[0]!="")
        document.getElementById(idImg).src=aImg[0];
    if (aImg[1]!="")
        timer1=setTimeout("document.getElementById(idImg).src=aImg[1]",2000);
    if (aImg[2]!="")
        timer2=setTimeout("document.getElementById(idImg).src=aImg[2]",4000);
}


function colocaImg(id, imagen)
{
    clearTimeout(timer1);
    clearTimeout(timer2);
    document.getElementById(id).src=imagen;
}
