<?
require 'CONFIG_START.php';
?>


<DIV ID="slowScreenSplash" STYLE="position:absolute;top:50%;left:-10%">
<table width="100%" height="100%" border="0">
<tr>
<td width="100%" align='center' clas='text_objects'>
<b><big>Calculando tarifas</big></b>
<br>Para todas as viaturas disponíveis<br><br>
<img src='../assets/images/waiting.gif' alt='' /><br>
Por favor aguarde
</td>
</tr>
</table>
</DIV>
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Bravacar - Rent a Car em Portugal, Lisboa, Porto, Algarve e Madeira</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META NAME="Abstract" CONTENT="Bravacar automoveis de aluguer em Lisboa, Porto , Faro e Funchal. Rent a car.">
<META NAME="Copyright" CONTENT="Bravacar 2006">
<META NAME="Description" CONTENT="Bravacar - Reserve o veículo para as suas férias em Portugal na Madeira , Lisboa, Algarve ou Porto. Fácil confirmação com emissão de voucher. Tudo incluído. O serviço de qualidade que você procura numa rent a car.">
<META NAME="Generator" CONTENT="Storm Content Publishing Engine v4.1.00.0021">
<META NAME="Keywords" CONTENT="rent a car,car rentals portugal,bravacar, car rental in madeira, rent a car in lisbon, rent a car in oporto, porto car rental, lisbon car rental, faro car rental, algarve rent a car, bravacar rent a car, rent, car, rent a car, car rental, rental, car rentals, rentals, holiday rentals, cheap rent a car, cheap car rental, cheap rental, cheap car rentals, cheap rentals, cheap holiday rentals, portugal rent a car, portugal car rental,madeira car rental,algarve car rental,lisbon car rental,porto car rental
low cost car rentals, low,cost,portugal,car,rental,lowcostportugalcarrentals,car rentals,Aluguer Automóveis,Autovermieting,Location de Voiture,Autoverhuur,Biluthyrning">
<META NAME="Language" CONTENT="pt">
<META NAME="revisit-after" CONTENT="2 days">
<META NAME="Robots" CONTENT="follow">
<link rel="stylesheet" href="../assets/clases.css" type="text/css" />
<script language="javascript" src="../assets/pop_up_car.js"></script>

<script language="javascript" src="../assets/cal3.js"></script>
<script language="javascript" src="../assets/cal_conf3.js"></script>
<script language="javascript" src="../assets/car_func.js"></script>
<script language="javascript" src="../assets/rodape_pt.js"></script>

<meta name="robots" content="index,follow" />
<meta name="googlebot" content="index,follow" />
<LINK REL="STYLESHEET" TYPE="text/css" HREF="../html/style.css">
<LINK REL="STYLESHEET" TYPE="text/css" HREF="../html/site.css">
<STYLE TYPE="text/css" TITLE="NOF_STYLE_SHEET">
<!--
DIV#LayoutRegionLYR {	position:relative; visibility:inherit; background-color: #D5DEEE; 	top:0; left:0; width:560; height:207;	z-index:1;	}
DIV#Table72LYR	{ position:absolute;	visibility:inherit;	top:40;	left:9; width:540; height:45; z-index:1 }
DIV#Table73LYR	{ position:absolute;	visibility:inherit;	top:90;	left:9; width:540; height:45; z-index:2 }
DIV#Table71LYR	{ position:absolute;	visibility:inherit;	top:149;	left:0; width:560; height:58; z-index:3 }
-->
</STYLE>

