// JavaScript Document

function showImage(imgSrc){
	document.getElementById('imageproduit').innerHTML = "<table border=\"0\" id=\"img_prod\"><tr><td align=\"center\"><img src='"+imgSrc+"' /></td></tr></table>";
}
/*
function cache(elmtid){           
    document.getElementById(elmtid).style.display = 'none';
}

function montre(elmtid){           
    document.getElementById(elmtid).style.display = 'block';
}
*/
function onglet(elmtidmontre,elmtidcache){
	document.getElementById(elmtidcache).style.display = 'none';
    document.getElementById(elmtidmontre).style.display = 'block';
}


//pour le nombre de checkbox

function checkProduit(posProduit,check) {

		var intChecked=0;

		for(i=0; i<=cpt;i++) {

			if (document.choix_comparaison.compare[i].checked)

				intChecked ++;

		}

		if (intChecked > 3) {

			alert('Veuillez sélectionner 2 ou 3 modèles');

			check.checked = false;

		} else {

		}

	}
	
	function check_selectprod() {
		fObj = document.forms[ 'choix_comparaison' ];
		chk = 0;
		for( i=0; i<fObj.elements.length; i++ ) {
			elmObj= fObj.elements[ i ];
			if ( elmObj.type == 'checkbox' & elmObj.name != 'checkbox' ) {
				if ( elmObj.checked ) {
					chk++;
				}
			}
		}
		if ( chk <= 1 || chk > 3 ) {
			alert( 'Veuillez sélectionner 2 ou  3 modèles' );
			return false;
		}
		if (document.choix_comparaison.checkbox && document.choix_comparaison.checkbox.checked) document.choix_comparaison.checkbox.checked=false;
		return true;
	}
	
	function selectprodsubmit(){
		if(check_selectprod()){
			document.choix_comparaison.submit();
		}
	}

