//========================================================
(function(jQuery) {

	jQuery.extend(jQuery.fn, {
		PaneScroll : function(opts) {
			var config = jQuery.extend({}, jQuery.fn.PaneScroll.defaults, opts || {});
			this.bind('mousedown', config, handleMouseDown);
			if (jQuery.fn.mousewheel) {
				this.mousewheel(function(e, delta) {
					this.scrollTop -= delta * config.mousewheelSpeed;
					e.preventDefault();
				});
			}
			if (!config.accesible) {
				this.css({ overflow: 'hidden' });
			}
			return this;
		}
	
	});
  
	function handleMouseDown(e) {
		jQuery(document).data('PaneScroll', {
			element: this,
			scroll: this.scrollTop,
			y : e.clientY,
			config : e.data
		}).bind('mousemove.PaneScroll', handleMouseMove).bind('mouseup.PaneScroll', handleMouseUp);
		e.preventDefault();
	}
  
	function handleMouseMove(e) {
		var data = jQuery(this).data('PaneScroll');
		data.element.scrollTop = data.scroll + (data.y - e.clientY) * data.config.speed;
	}
  
	function handleMouseUp(e) {
		jQuery(this).removeData('PaneScroll').unbind('.PaneScroll');    
	}
  
	jQuery.fn.PaneScroll.defaults = {
		accesible: true,
		speed: 1.5,
		mousewheelSpeed : 25 
	};
  

})(jQuery);
//======================================
//===========================================
function f_ENT_NewPassword(){
	
	var l_Username = prompt(gLANG['NO_USERNAME_PROMPT']); // Veuillez taper votre nom utilisateur;
	if(!l_Username){
		// Anulation
	}else{
		if(l_Username == ""){
			alert(gLANG['NO_LOGIN']); // Vous devez entrer un login
		}else{
			var l_Email = prompt(gLANG['ENT_NEWPASS_PROMPT']); // Veuillez taper votre adresse mail
			// Email
			if(!l_Email){
				// Anulation
			}else{
				if(l_Email == ""){
					alert(gLANG['ENT_NEWPASS_NO_EMAIL']); // Une adresse mail doit-être saisie
				}else{
					//
					if(!f_VerifEmail(l_Email)){
						alert(gLANG['ENT_NEWPASS_NO_VALID_EMAIL']); // Une adresse mail valide doit-être saisie
					}else{
						// REQUETTE AJAX D'ENVOI DU NOUVEAU LOGIN / MOT DE PASSE
						jQuery.post(gDirAppl+"functions/oma-funct-entreprise.php",
						   { ENT_NewPassword: l_Email, ENT_ForgotLogin: l_Username },
						   function(data){
							 alert(data);
						 });
						 //===========================
					}// Fin verif mail
				}// Fin mail est vide
			}// Fin prompt mail
		}// Fin login est vide
	}// Fin prompt login
}
//===================================
function f_ENT_CheckLogin(pForm){
	if(pForm){
		if((pForm.ENT_Username.value == "")&&(pForm.ENT_Username.value != gLANG['ENT_LOGIN_VALUE'])){
			alert(gLANG['ENT_NO_LOGIN']);
			pForm.ENT_Username.value = gLANG['ENT_LOGIN_VALUE']; // Login
			pForm.ENT_Username.focus();
			return false;
		}
		if(pForm.ENT_password.value == ""){
			alert(gLANG['ENT_NO_PASS']); // Vous devez entrer un mot de passe
			pForm.ENT_password.focus();
			return false;
		}
	}
	return true;
}
//====================================================
