<?xml version="1.0" encoding="UTF-8"?>
<Module>
  <ModulePrefs
  title="Buscador de hoteles - Hotelplease"
  title_url="http://www.hotelplease.com"
  screenshot="http://www.hotelplease.com/_aux_imagenes/screenshotGadgetHP.gif"
  thumbnail="http://www.hotelplease.com/_aux_imagenes/capturaGadgetHP.gif"
  description="El buscador de Hotelplease te ofrece los mejores precios en m&#225;s de 43.000 hoteles en todo el mundo. Filtras los hoteles seg&#250;n tus necesidades y disfruta de total seguridad en tus reservas. &#161;Una herramienta indispensable para todas tus escapadas!"
  author="Hotelplease"
  author_email="reservas@hotelplease.com"
  height="250"
  width="250"/>
  <Content type="html">
    <![CDATA[

<style type="text/css">
<!--
.taula1 {
background-color:#000000;
}
.taula2 {
background-color:#ECEBE8;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}
.camp {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
border:1px solid #333333;
}
.camp2 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
border:1px solid #333333;
width:120px;
}
-->
</style>

<script type="text/javascript">

var by = [2008, 2012, 2016];
var m = [31,28,31,30,31,30,31,31,30,31,30,31];
var ml = ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Setiembre", "Octubre", "Noviembre", "Diciembre"];
var _cd = (new Date()).getDate();
var _cm = (new Date()).getMonth();
var _cy, _ny;
var _defT = 'Introducir ciudad';
_cy = (new Date()).getFullYear();_ny = (new Date()).getFullYear()+1;
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/, ''); };
function $get(id){return document.getElementById(id);}
function ClearDrp(drp){$get(drp).innerHTML='';}
function AddOption(drp, t, v)
{
var opt = document.createElement("OPTION");
opt.value=v;opt.text=t;
//if(!drp){alert(drp);}
drp.options[drp.options.length]=opt;
}
function AddMonth(drp, m, y){AddOption(drp, ml[m]+" "+y, y+"-"+(m+1));}
function Getmy(drp){return [drp.value.split('-')[1]-1, drp.value.split('-')[0]]}
function _init()
{
ClearDrp('CheckInDay');ClearDrp('CheckInMonth');
ClearDrp('CheckOutDay');ClearDrp('CheckOutMonth');
//ldIn(_cm,_cy);
//ldOut(_cm,_cy);
var flag = false;
lm($get('CheckInMonth'));
lm($get('CheckOutMonth'));
$get('CityName').value=_defT;
$get('CheckOutDay').remove(0);
$get('CheckOutDay').selectedIndex=0;
}
function lm(drp,_m,_y)
{
var flag = false;
if(!_m && _m!=0){_m=_cm};if(!_y){_y=_cy};
while(!flag)
{
AddMonth(drp, _m, _y);
if((_m++)==11){_m=0;_y=_ny;}
flag=(_m>_cm && _y==_ny);
}
}
function rmo(){
ClearDrp('CheckOutMonth');
lm($get('CheckOutMonth'), parseInt($get('CheckInMonth').value.split('-')[1])-1, parseInt($get('CheckInMonth').value.split('-')[0]))
ldOut();
}
function SetValue(drp, _v){
for(i=0;i<drp.options.length;i++){
if(drp.options[i].value==_v){
drp.selectedIndex=i;break;
}
}
}
function ldIn(_m,_y)
{
var _sv=0;
var mOffset = 0;

if($get('CheckInDay').selectedIndex>0){_sv=$get('CheckInDay').value;}
ClearDrp('CheckInDay');
if(!_m){_m=parseInt($get('CheckInMonth').value.split('-')[1])-1;}
if(!_y){_y=parseInt($get('CheckInMonth').value.split('-')[0]);}
if(_m==1){for(i=0;i<by.length;i++){if(by[i]==_y){mOffset++;break;}}}
for(i=0;i<m[_m]+mOffset;i++)
if(!(_m==_cm && _y==_cy && i<(_cd)))
AddOption($get('CheckInDay'), i+1, i+1);
SetValue($get('CheckInDay'),_sv);
}
function ldOut(_m,_y)
{
var _sv=0;
var mOffset = 0;
if($get('CheckOutDay').selectedIndex>0){_sv=$get('CheckOutDay').value;}
ClearDrp('CheckOutDay');
if(!_m){_m=parseInt($get('CheckOutMonth').value.split('-')[1])-1;}
if(!_y){_y=parseInt($get('CheckOutMonth').value.split('-')[0]);}
if(_m==1){for(i=0;i<by.length;i++){if(by[i]==_y){mOffset++;break;}}}
for(i=0;i<m[_m]+mOffset;i++)
if(!(_m==_cm && _y==_cy && i<(_cd+1)))
AddOption($get('CheckOutDay'), i+1, i+1);
SetValue($get('CheckOutDay'),_sv);
}
function jsEncode(str)
{
var div = document.createElement('div');
var text = document.createTextNode(str);
div.appendChild(text);
return div.innerHTML;
}
function Validate()
{
var ok=true;
try{
var _msg='';
var _city = $get('CityName').value;
var _nr = parseInt($get('dRooms').value)+parseInt($get('sRooms').value);
var _cIn = new Date(parseInt($get('CheckInMonth').value.split('-')[0]), parseInt($get('CheckInMonth').value.split('-')[1])-1, $get('CheckInDay').value);
var _cOut = new Date(parseInt($get('CheckOutMonth').value.split('-')[0]), parseInt($get('CheckOutMonth').value.split('-')[1])-1, $get('CheckOutDay').value);
var _count = Math.ceil((_cOut.getTime()-_cIn.getTime())/(1000*60*60*24));
if(_nr==0){_msg+='Debe seleccionar al menos una habitacion\n';ok=false;}
if(_nr>3){_msg+='El total de habitaciones no puede ser superior a 3.\n';ok=false;}
if(_count>15){_msg+='La estancia m&#65533;xima es de 15 d&#65533;as.\n';ok=false;}
if(_count<=0){_msg+='La fecha de salida tiene que ser posterior a la de entrada.\n';ok=false;}
if(_city.trim().length==0 || _city.trim()==_defT){_msg+='Introduzca una ciudad de destino';ok=false;}
if(!ok){alert(_msg);}
}
catch(e){}
return ok;
}

