// JavaScript Document

function validationFormAjax(params){	


	switch(params){
		// LISTE 01
		case 'pid' :
				verif = $('tx_pilotproduct_pid_00').checked;
				if(verif==true){$('tx_pilotproduct_pid_00').checked=0;}
			break;
		case 'pid00' :		
				verif = $('tx_pilotproduct_pid_00').checked;	
				 var i=1;
				 var n=8;
	 
				if(verif==true){	
					for (i=0; i<=n; i++)
					 {
						$('tx_pilotproduct_pid_0'+i).checked = 1;	
					 }
				 }
	
				if(verif==false){	
					for (i=0; i<=n; i++)
					 {
						$('tx_pilotproduct_pid_0'+i).checked = 0;	
					 }
				 }
			break;
		// LISTE 02			
		case 'large' :
				verif = $('tx_pilotproduct_largeur_00').checked;
				if(verif==true){$('tx_pilotproduct_largeur_00').checked=0;}
			break;
		case 'large00' :		
				verif = $('tx_pilotproduct_largeur_00').checked;	
				 var i=1;
				 var n=5;
	 
				if(verif==true){	
					for (i=0; i<=n; i++)
					 {
						$('tx_pilotproduct_largeur_0'+i).checked = 1;	
					 }
				 }
	
				if(verif==false){	
					for (i=0; i<=n; i++)
					 {
						$('tx_pilotproduct_largeur_0'+i).checked = 0;	
					 }
				 }
			break;			
		// LISTE 03			
		case 'stylo' :
				verif = $('tx_pilotproduct_grip_00').checked;
				if(verif==true){$('tx_pilotproduct_grip_00').checked=0;}
			break;			
		case 'stylo00' :			
				verif = $('tx_pilotproduct_grip_00').checked;			
			
				if(verif==true){
					$('tx_pilotproduct_capuchon').checked = 1;
					$('tx_pilotproduct_retractable').checked = 1;					
					$('tx_pilotproduct_grip_01').checked = 1;				
					$('tx_pilotproduct_grip_02').checked = 1;				
				}
			
				if(verif==false){
					$('tx_pilotproduct_capuchon').checked = 0;
					$('tx_pilotproduct_retractable').checked = 0;					
					$('tx_pilotproduct_grip_01').checked = 0;				
					$('tx_pilotproduct_grip_02').checked = 0;
				}			
			break;				
		// LISTE 04			
		case 'corps' :
				verif = $('tx_pilotproduct_taille_coprs_00').checked;
				if(verif==true){$('tx_pilotproduct_taille_coprs_00').checked=0;}
			break;
		case 'corps00' :		
				verif = $('tx_pilotproduct_taille_coprs_00').checked;	
				 var i=1;
				 var n=3;
	 
				if(verif==true){	
					for (i=0; i<=n; i++)
					 {
						$('tx_pilotproduct_taille_coprs_0'+i).checked = 1;	
					 }
				 }
	
				if(verif==false){	
					for (i=0; i<=n; i++)
					 {
						$('tx_pilotproduct_taille_coprs_0'+i).checked = 0;	
					 }
				 }
			break;
		// LISTE 05			
		case 'recharge' :
				verif = $('tx_pilotproduct_rechargeable_00').checked;
				if(verif==true){$('tx_pilotproduct_rechargeable_00').checked=0;}
			break;
		case 'recharge00' :		
				verif = $('tx_pilotproduct_rechargeable_00').checked;	
				 var i=1;
				 var n=2;
	 
				if(verif==true){	
					for (i=0; i<=n; i++)
					 {
						$('tx_pilotproduct_rechargeable_0'+i).checked = 1;	
					 }
				 }
	
				if(verif==false){	
					for (i=0; i<=n; i++)
					 {
						$('tx_pilotproduct_rechargeable_0'+i).checked = 0;	
					 }
				 }
			break;
		// LISTE 03			
		case 'charac' :
				verif = $('tx_pilotproduct_characteristics').checked;
				if(verif==true){$('tx_pilotproduct_characteristics').checked=0;}
			break;			
		case 'charac00' :			
				verif = $('tx_pilotproduct_characteristics').checked;			
			
				if(verif==true){
					$('tx_pilotproduct_effacable').checked = 1;
					$('tx_pilotproduct_tous_supports').checked = 1;					
					$('tx_pilotproduct_permanent').checked = 1;				
					$('tx_pilotproduct_tableau_blanc').checked = 1;				
					$('tx_pilotproduct_textile').checked = 1;
					$('tx_pilotproduct_cd_dvd').checked = 1;					
					$('tx_pilotproduct_stylo_agenda').checked = 1;				
					$('tx_pilotproduct_calligraphie').checked = 1;	
				}
			
				if(verif==false){
					$('tx_pilotproduct_effacable').checked = 0;
					$('tx_pilotproduct_tous_supports').checked = 0;					
					$('tx_pilotproduct_permanent').checked = 0;				
					$('tx_pilotproduct_tableau_blanc').checked = 0;				
					$('tx_pilotproduct_textile').checked = 0;
					$('tx_pilotproduct_cd_dvd').checked = 0;					
					$('tx_pilotproduct_stylo_agenda').checked = 0;				
					$('tx_pilotproduct_calligraphie').checked = 0;
				}			
			break;				
			
			
			
			
	}


	$('tx_styloideal').request({
			method: 'post',				   
				onSuccess: function(response){
					$('tx_styloideal_nbresult').update(response.responseText);			
				}							   					   
		});


}


