$(document).ready(function() {
	
	DD_roundies.addRule('#content a', '2px 10px', true);
	DD_roundies.addRule('#slider img', '3px 12px', true);
	
	// Sliding content (sudoSlider jQuery Plugin)
	$("#slider").sudoSlider({
		autoheight: 	true,
		controlsAttr: 'id="controls"',
		speed: 1000,
		ease: "easeOutCubic"
	});
	
	// For scrolling
	function filterPath(string) {
		  return string
		 .replace(/^\//,'')
		 .replace(/(index|default).[a-zA-Z]{3,4}$/,'')
		 .replace(/\/$/,'');
		  }
		  var locationPath = filterPath(location.pathname);
		  $('a[href*=#]').each(function() {
		 var thisPath = filterPath(this.pathname) || locationPath;
		 if (  locationPath == thisPath
		 && (location.hostname == this.hostname || !this.hostname)
		 && this.hash.replace(/#/,'') ) {
		   var $target = $(this.hash), target = this.hash;
		   if (target) {
		  var targetOffset = $target.offset().top;
		  $(this).click(function(event) {
		    event.preventDefault();
		    $('html, body').animate({scrollTop: targetOffset}, 500, function() {
		   		location.hash = target;
		    });
		  });}}
	});
		  

	// Nav
	$("#header .nav a")
			.css( {backgroundPosition: "50px 0px"} )
			.mouseover(function(){
				$(this).stop().animate(
					{backgroundPosition:"-220px 0px"}, 
					{duration:500})
				})
			.mouseout(function(){
				$(this).stop().animate(
					{backgroundPosition:"50px 0px"}, 
					{duration:500})
				})
	
});

// Don't spam link
function dontSpam() {
	var tld = "com";
	var dom = "designbymagik";
	var s = "@";
	document.location = "ma" + "il" + "to" + ":" + "jeremy" + s + dom + "." + tld;
}
