/*
	Hotel Room Selection Options...
*/

function Fmore()
        {
       
        window.location = "eT_MoreFlightResults.aspx";
        
        }
        function TrackButton(s)
        {
        s.checked = true;
        var x = document.getElementById(s);
    
     
        
        }

function HotelNamePickTracker()
{

  document.getElementById("hdhotelnameTracker").value = "1";
}


function ShowHideRooms(obj)
{
	/// Get No of Rooms
	var rooms=obj.options[obj.selectedIndex].value;
		
	/// Get Div for Room
	var divRHoom2=document.getElementById('divHRoom2');
	
	/// If No Room Div there, Return
	if(!divRHoom2)
	{
	    divRHoom2=document.getElementById('ChangeSearch1_divHRoom2');
	    if(!divRHoom2)
		    return;
	}
		
	/// Show hide by No of Rooms!
	if(rooms==1)
		divRHoom2.style.display='none';
	else
		divRHoom2.style.display='';
}

function ChildAgeDynamic(obj,id)
{
/// Get No of Rooms
var rooms=obj.options[obj.selectedIndex].value;
if(id == 1)
{
   if(rooms != 0 )
   {
      document.getElementById('divRoomsChild').style.display = 'inline';
      document.getElementById('divRoom1child').style.display = 'inline';
    
      for(var i=rooms;i<= 6;i++)
      {
       var vla = "ucFlightHotelSearch_ddlR1C"+i.toString();
       document.getElementById(vla).style.display = 'none';
    
      }
      for(var i=rooms;i>= 1;i--)
      {
       var vla = "ucFlightHotelSearch_ddlR1C"+i.toString();
       document.getElementById(vla).style.display = 'inline';
    
      }
   
   }
   
   else 
   {
     //document.getElementById('divRoom2child').style.display = 'none';
     document.getElementById('divRoom1child').style.display = 'none';
      document.getElementById('ucFlightHotelSearch_ddlR1C1').style.display = 'none';
     
     if(document.getElementById('ucFlightHotelSearch_cmbRoom2Child').value == "0")
        document.getElementById('divRoomsChild').style.display = 'none';
     }
}
else
{
 
    if(rooms != 0 )
    {
    document.getElementById('divRoomsChild').style.display = 'inline';
    document.getElementById('divRoom2child').style.display = 'inline';
    
    for(var i=rooms;i<= 6;i++)
    {
    var vla = "ucFlightHotelSearch_ddlR2C"+i.toString();
    document.getElementById(vla).style.display = 'none';
    
    }
    for(var i=rooms;i>= 1;i--)
    {
    var vla = "ucFlightHotelSearch_ddlR2C"+i.toString();
    document.getElementById(vla).style.display = 'inline';
    
    }
   } 
   else 
   {
     document.getElementById('divRoom2child').style.display = 'none';
     
     if(document.getElementById('ucFlightHotelSearch_cmbRoom1Child').value == "0")
        document.getElementById('divRoomsChild').style.display = 'none';
     }
        
       
   }

}

function ChildAge(obj,id)
{

/// Get No of Rooms
var rooms=obj.options[obj.selectedIndex].value;
if(id == 1)
{
   if(rooms != 0 )
   {
    document.getElementById('divRoomsChild').style.display = 'inline';
    document.getElementById('divRoom1child').style.display = 'inline';
    
    for(var i=rooms;i<= 6;i++)
    {
    var vla = "SearchForm1_ddlR1C"+i.toString();
    document.getElementById(vla).style.display = 'none';
    
    }
    for(var i=rooms;i>= 1;i--)
    {
    var vla = "SearchForm1_ddlR1C"+i.toString();
    document.getElementById(vla).style.display = 'inline';
    
    }
   
   }
   
   else 
   {
     //document.getElementById('divRoom2child').style.display = 'none';
     document.getElementById('divRoom1child').style.display = 'none';
      document.getElementById('SearchForm1_ddlR1C1').style.display = 'none';
     
     if(document.getElementById('SearchForm1_ddlRoom2Children').value == "0")
        document.getElementById('divRoomsChild').style.display = 'none';
     }
}
else
{
 
    if(rooms != 0 )
    {
    document.getElementById('divRoomsChild').style.display = 'inline';
    document.getElementById('divRoom2child').style.display = 'inline';
    
    for(var i=rooms;i<= 6;i++)
    {
    var vla = "SearchForm1_ddlR2C"+i.toString();
    document.getElementById(vla).style.display = 'none';
    
    }
    for(var i=rooms;i>= 1;i--)
    {
    var vla = "SearchForm1_ddlR2C"+i.toString();
    document.getElementById(vla).style.display = 'inline';
    
    }
   } 
   else 
   {
     document.getElementById('divRoom2child').style.display = 'none';
     
     if(document.getElementById('SearchForm1_ddlRoom1Children').value == "0")
        document.getElementById('divRoomsChild').style.display = 'none';
     }
        
       
   }


}


function ChildAgeChangeSearch(obj,id)
{
if(document.getElementById("hdSearchOptionmini") != null && document.getElementById("hdSearchOptionmini").value == "FO")
return;
/// Get No of Rooms
var rooms = 0;
try{
    if (obj.options[obj.selectedIndex] != null)
    {
     rooms = obj.options[obj.selectedIndex].value
     }

  }catch(e)
{
    if (document.getElementById(obj) != null)
    {
     rooms = document.getElementById(obj).options[document.getElementById(obj).selectedIndex].value;
    }
}


if(id == 1)
{
   if(rooms != 0 )
   {
    if (document.getElementById('divRoomsChild') != null)
        document.getElementById('divRoomsChild').style.display = 'inline';
        
    if (document.getElementById('divRoom1child') != null)
    document.getElementById('divRoom1child').style.display = 'inline';
    
    for(var i=rooms;i<= 6;i++)
    {
        var vla = "ChangeSearch1_ddlR1C"+i.toString();
        if (document.getElementById(vla) != null)
            document.getElementById(vla).style.display = 'none';
        
    }
    for(var i=rooms;i>= 1;i--)
    {
        var vla = "ChangeSearch1_ddlR1C"+i.toString();
        if (document.getElementById(vla) != null)
            document.getElementById(vla).style.display = 'inline';
    
    }
   
   }
   
   else 
   {
     try{
       document.getElementById('divRoom1child').style.display = 'none';
      document.getElementById('ChangeSearch1_ddlR1C1').style.display = 'none';
     
     if(document.getElementById('ChangeSearch1_ddlRoom2Child').value == "0")
        document.getElementById('divRoomsChild').style.display = 'none';
        }catch(e){}
     }
}
else
{
    if(rooms != 0 )
    {
    document.getElementById('divRoomsChild').style.display = 'inline';
    document.getElementById('divRoom2child').style.display = 'inline';
    
    for(var i=rooms;i<= 6;i++)
    {
    var vla = "ChangeSearch1_ddlR2C"+i.toString();
    document.getElementById(vla).style.display = 'none';
    
    }
    for(var i=rooms;i>= 1;i--)
    {
    var vla = "ChangeSearch1_ddlR2C"+i.toString();
    document.getElementById(vla).style.display = 'inline';
    
    }
   } 
   else 
   {
    try{
     document.getElementById('divRoom2child').style.display = 'none';
     if(document.getElementById('ChangeSearch1_ddlRoom1Child').value == "0")
      document.getElementById('divRoomsChild').style.display = 'none';
      }catch(e){}
     }
        
       
   }


}