</HEAD>
<BODY STYLE="text-align: center; background-color: rgb(255,255,255); background-image: none; margin: 0px;">
    <DIV ALIGN="CENTER">
    <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
        <TR>
            <TD>
                <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="780">
                    <TR VALIGN="TOP" ALIGN="LEFT">
                        <TD HEIGHT="21" WIDTH="780">
                            <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="780" STYLE="background-color: rgb(40,49,79); height: 21;">
                                <TR ALIGN="LEFT" VALIGN="TOP">
                                    <TD>
                                        <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="777">
                                            <TR VALIGN="TOP" ALIGN="LEFT">
                                                <TD>
                                                    <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="594">
                                                        <TR VALIGN="TOP" ALIGN="LEFT">
                                                            <TD WIDTH="522" HEIGHT="6"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="522" HEIGHT="1" BORDER="0" ALT=""></TD>
                                                            <TD></TD>
                                                            <TD WIDTH="12"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="12" HEIGHT="1" BORDER="0" ALT=""></TD>
                                                            <TD></TD>
                                                            <TD WIDTH="12"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="12" HEIGHT="1" BORDER="0" ALT=""></TD>
                                                            <TD></TD>
                                                        </TR>
                                                        <TR VALIGN="TOP" ALIGN="LEFT">
                                                            <TD HEIGHT="11"></TD>
                                                            <TD WIDTH="16"><IMG ID="Picture364" HEIGHT="11" WIDTH="16" SRC="../assets/images/pt.gif" BORDER="0" ALT="pt" TITLE="pt"></TD>
                                                            <TD></TD>
                                                            <TD WIDTH="16"><IMG ID="Picture365" HEIGHT="11" WIDTH="16" SRC="../assets/images/gb.gif" BORDER="0" ALT="gb" TITLE="gb"></TD>
                                                            <TD></TD>
                                                            <TD WIDTH="16"><IMG ID="Picture366" HEIGHT="11" WIDTH="16" SRC="../assets/images/de.gif" BORDER="0" ALT="de" TITLE="de"></TD>
                                                        </TR>
                                                    </TABLE>
                                                </TD>
                                                <TD>
                                                    <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
                                                        <TR VALIGN="TOP" ALIGN="LEFT">
                                                            <TD WIDTH="6" HEIGHT="7"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="6" HEIGHT="1" BORDER="0" ALT=""></TD>
                                                            <TD></TD>
                                                        </TR>
                                                        <TR VALIGN="TOP" ALIGN="LEFT">
                                                            <TD></TD>
                                                            <TD WIDTH="177">
                                                                <TABLE ID="Table86" BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="100%" STYLE="height: 8;" class="table_netrent">
                                                                    <TR STYLE="height:12px">
                                                                        <TD WIDTH="177">
                                                                            <P><B><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif;"><SPAN STYLE="color: rgb(255,0,0);"><SPAN STYLE="font-size: xx-small;">Português</SPAN></SPAN><SPAN STYLE="font-size: xx-small; color: rgb(255,255,255);"> | <A HREF="../english/index.php">English</A> | <A HREF="../deutsch/index.php">Deutsch</A></SPAN></SPAN></B></P>
                                                                        </TD>
                                                                    </TR>
                                                                </TABLE>
                                                            </TD>
                                                        </TR>
                                                    </TABLE>
                                                </TD>
                                            </TR>
                                        </TABLE>
                                    </TD>
                                </TR>
                            </TABLE>
                        </TD>
                    </TR>
                </TABLE>
                <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="780">
                    <TR VALIGN="TOP" ALIGN="LEFT">
                        <TD HEIGHT="48" WIDTH="780"><IMG ID="Picture357" HEIGHT="48" WIDTH="780" SRC="../assets/images/BRAVACAR_01.gif" BORDER="0" ALT="BRAVACAR_01" TITLE="BRAVACAR_01"></TD>
                    </TR>
                </TABLE>
                <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="780">
                    <TR VALIGN="TOP" ALIGN="LEFT">
                        <TD HEIGHT="159" WIDTH="780"><IMG ID="Picture358" HEIGHT="159" WIDTH="780" SRC="../assets/images/BRAVACAR_0202.jpg" BORDER="0" ALT=""></TD>
                    </TR>
                </TABLE>
                <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="780">
                    <TR VALIGN="TOP" ALIGN="LEFT">
                        <TD HEIGHT="7" WIDTH="780"><IMG ID="Picture359" HEIGHT="7" WIDTH="780" SRC="../assets/images/linha01.jpg" BORDER="0" ALT=""></TD>
                    </TR>
                </TABLE>
                <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="780">
                    <TR VALIGN="TOP" ALIGN="LEFT">
                        <TD>
                            <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="159">
                                <TR VALIGN="TOP" ALIGN="LEFT">
                                    <TD WIDTH="25" CLASS="TextObject">
                                        <P><script language="javascript" src="../assets/menu_bravacar_pt.js"></script>&nbsp;</P>
                                    </TD>
                                    <TD WIDTH="134"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="134" HEIGHT="1" BORDER="0" ALT=""></TD>
                                </TR>
                                <TR VALIGN="TOP" ALIGN="LEFT">
                                    <TD COLSPAN="2" HEIGHT="86"></TD>
                                </TR>
                                <TR VALIGN="TOP" ALIGN="LEFT">
                                    <TD HEIGHT="46" COLSPAN="2" WIDTH="159"><IMG ID="Picture360" HEIGHT="46" WIDTH="159" SRC="../assets/images/autogen/a_botao-estatico.gif" BORDER="0" ALT="Reservas" TITLE="Reservas"></TD>
                                </TR>
                                <TR VALIGN="TOP" ALIGN="LEFT">
                                    <TD HEIGHT="259" COLSPAN="2" WIDTH="159">
                                        <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="159" STYLE="background-color: rgb(225,221,221); background-image: url('../assets/images/12interuiior.jpg'); height: 259;">
                                            <TR ALIGN="LEFT" VALIGN="TOP">
                                                <TD>&nbsp;</TD>
                                            </TR>
                                        </TABLE>
                                    </TD>
                                </TR>
                            </TABLE>
                        </TD>
                        <TD>
                            <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="29">
                                <TR VALIGN="TOP" ALIGN="LEFT">
                                    <TD WIDTH="29" HEIGHT="158"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="29" HEIGHT="1" BORDER="0" ALT=""></TD>
                                </TR>
                            </TABLE>
                        </TD>
                        <TD>
                            <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="471">
                                <TR VALIGN="TOP" ALIGN="LEFT">
                                    <TD WIDTH="1" HEIGHT="72"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="1" HEIGHT="1" BORDER="0" ALT=""></TD>
                                    <TD WIDTH="470"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="470" HEIGHT="1" BORDER="0" ALT=""></TD>
                                </TR>
                                <TR VALIGN="TOP" ALIGN="LEFT">
                                    <TD></TD>
                                    <TD WIDTH="470" CLASS="TextObject">
                                        <P><?
	include('main.php');
       include('car_functions.php');
	db_connect();       
       
       $cod_regiao = 0;
	if ($_SERVER['REQUEST_METHOD'] == "GET" and isset($_GET['car_destination'])) 
       {          
          $cod_regiao     = $_GET['car_destination'];

          $data_in        = $_GET['car_data_up'];
          $data_out       = $_GET['car_data_off'];         

          $data_inicio    = $_GET['car_data_up'];
          $data_fim       = $_GET['car_data_off'];

          $hour_in        = $_GET['car_hour_up'];
          $hour_out       = $_GET['car_hour_off'];
          
          $min_in         = $_GET['car_min_up'];
          $min_out        = $_GET['car_min_off'];          
          
          $car_class      = $_GET['car_class'];
          $car_pickup_loc = $_GET['car_pickup_loc'];

          $vDY1           = $data_in;
          $vDY7           = $data_out;
          
          $erro = "";
                  
	   if ($cod_regiao==0)
              $erro = $erro."Por favor escolha um destino<br>";

	   if ($car_pickup_loc==0)
              $erro = $erro."Por favor escolha um local de entrega<br>";

	   if ($data_in =="")
              $erro = $erro."Por favor escolha uma data de entrega<br>";

          if ($data_in !="" and !(IsDate($data_in)))
              $erro = $erro."Por favor escolha uma data de entrega válida<br>";

	   if ($data_out =="")
              $erro = $erro."Por favor escolha uma data de recolha<br>";

          if ($data_out !="" and !(IsDate($data_out)))
              $erro = $erro."Por favor escolha uma data de recolha válida<br>";

          if (IsDate($data_in) and IsDate($data_out))
          {
             $data_hora_inicio = $data_in.' '.$hour_in.':'.$min_in;
             $data_hora_fim    = $data_out.' '.$hour_out.':'.$min_out;

             $data_in  = FormatarDataHora($data_in,$hour_in,$min_in);
             $data_out = FormatarDataHora($data_out,$hour_out,$min_out);             

             $data_hoje  = getDate();
             $data_today = date("Y-m-d H:i:s", mktime($data_hoje['hours'],$data_hoje['minutes'],0,$data_hoje['mon'],$data_hoje['mday'],$data_hoje['year'])); 

             $nro_dias = diff_days($data_today,$data_in);   
             // if ($nro_dias < 0)
             //   $erro = $erro."A data de entrega deve ser como mínimo a data de hoje<br>";

             if ($nro_dias <= 0)
                $erro = $erro."O aluguer só pode ser efectuado 24 horas a partir da data de hoje<br>";

             $data_out_ant = strtotime($data_out)- 7200;
             $data_out_ant = date("Y-m-d H:i:s", $data_out_ant);         

             $nro_dias = diff_days($data_in,$data_out_ant);                
             if ($nro_dias < 0)
                $erro = $erro."A data de recolha deve ser como mínimo 2 horas posteriores a data de entrega<br>";
             
             $nro_dias = diff_days($data_in,$data_out);
             $hora_tol = (fmod((strtotime($data_out) - strtotime($data_in)),86400)/3600);
             
          }  
     }

