/*
 * Créer et programmer par Jean-François Duquette de Labo X Design 2011
 * 2011-04-07
 * 
 * */
	function isAlpha(str){
		  var re = /[^a-zA-Z- ]/g;
		  if (re.test(str)){
			   return false;
		  }
		  return true;
	}
	function echeck(str) {

		var at="@";
		var dot=".";
		var lat=str.indexOf(at);
		var lstr=str.length;
		var ldot=str.indexOf(dot);
		if (str.indexOf(at)==-1){
		   return false;
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return false;
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return false;
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    return false;
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    return false;
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    return false;
		 }
		
		 if (str.indexOf(" ")!=-1){		   
		    return false;
		 }

 		 return true;					
	}
	function loadPage(page,title)
 	{
		$("#row-top").empty();
		$("#row-bottom").empty();
		
		$("#row-top").load(page, function() // Envoie au formulaire les donn�es n�c�ssaires pour la manipulation.
 		{					
					document.title = title;
 		});
 	}
	function scrollText(scrolling_content_id,action,top_move)
 	{
		if($('#'+scrolling_content_id))
		{
			var t_height = $('#'+scrolling_content_id).height()/top_move;						
			var t_position = $('#'+scrolling_content_id).position();
			var t_top = t_position.top;
			var max = $('#'+scrolling_content_id).height();
			
				if(action == "1")
				{
					if(t_top < 0)
					{
						$('#'+scrolling_content_id).animate({"top":"+="+top_move+"px"},1);
					}
				}
				else
				{		
					    var offset_top =  t_height - max;
					  
						if(t_top > offset_top)
						{
							$('#'+scrolling_content_id).animate({"top": "-="+top_move+"px"},1);
						}
				}
			
		}		
 	}
 	
