// JavaScript Document
	
	

//VALIDATION			
			
function validationform(form_id){
	
			function formCallback(result, form) {
							window.status = "validation callback for form '" + form.id 
							+ "': result = " + result;
						}
						
						var valid2 = new Validation(form_id, {immediate : true, 
													onFormValidate : formCallback});
	}



//ENREGISTRE DES QUESTION
function myquestion()
{
	var nom = $('nom').value;
	var contact = $('contact').value;
	var fr_email = $('fr_email').value;
	var question = $('question').value;
	
   
    var myAjax = new Ajax.Request(
        'php/sendquestion.php', 
        {
          method: 'get',
		  
		  onCreate: function(){
			Element.update('rep-quest', '<div style="color:#FF6600; font-size:18px; font-weight:bold; text-align:center; text-decoration:blink">Loading . . .</div>');
		},
		  onLoad: function (xhr)
            { 
			Element.update('rep-quest', '<div style="color:#FF6600; font-size:18px; font-weight:bold; text-align:center; text-decoration:blink">Loading . . .</div>');
            },
   
          onSuccess: function (xhr)
            {
					
  				new Ajax.Updater($('rep-quest'),'php/sendquestion.php?nom='+nom+'&contact='+contact+'&fr_email='+fr_email+'&question='+question,
  					{
 				 		method: 'get'

 					 }
  					);
				/*Element.update('load', '<center><img src="images/loading.gif" alt="Loading..."/></center>'); */
            },
			
		  onFailure: function()
		  {
			  Element.update(div, 'OPERATION FAILLED...');
			  },
			  
          onComplete: function()
            { // Toujours appelé en fin de requête
				/*new Ajax.Updater($(div),url,
  					{
 				 		method: 'get'

 					 }
  					);*/
            }
        });
}


//ENREGISTREMENT DES COMMENTAIRE
function addnewsletter(mystatus)
{
	
	var your_email = $('tx_email').value;
	
	if (mystatus==true)
	{
   		Effect.Appear('rep-newsletter');
		//alert (your_email); 
    var myAjax = new Ajax.Request(
        'addnewsletter.php', 
        {
          method: 'get',
		  
		  onCreate: function(){
			Element.update('addnewsletter', '<div style="color:#FF6600; font-size:18px; font-weight:bold; text-align:center; text-decoration:blink">Loading . . .</div>');
		},
		  onLoad: function (xhr)
            { 
			Element.update('addnewsletter', '<div style="color:#FF6600; font-size:18px; font-weight:bold; text-align:center; text-decoration:blink">Loading . . .</div>');
            },
   
          onSuccess: function (xhr)
            {
					
  				new Ajax.Updater($('addnewsletter'),'addnewsletter.php?txt_email='+your_email,
  					{
 				 		method: 'get'

 					 }
  					);
				/*Element.update('load', '<center><img src="images/loading.gif" alt="Loading..."/></center>'); */
            },
			
		  onFailure: function()
		  {
			  Element.update('addnewsletter', 'OPERATION FAILLED...');
			  },
			  
          onComplete: function()
            { // Toujours appelé en fin de requête
				/*new Ajax.Updater($(div),url,
  					{
 				 		method: 'get'

 					 }
  					);*/
            }
        });
}
}


function rotative(img)
	{
		$('rotpic').update('<img src="images/rotative/'+img+'.jpg" width="138" height="138" />');
		
	}

