$(document).ready(function(){
       
       //Add a smooth color transition to anchors
       $("a").hover(function(){
          $(this).stop().animate({color:'#fff'},900);
       },function(){
        $(this).stop().animate({color:'#999'},900);
        });
       

       //live() up some elements to make em useable in feature
       $("#submit-button").live('mouseover',function(){$(this).stop().animate({backgroundColor:'#111'},600);});
       $("#submit-button").live('mouseout',function(){$(this).stop().animate({backgroundColor:'#070707'},600);});
       
       $(".text-input").live('mouseover',function(){$(this).stop().animate({color:'cyan',backgroundColor:'#070707'},600);});
       $(".text-input").live('mouseout',function(){$(this).stop().animate({color:'#999',backgroundColor:'#000'},600);});
       
       $(".misc").live('mouseover',function(){$(this).stop().animate({color:'#fff'},800);});
       $(".misc").live('mouseout',function(){$(this).stop().animate({color:'#444'},800);});
       
       $(".contact-link").live("click",function(){$("#contact-link").click();return false});
       
       $("a img").live("mouseover",function(){$(this).stop().animate({opacity:'1'},600);});
       $("a img").live("mouseout",function(){$(this).stop().animate({opacity:'0.3'},600);});
       
       //Ajax contact Form
       
       $("#submit-button").live("mouseover",function(){
              
              var options={
              target: '#submit-status',
              beforeSubmit: function(){return true}, 
              success: function(){},
              url: 'something.php'
              }
              
              $("#contact-form").ajaxForm(options);
              
              
              
              });
       

       $("#submit-button").live("click",function(){
              $("#submit-status").animate({opacity:0,height:'hide'},700);
              $("#submit-button").val("Sending...");
              var options={
              target: '#submit-status',
              beforeSubmit: function(){return true}, 
              success: function(){$("#submit-status").animate({opacity:1,height:'show'},700);
                                   $("#submit-button").val("Done");}
              }
              
              $("#contact-form").ajaxForm(options);
              
              
              
              });


       //End AJax form
       
       
       //hide the stuff divs
       $(".stuff").addClass("hidden");
       
       //extract each div contents
       var home=$(".home").html();
       var about=$(".about").html();
       var portfolio=$(".portfolio").html();
       var contact=$(".contact").html();
       
       //By default set the content of #content to homepage stuff
       $("#content").html(home);
       
       //Show homepage-part
       $("#home-link").click(function(){
              $("#content").animate({opacity:'0'},700,function(){$("#content").html(home);});
              $("#content").animate({opacity:'1'},700);
              return false
       });
       
       //Show contact
       $("#contact-link").click(function(){
              $("#content").animate({opacity:'0'},700,function(){$("#content").html(contact);});
              $("#content").animate({opacity:'1'},700);
              return false
              
              
              
             




       });
       

       //Show about me
       $("#about-link").click(function(){
              $("#content").animate({opacity:'0'},700,function(){$("#content").html(about);});
              $("#content").animate({opacity:'1'},700);
              return false
       });
       
       //Show portfolio
       $("#portfolio-link").click(function(){
              $("#content").animate({opacity:'0'},700,function(){$("#content").html(portfolio);});
              $("#content").animate({opacity:'1'},700);
              return false
       });
       
      
            
     });

