
window.targetUrlDomain = 'logistique';

/* fonction qui remplace la value en valeur vide du champ input text */
var ft = true;
function changeCouleurRecherche(champ) {
	if (champ.name == 'q') {
		if (champ.value == 'Saisissez votre recherche') champ.value = '';
		champ.className = 'focusRecherche';
	}
	else {
		champ.value = '';
		champ.className = 'focusRecherche';
	}
}


var recHead = true;
function inputRechercheArticle(recherche) {
	if (recHead == true && recherche.value == 'Saisissez votre recherche') {
		recHead = false;
		recherche.value = '';
		recherche.className = 'autreRechercheInputTextFocus';
	}
}


var rec404 = true;
function changeCouleurRecherche404(recherche) {
	if (rec404 == true && recherche.value == 'Saisissez votre recherche') {
		rec404 = false;
		recherche.value = '';
		recherche.className = 'autreRechercheInputTextFocus';
	}
}


var moncompte = true;
function changeCouleurCompte(recherche) {
	if (moncompte == true && recherche.value == 'Email') {
		moncompte = false;
		recherche.value = '';
		recherche.className = 'champConnexionFocus';
	}
}


var moncomptemdp = true;
function changeCouleurCompteMdp(recherche) {
	if (moncomptemdp == true && recherche.value == 'Mot de passe') {
		moncomptemdp = false;
		recherche.value = '';
		recherche.className = 'champConnexionFocus';
	}
}

/* fonction de popup des outil des articles */
function montre(id) {
	var d = document.getElementById(id);
     for (var i = 1; i<=80; i++) {
          if (document.getElementById('popdiv'+i)) {document.getElementById('popdiv'+i).style.display='none';}
     }
	if (d) {d.style.display='block';}
}


function cite2(id) {
	// On recherche le div qui contient le texte
	var root = document.getElementById(id);
	var commentaire = document.getElementById('commentaire');
	if (!root || !commentaire) return false;
	var list = root.getElementsByTagName('p');
	if (!list.length) return false;
	if (list[1].className != 'vosReactionTexte') return false;
	if (commentaire.value.charAt(commentaire.value.lenght-1) != "\n")
		commentaire.value += "\n";
	commentaire.value += '"'+list[1].innerHTML.replace(/<br[^>]*>/ig, "\n")+'"'+"\n";
	commentaire.focus();
	return true;
}



function outilReseau(id){
	if (document.getElementById(id).className == "visible"){
		document.getElementById(id).className = "invisible";
		var disp = document.getElementById('envoyer_page_message');
		if (disp) disp.style.display = '';
		var hide = document.getElementById('envoyer_page_error');
		if (hide) hide.style.display = 'none';
	}
	else {
		document.getElementById(id).className = "visible";
	}
}


function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
   var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
   if ((version >= 5.5) && (document.body.filters)) 
   {
      for(var i=0; i<document.images.length; i++)
      {
         var img = document.images[i]
         var imgName = img.src.toUpperCase()
         if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
         {
            var imgID = (img.id) ? "id='" + img.id + "' " : ""
            var imgClass = (img.className) ? "class='" + img.className + "' " : ""
            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
            var imgStyle = "display:inline-block;" + img.style.cssText 
            if (img.align == "left") imgStyle = "float:left;" + imgStyle
            if (img.align == "right") imgStyle = "float:right;" + imgStyle
            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
            var strNewHTML = "<span " + imgID + imgClass + imgTitle
            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
            + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
            img.outerHTML = strNewHTML
            i = i-1
         }
      }
   }    
}


function closeTimer(){   //Timer de 5 secondes (5000 milisecondes)
   timeoutID = setTimeout("document.getElementById('envoieArticleReaction').className='invisible'",5000);
}


function closeTimer2(){   //Timer de 5 secondes (5000 milisecondes)
   timeoutID = setTimeout("document.getElementById('envoieArticleReaction2').className='invisible'",5000);
}

function urlencode(str) {

	var reg1 = / & /g;
	var reg2 = / /g;
	
    return (str.replace(reg1, '+').replace(reg2, '+'));
}

// Vérification du mot de passe
function testMotCle(champ, root) {
	if (champ.length == 0) {
		 return;
	}
	else {
		if (champ == 'Saisissez votre recherche') {
			return;
		}
		else {
			document.location.href = root + 'recherche=' + urlencode(champ);
		}
	}
}


//Bloc regions de la colonne de droite
function gotonewpage(what) {
	value = what.options[what.selectedIndex].value;
	if (value == "") return;
	  window.location.href = value;
	}





