/**
 * Librairie javascript commune a tout l'ecog
 *
 * @author			Julie Tetard <julie@2jstudio.com> 
 * @version		E-cog 3.0
 * @package			public
 * @subpackage		param
 * @category		js
 * @internal		last modified
 */



/**
 * Attache Evenements
 */
$(document).ready(function () {
	
	// Rollovers
	$('#menu img, #other-menu img').each(function() {
		$(this).mouseover(ECOG_rollOver);
		$(this).mouseout(ECOG_rollOut);		
	});
		
	// Top Modal
	$("#contact").parent().removeAttr('href');
	$("#devis").parent().removeAttr('href');
	$("#footer-contact").parent().removeAttr('href');
	$("#footer-devis").parent().removeAttr('href');
	$("#contact, #devis, #footer-devis, #footer-contact, .devis").click(function(){
		$("#contact-panel").animate({ top: "0" }, 600);
		$("#contact-mask").css('display', '').animate({ opacity: "0.2" }, 600);
		$('#mots').focus();
	});	
	
	// If click outside panel or cancel button : hide
	$("#contact-mask, #cancel").click(function(){
		$("#contact-panel").animate({ top: "-800px" }, 600);
		$("#contact-mask").animate({ opacity: "0" }, 600).css('display', 'none');
	});
		
	// If panel displayed onload 
	if ($("#contact-mask").css('display') != 'none') {
		$('#mots').focus();
	}
});

function validation(email)
{
	var verif = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
 	 if (verif.exec(email) == null)	{
		return false;
	} else	{
		return true;
	}
} 