?>
&nbsp;</P>
                                    </TD>
                                </TR>
                            </TABLE>
                            <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
                                <TR VALIGN="TOP" ALIGN="LEFT">
                                    <TD WIDTH="1" HEIGHT="14"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="1" HEIGHT="1" BORDER="0" ALT=""></TD>
                                    <TD></TD>
                                </TR>
                                <TR VALIGN="TOP" ALIGN="LEFT">
                                    <TD></TD>
                                    <TD WIDTH="560">
                                        <TABLE ID="Table70" BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="100%" STYLE="background-color: rgb(208,25,32); border-left-color:  rgb(255,255,255); border-top-color:  rgb(255,255,255); border-right-color:  rgb(255,255,255); border-bottom-color:  rgb(255,255,255); height: 37;">
                                            <TR VALIGN="MIDDLE" STYLE="height:37px">
                                                <TD VALIGN="MIDDLE" WIDTH="560">
                                                    <P><SPAN STYLE="font-size: x-large; color: rgb(0,102,153);">&nbsp;<SPAN STYLE="color: rgb(255,255,255);">.............................................</SPAN></SPAN></P>
                                                </TD>
                                            </TR>
                                        </TABLE>
                                    </TD>
                                </TR>
                            </TABLE>
                            <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
                                <TR VALIGN="TOP" ALIGN="LEFT">
                                    <TD WIDTH="1" HEIGHT="1"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="1" HEIGHT="1" BORDER="0" ALT=""></TD>
                                    <TD></TD>
                                </TR>
                                <TR VALIGN="TOP" ALIGN="LEFT">
                                    <TD HEIGHT="22"></TD>
                                    <TD ROWSPAN="2" WIDTH="560">
                                        <TABLE ID="Table84" BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="100%" STYLE="height: 138;">
                                            <TR STYLE="height:138px">
                                                <TD WIDTH="560" STYLE="background-image: url('../assets/images/30megane.jpg');">
                                                    <P>&nbsp;</P>
                                                </TD>
                                            </TR>
                                        </TABLE>
                                    </TD>
                                </TR>
                                <TR VALIGN="TOP" ALIGN="LEFT">
                                    <TD WIDTH="0"><IMG ID="Rectangle1" HEIGHT="0" WIDTH="0" BORDER="0" ALT=""></TD>
                                </TR>
                            </TABLE>
                            <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="561">
                                <TR VALIGN="TOP" ALIGN="LEFT">
                                    <TD WIDTH="1" HEIGHT="207"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="1" HEIGHT="1" BORDER="0" ALT=""></TD>
                                    <TD WIDTH="560"><DIV ID="LayoutRegionLYR">
                                        <FORM NAME="LayoutRegion3FORM" ACTION="rentacar.php" method="GET">
                                            <INPUT type=hidden NAME="registos" VALUE=""><DIV ID="Table72LYR" STYLE="visibility:inherit;top:40px;left:9px;z-index:1;width:540;height:45">
                                            <TABLE ID="Table72" BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="100%" STYLE="height: 45;">
                                                <TR STYLE="height:18px">
                                                    <TD WIDTH="214">
                                                        <P>&nbsp;<SPAN STYLE="font-family: Arial,Helvetica,Geneva,Sans-serif; font-size: 11px;">Destino:&nbsp;&nbsp;<?
