//smooth scrolling

jQuery(document).ready(function() {
  function filterPath(string) {
	return string
	  .replace(/^\//,'')
	  .replace(/(index|default).[a-zA-Z]{3,4}jQuery/,'')
	  .replace(/\/jQuery/,'');
  }
  
  /*
  jQuery('a[href*=#]').each(function() {
	if ( filterPath(location.pathname) == filterPath(this.pathname)
	&& location.hostname == this.hostname
	&& this.hash.replace(/#/,'') ) {
	  var jQuerytarget = jQuery(this.hash), target = this.hash;
	 
	  if (jQuerytarget) {
  		var targetOffset = jQuerytarget.offset().top;
	
  		jQuery(this).click(function() {
  		  jQuery('html, body').animate({scrollTop: targetOffset}, 600, function() {
  			  if (!location.hash) window.location += target;
  		  });
  		});
	  }
	}
  });*/
 
  jQuery('a[href*=#]').click(function() {
	if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
	&& location.hostname == this.hostname) {
	  var jQuerytarget = jQuery(this.hash);
	  jQuerytarget = jQuerytarget.length && jQuerytarget
	  || jQuery('[name=' + this.hash.slice(1) +']');
	  if (jQuerytarget.length) {
		var targetOffset = jQuerytarget.offset().top;
		jQuery('html,body')
		.animate({scrollTop: targetOffset}, 1000);
	   return false;
	  }
	}
  });


  
});



  



