

(function() {
	var window = this,
			document = window.document;

	//v4.01
	function inner_MM_findObj(n, d) {
		var p, i, x;
		if (!d){ d = document; }
		if ((p = n.indexOf('?')) > 0 && window.parent.frames.length) {
			d = window.parent.frames[n.substring(p + 1)].document;
			n = n.substring(0, p);
		}
		if (!(x = d[n]) && d.all){
			x = d.all[n];
		}
		for (i = 0; !x && i < d.forms.length; i++){
			x = d.forms[i][n];
		}
		for (i = 0; !x && d.layers && i < d.layers.length; i++){
			x = inner_MM_findObj(n, d.layers[i].document);
		}
		if (!x && d.getElementById){
			x = d.getElementById(n);
		}
		return x;
	}
	window.MM_findObj = inner_MM_findObj;

	window.MM_validateForm = function() {
		var i, val, p, q, nm, test, num, min, max, errors = '', args = arguments;
		for (i = 0; i < (args.length - 2); i += 3) {
			test = args[i + 2];
			val = inner_MM_findObj(args[i]);
			if (val) {
				nm = val.name;
				if ((val = val.value)) {
					if (test.indexOf('isEmail') != -1) {
						p = val.indexOf('@');
						if (p < 1 || p == (val.length - 1)){
							errors += 'Entrer une adresse e-mail valide.';
						}
					}
				}
			}
		}
		if (errors){
			window.alert(errors);
		}
		else{
			window.open('http://lbv5.mperf.com/form.aspx?GV1=ASP1054000000000000000000000024Y&email_0=' + document.formInscription.email_0.value, 'newletter', 'width="200",height="100"');
		}
	};
}());