function ConvertToJSArray2D($PArray , $ArrayName, $filas)
{
   $Row = $filas;
   $Col = 3;

   ?>
   <SCRIPT LANGUAGE = 'JAVASCRIPT' >
      <?=$ArrayName?> = new Array(<?=$Row?>);
      for (i=0; i < <?=$Row?>; i++) 
      { 
      <?=$ArrayName?>[i] = new Array(<?=$Col?>);
      for (j=0; j < <?=$Col?>; j++) 
          <?=$ArrayName?>[i][j] = " ";
      }
      
   <? 
      for ($i=0;$i<$Row;$i++) 
      {
          for ($j=0;$j<$Col;$j++) 
          {
	       $str = $PArray[$i][$j];
              ?> 
	       <?=$ArrayName?>[<?=$i?>][<?=$j?>] = "<?=$str?>"
          <?
          }
      }
   ?> 
   document.LayoutRegion3FORM.registos.value = <?=$Row?>;
   </SCRIPT>

   <?

}


$sql = "SELECT a.cod_regiao, a.cod_localidade, b.descricao_pt ";
$sql = $sql." FROM tr_rentacar_escritorios a, tr_rentacar_localidades b, tr_rentacar c ";
$sql = $sql." WHERE a.cod_localidade = b.cod_localidade ";
$sql = $sql." and a.cod_rentacar = c.cod_rentacar ";
$sql = $sql." and a.entrega = 1 ";
$sql = $sql." and c.activo = 1 ";
$sql = $sql." GROUP BY a.cod_regiao, a.cod_localidade, b.descricao_pt ";
$sql = $sql." ORDER BY b.descricao ";
  
