function InsertFlash(data, width, height, transparent) {
	if (data == "") {
		return;
	}
	var swf = '<object' + ' type="application/x-shockwave-flash" data="' + data
			+ '" width="' + width + '" height="' + height + '">\n';
	swf += '<param name="movie" value="' + data + '" />\n';
	if (transparent == true){swf += '<param name="wmode" value="transparent" />\n';}
	swf += '<embed src="' + data
			+ '" pluginspage="http://www.macromedia.com/go/getflashplayer'
			+ '" width="' + width + '" height="' + height
			+ '" wmode="transparent" type="application/x-shockwave-flash">' + '</embed>\n';
	swf += '</object>\n';
	document.write(swf);
	return;
}

function cache_mot_rech() {

	if ($('mot_content2')) {
		$('mot_content2').setStyle( {
			display :'none'
		});
	}

	if ($('mot_search_right')) {
		$('mot_search_right').setStyle( {
			display :'block'
		});
	}



}

function affich_mot_rech() {

	if ($('mot_search_right').style.display != "none") {

		$('mot_search_right').setStyle( {
			display :'none'
		});

		if ($('mot_content2')) {
			$('mot_content2').setStyle( {
				display :'block'
			});
		}

	}
}



function affich_caracteristiques() {
	$('div_1').setStyle( {
		display :'block'
	});
	$('aff_car').setStyle( {
		display :'none'
	});
}


function changeCritereObligatoireTrouverProduit(theForm) {
	// On change de critere obligatoire

	newCriOblId = theForm.obligatoire.value;


	if (newCriOblId == '') {
		// Si on ne choisit pas de critere obligatoire, on ne fait rien
	} else {
		resetTrouverProduit(theForm);
	}

}

function resetTrouverProduit(theForm) {

	if (theForm.obligatoire.value == '') {
		// Si on n'a pas de critere obligatoire, on choisit le premier arbitrairement
		theForm.obligatoire.value = theForm.obligatoire.options[1].value;
	}

	// on réinitialise les critères optionnels
	for(i=0; i<theForm.elements.length; i++) {
		if(theForm.elements[i].name.indexOf("esclave") == 0 ) {
			theForm.elements[i].value = '';
		}
	}
	// et on poste
	theForm.submit();
}
