// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
jQuery.fn.center = function () {
    this.css("position","fixed");
    this.css("top", ( $(window).height() - this.outerHeight() ) / 2+$(window).scrollTop() + "px");
    this.css("left", ( $(window).width() - this.outerWidth() ) / 2+$(window).scrollLeft() + "px");
    return this;
}
$(document).ready(function() {
   var slideHide = function(){ $('#new_look_content').slideUp('fast', function(){$('#new_look').fadeOut('fast');})}
   $('#new_look').hide().fadeIn('slow').click(slideHide);
   $('#new_look_content').center().delay(650).slideDown(800).click(slideHide);
   $.localScroll({hash : true, offset : -300});
   $('.screenshots a').unbind('click');
   $("#portfolio .screenshots a").fancyZoom();
   $(window).resize(function(){
      if($(window).width() <= 800){
         $('#oh_hai').fadeIn('fast');
      } else {
         $('#oh_hai').fadeOut('fast')
      }
   });
   if($(window).width() <= 800){
      $('#oh_hai').fadeIn('fast',
         function(){ 
            $("#yah_ok").click(
               function(){
                  $("#oh_hai").fadeOut('fast');
                  setCookie("yah_ok", "don't show", 90);
               }
            );
         }
      );
   }
});
