$.fn.clearValue = function() {
	$(this).each(
		function() {			
			$(this).click(function() {
				this.initValue = $(this).attr('title');
				if(this.value == this.initValue) {
					this.value = '';
				}
			});
			
			$(this).blur(function() {
				if( this.value.length == 0 ) {
					this.value = this.initValue;
				}
			})
		}
	);
}

$ (function () {
	
	//$('div.contentscroll').jCustomScrollbar() ;		
	/* vidage des champs */
	
	$("input[@type='text']").click ( function () {
		this.value = "";
	});
	
	$("input[@type='password']").click ( function () {
		this.value = "";
	});
	
	/*$("textarea").click ( function () {
		this.value = "";
	});*/
	
	
	$('.typepwd').click(
		function() {
			$(this).hide();
			$(this).next('.realpwd')
				.val('')
				.show()
				.focus();
		}
	);
	
	$(".B_moncompte_form").find("input[@type='text']").not(".perso").unbind('click');
	$(".B_moncompte_form").find("textarea").not(".perso").unbind('click');
	
	$('#form_creer_alerte').find("input[@type='text']").each( function() {
		$(this)
			.unbind('click')
			.clearValue();
	});
	
	// open additional description box for login -- I_showLoginForm.php
	$jQ('div.B_Identification2 .B_cadreIdentidfication a.open_B_blocIdentification_form_desc').live('click', function(ev) {
      ev.preventDefault();
      $jQ('div.open_B_blocIdentification_form_desc_box').addClass('show').slideDown('fast');
	});

	// clos additional description box for login -- I_showLoginForm.php
	$jQ('div.B_Identification2 .B_cadreIdentidfication .open_B_blocIdentification_form_desc_box a.close').live('click', function(ev) {
      ev.preventDefault();
      $jQ('div.open_B_blocIdentification_form_desc_box').removeClass('show').addClass('hide').slideUp('fast');
	});	

	// open additional description box for login -- I_showLoginForm.php
	$jQ('div.B_Identification3 .B_cadreIdentidfication a.open_B_blocIdentification_form_desc').live('click', function(ev) {
      ev.preventDefault();
      $jQ('div.open_B_blocIdentification_form_desc_box').addClass('show').slideDown('fast');
	});

	// clos additional description box for login -- I_showLoginForm.php
	$jQ('div.B_Identification3 .B_cadreIdentidfication .open_B_blocIdentification_form_desc_box a.close').live('click', function(ev) {
      ev.preventDefault();
      $jQ('div.open_B_blocIdentification_form_desc_box').removeClass('show').addClass('hide').slideUp('fast');
	});		
});
