jQuery(document).ready(function() {
	jQuery("a.link").LinkAnimate()
	});

	jQuery.fn.LinkAnimate = function(settings) {

	settings = jQuery.extend({
	speed : 1000
	}, settings);

	return this.each(function(){
	var boxcall =jQuery(this);
	jQuery(boxcall).click(function (event) {
	event.preventDefault()
	var locationHref = window.location.href
	var elementClick = jQuery(boxcall).attr("href")

	var destination = jQuery(elementClick).offset().top;
	jQuery("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, settings.speed, function() {
	window.location.hash = elementClick
	});
	return false;
	})
	})
	}
	
	//contact
	
	jQuery("input[name='name']").keyup(
							function(){
											var name = jQuery(this).val();
											
											if(name != '')
											{
												jQuery("#ok1").html("<img src='img/shortcuts/accept.png'/>");
											}
											else
											{
												jQuery("#ok1").html("<img src='img/shortcuts/remove.png'/>");
											}
											
										}
								);
	jQuery("input[name='name']").blur(
							function(){
											var name = jQuery(this).val();
											
											if(name != '')
											{
												jQuery("#ok1").html("<img src='img/shortcuts/accept.png'/>");
											}
											else
											{
												jQuery("#ok1").html("<img src='img/shortcuts/remove.png'/>");
											}
											
										}
								);
								
	jQuery("input[name='email']").keyup(
							function(){
											var email = jQuery(this).val();
											
											if(isValidEmailAddress(email))
											{
												jQuery("#ok2").html("<img src='img/shortcuts/accept.png'/>");
											}
											else
											{
												jQuery("#ok2").html("<img src='img/shortcuts/remove.png'/>");
											}
											
										}
								);
	jQuery("input[name='email']").blur(
							function(){
											var email = jQuery(this).val();
											
											if(isValidEmailAddress(email))
											{
												jQuery("#ok2").html("<img src='img/shortcuts/accept.png'/>");
											}
											else
											{
												jQuery("#ok2").html("<img src='img/shortcuts/remove.png'/>");
											}
											
										}
								);
								
	jQuery("#input_msg").keyup(
	
		function(){
		
					var text = jQuery(this).val();
					
					if(text != '')
					{
						jQuery("#ok3").html("<img src='img/shortcuts/accept.png'/>");
					}
					else
					{
						jQuery("#ok3").html("<img src='img/shortcuts/remove.png'/>");
					}
					
				   }
		
	);
	
	jQuery("#input_msg").blur(
	
		function(){
		
					var text = jQuery(this).val();
					
					if(text != '')
					{
						jQuery("#ok3").html("<img src='img/shortcuts/accept.png'/>");
					}
					else
					{
						jQuery("#ok3").html("<img src='img/shortcuts/remove.png'/>");
					}
					
				   }
		
	);
	
	jQuery("input[name='ope']").blur(
	
		function(){
			
			var num = jQuery(this).val()
			if(num == '6')
					{
						jQuery("#label_right").html("<img src='img/shortcuts/accept.png'/>");
					}
					else
					{
						jQuery("#label_right").html("<img src='img/shortcuts/remove.png'/>");
					}
			
		}
	
	);
	jQuery("input[name='ope']").keyup(
	
		function(){
			
			var num = jQuery(this).val()
			if(num == '6')
					{
						jQuery("#label_right").html("<img src='img/shortcuts/accept.png'/>");
					}
					else
					{
						jQuery("#label_right").html("<img src='img/shortcuts/remove.png'/>");
					}
			
		}
	
	);
	
	
	
	
	
	
	function isValidEmailAddress(emailAddress) {
		var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
		return pattern.test(emailAddress);
	}
	
	
	jQuery("input").bind("keypress", function(e) {
	  if (e.keyCode == 13) return false;
	});

	
	jQuery("#experience_titre").click(
		function(){
			jQuery("#formation").slideUp(1000);
			jQuery("#experience").slideDown(1000);
			jQuery("#competence").slideUp(1000);
			jQuery("#experience_titre").css("background","#cccccc");
			jQuery("#formation_titre").css("background","#ffffff");
			jQuery("#competence_titre").css("background","#ffffff");
		}
	);
	
	jQuery("#formation_titre").click(
		function(){
			jQuery("#formation").slideDown(1000);
			jQuery("#experience").slideUp(1000);
			jQuery("#competence").slideUp(1000);
			jQuery("#formation_titre").css("background","#cccccc");
			jQuery("#experience_titre").css("background","#ffffff");
			jQuery("#competence_titre").css("background","#ffffff");
		}
	);
	
	jQuery("#competence_titre").click(
		function(){
			jQuery("#formation").slideUp(1000);
			jQuery("#experience").slideUp(1000);
			jQuery("#competence").slideDown(1000);
			jQuery("#competence_titre").css("background","#cccccc");
			jQuery("#formation_titre").css("background","#ffffff");
			jQuery("#experience_titre").css("background","#ffffff");
		}
	);
	
	jQuery("#portfolio_onglet_web").click(
		function(){
			jQuery("#port_web").css("display","block");
			jQuery("#port_c").css("display","none");
			jQuery("#port_cpp").css("display","none");
			jQuery("#port_delphi").css("display","none");
			jQuery("#port_vb").css("display","none");
		}
	);
	jQuery("#portfolio_onglet_c").click(
		function(){
			jQuery("#port_web").css("display","none");
			jQuery("#port_c").css("display","block");
			jQuery("#port_cpp").css("display","none");
			jQuery("#port_delphi").css("display","none");
			jQuery("#port_vb").css("display","none");
		}
	);
	jQuery("#portfolio_onglet_cpp").click(
		function(){
			jQuery("#port_web").css("display","none");
			jQuery("#port_c").css("display","none");
			jQuery("#port_cpp").css("display","block");
			jQuery("#port_delphi").css("display","none");
			jQuery("#port_vb").css("display","none");
		}
	);
	jQuery("#portfolio_onglet_delphi").click(
		function(){
			jQuery("#port_web").css("display","none");
			jQuery("#port_c").css("display","none");
			jQuery("#port_cpp").css("display","none");
			jQuery("#port_delphi").css("display","block");
			jQuery("#port_vb").css("display","none");
		}
	);
	jQuery("#portfolio_onglet_vb").click(
		function(){
			jQuery("#port_web").css("display","none");
			jQuery("#port_c").css("display","none");
			jQuery("#port_cpp").css("display","none");
			jQuery("#port_delphi").css("display","none");
			jQuery("#port_vb").css("display","block");
		}
	);

