// JavaScript Document

function montrer(v)
{
	document.getElementById(v).style.visibility="visible";
	//var int_v=parseInt(v);
	//int_v-=1;
	//int_v=int_v*largeur_menu_milieu;
	//var lien='a'+v;
	//var value_backgroundposition=int_v + "px " + hauteur_menu_milieu+"px";
	//document.getElementById(lien).style.backgroundPosition=value_backgroundposition;
}

function cacher(v)
{
	document.getElementById(v).style.visibility="hidden";
	//var lien='a'+v;
	//var int_v=parseInt(v);
	//int_v-=1;
	//int_v=int_v*largeur_menu_milieu;
	//var value_backgroundposition=int_v + "px 0px";
	//document.getElementById(lien).style.backgroundPosition=value_backgroundposition;
}

function switch_display(v,calque)
{
	var bloc = document.getElementById(v);
	if (bloc.style.display=="block" || bloc.style.display=="")
	{
		bloc.style.display="none";
		if (document.getElementById("information"+calque))
		document.getElementById("information"+calque).innerHTML="+ Informations :";
	}
	else if (bloc.style.display=="none")
	{
		bloc.style.display="block";
		if (document.getElementById("information"+calque))
		document.getElementById("information"+calque).innerHTML="- Informations :";
	}
	return false;
}

function popup_demo()
{
	
	
}

/*Function test si un article a été sélectionné, pour être ajouter au BDC*/
function Ajouter(frmobject){
	var icheck=0;
	for(var i=0; i < frmobject.chk_prod.length;i++){
				if (frmobject.chk_prod[i].checked){
						icheck++;
				}
	}
	if (icheck > 0){
		/*document.location.href = "commande_ajout.asp";*/
		//frmobject.action = "commande_ajout.asp";
		//frmobject.submit();
		/*parent.contenu.location = "../commande/commande_bon.asp;*/
		return true;
	}
	else {
		alert("Vous devez sélectionner un article"); 
		return false;
	}
}

function Dechecked(champ, id)
{
	var valeur = document.getElementById(id).value;
	if (valeur == 0)
	{
		champ.checked = true;
		document.getElementById(id).value = 1;
	}
	else
	{
		champ.checked = false;
		document.getElementById(id).value =0; 
	}
	
}

function montrer2(div)
{
	var bloc = document.getElementById(div);
	if (bloc.style.display=="block" || bloc.style.display=="")
	{
		bloc.style.display="none";
	}
	else if (bloc.style.display=="none")
	{
		bloc.style.display="block";
	}
}

function depli()
{
	var depli2=document.getElementById("enligne").style.display;	
	if (depli2=="none")
	{
		document.getElementById("enligne").style.display="block";
		document.getElementById("enligne2").style.display="block";
		document.getElementById("enligne3").style.display="block";
		document.getElementById("ligne").value="oui";
	}
	if (depli2=="block")
	{
		document.getElementById("enligne").style.display="none";
		document.getElementById("enligne2").style.display="none";
		document.getElementById("enligne3").style.display="none";
		document.getElementById("ligne").value="non";
	}
}

// AKRIO ///
function remiseAZeroSsdom() {
    if (document.formulaire.ssdom) {
        document.formulaire.ssdom.value = '0';
    }
}

function remiseAZeroAges() {
    if (document.formulaire.ages) {
        document.formulaire.ages.value = '0';
    }
}

function multiTarif(tarif,id) {
    var tab = tarif.split("#");
    document.getElementById('prixHT' + id).innerHTML = tab[0];
    document.getElementById('prixTTC' + id).innerHTML = tab[1];
    document.getElementById(id).value = tab[2];
}

function hideSupport(support) {
    var depliSupport = document.getElementById(support).style.display;
    if (depliSupport == "none") {
        document.getElementById(support).style.display = "block";
        document.getElementById("aff_" + support).innerHTML = "+ réduire";
    } else {
        document.getElementById(support).style.display = "none";
        document.getElementById("aff_" + support).innerHTML = "- agrandir";
    }
    
}
