	
var currenttabID = 0;
 
var totalTabCount =2;

var virtualpath = "http://bookings.brol.com/brol";

var arrowleftmonthimage = virtualpath + "/images/arrowleftmonth.gif";
    
var arrowrightmonthimage = virtualpath + "/images/arrowrightmonth.gif";

var todaysDate = new Date();

var pkgtype = null;
$(document).ready(function()
{
   
	ShowHideDivs2(currenttabID);
    InitialiseCalendar("#txtcheckindate");
    InitialiseCalendar("#txtcheckoutdate");
    InitialiseCalendar("#AttractionDepDate");   
    InitialiseCalendar("#TransferDepDate");
    InitialiseCalendar("#txtDepartureDate");
    InitialiseCalendar("#txtReturnDate");
	InitialiseCalendar("#departure_date");
	InitialiseCalendar("#return_date");
});

function InitialiseCalendar(controlID) {
  $(controlID).datepicker({
        numberOfMonths: 2,
        showOn: 'button',
        buttonImage: '../../xyka/ffincl/calendar.gif',
        buttonImageOnly: true,
        minDate: 0
    });
}
 
function ShowHideDivs(tabID)
{	

 //document.getElementById("rbt"+tabID).checked = 'checked';
	if (tabID == 0) {
		//document.getElementById("rbt"+tabID).checked = 'checked';
		document.getElementById("drpChild1").selectedIndex =0;
		document.getElementById("drpChild2").selectedIndex =0;
		document.getElementById("drpChild3").selectedIndex =0;
		document.getElementById("drpChild4").selectedIndex =0;
		document.getElementById("drpRooms").selectedIndex =0;			
	}

    if ((tabID == 4)&&(pkgtype != 'ecotravel')&&(pkgtype != 'cruises')) {    
        pkgtype = 'vacations';
    }
    else if (tabID == 6) {    
        tabID = 4;
        pkgtype = 'ecotravel';
    }
    else if (tabID == 7) {    
        tabID = 4;
        pkgtype = 'cruises';
    }
	currentTabID = tabID;
	 
    /*Hide all the tabs*/
    
    
    $(".ffmid").hide();
    
    $(".ffmid").hide();
    
    $(".liheader").removeClass("active")
    
	
    $(".ffmid").each(function()
    {
        if($(this).attr("tabid") == tabID)
        {
            $(this).show();
            
            if($(this).attr("initializefunction") != null)
            {
                eval($(this).attr("initializefunction") +"()");
            }
        }
    })
	
    $(".liheader").each(function()
    {
        if($(this).attr("tabid") == tabID)
        {
            $(this).addClass("active")
        }
    })
}

function ShowHideDivs2(tabID)
{	

var url = window.location.href;
var home = url.search('home');
var flight = url.search('flight');
var ctravel = url.search('corporate%20travel');
var groups = url.search('groups');
var airpass = url.search('air%20passes');
var hotels = url.search('hotels');
var vacations = url.search('vacations');
var tours = url.search('Tours');
var cruise = url.search('cruise');
var activities = url.search('activities');
var ecotravel = url.search('ecotravel');

if(home > 0 ||flight > 0||ctravel > 0 ||groups > 0 ||airpass > 0)
{
document.getElementById("rbt1").checked = 'checked';
ShowHideDivs(1);
}
else if(hotels > 0)
{
document.getElementById("rbt0").checked = 'checked';
}
else if(tours > 0)
{
document.getElementById("rbt5").checked = 'checked';
}
else if(activities > 0)
{
document.getElementById("rbt3").checked = 'checked';
}
  else if(vacations > 0)
{
document.getElementById("rbt4").checked = 'checked';
}
else if(ecotravel > 0)
{
document.getElementById("rbt6").checked = 'checked';
pkgtype = 'ecotravel';
ShowHideDivs(6);
}
else if(cruise > 0)
{
document.getElementById("rbt7").checked = 'checked';
pkgtype = 'cruises';
ShowHideDivs(7);
}
  

  /*  if (tabID == 4) {    
        pkgtype = 'vacations';
    }
    else if (tabID == 6) {    
        tabID = 4;
        pkgtype = 'ecotravel';
    }
    else if (tabID == 7) {    
        tabID = 4;
        pkgtype = 'cruises';
    }
	currentTabID = tabID;
	 
    Hide all the tabs
    
    
    $(".ffmid").hide();
    
    $(".ffmid").hide();
    
    $(".liheader").removeClass("active")
    
	
    $(".ffmid").each(function()
    {
        if($(this).attr("tabid") == tabID)
        {
            $(this).show();
            
            if($(this).attr("initializefunction") != null)
            {
                eval($(this).attr("initializefunction") +"()");
            }
        }
    })
	
    $(".liheader").each(function()
    {
        if($(this).attr("tabid") == tabID)
        {
            $(this).addClass("active")
        }
    })*/
}
 
function redirect(url)
{
	windowFeatures = "top=0, left=0,resizable=1,scrollbars=1,status=1,menubar=1,toolbar=1,location=1,directories=1,screenY=" + window.screenTop + ",screenX=" + window.screenLeft + ", addressbar=1"+",width=" + (screen.width-50)+",height=" + (screen.height-200); 
	window.open(url,'',windowFeatures,'');
}


function initializetransfers()
{
return true;
}
