/**
 * checkboxAdresseClick
 */
function checkboxAdresseClick() {
	inverseModifiable( "pays" );
	inverseModifiable( "adresse" );
}

/**
 * checkboxTelClick
 */
function checkboxTelClick() {
	inverseModifiable( "tel" );
}

/**
 * checkboxEmailClick
 */
function checkboxEmailClick() {
	inverseModifiable( "email" );
}

/**
 * Méthode qui active ou désactive un composant en fonction de son id
 *
 * @param int idComposant
 */
function inverseModifiable( idComposant ) {
	// on récupére le composant
	composant = document.getElementById( idComposant );
	
	if ( composant.disabled == true ) {
		composant.disabled = false;
	} else {
		composant.disabled = true;
	}
}

/**
 * Fonction qui renvoie la valeur du radio sélectionné
 *
 * @param objRadio objet radio en html
 *
 * @return string
 */
function getRadioValue( objRadio ) {
	if( !objRadio ) {
		return "";
	}
	var radioLength = objRadio.length;
	if ( radioLength == undefined ) {
		if ( objRadio.checked ) {
			return objRadio.value;
		} else {
			return "";
		}
	} 
	for( var i = 0; i < radioLength; i++ ) {
		if( objRadio[i].checked ) {
			return objRadio[i].value;
		}
	}
	return "";
}

//Ouvrir une popup
function OuvrirPopup(page,nom,option) {
       window.open(page,nom,option);
}


function openhide(id) {
	
	if( document.getElementById( id ).style.display == "none" || document.getElementById( id ).style.display == "" )
		document.getElementById( id ).style.display = "block";
	else
		document.getElementById( id ).style.display = "none";
	
}


function redirectByMarque(url){
	document.location.href = url;
}

function encode26(id){
	var chaine = document.getElementById(id).value;
	var sortie = chaine.replace(/%/g,'%25');
	sortie = sortie.replace(/\?/g, "%3F");
	return chaine = sortie.replace(/&/g,"%26");	
}
