$(document).ready(function(){

  
var speed = 1200;
//--------------------------------------01  
$("#menu01").click (function() {
  
  //$("#menu01Image").slideDown(1200);
  //$(".dropDown").slideUp(100);

  var position = $(this).css("bottom");
  
  var isVisable = $(this).children(".dropDown").css("display");
  
  if (position == "100px") {
  
  $("#menu01").animate ({
    bottom: "623px"
    }, speed);
    
    $(".dropDown").slideUp(100);
    var t = setTimeout('$("#menu01").children(".dropDown").slideDown(600)', 1200);
    
    $("#menu01Image").slideDown(1200);
    }
  else {
    
    if(isVisable=='none') {
      $(".dropDown").slideUp(100);
      var t = setTimeout('$("#menu01").children(".dropDown").slideDown(600)', 1200);
      }
    
    $("#menu02").animate ({
    bottom: "75px"
    }, speed);
    $("#menu03").animate ({
    bottom: "50px"
    }, speed);
    $("#menu04").animate ({
    bottom: "25px"
    }, speed);
    $("#menu05").animate ({
    bottom: "0px"
    }, speed);
    
    if($("#menu02").css("bottom") == "598px") {
      $("#menu01Image").show();
      $("#menu02Image").show();
      }
      
    if($("#menu03").css("bottom") == "572px") {
      $("#menu01Image").show();
      $("#menu03Image").show();
    }
    
    if($("#menu04").css("bottom") == "546px") {
      $("#menu01Image").show();
      $("#menu04Image").show();
    }
    
    if($("#menu05").css("bottom") == "520px") {
      $("#menu01Image").show();
      $("#menu05Image").show();
    }
    
    $("#menu01Image").show();
    $("#menu02Image").slideUp(1200);
    $("#menu03Image").slideUp(1200);
    $("#menu04Image").slideUp(1200);
    $("#menu05Image").slideUp(1200);
    
    }
    
    $("#content").fadeOut("fast");
});
//--------------------------------------02
$("#menu02").click (function() {

  var isVisable = $(this).children(".dropDown").css("display");

  var position = $(this).css("bottom");
  

  if (position == "75px") {
  
  $(".dropDown").slideUp(100);
  var t = setTimeout('$("#menu02").children(".dropDown").slideDown(600)', 1200);
  
  $("#menu01").animate ({
    bottom: "623px"
    }, speed);
  $("#menu02").animate ({
    bottom: "598px"
    }, speed);
    
    $("#menu02Image").slideDown(1200);
    }
    
  else {
  
    if(isVisable=='none') {
      $(".dropDown").slideUp(100);
      var t = setTimeout('$("#menu02").children(".dropDown").slideDown(600)', 1200);
      }

    $("#menu03").animate ({
    bottom: "50px"
    }, speed);
    $("#menu04").animate ({
    bottom: "25px"
    }, speed);
    $("#menu05").animate ({
    bottom: "0px"
    }, speed);
    
    //if($("#menu03").css("bottom") > "50px") {
    //$("#menu02Image").show();
    //$("#menu03Image").show();
    //}
    
    
    if($("#menu03").css("bottom") == "572px") {
      $("#menu02Image").show();
      $("#menu03Image").show();
    }
    
    if($("#menu04").css("bottom") == "546px") {
      $("#menu02Image").show();
      $("#menu04Image").show();
    }
    
    if($("#menu05").css("bottom") == "520px") {
      $("#menu02Image").show();
      $("#menu05Image").show();
    }
    
    $("#menu02Image").show();
    $("#menu03Image").slideUp(1200);
    $("#menu04Image").slideUp(1200);
    $("#menu05Image").slideUp(1200);
    }
    
    $("#content").fadeOut("fast");
});
//--------------------------------------03

  $("#menu03").click (function() {
  
  var isVisable = $(this).children(".dropDown").css("display");
  
  var position = $(this).css("bottom");

  if (position == "50px") {
  
    $("#menu01").animate ({
      bottom: "623px"
      }, speed);
    $("#menu02").animate ({
      bottom: "598px"
      }, speed);
    $("#menu03").animate ({
      bottom: "572px"
      }, speed);
      
    $("#menu03Image").slideDown(1200);

    $(".dropDown").slideUp(100);
    var t = setTimeout('$("#menu03").children(".dropDown").slideDown(600)', 1200);
    }
  else {
    
    if(isVisable=='none') {
      $(".dropDown").slideUp(100);
      var t = setTimeout('$("#menu03").children(".dropDown").slideDown(600)', 1200);
      }

    $("#menu04").animate ({
    bottom: "25px"
    }, speed);
    $("#menu05").animate ({
    bottom: "0px"
    }, speed);
    
    if($("#menu04").css("bottom") == "546px") {
      $("#menu03Image").show();
      $("#menu04Image").show();
    }
    
    if($("#menu05").css("bottom") == "520px") {
      $("#menu03Image").show();
      $("#menu05Image").show();
    }
    
    ///if($("#menu04").css("bottom") > "25px") {
    //$("#menu03Image").show();
    //}
    $("#menu03Image").show();
    $("#menu04Image").slideUp(1200);
    $("#menu05Image").slideUp(1200);
    
      //if(isVisable=='none') {
      //$(".dropDown").slideUp(100);
      //var t = setTimeout('$("#menu03").children(".dropDown").slideDown(600)', 1200);
      //}
    }
    
    $("#content").fadeOut("fast");
});
//--------------------------------------04
$("#menu04").click (function() {
  
  var isVisable = $(this).children(".dropDown").css("display");

  var position = $(this).css("bottom");

  if (position == "25px") {
  
    $(".dropDown").slideUp(100);
  var t = setTimeout('$("#menu04").children(".dropDown").slideDown(600)', 1200);
    $("#menu01").animate ({
      bottom: "623px"
      }, speed);
    $("#menu02").animate ({
      bottom: "598px"
      }, speed);
    $("#menu03").animate ({
      bottom: "572px"
      }, speed);
    $("#menu04").animate ({
      bottom: "546px"
      }, speed);
      
      $("#menu04Image").slideDown(1200);
    
    }
  else {
  
    if(isVisable=='none') {
      $(".dropDown").slideUp(100);
      var t = setTimeout('$("#menu04").children(".dropDown").slideDown(600)', 1200);
      }

    $("#menu05").animate ({
    bottom: "0px"
    }, speed);
    
    if($("#menu05").css("bottom") == "520px") {
      $("#menu04Image").show();
      $("#menu05Image").show();
    }
    
    $("#menu04Image").show();
    $("#menu05Image").slideUp(1200);
    
      //$(".dropDown").slideUp(100);
      //var t = setTimeout('$("#menu04").children(".dropDown").slideDown(600)', 1200);

    
    }
  
  $("#content").fadeOut("fast");
  
});
//--------------------------------------05
$("#menu05").click (function() {

  //$(".dropDown").slideUp(100);
  
  var isVisable = $(this).children(".dropDown").css("display");
  
  if(isVisable=='none') {
      $(".dropDown").slideUp(100);
      var t = setTimeout('$("#menu05").children(".dropDown").slideDown(600)', 1200);
      }
  
  $("#menu01").animate ({
    bottom: "623px"
    }, speed);
  $("#menu02").animate ({
    bottom: "598px"
    }, speed);
  $("#menu03").animate ({
    bottom: "572px"
    }, speed);
  $("#menu04").animate ({
    bottom: "546px"
    }, speed);
  $("#menu05").animate ({
    bottom: "520px"
    }, speed);
    
    $("#menu05Image").slideDown(1200);
    
    $("#menu05Image").show();
    $("#content").fadeOut("fast");

      //$(".dropDown").slideUp(100);
      var t = setTimeout('$("#menu05").children(".dropDown").slideDown(600)', 1200);

    
});

/*-----------------------------------------------*/

var scrollDiv = $("#scroll");
var scroll = 642; //scroll size in px
var scrollRight = scroll * (-1);
var scrollLeft = scroll;
var totalPics = 2;
var displayedPics = 1;

$("#left").click (function() {

  $("#right").fadeIn("fast");
  $("#left").fadeOut("fast");
  var stringScroll = -642;
    stringScroll += 'px';
    scrollDiv.animate({
    right: stringScroll
    }, { queue:false, duration:400 }, 1500);
  
  });
  
$("#right").click (function() {
  $("#right").fadeOut("fast");
    $("#left").fadeIn("fast");
      var stringScroll = 0;
      scrollDiv.animate({
      right: stringScroll
      }, { queue:false, duration:400 }, 1500);
  });
  
$(".right").click (function() {
  $("#right").fadeOut("fast");
  $("#left").fadeIn("fast");
  var p = $("#scroll");
  var position = p.position();

  if(position.left == -11) {
    var stringScroll = 0;
    scrollDiv.animate({
    right: stringScroll
    }, { queue:false, duration:400 }, 1500);
  }
  });
  
$(".left").click (function() {
  $("#left").fadeOut("fast");
  $("#right").fadeIn("fast");
  var p = $("#scroll");
  var position = p.position();

  if(position.left == -652 || position.left == -653) {
    var stringScroll = -642;
    stringScroll += 'px';
    scrollDiv.animate({
    right: stringScroll
    }, { queue:false, duration:400 }, 1500);
  }
  });
  

/*----------------------------------------------------------*/

$(".scrollingThumbDesc").fadeTo("slow", 0.7);


$(".scrollingThumb").hover (
  function(){
    $(this).children(".scrollingThumbDesc").fadeIn(200);
    },
  function(){
    $(this).children(".scrollingThumbDesc").fadeOut(200 );
  }
);
   
   
 });
 
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[ i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[ i];}}
}