$result = mysql_query($sql) or die("select fails");      
$filas  = mysql_num_rows($result);   

$i = 0;	

while ($row = mysql_fetch_row($result))
{     
   $tabela_loc[$i][0] = $row[0];
   $tabela_loc[$i][1] = $row[1];
   $tabela_loc[$i][2] = $row[2];
   $i = $i + 1;
}  

if ($filas >0)
{
    ConvertToJSArray2D($tabela_loc, 'tb_loc', $filas);
}

?>
</SPAN></P>
                                                    </TD>
                                                    <TD WIDTH="191">
                                                        <P>&nbsp;<SPAN STYLE="font-family: Arial,Helvetica,Geneva,Sans-serif; font-size: 11px;">Local de entrega:</SPAN></P>
                                                    </TD>
                                                    <TD WIDTH="135">
                                                        <P><SPAN STYLE="font-size: 11px;">&nbsp;Categoria do carro:</SPAN></P>
                                                    </TD>
                                                </TR>
                                                <TR STYLE="height:27px">
                                                    <TD>
                                                        <P>&nbsp;
                                                            <SELECT ID="ID_car_destination" NAME="car_destination" style="width:180px" class="text_objects" onChange="change_pick_up(document.LayoutRegion3FORM.car_destination.value,document.LayoutRegion3FORM.registos.value)"
