/* -------------------------------------------------------------- 
  
   style.js
   
   auteur : Denis Fongue - denis.fongue@gmail.com
   site : Sturdyheaven
   
-------------------------------------------------------------- */

/**
 *	clearDefault
 *	clear the value attribut of a <input>
 *
 **/

 
function clearDefaultInput(el) {
  if (el.defaultValue==el.value) el.value = "";
}

/**
 *	GET READY !
 *
 **/
 
$(document).ready(function(){

		$("#comment-form-fields input").focus(function() {
			clearDefaultInput(this);
		});
		
		$("#comment-form-fields input").blur(function() {
			myValue = $.trim(this.value);
			if (myValue == ''){  
	            this.value = (this.defaultValue ? this.defaultValue : '');  
	        } 
		});
		
		$("#comment-form textarea").focus(function() {
			if ($(this).text()== "commentaire") {
				$(this).text("");
			};
		});
		
		$("#comment-form input#submit").click(function() {
			if ($("#comment-form textarea").text() == "commentaire") $("#comment-form textarea").text("");
			if ($("#comment-form input#url").text() == "siteweb") $("#comment-form input#url").text("");
		});
		
		$('div a.lightbox, div#excerpt a').lightbox();
});