//=====================================================

  function buildTable2D(tabName,xmlDoc,id)
      {
	    var html="";
		var htmCell;
		var position = id;
        var htmDiv = document.getElementById('div'+tabName);
        htmDiv.innerHTML = '<table id="'+tabName+'" border="0"  cellpadding="4" cellspacing="0" ></table>';
        var htmTab = document.getElementById(tabName);
        var xmlTag = xmlDoc.getElementsByTagName(xmlDoc.documentElement.tagName).item(0);
       
	    if(xmlTag.childNodes.length>5) htmDiv.setAttribute('style','left:0px; top:25px; position:relative;overflow-y:auto; max-height:454px;');
		else htmDiv.setAttribute('style','left:0px; top:25px; position:relative;');
		
		for (var row=0; row <= xmlTag.childNodes.length; row++)
        {
          var xmlRow = xmlTag.childNodes.item(row);
		  if(xmlRow.childNodes.length > 0)
          {
		     htmRow = htmTab.insertRow(row);
			 htmRow.setAttribute("height","20px");
			 if((row)%2 == 0) {htmRow.setAttribute('bgcolor','#ffffff');}
			 else{ htmRow.setAttribute('bgcolor','#EDF1F4');}
		  	
			for (var col=1; col < xmlRow.childNodes.length; col++)
            {
				htmCell = htmRow.insertCell(parseInt(col/2));
				htmCell.setAttribute('align','center');
				if(col==1)htmCell.setAttribute('width','41%');
				else if(col==2)htmCell.setAttribute('width','17%');
				else if(col==3)htmCell.setAttribute('width','27%');
                var xmlCell = xmlRow.childNodes.item(col);
                htmCell.innerHTML = xmlCell.childNodes.item(0).data;
              
            }
			 var view=xmlRow.childNodes.item(0);
			 htmCell = htmRow.insertCell(3);
			 if(id==1) {
			 htmCell.innerHTML = '<a href="http://www.twassalni.com/detail-trajet-2.php?ID_trajet='+view.childNodes.item(0).data+'"><img src="http://www.twassalni.com/image/loupe.gif" alt="voir en d&eacute;tail " border="0" ></a>'; 
			 }
			 else if(id==0) {
			 htmCell.innerHTML = '<a href="http://www.twassalni.com/detail-trajet.php?ID_trajet='+view.childNodes.item(0).data+'"><img src="http://www.twassalni.com/image/loupe.gif" alt="voir en d&eacute;tail " border="0" ></a>';
			 }
			 htmCell.setAttribute('align','center');
             htmCell.setAttribute('width','15%');
			
			 
          }
        }
		
      }

      //=====================================================

      function buildTable(header) {
        var html="";
		var htmCell;
        var htmDiv = document.getElementById('div'+header);
        htmDiv.innerHTML = '<table id="'+header+'"  width="520" border="0" cellpadding="4" cellspacing="0" ></table>';
        var htmheaderTab = document.getElementById('header');
		htmRow = htmheaderTab.insertRow(0);
		htmRow.setAttribute("class","toprow");
		htmRow.setAttribute("height","25");
		htmCell = htmRow.insertCell(0);
		htmCell.innerHTML="Trajet";
		htmCell.setAttribute('width','41%');
		htmCell = htmRow.insertCell(1);
		htmCell.innerHTML="Type";
		htmCell.setAttribute('width','17%');
		htmCell = htmRow.insertCell(2);
		htmCell.innerHTML="Jours";
		htmCell.setAttribute('width','27%');
		htmCell = htmRow.insertCell(3);
		htmCell.innerHTML="Action";
		htmCell.setAttribute('width','27%');
      }
	  
	  function url1(id) {
        hidden= location.replace("http://www.twassalni.com/detail-trajet.php?ID_trajet="+id);
      }
	  function url2(id) {
        hidden= location.replace("http://www.twassalni.com/detail-trajet-2.php?ID_trajet="+id);
      }

     