/*jQuery Sliding Login Panel Button*/
$(document).ready(function(){

  $(".btn-slide").click(function(){
    $("#panel").slideToggle("slow");
    $(this).toggleClass("active"); return false;
  });
   
});

// Sliding Panel //
$(document).ready(function() {
      
  // Expand Panel
  $("#open").click(function(){
    
    $("div#panel").slideDown("slow");
    $('.formError').animate({opacity:.8},1000);
    $("#name").fadeOut(0).fadeIn(400, function() {
      $(this).focus();
    });

  }); 

  // Collapse Panel
  $("#close").click(function(){
    $("div#panel").slideUp("slow"); 
    $('.formError').animate({opacity:0},400);
  });   
  
  // Switch buttons //
  $("#toggle a").click(function () {
    $("#toggle a").toggle();
  });   
    
});

/* lightbox  */
$(function() {
  $('.lightbox').lightBox();
});

/* Color hover  */
// color animation 
$(document).ready(function(){
  $(".content_block img").hover(function() {
    $(this).stop().animate({ backgroundColor: "#3e6bb2" }, 200);
  },function() {
    $(this).stop().animate({ backgroundColor: "#5c8fc7" }, 400);   
  });
});
  
//  color animation 
$(document).ready(function(){
  $(".content_block .visit img").hover(function() {
    $(this).stop().animate({ backgroundColor: "#FFF" }, 200);
  },function() {
    $(this).stop().animate({ backgroundColor: "#FFF" }, 400);  
  });
});

// color animation 
//$(document).ready(function(){
 // $("#ident_menu a, #ident2_menu a").hover(function() {
  //  $(this).stop().animate({ backgroundColor: "#3e6bb2" }, 200);
  //},function() {
 //  $(this).stop().animate({ backgroundColor: "#FFF" }, 400);   
 // });
//});

// Portfolio Swap Functionality //
$(document).ready(function(){
 
  $("a.switch_thumb").toggle(function(){
    $(this).addClass("swap"); 
    $( 'html, body' ).animate( { scrollTop: 1060 }, 'slow' );
    $(".thumb_view").fadeOut("fast", function() {
      $(this).fadeIn("slow").addClass("display"); 
    });
  }, function () {
    $(this).removeClass("swap");
    $( 'html, body' ).animate( { scrollTop: 1060 }, 'slow' );
    $(".thumb_view").fadeOut("fast", function() {
      $(this).fadeIn("slow").removeClass("display");
    });
  }); 
 
});


//Image Replacement Gallery //

$(document).ready(function(){
 
  $(".thumbs a").click(function(){              
    $('#irg img').hide(0);
    $('#hiddenbox').show();
    $(this).delay(1000,function(){  
      $('#hiddenbox').hide();
    });
  
    $(this).delay(1000,function(){  
      $('#irg img').show();
    });               

    var largePath = $(this).attr("href");
    var largeAlt = $(this).attr("title");
    
    $("#largeImg").attr({ src: largePath, alt: largeAlt });
    
    $(".thumb_block h3").html(" " + largeAlt + " "); return false;
  });
  
});

//delay //

jQuery.fn.delay = function(time,func){
  this.each(function(){
    setTimeout(func,time);
  });
  
  return this;
};

//slider //

$(document).ready(function(){ 
  $("#slider").easySlider({
    auto: true, 
    continuous: true
  });
});

$(document).ready(function(){
  // prevent the hyperlinks from moving to an anchor
  $('#ident_menu, #ident2_menu').delegate('a', 'click', function(e) {
    return false;
  });
});

