function checkLogin () {
	obj = document.FRMLogin;
	if (isEmpty(obj.email.value)) {
		goAlert (obj.email, "Veuillez saisir votre adresse email.", "");
	} else if (!isEmail(obj.email.value)) {
		goAlert (obj.email, "Votre adresse email n'est pas valide.", "");
	} else if (isEmpty(obj.password.value)) {
		goAlert (obj.password, "Veuillez saisir votre mot de passe.", "");
	} else {
		obj.action = BasePath + "/service/user/php_login.php";
		obj.submit();
	}
}

function alertFctn(fieldId, msg) {
	emphasizeIncorrectField($(fieldId), msg);
}

function addToBasket(type, code_type, quantity) {
	(new Request({method: 'get', onComplete: function() {
		window.location = BasePath + "/shop/basket/index.php";
	}, url: BasePath + "/shop/basket/php_basket.php"})).send("type=" + type + "&code_type=" + code_type + "&quantity=" + quantity);
}

function alertSuccess(msg) {
	alert(msg);
}

function alertError(msg) {
	alert(msg);
}
var lastSticky;
function emphasizeIncorrectField(element, message){
	var sticky = new Element('div', {'id': 'Sticky', 'class': 'closeSticky', 'html' : message});
	sticky.inject(element, 'after');
	(function(){ sticky.set('fade', {onComplete: function() {this.dispose();}}).fade('out');}).delay(3000);
	lastSticky = sticky;
	element.highlight();
	element.focus();
}
