<?
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>Calculating rates</big></b>
<br>From all available cars<br><br>
<img src='../assets/images/waiting.gif' alt='' /><br>
Please wait
</td>
</tr>
</table>
</DIV>
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Bravacar - Rent a Car - Online bookings</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META NAME="Abstract" CONTENT="rent a car  madeira island, car rental lisbon, car rental algarve, car rental porto, car rental online bookings, funchal rent a car, madeira rent a car">
<META NAME="Copyright" CONTENT="Bravacar">
<META NAME="Description" CONTENT="Bravacar - Easy rent a car bookings in Portugal.  Bookings available in Lisbon, Madeira Island, Algarve and Porto.  Customers pay only a small percentage when booking online and pay the remainder at pickup location.">
<META NAME="Generator" CONTENT="Bravacar">
<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, netrent 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,bravacar madeira,bravacar porto, bravacar lisbon, bravacar faro">
<META NAME="Language" CONTENT="en">
<META NAME="revisit-after" CONTENT="2 days">
<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>
<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">

</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" STYLE="background-color: rgb(40,49,79); height: 21;">
                    <TR ALIGN="LEFT" VALIGN="middle">
                        <TD width="510" HEIGHT="21"></TD>
                        <TD WIDTH="20"><IMG ID="PictPT" HEIGHT="11" WIDTH="16" SRC="../assets/images/pt.gif" BORDER="0" ALT="pt"></TD>
                        <TD width="18"></TD>
                        <TD WIDTH="20"><IMG ID="PictGB" HEIGHT="11" WIDTH="16" SRC="../assets/images/gb.gif" BORDER="0" ALT="gb"></TD>
                        <TD width="18"></TD>
                        <TD WIDTH="20"><IMG ID="PictDE" HEIGHT="11" WIDTH="16" SRC="../assets/images/de.gif" BORDER="0" ALT="de"></TD>
                        <TD WIDTH="174" class="muda_link">                            
                            <P STYLE="text-align: center;">
                            <B><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: xx-small;">
                            <A HREF="../../index.php">Português</A> | 
                            <span class="link_actual"><A HREF="../index.php">English</A></span> | 
                            <A HREF="../../deutsch/index.php">Deutsch</A></SPAN></B></P>                                                        
                        </TD>
                    </TR>
                </TABLE>       
                
                <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="780">
                    <TR>
                        <TD HEIGHT="48" WIDTH="780">
                        	<IMG ID="Pict357" HEIGHT="48" WIDTH="780" SRC="../assets/images/bravacar_01.gif" BORDER="0" ALT=""></TD>
                    </TR>
                    <TR>
                        <TD HEIGHT="159" WIDTH="780">
                        	<IMG ID="Pict358" HEIGHT="159" WIDTH="780" SRC="../assets/images/bravacar_02.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="Pict359" HEIGHT="7" WIDTH="780" SRC="../assets/images/linha01.jpg" BORDER="0" ALT=""></TD>
                    </TR>
					<TR VALIGN="TOP" ALIGN="LEFT">
                        <TD HEIGHT="25" CLASS="TextObject">
                        <P><script language="javascript" src="../assets/menu_bravacar_en.js"></script></P></TD>
                  	</TR>       
					<TR VALIGN="TOP" ALIGN="LEFT">
                        <TD HEIGHT="25" CLASS="TextObject">&nbsp;</TD>
                  	</TR>                                  
                </TABLE>
                
				<?
                    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."Please select a destination<br>";
                
                       if ($car_pickup_loc==0)
                              $erro = $erro."Please select a pick-up location<br>";
                
                       if ($data_in =="")
                              $erro = $erro."Please select a pick-up date<br>";
                
                          if ($data_in !="" and !(IsDate($data_in)))
                              $erro = $erro."Please select a valid pick-up date<br>";
                
                       if ($data_out =="")
                              $erro = $erro."Please select a drop-off date<br>";
                
                          if ($data_out !="" and !(IsDate($data_out)))
                              $erro = $erro."Please select a valid drop-off date<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."The pick-up date must be at least the date of today<br>";
                
                             if ($nro_dias <= 0)
                                $erro = $erro."The pick-up date must be at least the date of tomorrow (24 hours)<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."The drop-off date must be at least two hours after the pick-up date<br>";
                             
                             $nro_dias = diff_days($data_in,$data_out);
                             $hora_tol = (fmod((strtotime($data_out) - strtotime($data_in)),86400)/3600);
                             
                          }  
                     }
                
                ?>
                                            
                <TABLE width="780" border="0" cellspacing="0" cellpadding="0">
                    <tr>                
                        <td><img id="Picture360" height="46" width="159" src="../assets/images/autogen/a_botao-estatico.gif" border="0" alt=""></td>
                        <td>&nbsp;</td>                    
                        <td VALIGN="middle" STYLE="background-color: rgb(228,31,31); text-align:center; font-size:22px; color:rgb(255,255,255);">
                        ...............................................................</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td valign="top"><img src="../assets/images/12interuiior.jpg" width="159" height="259"></td>
                        <td>&nbsp;</td>
                        <td valign="top" STYLE="height: 290;">                        
                            <FORM NAME="LayoutRegion3FORM" ACTION="rentacar.php" method="GET">
                            <input type=hidden name="registos" value="">
                            <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>
                            <TABLE ID="Table72" BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="100%" STYLE="height: 52; background-color: rgb(213,222,238); ">
                                <TR>
                                    <TD WIDTH="214" HEIGHT="25" valign="bottom">
                                        &nbsp; <SPAN STYLE="font-size: 11px;">Destination:</SPAN>
                                        <?
                                            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 ";
                                            $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 ";
                                            $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);
                                            }								
                                        ?>                                    
                                    </TD>
                                    <TD WIDTH="191" valign="bottom">
                                        &nbsp;<SPAN STYLE="font-size: 11px;">Pick-up location:</SPAN>
                                    </TD>
                                    <TD WIDTH="135" valign="bottom">
                                        <SPAN STYLE="font-size: 11px;">Car class:</SPAN>                                    
                                    </TD>
                                </TR>
                                <TR>
                                    <TD height="27" valign="top">
                                        &nbsp; <SELECT ID="ID_car_destination" NAME="car_destination" style="width:180px; height:20px;" class="text_objects" onChange="change_pick_up(document.LayoutRegion3FORM.car_destination.value,document.LayoutRegion3FORM.registos.value)">
                                        	<OPTION VALUE="0" SELECTED>Select a destination</OPTION>
                                            <OPTION VALUE="3">Faro - Algarve</OPTION>
                                            <OPTION VALUE="5">Lisbon</OPTION>
                                            <OPTION VALUE="6">Madeira</OPTION>
                                            <OPTION VALUE="8">Oporto</OPTION>
                                        </SELECT>                                    
                                    </TD>
                                    <TD valign="top">
                                        &nbsp;<SELECT ID="ID_car_pickup_loc" NAME="car_pickup_loc" style="width:180px; height:20px;" class="text_objects">
                                            <OPTION VALUE="0" SELECTED>Select a location</OPTION>
                                        </SELECT>                                   
                                    </TD>
                                    <TD valign="top">
                                        <SELECT ID="ID_car_class" NAME="car_class" style="width:130px; height:20px;" class="text_objects">
                                            <OPTION VALUE="0" SELECTED>No preference</OPTION>
                                            <OPTION VALUE="1">Economy</OPTION>
                                            <OPTION VALUE="2">Compact</OPTION>
                                            <OPTION VALUE="3">Midsize</OPTION>
                                            <OPTION VALUE="4">Standard</OPTION>
                                            <OPTION VALUE="5">Full Size</OPTION>
                                            <OPTION VALUE="6">Premium</OPTION>
                                            <OPTION VALUE="7">Luxury</OPTION>
                                            <OPTION VALUE="8">Convertible</OPTION>
                                            <OPTION VALUE="9">Minivan</OPTION>
                                            <OPTION VALUE="10">Sports car</OPTION>
                                        </SELECT>                                   
                                    </TD>
                                </TR>
                            </TABLE>
                                                        
                          <TABLE ID="Table73" BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="100%" STYLE="background-color: rgb(213,222,238); ">
                                <TR>
                                    <TD WIDTH="221" HEIGHT=25 valign="bottom">
                                    	&nbsp; <SPAN STYLE="font-size: 11px;">Pick-up date:</SPAN>
                                    </TD>
                                    <TD WIDTH="339" valign="bottom">
                                		&nbsp;<SPAN STYLE="font-size: 11px;">Drop-off date:</SPAN>
                                    </TD>
                              	</TR>
                                <TR>
                                    <TD height="35" valign="top">
                                    	&nbsp; <INPUT ID="ID_car_data_up" TYPE="TEXT" NAME="car_data_up" STYLE="white-space: pre; height:20px;" 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; height:20px;" 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; height:20px;" 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>
                                    </TD>
                                    <TD valign="top">
                                        <SPAN STYLE="font-size: 11px;">&nbsp;<INPUT ID="FormsEditField27" TYPE="TEXT" NAME="car_data_off" STYLE="white-space: pre; height:20px;" 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; height:20px;" 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; height:20px;" 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>
                                    </TD>
                                </TR>
                            </TABLE>  
                            
                            <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: 1; visibility: inherit; left: 0; height: 58; top: 149;">
                                <TR VALIGN="MIDDLE" ALIGN="CENTER">
                                    <TD ALIGN="CENTER" WIDTH="560" height="40">
                                        <INPUT ID="FormsButton19" NAME="FormsButton18" TYPE="IMAGE" STYLE="border-style:solid;border-width:0" SRC="../assets/images/Search_verde_rentacar.jpg">
                                    </TD>
                                </TR>
                                <TR>
                                    <TD STYLE="background-color: rgb(255,255,255);" height="18">
                                        <P STYLE="text-align: center;"><SPAN STYLE="color: rgb(0,102,153);">_________________________________________________________________________________________</SPAN></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>
                                                             <TR>
                                                               <TD HEIGHT=25 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;">Message error</SPAN></B></P>
                                                               </TD>
                                                             </TR>
                                                             <TR VALIGN=MIDDLE ALIGN=CENTER>
                                                               <TD HEIGHT=46>
                                                                 <P STYLE="text-align: center;"><SPAN STYLE="font-size: xx-large; color: rgb(0,102,153);">........................</SPAN></P>
                                                               </TD>
                                                             </TR>
                                                             <TR>
                                                               <TD HEIGHT=49 ALIGN=CENTER>
                                                                 <P><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif,sans-serif; font-size:12px; 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();
                                        ?>                                        
                                    </TD>
                                </TR>
                            </TABLE>
                            </FORM>
                            
							<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">Go to home page</A></SPAN></B></P>
                                    </TD>
                                </TR>
                            </TABLE>                            
                        </td>
                		<td>&nbsp;</td>
                    </tr>                                            
                </TABLE>                
                
                <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="780">
                    <TR VALIGN="TOP" ALIGN="LEFT">
                        <TD HEIGHT="50"></TD>
                    </TR>
                    <TR VALIGN="TOP" ALIGN="LEFT">
                        <TD STYLE="background-image: url('../assets/images/f000.jpg'); height: 42; vertical-align:middle" class="table_esq">
                             <P STYLE="text-align: center; font-size: 12px;">&nbsp;&nbsp; 
                             <A HREF="../index.php">Home</A>&nbsp;|&nbsp;
                             <A HREF="../html/newsletter.php">Subscribe our Newsletter</A>&nbsp;|&nbsp;
                             <A HREF="../html/custsuport.php">Customer support</A>&nbsp;|&nbsp;
                             <A HREF="../html/questions.php">FAQ&#8217;s</A></P>
                        </TD>
                    </TR>
                    <TR>
                        <TD VALIGN="TOP" STYLE="background-color: rgb(209,36,36);height:34px" class="table_esq">
                            <SPAN STYLE="font-size: 8pt; color: rgb(255,255,255);">
                            Copyright &#169; 2006-2009 Bravacar, Lda - Rent a Car &#153; </SPAN></P>
                        </TD>
                    </TR>
                    <TR>
                        <TD class="table_esq" align="center" STYLE="height:45px; font-family: Tahoma,Verdana,Arial,Helvetica,Sans-serif; font-size: 11px; color: rgb(153,153,153);" >
                            <BR>Partner sites: 
                            <A HREF="http://www.baiabrava.pt/en/index.html" TARGET="_blank">Hotel Apartamentos Baía Brava</A>&nbsp;|&nbsp;
                            <A HREF="http://www.terrasdeaventura.com/english/index.php" TARGET="_blank">Terras de Aventura</A>&nbsp;|&nbsp;
                            <A HREF="http://www.albergariafozdosado.com/en/homebt.html" TARGET="_blank">Albergaria Foz do Sado</A>&nbsp; |&nbsp;
                            <A HREF="http://www.parquetematicodamadeira.pt/en/default.asp" TARGET="_blank">The Madeira Island Theme Park</A>
                            <BR>
                        </TD>
                    </TR>
                </TABLE>  
                
                <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>

 