jQuery.noConflict();
jQuery(document).ready(function($) {
// $(document).ready(function() {
  
  if(document.location == 'http://www.steueranwalt.de/content/fachbeitraege/fachbeitraege/nach-anwalt/' || document.location == 'http://www.steueranwalt.de/content/vortraege/termine/' || document.location == 'http://www.steueranwalt.de/content/vortraege/referenten/') {
    $('#print').css('display','none');
  }

  navImg();  
  
  if (window.navigator.platform == 'MacIntel') {
    $(".mainmenu2_7").css("left","407px");
    $(".mainmenu2_3").css("left","0px");
    $(".mainmenu2_5").css("left","167px");
    $("#landingmenu_bottom_1 ul li").css("margin-bottom","7px");
    $("#landingmenu_bottom_2 ul li").css("margin-bottom","7px");
    $("#landingmenu_bottom_3 ul li").css("margin-bottom","7px");
  }
  
  if (document.location == 'http://www.steueranwalt.de/' || document.location == 'http://www.steueranwalt.de/?L=0' || document.location == 'http://www.steueranwalt.de/?L=1' ||
      document.location == 'http://steueranwalt.de/' || document.location == 'http://steueranwalt.de/?L=0' || document.location == 'http://steueranwalt.de/?L=1') {
    
    $("#landingmenu_bottom").css("height","300px");
    
  }
  
    $("#landingmenu_top_no").click(function() {
        $("#landingmenu_bottom").animate({"height" : "+=300px"},600,'linear',function() {
            $("#landingmenu_top_act").css("display","block");
            $("#landingmenu_top_no").css("display","none");
        });
    })

    $("#landingmenu_top_act").click(function() {
        $("#landingmenu_bottom").animate({"height" : "-=300px"},600,'linear',function() {
            $("#landingmenu_top_act").css("display","none");
            $("#landingmenu_top_no").css("display","block");
        });
    })
      
      
      
      
    $("#anwalt_top_act").click(function() {
        $("#over_content").animate({"height" : "-=440px"},600,'linear',function() {
            $("#anwalt_top_act").css("display","none");
            $("#anwalt_top_no").css("display","block");
        });
    })

    $("#anwalt_top_no").click(function() {
        $("#over_content").animate({"height" : "+=440px"},600,'linear',function() {
            $("#anwalt_top_act").css("display","inline");
            $("#anwalt_top_no").css("display","none");
        });
    })
      
    
    $("#content_top_act").click(function() {
        $("#over_content").animate({"height" : "-=410px"},600,'linear',function() {
            $("#content_top_act").css("display","none");
            $("#content_top_no").css("display","block");
            $("#wrap_content_menu").css("display","none");
        });
    })
      
      
    $("#content_top_no").click(function() {
        $("#over_content").animate({"height" : "+=410px"},600,'linear',function() {
            $("#content_top_act").css("display","block");
            $("#content_top_no").css("display","none");
            $("#wrap_content_menu").css("display","inline");
        });
    })
   

    $("#main3").mouseenter(function() {
        $("#main3 span a").css("background-color","#6e5f5a");
        $("#main3 ul").css("display","block");
    }).mouseleave(function() {
        $("#main3 span a").css("background-color","#000");
        $("#main3 ul").css("display","none");
    })

    
    $("#main4").mouseenter(function() {
        $("#main4 span").css("background-color","#6e5f5a");
        $("#main4 ul").css("display","block");
    }).mouseleave(function() {
        $("#main4 span").css("background-color","#000");
        $("#main4 ul").css("display","none");
    })

    
    $("#main5").mouseenter(function() {
        $("#main5 span a").css("background-color","#6e5f5a");
        $("#main5 ul").css("display","block");
    }).mouseleave(function() {
        $("#main5 span a").css("background-color","#000");
        $("#main5 ul").css("display","none");
    })
      

    $("#main7").mouseenter(function() {
        $("#main7 span a").css("background-color","#6e5f5a");
        $("#main7 ul").css("display","block");
    }).mouseleave(function() {
        $("#main7 span a").css("background-color","#000");
        $("#main7 ul").css("display","none");
    })

      
function navImg() {
 
 var i;
    

    if (document.location == 'http://www.steueranwalt.de/' || document.location == 'http://www.steueranwalt.de/?L=0' || document.location == 'http://www.steueranwalt.de/?L=1' ||
      document.location == 'http://steueranwalt.de/' || document.location == 'http://steueranwalt.de/?L=0' || document.location == 'http://steueranwalt.de/?L=1') {
     
      $('body').gallery({
        folderImg : 'fileadmin/template/images/randomHome/',
        countImg : 9,
        pfeilLinks: 'fileadmin/template/layout/sms_navimg_left.png',
        pfeilRechts : 'fileadmin/template/layout/sms_navimg_right.png',
        arrowTagID : 'body',
        wrapID: 'body',
      });
    }else {
      
      
      if (document.location == 'http://www.steueranwalt.de/anwaelte/streck/' || document.location == 'http://www.steueranwalt.de/anwaelte/streck/?L=0' || document.location == 'http://www.steueranwalt.de/anwaelte/streck/?L=1' ||
          document.location == 'http://steueranwalt.de/anwaelte/streck/' || document.location == 'http://steueranwalt.de/anwaelte/streck/?L=0' || document.location == 'http://steueranwalt.de/anwaelte/streck/?L=1') {
        var path = 'fileadmin/template/images/streck/';
        var maxImg = 5;
      }
  
      if (document.location == 'http://www.steueranwalt.de/content/anwaelte/mack/' || document.location == 'http://www.steueranwalt.de/content/anwaelte/mack/?L=0' || document.location == 'http://www.steueranwalt.de/content/anwaelte/mack/?L=1' ||
          document.location == 'http://steueranwalt.de/content/anwaelte/mack/' || document.location == 'http://steueranwalt.de/content/anwaelte/mack/?L=0' || document.location == 'http://steueranwalt.de/content/anwaelte/mack/?L=1') {
        var path = 'fileadmin/template/images/mack/';
        var maxImg = 6;
      }
      
      if (document.location == 'http://www.steueranwalt.de/content/anwaelte/schwedhelm/' || document.location == 'http://www.steueranwalt.de/content/anwaelte/schwedhelm/?L=0' || document.location == 'http://www.steueranwalt.de/content/anwaelte/schwedhelm/?L=1' ||
          document.location == 'http://steueranwalt.de/content/anwaelte/schwedhelm/' || document.location == 'http://steueranwalt.de/content/anwaelte/schwedhelm/?L=0' || document.location == 'http://steueranwalt.de/content/anwaelte/schwedhelm/?L=1') {
        var path = 'fileadmin/template/images/schwedhelm/';
        var maxImg = 5;
      }
      
      if (document.location == 'http://www.steueranwalt.de/content/anwaelte/olgemoeller/' || document.location == 'http://www.steueranwalt.de/content/anwaelte/olgemoeller/?L=0' || document.location == 'http://www.steueranwalt.de/content/anwaelte/olgemoeller/?L=1' ||
          document.location == 'http://steueranwalt.de/content/anwaelte/olgemoeller/' || document.location == 'http://steueranwalt.de/content/anwaelte/olgemoeller/?L=0' || document.location == 'http://steueranwalt.de/content/anwaelte/olgemoeller/?L=1') {
        var path = 'fileadmin/template/images/olgemoeller/';
        var maxImg = 5;
      }
      
      if (document.location == 'http://www.steueranwalt.de/content/anwaelte/olbing/' || document.location == 'http://www.steueranwalt.de/content/anwaelte/olbing/?L=0' || document.location == 'http://www.steueranwalt.de/content/anwaelte/olbing/?L=1' ||
        document.location == 'http://steueranwalt.de/content/anwaelte/olbing/' || document.location == 'http://steueranwalt.de/content/anwaelte/olbing/?L=0' || document.location == 'http://steueranwalt.de/content/anwaelte/olbing/?L=1') {
        var path = 'fileadmin/template/images/olbing/';
        var maxImg = 5;
      }
      
      if (document.location == 'http://www.steueranwalt.de/content/anwaelte/spatscheck/' || document.location == 'http://www.steueranwalt.de/content/anwaelte/spatscheck/?L=0' || document.location == 'http://www.steueranwalt.de/content/anwaelte/spatscheck/?L=1' ||
        document.location == 'http://steueranwalt.de/content/anwaelte/spatscheck/' || document.location == 'http://steueranwalt.de/content/anwaelte/spatscheck/?L=0' || document.location == 'http://steueranwalt.de/content/anwaelte/spatscheck/?L=1') {
        var path = 'fileadmin/template/images/spatscheck/';
        var maxImg = 4;
      }
      
      if (document.location == 'http://www.steueranwalt.de/content/anwaelte/kamps/' || document.location == 'http://www.steueranwalt.de/content/anwaelte/kamps/?L=0' || document.location == 'http://www.steueranwalt.de/content/anwaelte/kamps/?L=1'|| 
        document.location == 'http://steueranwalt.de/content/anwaelte/kamps/' || document.location == 'http://steueranwalt.de/content/anwaelte/kamps/?L=0' || document.location == 'http://steueranwalt.de/content/anwaelte/kamps/?L=1') {
        var path = 'fileadmin/template/images/kamps/';
        var maxImg = 5;
      }
      
      if (document.location == 'http://www.steueranwalt.de/content/anwaelte/binnewies/' || document.location == 'http://www.steueranwalt.de/content/anwaelte/binnewies/?L=0' || document.location == 'http://www.steueranwalt.de/content/anwaelte/binnewies/?L=1' || 
        document.location == 'http://steueranwalt.de/content/anwaelte/binnewies/' || document.location == 'http://steueranwalt.de/content/anwaelte/binnewies/?L=0' || document.location == 'http://steueranwalt.de/content/anwaelte/binnewies/?L=1') {
        var path = 'fileadmin/template/images/binnewies/';
        var maxImg = 5;
      }
      
      if (document.location == 'http://www.steueranwalt.de/content/anwaelte/alvermann/' || document.location == 'http://www.steueranwalt.de/content/anwaelte/alvermann/?L=0' || document.location == 'http://www.steueranwalt.de/content/anwaelte/alvermann/?L=1' || 
        document.location == 'http://steueranwalt.de/content/anwaelte/alvermann/' || document.location == 'http://steueranwalt.de/content/anwaelte/alvermann/?L=0' || document.location == 'http://steueranwalt.de/content/anwaelte/alvermann/?L=1') {
        var path = 'fileadmin/template/images/alvermann/';
        var maxImg = 5;
      }
      
      if (document.location == 'http://www.steueranwalt.de/content/anwaelte/wulf/' || document.location == 'http://www.steueranwalt.de/content/anwaelte/wulf/?L=0' || document.location == 'http://www.steueranwalt.de/content/anwaelte/wulf/?L=1' ||
        document.location == 'http://steueranwalt.de/content/anwaelte/wulf/' || document.location == 'http://steueranwalt.de/content/anwaelte/wulf/?L=0' || document.location == 'http://steueranwalt.de/content/anwaelte/wulf/?L=1') {
        var path = 'fileadmin/template/images/wulf/';
        var maxImg = 5;
      }
      
      if (document.location == 'http://www.steueranwalt.de/content/anwaelte/wollweber/' || document.location == 'http://www.steueranwalt.de/content/anwaelte/wollweber/?L=0' || document.location == 'http://www.steueranwalt.de/content/anwaelte/wollweber/?L=1' || 
        document.location == 'http://steueranwalt.de/content/anwaelte/wollweber/' || document.location == 'http://steueranwalt.de/content/anwaelte/wollweber/?L=0' || document.location == 'http://steueranwalt.de/content/anwaelte/wollweber/?L=1') {
        var path = 'fileadmin/template/images/wollweber/';
        var maxImg = 5;
      }
      
      if (document.location == 'http://www.steueranwalt.de/content/anwaelte/talaska/' || document.location == 'http://www.steueranwalt.de/content/anwaelte/talaska/?L=0' || document.location == 'http://www.steueranwalt.de/content/anwaelte/talaska/?L=1' ||
        document.location == 'http://steueranwalt.de/content/anwaelte/talaska/' || document.location == 'http://steueranwalt.de/content/anwaelte/talaska/?L=0' || document.location == 'http://steueranwalt.de/content/anwaelte/talaska/?L=1') {
        var path = 'fileadmin/template/images/talaska/';
        var maxImg = 5;
      }
      
      if (document.location == 'http://www.steueranwalt.de/content/anwaelte/finke/' || document.location == 'http://www.steueranwalt.de/content/anwaelte/finke/?L=0' || document.location == 'http://www.steueranwalt.de/content/anwaelte/finke/?L=1' || 
        document.location == 'http://steueranwalt.de/content/anwaelte/finke/' || document.location == 'http://steueranwalt.de/content/anwaelte/finke/?L=0' || document.location == 'http://steueranwalt.de/content/anwaelte/finke/?L=1') {
        var path = 'fileadmin/template/images/finke/';
        var maxImg = 5;
      }
      
      if (document.location == 'http://www.steueranwalt.de/content/anwaelte/zumwinkel/' || document.location == 'http://www.steueranwalt.de/content/anwaelte/zumwinkel/?L=0' || document.location == 'http://www.steueranwalt.de/content/anwaelte/zumwinkel/?L=1' ||
        document.location == 'http://steueranwalt.de/content/anwaelte/zumwinkel/' || document.location == 'http://steueranwalt.de/content/anwaelte/zumwinkel/?L=0' || document.location == 'http://steueranwalt.de/content/anwaelte/zumwinkel/?L=1') {
        var path = 'fileadmin/template/images/zumwinkel/';
        var maxImg = 5;
      }
      
      if (document.location == 'http://www.steueranwalt.de/content/anwaelte/gomes/' || document.location == 'http://www.steueranwalt.de/content/anwaelte/gomes/?L=0' || document.location == 'http://www.steueranwalt.de/content/anwaelte/gomes/?L=1' ||
        document.location == 'http://steueranwalt.de/content/anwaelte/gomes/' || document.location == 'http://steueranwalt.de/content/anwaelte/gomes/?L=0' || document.location == 'http://steueranwalt.de/content/anwaelte/gomes/?L=1') {
        var path = 'fileadmin/template/images/gomes/';
        var maxImg = 5;
      }
      
      if (document.location == 'http://www.steueranwalt.de/content/anwaelte/beckschaefer/' || document.location == 'http://www.steueranwalt.de/content/anwaelte/beckschaefer/?L=0' || document.location == 'http://www.steueranwalt.de/content/anwaelte/beckschaefer/?L=1' ||
        document.location == 'http://steueranwalt.de/content/anwaelte/beckschaefer/' || document.location == 'http://steueranwalt.de/content/anwaelte/beckschaefer/?L=0' || document.location == 'http://steueranwalt.de/content/anwaelte/beckschaefer/?L=1') {
        var path = 'fileadmin/template/images/beckschaefer/';
        var maxImg = 5;
      }
      
      if (document.location == 'http://www.steueranwalt.de/content/anwaelte/ruske/' || document.location == 'http://www.steueranwalt.de/content/anwaelte/ruske/?L=0' || document.location == 'http://www.steueranwalt.de/content/anwaelte/ruske/?L=1' ||
        document.location == 'http://steueranwalt.de/content/anwaelte/ruske/' || document.location == 'http://steueranwalt.de/content/anwaelte/ruske/?L=0' || document.location == 'http://steueranwalt.de/content/anwaelte/ruske/?L=1') {
        var path = 'fileadmin/template/images/ruske/';
        var maxImg = 6;
      }
      
      if (document.location == 'http://www.steueranwalt.de/content/anwaelte/albrecht/' || document.location == 'http://www.steueranwalt.de/content/anwaelte/albrecht/?L=0' || document.location == 'http://www.steueranwalt.de/content/anwaelte/albrecht/?L=1' ||
        document.location == 'http://steueranwalt.de/content/anwaelte/albrecht/' || document.location == 'http://steueranwalt.de/content/anwaelte/albrecht/?L=0' || document.location == 'http://steueranwalt.de/content/anwaelte/albrecht/?L=1') {
        var path = 'fileadmin/template/images/albrecht/';
        var maxImg = 5;
      }
      
      if (document.location == 'http://www.steueranwalt.de/content/anwaelte/hoepfner/' || document.location == 'http://www.steueranwalt.de/content/anwaelte/hoepfner/?L=0' || document.location == 'http://www.steueranwalt.de/content/anwaelte/hoepfner/?L=1' ||
        document.location == 'http://steueranwalt.de/content/anwaelte/hoepfner/' || document.location == 'http://steueranwalt.de/content/anwaelte/hoepfner/?L=0' || document.location == 'http://steueranwalt.de/content/anwaelte/hoepfner/?L=1') {
        // var path = 'fileadmin/template/images/albrecht/';
        // var maxImg = 5;
        $("#rightImgNav").css("display","none");
      }
      
      if (document.location == 'http://www.steueranwalt.de/content/anwaelte/hoell/' || document.location == 'http://www.steueranwalt.de/content/anwaelte/hoell/?L=0' || document.location == 'http://www.steueranwalt.de/content/anwaelte/hoell/?L=1' ||
        document.location == 'http://steueranwalt.de/content/anwaelte/hoell/' || document.location == 'http://steueranwalt.de/content/anwaelte/hoell/?L=0' || document.location == 'http://steueranwalt.de/content/anwaelte/hoell/?L=1') {
        // var path = 'fileadmin/template/images/albrecht/';
        // var maxImg = 5;
        $("#rightImgNav").css("display","none");
      }
   
      var bgImg = new Array();
      for (i = 0; i < maxImg; i++) {
        bgImg[i] = path+'img_'+i+'.jpg';
      }
      // alert(bgImg);
      
      var newBgImg = bgImg.slice(0,maxImg-1);
      // alert(newBgImg);
      
      /* var leftNav = '<div id="slide_l" />';
      var rightNav = '<div id="slide_r" />';
      
      $(leftNav).appendTo("#over_center");
      $(rightNav).appendTo("#over_center");*/
      
      var i = maxImg - 1;    
      // alert(i);

      $("#leftImgNav").click(function() {
        //window.clearInterval(changeImg);
    
        i++;
        // alert(i);
        // $(".bgimg").css("display","none");
        $(".bgimg").attr("src", newBgImg[i]);
        // $(".bgimg").fadeIn(600);


        if (i == newBgImg.length) {
          $("#leftImgNav").css("display","none");
          $(".bgimg").attr("src", bgImg[maxImg-1]);
        }
        
        if (i < newBgImg.length) {
          $("#rightImgNav").css("display","block");
        }

      })


      $("#rightImgNav").click(function() {
        
        //window.clearInterval(changeImg);
        
        i--;
        // alert(i);
        //  $(".bgimg").css("display","none");
        $(".bgimg").attr("src", newBgImg[i]);
        // $(".bgimg").fadeIn(600);
        
        
        if (i < newBgImg.length) {
          $("#leftImgNav").css("display","block");
        }
        
        if (i == 0) {
          $("#rightImgNav").css("display","none");
        }
        
      })
  }//include if - END     
}


});
