var onblur_def = new Array();










function hideElem(elem_div,elem,n_class) // cache les elemnts enfants de l'element passé en param
{
	
	var whichCell = 0;
	tds = document.getElementById(elem_div).getElementsByTagName(elem);
	while (tds[whichCell])
	{ 	
		if(arguments.length == 3) 
		{
			if(tds[whichCell].className == n_class)
			{
				tds[whichCell].style.display = "none";
			}
		} else {
			tds[whichCell].style.display = "none";
		}
		whichCell++;
	}	
}

function showHide(elem) 
{
	if (document.getElementById(elem).style.display == "none")
	{
		document.getElementById(elem).style.display = "";
		} else {
		document.getElementById(elem).style.display = "none";
	}
}

var mem_elem = 0;
function showElem(elem) // cache un div et masque le precedent
{
	if(elem != mem_elem) {	
		document.getElementById(elem).style.display = "";
		if(mem_elem !=0) document.getElementById(mem_elem).style.display = "none";
		mem_elem = elem;
	} 
}


function doToc(elem_div, elem_class) // construit le menu de la fiche produit et destination
{
	
	var whichCell = 0;
	tds = document.getElementById(elem_div).getElementsByTagName('div');
//	document.getElementById('menu_fiche').innerHTML
	while (tds[whichCell])
	{ 
		if (tds[whichCell].className == elem_class) 
		{ 
			tds[whichCell].style.display = "none";
			behavior = '<a href="Javascript:;" onclick=showElem("'+ tds[whichCell].id +'",this.id); class="test" id="'+[whichCell]+'">';
			document.getElementById('menu_fiche').innerHTML += behavior + tds[whichCell].id + "</a><br />";
		}
		whichCell++;
	}
	
}

function getHttpObject() {
  var xmlhttp;
  /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}

function OpenPopup() {
    var xmlhttp = getHttpObject() ;
    xmlhttp.open("GET", "openpopup.php");
    xmlhttp.onreadystatechange = function() {
        if(xmlhttp.readyState == 4 && xmlhttp.responseText != "") {
            eval(xmlhttp.responseText);
        }
    }
    xmlhttp.send(null) ;
}
