jQuery.fn.DefaultValue = function(text){
    return this.each(function(){
		//Make sure we're dealing with text-based form fields
		if(this.type != 'text' && this.type != 'password' && this.type != 'textarea')
			return;
		//Store field reference
		var fld_current=this;
		//Set value initially if none are specified
        if(this.value=='') {
			this.value=text;
		} else {
			//Other value exists - ignore
			return;
		}
		//Remove values on focus
		$(this).focus(function() {
			if(this.value==text || this.value=='')
				this.value='';
		});
		//Place values back on blur
		$(this).blur(function() {
			if(this.value==text || this.value=='')
				this.value=text;
		});
		//Capture parent form submission
		//Remove field values that are still default
		$(this).parents("form").each(function() {
			//Bind parent form submit
			$(this).submit(function() {
				if(fld_current.value==text) {
					fld_current.value='';
				}
			});
		});
    });
};
//clear field on focus
$(document).ready(function() {
			//Assign default value to form field #1
			$("#searchfield").DefaultValue("Search the site");
});	


//make input text darker on hover
	$(window).load(function(){
		  var _e = $('#searchfield');
		  
		  _e.hover(function() {
			_e
		   .css('color','#333');
		  }, function() {
			_e
			.css('color','#999');
		  });
		  

		  var _f = $('ul#features li a img');
		  _f.hover(function() {
			_f
		   $(this).css('border','#99d4e1 3px solid')
		   $(this).css('cursor', 'pointer')
		   $(this).css('padding','0px');
		  }, function() {
			_f
			$(this).css('border','none')
			$(this).css('padding','3px');
		  });		
		  
		  var _s = $('ul#features li a span');
		  _s.hover(function() {
			_s
		   $(this).prev().css('border','#99d4e1 3px solid')
		   $(this).css('cursor', 'pointer')
		   $(this).prev().css('padding','0px');
		  }, function() {
			_s
			$(this).prev().css('border','none')
			$(this).prev().css('padding','3px');
		  });		
		  
		  
		  
		  var _t = $('dd#tshirts');
		  _t.hover(function() {
			_t
		   $('dd#tshirts a img').css('border','#99d4e1 3px solid')
		   $('dd#tshirts a img').css('padding','0px')
		   $('dd#tshirts a').css('text-decoration','underline');
		  }, function() {
			_t
			$('dd#tshirts a img').css('border','none')
			$('dd#tshirts a img').css('padding','3px');
			$('dd#tshirts a').css('text-decoration','none');

		  });		  
		  
		 $("#credits").hover(function(){
			$("#credits").fadeOut("slow",function(){
				$("#credits").css("display","none");
				$("#design").fadeIn("slow",function(){
					$("#design").hover(function(){ 
						$("#design").css("display","inline");
						$("#credits").css("display","none");
					})
				});
				$("#development").fadeIn("slow",function(){
					$("#design").hover(function(){ 
						$("#development").css("display","inline");
						$("#credits").css("display","none");
					})
				});
			});	
		},function(){
		});

		  
		  /*
		  var _l = $('ul#stage li');
		  _l.hover(function() {
			_l
		   $(this).css('background','#fff')
		  }, function() {
			_l
			$(this).css('background','transparent')
		  });		  
		  */
		$(function() {
			// Use this example, or...
			$('a[@rel*=lightbox]').lightBox(); // Select all links that contains lightbox in the attribute rel
		});
	
		$(".comments").click(function(){ 
						$("#disqus_thread").css("padding-top","130px");
					});
		
});


	/*
	$(document).ready(function(){
						   
	$("#content ul#stage li").click(function(){
    	window.location=$(this).find("h2 a").attr("href");return false;
	});
	

}); //close doc ready

*/




/* load links in new window with rel instead of rel="external" */
function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
if (anchor.getAttribute("href") &&
anchor.getAttribute("rel") == "external")
anchor.target = "_blank";
}
}
window.onload = externalLinks; 

