
/*--------------------------------------------------+
|													|
|				jquery.placeholders.js				|
|					  Version: 1.3					|
|			   Created: January 5th 2011			|
|			 By: vincent@webspacedesign.nl			|
|													|
|	Enables placeholders on input elements for		|
|	browsers without native placeholder support.	|
|													|
|				Tested with jQuery 1.4.2			|
|													|
|			Copyright: WebspaceDesign 2011			|
|			 http://www.webspacedesign.nl/			|
|													|
+--------------------------------------------------*/

function showplaceholders(ajax){

	if(ajax) var itemlist = $("#dnContent input[placeholder]");
	else var itemlist = $("input[placeholder]");

	//if('placeholder' in document.createElement('input') !== false) return;
	itemlist.each(function(){
		if($(this).val()=="" || $(this).attr("placeholder") == $(this).val()){
			$(this).val($(this).attr("placeholder")).addClass("placeholder");
		}
		$(this).focus(function(){
			if($(this).val()==$(this).attr("placeholder")) $(this).val("").removeClass("placeholder");
		});
		$(this).blur(function(){
			if($(this).val()=="" || $(this).attr("placeholder") == $(this).val()) $(this).addClass("placeholder").val($(this).attr("placeholder"));
		});
		$(this).closest("form").submit(function(){
			$(this).find("input[placeholder]").each(function(){
				if($(this).val() == $(this).attr("placeholder")) $(this).val("");
			});
		});
	});
}


