/*
wsd_placeholder.js V2
Revision 1 (01-06-2011)
© Webspacedesign (www.webspacedesign.nl)


arguments:
- none
*/


jQuery.fn.wsd_placeholder = function( arguments ) {
	if('placeholder' in document.createElement('input') !== false && $.browser.webkit !== true) return; // Browser has native support for placeholders
	if( $(this[0]).attr("placeholder") == undefined ) return; // Missing placeholder attribute
	if($(this[0]).val()=="" || $(this[0]).attr("placeholder") == $(this[0]).val()){
		$(this[0]).val($(this[0]).attr("placeholder")).addClass("placeholder");
	}
	$(this[0]).focus(function(){
		if($(this).val()==$(this).attr("placeholder")) $(this).val("").removeClass("placeholder");
	});
	$(this[0]).blur(function(){
		if($(this).val()=="" || $(this).attr("placeholder") == $(this).val()) $(this).addClass("placeholder").val($(this).attr("placeholder"));
	});
}