function videFormAjax(formName){

	$('tx_pilotproduct_pid_00').checked = 0;
	$('tx_pilotproduct_pid_01').checked = 0;
	$('tx_pilotproduct_pid_02').checked = 0;
	$('tx_pilotproduct_pid_03').checked = 0;	
	$('tx_pilotproduct_pid_04').checked = 0;	
	$('tx_pilotproduct_pid_05').checked = 0;	
	$('tx_pilotproduct_pid_06').checked = 0;	
	$('tx_pilotproduct_pid_07').checked = 0;	
	$('tx_pilotproduct_pid_08').checked = 0;		
	
	$('tx_pilotproduct_largeur_00').checked = 0;
	$('tx_pilotproduct_largeur_01').checked = 0;
	$('tx_pilotproduct_largeur_02').checked = 0;
	$('tx_pilotproduct_largeur_03').checked = 0;	
	$('tx_pilotproduct_largeur_04').checked = 0;	
	$('tx_pilotproduct_largeur_05').checked = 0;	
	
	$('tx_pilotproduct_capuchon').checked = 0;
	$('tx_pilotproduct_retractable').checked = 0;					
	$('tx_pilotproduct_grip_01').checked = 0;				
	$('tx_pilotproduct_grip_02').checked = 0;	
	$('tx_pilotproduct_grip_00').checked = 0;	
	
	$('tx_pilotproduct_taille_coprs_00').checked = 0;
	$('tx_pilotproduct_taille_coprs_01').checked = 0;
	$('tx_pilotproduct_taille_coprs_02').checked = 0;
	$('tx_pilotproduct_taille_coprs_03').checked = 0;	

	$('tx_pilotproduct_rechargeable_00').checked = 0;
	$('tx_pilotproduct_rechargeable_01').checked = 0;
	$('tx_pilotproduct_rechargeable_02').checked = 0;
	

	$('tx_pilotproduct_effacable').checked = 0;
	$('tx_pilotproduct_tous_supports').checked = 0;					
	$('tx_pilotproduct_permanent').checked = 0;				
	$('tx_pilotproduct_tableau_blanc').checked = 0;				
	$('tx_pilotproduct_textile').checked = 0;
	$('tx_pilotproduct_cd_dvd').checked = 0;					
	$('tx_pilotproduct_stylo_agenda').checked = 0;				
	$('tx_pilotproduct_calligraphie').checked = 0;
	$('tx_pilotproduct_characteristics').checked = 0;

	$('tx_styloideal').request({
			method: 'post',				   
				onSuccess: function(response){
					$('tx_styloideal_nbresult').update(response.responseText);			
				}							   					   
		});

}
 
