function inicio(){fecha=new Date();FechaHoy=new Date(fecha.getFullYear(),fecha.getMonth()+1,fecha.getDate());FechaFin=new Date(2029,03,12);MSxDia=24*60*60*1000;DiasFaltan=Math.floor((FechaFin.getTime()-FechaHoy.getTime())/MSxDia);if(DiasFaltan>0){if(document.implementation&&document.implementation.createDocument){xmlDoc=document.implementation.createDocument("","",null);xmlDoc.onload=createListHouses;}else if(window.ActiveXObject){xmlDoc=new ActiveXObject("Microsoft.XMLDOM");xmlDoc.onreadystatechange=function(){if(xmlDoc.readyState==4)createListHouses()};}else{alert('Your browser can\'t handle this script');return;};xmlDoc.load("datos.xml");}};function createListHouses(){var x=xmlDoc.getElementsByTagName('promocion');var newEl=document.createElement('DIV');newEl.className='listadoCasas';for(j=0;j<x.length;j++){if(x[j].nodeType!=1)continue;var link=document.createElement('A');link.setAttribute('href','proyectos.html?promocion='+j+'&constructora=BAG&tipo=vivienda%20unifamiliar&categoria=casa%20rural&ubicacion=Grajera%20Segovia');var container=document.createElement('DIV');container.className='casilla';var imagen=document.createElement('IMG');imagen.setAttribute('src',x[j].getAttribute("imagen"));imagen.setAttribute('alt',x[j].getAttribute("nombre"));imagen.setAttribute('title',x[j].getAttribute("nombre")+" (Click para ver oferta)");link.appendChild(imagen);container.appendChild(link);var descripcion=document.createElement('P');var theData=document.createTextNode(x[j].getAttribute("nombre"));descripcion.appendChild(theData);container.appendChild(descripcion);newEl.appendChild(container);};document.getElementById('ofertas').appendChild(newEl);}

