// JavaScript Document



   var http_request = false;

   function makeRequest(url, parameters) {

      http_request = false;

      if (window.XMLHttpRequest) { // Mozilla, Safari,...

         http_request = new XMLHttpRequest();

         if (http_request.overrideMimeType) {

            http_request.overrideMimeType('text/xml');

         }

      } else if (window.ActiveXObject) { // IE

         try {

            http_request = new ActiveXObject("Msxml2.XMLHTTP");

         } catch (e) {

            try {

               http_request = new ActiveXObject("Microsoft.XMLHTTP");

            } catch (e) {}

         }

      }

      if (!http_request) {

         alert('Cannot create XMLHTTP instance');

         return false;

      }

      http_request.onreadystatechange = alertContents;

      http_request.open('GET', url + parameters, true);

      http_request.send(null);

   }



   function alertContents() {

   

      if (http_request.readyState == 4) {

         if (http_request.status == 200) {



            var xmldoc = http_request.responseXML;

            

            

            var root = xmldoc.getElementsByTagName('transmissions').item(0);

          

          

            var texto = '';

			

			var ordre = 0;

			var titol = xmldoc.getElementsByTagName('titol');

			var data_ini = xmldoc.getElementsByTagName('data');

			var hora_ini = xmldoc.getElementsByTagName('hora_ini');

			var data_text = xmldoc.getElementsByTagName('data_text');

			var sotstitol = xmldoc.getElementsByTagName('sotstitol');

			texto+='<div class="bgBlanc" style="font-size:12px; color:#000000; padding:10px"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="taulaRankPorra"><caption></caption><tr><th>data</th><th>hora</th><th>títol</th><th></th></tr>';

				

			var fecha = new Date();

			

			for (i=0; i<5; i++) {

				

				

				

				

				ordre = 1 + i;

				

				

				

				

				

					

					

				texto+="<tr>";

				texto+="<td>" + data_text[i].firstChild.nodeValue + "</td>";

				texto+="<td>" + hora_ini[i].firstChild.nodeValue + "</td>";

				texto+="<td>" + titol[i].firstChild.nodeValue + "</td>";

				texto+="<td>" + sotstitol[i].firstChild.nodeValue + "</td>";

				texto+='</tr>';

					

				

				

				

				

					

				

				

				

				

				

				

				}

			texto+='</table><div class="clear"></div></div>';

			var identificador = document.getElementById("sortida");

			identificador.innerHTML = texto;

			

			

			

         }

      }

   }

   function do_xml() {

      makeRequest('programacio.xml', '');

   }

   




