function nuevoAjax(){
 var xmlhttp=false;
  try {
   xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
   try {
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
   } catch (E) {
    xmlhttp = false;
   }
   }
 
 if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
   xmlhttp = new XMLHttpRequest();
 }
 return xmlhttp;
}
 
 
function showTickets(idioma){

var fecha_inicio;
fecha_inicio="08/05/2009"

   var contenedor;
   contenedor = document.getElementById('disponibilidad');
  contenedor.innerHTML = '<p><img src="../../ROL4.0/img/ajax-loader.gif"></p>';
  ajax=nuevoAjax();
  ajax.open("POST","/ROL4.0/Dispo_serveis.aspx",true);
  
  ajax.onreadystatechange=function() {
   if (ajax.readyState==4 ) {
   contenedor.innerHTML = ajax.responseText;
    }
  }
  ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  ajax.send("idioma=" + idioma + "&idServei=8842&fecha_inicio="+fecha_inicio);
}


function calcula_linea_serv(item,numero,linea,book)
{

var total=0;
var amount=document.getElementById("precio"+item+"_"+linea).value;
var total_desa=0;
var capacidad_total;
var habitaciones=0;
amount=amount.replace(",",".")
amount=amount*numero.value;
capacidad_total=0;
habitaciones=0;
document.getElementById("precio" + item + "_linea_"+linea).value= amount

for(i=1;i<document.getElementById("habitaciones_"+item).value;i++)
  {
  total=total+parseFloat(document.getElementById("precio" + item + "_linea_"+i).value);
  /*   if((document.getElementById(item + "_"+i).value!="") && (document.getElementById(item + "_"+i).value>0))
       {total_desa=parseFloat(document.getElementById("X_desa_" + item + "_"+i).value)*parseInt(document.getElementById(item + "_"+i).value)+total_desa
       capacidad_total=capacidad_total+(parseFloat(document.getElementById("capacidad_" + item + "_"+i).value)*parseInt(document.getElementById(item + "_"+i).value));
       }*/
  }

document.getElementById("total_"+item).innerHTML=total + book
document.getElementById("total_"+item+"_iva").innerHTML=((total) + book).toFixed(2)
}


document.write ('<div id="detalle_div" style="display:none;position:absolute;border-style: solid;background-color: white;padding: 5px;width:400px;overflow:auto;">')
document.write ('    <div align="right"><b><a href="javascript:;" onclick="document.getElementById(\'detalle_div\').style.display=\'none\';">x</a></b></div>')
document.write ('    <iframe src="" id="frame_detalle" width="400" frameborder="0"></iframe>')
document.write ('</div>')


function activa(boton,lineas)
{

var correct;
correct=0;
document.forms["form1"].action="https://www.barcelona-on-line.es/ROL4.0/p3.aspx"

document.getElementById("reserva_txt").value=""
//document.getElementById("boton_select").value=boton;



for(i=1;i<lineas;i++)
{
var cant;
if (document.getElementById(""+boton+"_"+i).value=="")
  cant=0
  else
  cant=document.getElementById(""+boton+"_"+i).value;

document.getElementById("reserva_txt").value=document.getElementById("reserva_txt").value + document.getElementById("linea"+boton+"_"+i).value + "." + cant + "|"
if (correct==0)
    correct=document.getElementById(boton+"_"+i).selectedIndex;
}

if(correct==0)
    {
         for(i=1;i<lineas;i++)
         document.getElementById("td_combo_"+i).style.backgroundColor="#ff0000"
        return false;
    }
	
	
}


