jQuery(document).ready(function(){
   jQuery("a[href*=#]")
      .click(function() {

         var duration=1500;
         var easing="easeOutBack";
         var newHash=this.hash;
         var target=jQuery(this.hash).offset().top;
         var oldLocation=window.location.href.replace(window.location.hash, '');
         var newLocation=this;

         if(oldLocation+newHash==newLocation){
            jQuery('html:not(:animated),body:not(:animated)')
               .animate({ scrollTop: target }, duration, easing, function() {
                  window.location.href=newLocation;
            });

            return false;

         }

   });
   
       	$('input[type="text"]').focus(function() {
       			$(this).addClass("focusinput");
      		});
    		$('input[type="text"]').blur(function() {
    			$(this).removeClass("focusinput");
      		});
      		
       	$('textarea').focus(function() {
       			$(this).addClass("focustextarea");
      		});
    		$('textarea').blur(function() {
    			$(this).removeClass("focustextarea");
      		});
});