>
                                                                <OPTION VALUE="0" SELECTED>Selecione um destino</OPTION>
                                                                <OPTION VALUE="3">Faro - Algarve</OPTION>
                                                                <OPTION VALUE="5">Lisboa</OPTION>
                                                                <OPTION VALUE="6">Madeira</OPTION>
                                                                <OPTION VALUE="8">Porto</OPTION>
                                                            </SELECT>
                                                             </P>
                                                    </TD>
                                                    <TD>
                                                        <P>
                                                            <SELECT ID="ID_car_pickup_loc" NAME="car_pickup_loc" style="width:180px" class="text_objects">
                                                                <OPTION VALUE="0" SELECTED>Selecione um local</OPTION>
                                                            </SELECT>
                                                        </P>
                                                    </TD>
                                                    <TD>
                                                        <P>
                                                            <SELECT ID="ID_car_class" NAME="car_class" style="width:130px" class="text_objects">
                                                                <OPTION VALUE="0" SELECTED>Sem preferência</OPTION>
                                                                <OPTION VALUE="1">Económico</OPTION>
                                                                <OPTION VALUE="2">Compacto</OPTION>
                                                                <OPTION VALUE="3">Intermédio</OPTION>
                                                            </SELECT>
                                                        </P>
                                                    </TD>
                                                </TR>
                                            </TABLE>
                                            </DIV><DIV ID="Table73LYR" STYLE="visibility:inherit;top:90px;left:9px;z-index:2;width:540;height:45">
                                            <TABLE ID="Table73" BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="100%" STYLE="height: 45;">
                                                <TR STYLE="height:18px">
                                                    <TD WIDTH="209">
                                                        <P>&nbsp; <SPAN STYLE="font-size: 11px;">Data de entrega:</SPAN></P>
                                                    </TD>
                                                    <TD WIDTH="331">
                                                        <P>&nbsp;<SPAN STYLE="font-size: 11px;">Data de recolha:</SPAN></P>
                                                    </TD>
                                                </TR>
                                                <TR STYLE="height:27px">
                                                    <TD>
                                                        <P><SPAN STYLE="font-size: 11px;">&nbsp; <INPUT ID="ID_car_data_up" TYPE="TEXT" NAME="car_data_up" STYLE="white-space: pre;" VALUE="<?=$vDY1?>" SIZE="9" MAXLENGTH="10" class="text_objects"> <A HREF="javascript:showCal('Calendar3')" TARGET="_self"><IMG ID="Picture192" HEIGHT="18" WIDTH="19" SRC="../assets/images/cal06.gif" VSPACE="0" HSPACE="0" ALIGN="TOP" BORDER="0" ALT=""></A>&nbsp; 
                                                            <SELECT ID="ID_car_hour_up" NAME="car_hour_up" style="width:40px" class="text_objects">
                                                                <OPTION VALUE="00">00</OPTION>
                                                                <OPTION VALUE="01">01</OPTION>
                                                                <OPTION VALUE="02">02</OPTION>
                                                                <OPTION VALUE="03">03</OPTION>
                                                                <OPTION VALUE="04">04</OPTION>
                                                                <OPTION VALUE="05">05</OPTION>
                                                                <OPTION VALUE="06">06</OPTION>
                                                                <OPTION VALUE="07">07</OPTION>
                                                                <OPTION VALUE="08">08</OPTION>
                                                                <OPTION VALUE="09" SELECTED>09</OPTION>
                                                                <OPTION VALUE="10">10</OPTION>
                                                                <OPTION VALUE="11">11</OPTION>
                                                                <OPTION VALUE="12">12</OPTION>
                                                                <OPTION VALUE="13">13</OPTION>
                                                                <OPTION VALUE="14">14</OPTION>
                                                                <OPTION VALUE="15">15</OPTION>
                                                                <OPTION VALUE="16">16</OPTION>
                                                                <OPTION VALUE="17">17</OPTION>
                                                                <OPTION VALUE="18">18</OPTION>
                                                                <OPTION VALUE="19">19</OPTION>
                                                                <OPTION VALUE="20">20</OPTION>
                                                                <OPTION VALUE="21">21</OPTION>
                                                                <OPTION VALUE="22">22</OPTION>
                                                                <OPTION VALUE="23">23</OPTION>
                                                            </SELECT>
                                                             
                                                            <SELECT ID="ID_car_min_up" NAME="car_min_up" style="width:40px" class="text_objects">
                                                                <OPTION VALUE="00" SELECTED>00</OPTION>
                                                                <OPTION VALUE="15">15</OPTION>
                                                                <OPTION VALUE="30">30</OPTION>
                                                                <OPTION VALUE="45">45</OPTION>
                                                            </SELECT>
                                                            </SPAN></P>
                                                    </TD>
                                                    <TD>
                                                        <P><SPAN STYLE="font-size: 11px;">&nbsp;<INPUT ID="FormsEditField27" TYPE="TEXT" NAME="car_data_off" STYLE="white-space: pre;" VALUE="<?=$vDY7?>" SIZE="9" MAXLENGTH="10" class="text_objects"> <A HREF="javascript:showCal('Calendar4')" TARGET="_self"><IMG ID="Picture194" HEIGHT="18" WIDTH="19" SRC="../assets/images/cal06.gif" VSPACE="0" HSPACE="0" ALIGN="TOP" BORDER="0" ALT=""></A>&nbsp; 
                                                            <SELECT ID="ID_car_hour_off" NAME="car_hour_off" style="width:40px" class="text_objects">
                                                                <OPTION VALUE="00">00</OPTION>
                                                                <OPTION VALUE="01">01</OPTION>
                                                                <OPTION VALUE="02">02</OPTION>
                                                                <OPTION VALUE="03">03</OPTION>
                                                                <OPTION VALUE="04">04</OPTION>
                                                                <OPTION VALUE="05">05</OPTION>
                                                                <OPTION VALUE="06">06</OPTION>
                                                                <OPTION VALUE="07">07</OPTION>
                                                                <OPTION VALUE="08">08</OPTION>
                                                                <OPTION VALUE="09" SELECTED>09</OPTION>
                                                                <OPTION VALUE="10">10</OPTION>
                                                                <OPTION VALUE="11">11</OPTION>
                                                                <OPTION VALUE="12">12</OPTION>
                                                                <OPTION VALUE="13">13</OPTION>
                                                                <OPTION VALUE="14">14</OPTION>
                                                                <OPTION VALUE="15">15</OPTION>
                                                                <OPTION VALUE="16">16</OPTION>
                                                                <OPTION VALUE="17">17</OPTION>
                                                                <OPTION VALUE="18">18</OPTION>
                                                                <OPTION VALUE="19">19</OPTION>
                                                                <OPTION VALUE="20">20</OPTION>
                                                                <OPTION VALUE="21">21</OPTION>
                                                                <OPTION VALUE="22">22</OPTION>
                                                                <OPTION VALUE="23">23</OPTION>
                                                            </SELECT>
                                                             
                                                            <SELECT ID="ID_car_min_off" NAME="car_min_off" style="width:40px" class="text_objects">
                                                                <OPTION VALUE="00" SELECTED>00</OPTION>
                                                                <OPTION VALUE="15">15</OPTION>
                                                                <OPTION VALUE="30">30</OPTION>
                                                                <OPTION VALUE="45">45</OPTION>
                                                            </SELECT>
                                                            </SPAN></P>
                                                    </TD>
                                                </TR>
                                            </TABLE>
                                            </DIV><DIV ID="Table71LYR" STYLE="background-color: rgb(255,255,255); border-left-color:  rgb(255,255,255); border-top-color:  rgb(255,255,255); border-right-color:  rgb(255,255,255); border-bottom-color:  rgb(255,255,255); z-index: 3; visibility: inherit; left: 0; top: 149;">
                                            <TABLE ID="Table71" BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="100%" STYLE="background-color: rgb(255,255,255); border-left-color:  rgb(255,255,255); border-top-color:  rgb(255,255,255); border-right-color:  rgb(255,255,255); border-bottom-color:  rgb(255,255,255); z-index: 3; visibility: inherit; left: 0; height: 58; top: 149;">
                                                <TR VALIGN="MIDDLE" ALIGN="CENTER" STYLE="height:40px">
                                                    <TD ALIGN="RIGHT" WIDTH="560">
                                                        <P STYLE="text-align: center;"><SPAN STYLE="font-family: Tahoma,Verdana,Arial,Helvetica,Sans-serif; font-size: 11px;"><INPUT TYPE="SUBMIT" NAME="FormsButton23" VALUE="Procurar" ID="FormsButton23"></SPAN></P>
                                                    </TD>
                                                </TR>
                                                <TR STYLE="height:18px">
                                                    <TD STYLE="background-color: rgb(255,255,255);">
                                                        <P STYLE="text-align: center;"><SPAN STYLE="color: rgb(0,102,153);">_________________________________________________________________________________________</SPAN></P>
                                                    </TD>
                                                </TR>
                                            </TABLE>
                                            </DIV>
                                        </FORM>
                                        </DIV>
                                    </TD>
                                </TR>
                            </TABLE>
                            <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="560">
                                <TR VALIGN="TOP" ALIGN="LEFT">
                                    <TD WIDTH="1" HEIGHT="28"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="1" HEIGHT="1" BORDER="0" ALT=""></TD>
                                    <TD WIDTH="559"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="559" HEIGHT="1" BORDER="0" ALT=""></TD>
                                </TR>
                                <TR VALIGN="TOP" ALIGN="LEFT">
                                    <TD></TD>
                                    <TD WIDTH="559" CLASS="TextObject">
                                        <P><?
	if ($_SERVER['REQUEST_METHOD'] == "GET" and isset($_GET['car_destination'])) 
       {  

          ?>
          <SCRIPT LANGUAGE = 'JAVASCRIPT' >
              document.LayoutRegion3FORM.car_destination.value = <?=$cod_regiao?>;
              change_pick_up(<?=$cod_regiao?>,document.LayoutRegion3FORM.registos.value);
              document.LayoutRegion3FORM.car_pickup_loc.value = <?=$car_pickup_loc?>;
              document.LayoutRegion3FORM.car_class.value = <?=$car_class?>;
              document.LayoutRegion3FORM.car_hour_up.value = <?="'".$hour_in."'";?>;
              document.LayoutRegion3FORM.car_min_up.value = <?="'".$min_in."'";?>;
              document.LayoutRegion3FORM.car_hour_off.value = <?="'".$hour_out."'";?>;
              document.LayoutRegion3FORM.car_min_off.value = <?="'".$min_out."'";?>;

          </SCRIPT>
          <?
          if ($erro!="")
          {
              echo '<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=560 HEIGHT=120 >
                     <TR HEIGHT=25>
                       <TD STYLE="background-color: rgb(215,220,232);">
                         <P STYLE="text-align: center;"><B><SPAN STYLE="font-family: Tahoma,Verdana,Arial,Helvetica,Sans-serif,sans-serif; font-size: medium;">Mensagem de erro</SPAN></B></P>
                       </TD>
                     </TR>
                     <TR VALIGN=MIDDLE ALIGN=CENTER HEIGHT=46>
                       <TD>
                         <P STYLE="text-align: center;"><SPAN STYLE="font-size: xx-large; color: rgb(0,102,153);">........................</SPAN></P>
                       </TD>
                     </TR>
                     <TR HEIGHT=49>
                       <TD ALIGN=CENTER>
                         <P><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif,sans-serif; font-size: x-small; color: rgb(255,0,0);">'.$erro.'</SPAN></P>
                       </TD>
                     </TR>
                    </TABLE>';
          }
          else
          {             
             if ($nro_dias == 0)
             {
                 $nro_dias = $nro_dias + 1;  
                 $hora_tol = 0;
             }        
             
             $result = criar_pesq_rentacar($cod_regiao,$data_in,$data_out,$hour_in,$hour_out,$nro_dias,$hora_tol,$car_class,$car_pickup_loc);
             $no     = mysql_num_rows($result);

             if ($no==0) 
             {
                 mensagem_rentacar_not_found();
             } 
             else 
             {                  
                draw_header_rentacar();
                while ($row = mysql_fetch_row($result))
                {     
                   $cod_rentacar   = $row[0];
                   $cod_grupo      = $row[1];
                   $desc_viaturas  = $row[2];
                   $sipp           = $row[3];
                   $preco          = $row[4];
                   $desc_categoria = $row[5];
                   $preco_dia      = $row[6];
                   $total_dias     = $row[7];
                   $dispon         = $row[8];

                   draw_body_rentacar($cod_rentacar, $cod_regiao, $car_pickup_loc, $car_class, $cod_grupo, $desc_viaturas, $sipp, $data_inicio, $hour_in, $min_in, $data_fim, $hour_out, $min_out, $preco, $desc_categoria, $dispon, $preco_dia, $total_dias);
                }                
                draw_foot_rentacar(); 
             }
          } 
       }
       db_disconnect();