</script>

<form method="post" action="http://www.hotelplease.com/tdredirect.aspx?utm_source=igoogle&utm_medium=buscador&utm_campaign=lanzamiento" target="_blank">

<table width="250" height="250" border="0" cellpadding="1" cellspacing="0" bgcolor="#0678C2" class="taula1" align='center'>
<tr>
<td valign="top"><div align="center"><img src="http://www.hotelplease.com/_aux_imagenes/buscador.gif" /></div></td>
</tr>
<tr>
<td valign="top"><table width="248" height="209" align="center" cellpadding="5" cellspacing="0" bgcolor="#FFFFFF" class="taula2">
<tbody>
<tr>
<td width="59">&nbsp;&nbsp;Destino:</td>
<td width="172"><input name="CityName" class="camp" id="CityName" onclick="this.value=''" value="" size="25" /> </td>
</tr>
<tr>
<td> &nbsp;&nbsp;Entrada: </td>
<td><select name="CheckInDay" class="camp" id="CheckInDay" >
<option></option>
</select>
<select name="CheckInMonth" class="camp2" id="CheckInMonth" onchange="ldIn();rmo();" >
<option></option>
</select> </td>
</tr>
<tr>
<td> &nbsp;&nbsp;Salida:</td>
<td><select name="CheckOutDay" class="camp" id="CheckOutDay" >
<option></option>
</select>
<select name="CheckOutMonth" class="camp2" id="CheckOutMonth" onchange="ldOut();" >
<option></option>
</select> </td>
</tr>
<tr>
<td colspan="2"> &nbsp;&nbsp;Habitaciones
dobles:
<select name="dRooms" class="camp" id="dRooms">
<option value="0">0</option>
<option value="1" selected="selected">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select> </td>
</tr>
<tr>
<td colspan="2"> &nbsp;&nbsp;Habitaciones individuales:
<select name="sRooms" class="camp" id="sRooms">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<input id="hLanguage" name="hLanguage" type="hidden" value="SPA" /> </td>
</tr>
<tr>
<td colspan="2">
<div align="center">
<input type="image" src="http://www.hotelplease.com/_aux_imagenes/boto_buscador.gif" width="62" height="21" />
</div></td>
</tr>
<tr>
<td colspan="2" bgcolor="#FFFFFF"><div align="center"><img src="http://www.hotelplease.com/_aux_imagenes/logogris.gif" /></div></td>
</tr>
</tbody>
</table></td>
</tr>
</</form>
<script type="text/javascript">
_init();
ldIn();rmo();ldOut();
</script>
]]>
  </Content>
</Module>
