$(document).ready(function() {
  $("div.warning").fadeIn(2000).animate({opacity: 1.0}, 3000).fadeOut(1000, function() { $(this).remove(); } ); 
	$(".fadeIn").hide().fadeIn(1000);
	$(".fadeInSlow").hide().fadeIn(2000);
	$("#content_middle").hide().fadeIn(600);
  $("#content_right").hide().fadeIn(1000);
  $('#content_photo').fadeIn(600);  
  $('#slideshow').cycle({
      speedIn:2500,
      speedOut:1500,
      sync: 1,
      delay:-1000,
      after: onAfter
    });
    
  function onBefore(curr,next,opts) {
  }
        
  function onAfter(curr,next,opts) {
    $("#banner_01").removeClass("banner_nav_active"); 
    $("#banner_02").removeClass("banner_nav_active"); 
    $("#banner_03").removeClass("banner_nav_active"); 
    $("#banner_04").removeClass("banner_nav_active"); 
    $("#banner_05").removeClass("banner_nav_active");
    $("#banner_0"+(opts.currSlide + 1)+"").addClass("banner_nav_active"); 
  }

  $('#slideshow_interior').cycle({
      speedIn:2500,
      speedOut:1500,
      sync: 1,
      delay:-1000
    });    

//	$("#stage_content_wide").fadeIn(900).animate({opacity: 1.0}, 2);
// { fx: 'scrollHorz', timeout:  2000, autostop: 1, end: function() { alert('The slideshow has ended.'); } }  
  
  $('#toggle').click(function(){
   $('div.showhide').slideToggle();
  });
  
  $("#acc1").accordion({
    active: '.selected',
    alwaysOpen: false,
    autoheight: false,
    header: 'a.acc1',
    clearStyle: true
  });
  
  $("#acc2").accordion({
    active: '.selected',
    alwaysOpen: false,
    autoheight: false,
    header: 'a.acc2',
    clearStyle: true
  }); 

  $("#acc_left").accordion({
    active: '.selected',
    alwaysOpen: false,
    autoheight: false,
    header: 'a.acc2',
    clearStyle: true
  });  

  $("#acc_right").accordion({
    active: '.selected',
    alwaysOpen: false,
    autoheight: false,
    header: 'a.acc2',
    clearStyle: true
  });  

  $("#acc_stage").accordion({
    active: '.selected',
    alwaysOpen: false,
    autoheight: false,
    header: 'a.acc2',
    clearStyle: true
  });  

  $("[title]").mbTooltip({          // also $([domElement])..mbTooltip  >>  in this case only children element are involved
    opacity : .97,                  //opacity
    wait:1200,                      //before show
    cssClass:"default",             // default = default
    timePerWord:70,                 //time to show in milliseconds per word
    hasArrow:true,			            // if you whant a little arrow on the corner
    imgPath:"/img/tooltips/",
    ancor:"mouse",                  //"parent"  you can ancor the tooltip to the mouse position or at the bottom of the element
    shadowColor:"black"             //the color of the shadow
  });
  
  $("div.round").corner("6px");

  // contact form
  $('#form_contact').ajaxForm(function(data) {
    if (data==1){
      $('#success').fadeIn("slow");
      $('#form_contact').resetForm();
    } else {
      $('#errormsg').html(data).fadeIn("slow");
    }
  });
  
});