?>
&nbsp;</P>
                                    </TD>
                                </TR>
                            </TABLE>
                            <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
                                <TR VALIGN="TOP" ALIGN="LEFT">
                                    <TD WIDTH="1" HEIGHT="29"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="1" HEIGHT="1" BORDER="0" ALT=""></TD>
                                    <TD></TD>
                                </TR>
                                <TR VALIGN="TOP" ALIGN="LEFT">
                                    <TD></TD>
                                    <TD WIDTH="546">
                                        <TABLE ID="Table41" BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="100%" STYLE="height: 25;">
                                            <TR STYLE="height:25px">
                                                <TD WIDTH="546" STYLE="background-color: rgb(255,255,255);" class="search_link">
                                                    <P STYLE="margin-left: 10pt;"><B><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;"><A HREF="../index.php">Ir para página principal</A></SPAN></B></P>
                                                </TD>
                                            </TR>
                                        </TABLE>
                                    </TD>
                                </TR>
                            </TABLE>
                        </TD>
                    </TR>
                    <TR VALIGN="TOP" ALIGN="LEFT">
                        <TD HEIGHT="191"></TD>
                    </TR>					
                </TABLE>
			    <script language="javascript" type="text/javascript">
					rodape_pt();
				</script>	
                <DIV ID="dek"></DIV>

<SCRIPT language="JavaScript">
   Xoffset= 10;    
   Yoffset= 20;    
   var old,skn,iex=(document.all),yyy=-1000;
   var ns4=document.layers
   var ns6=document.getElementById&&!document.all
   var ie4=document.all

   if (ns4)
       skn=document.dek
   else if (ns6)
       skn=document.getElementById("dek").style
   else if (ie4)
       skn=document.all.dek.style

   if(ns4)
       document.captureEvents(Event.MOUSEMOVE);
   else
   {
       skn.visibility="visible"
       skn.display="none"
   }
   document.onmousemove=get_mouse;

   function popup(msg,bak)
   {
       var content="<TABLE class=text_bold BORDER=0 BORDERCOLOR=black CELLPADDING=1 CELLSPACING=0 BGCOLOR='#000000'><TD><TABLE CELLSPACING=0 CELLPADDING=5 BORDER=0 WIDTH='150' BGCOLOR='#FFFFFF'><TR><TD><SPAN CLASS=text_bold>"+msg+"</TD></TR></TABLE></TD></TABLE>";
       yyy=Yoffset;
       if(ns4){skn.document.write(content);skn.document.close();skn.visibility="visible"}
       if(ns6){document.getElementById("dek").innerHTML=content;skn.display=''}
       if(ie4){document.all("dek").innerHTML=content;skn.display=''}
   }

   function get_mouse(e)
   {
       var x=(ns4||ns6)?e.pageX:event.x+document.body.scrollLeft;
       skn.left=x+Xoffset;
       var y=(ns4||ns6)?e.pageY:event.y+document.body.scrollTop;
       skn.top=y+yyy;
   }

   function kill()
   {
       yyy=-1000;
       if(ns4){skn.visibility="hidden";}
       else if (ns6||ie4)
          skn.display="none"
   }

   function do_info( the_index )
   {
	popup(the_index,'#EBEBEB') ;
   }
</SCRIPT>
            </TD>
        </TR>
    </TABLE>
    </DIV>
</BODY>
</HTML>
<script>
     document.all["slowScreenSplash"].style.display = "none";
</script>

 