
$(document).ready(function()
{
var tabContainers = $('#search-tabs > div');
tabContainers.hide().filter(initTab).show();
$('#search-tabs ul a').click(function () {
tabContainers.hide();
tabContainers.filter(this.hash).fadeIn(400);
$('#search-tabs ul a').removeClass('selected');
$(this).addClass('selected');
var selectedTab = $(this).attr("href").substr(1,$(this).attr("href").length);
$('#'+selectedTab).css("display","block");
trackingInfo["interaction"] = selectedTab;
document.getElementById("t-tracking-fragment").innerHTML = vsDoTracking();
return false;
});
$("#search-tabs ul a[href='" + initTab + "']").click();
$('#searchResults').hide();
clearAutoComplete();
setAutoComplete("fromDep",	"FieldAutoComplete",
"/rtad/dwr/exec/locationHelper.getMatchedLocations.dwr?callCount=1&c0-scriptName=locationHelper&c0-methodName=getMatchedLocations&xml=true&c0-param0=string:",
DWRdestsResponseParser,
function(selectedOption) {}
);
setAutoComplete("toDep", "toFieldAutoComplete",
"/rtad/dwr/exec/locationHelper.getMatchedLocations.dwr?callCount=1&c0-scriptName=locationHelper&c0-methodName=getMatchedLocations&xml=true&c0-param0=string:",
DWRdestsResponseParser,
function(selectedOption) {}
);
setAutoComplete("toArr","toFieldAutoComplete",
"/rtad/dwr/exec/locationHelper.getMatchedLocations.dwr?callCount=1&c0-scriptName=locationHelper&c0-methodName=getMatchedLocations&xml=true&c0-param0=string:",
DWRdestsResponseParser,
function(selectedOption) {}
);
setAutoComplete("fromArr", "FieldAutoComplete",
"/rtad/dwr/exec/locationHelper.getMatchedLocations.dwr?callCount=1&c0-scriptName=locationHelper&c0-methodName=getMatchedLocations&xml=true&c0-param0=string:",
DWRdestsResponseParser,
function(selectedOption) {}
);
setAutoComplete("airportOrCityCode", "FieldAutoComplete",
"/rtad/dwr/exec/locationHelper.getMatchedLocations.dwr?callCount=1&c0-scriptName=locationHelper&c0-methodName=getMatchedLocations&xml=true&c0-param0=string:",
DWRdestsResponseParser,
function(selectedOption) {}
);
$("body").click(function() {
clearAutoComplete();
});
$('#t-section-nav-fragment .ARRDEP a:first').attr('class', 'selected');
});
function swapAirportWording(arrDep) {
$('#airportOrCityCodeLabelText').text(arrDep.value=='Arrival'?atText:fromText);
}
function positionResults(id){
var inputOffset = $('#'+id).position();
var parentOffset = $('#t-main-fragment').position();
if(id.substr(0,2)=="to")
{
$('#toFieldAutoComplete').css("margin-left",inputOffset.left-(parentOffset.left-7)+"px");
$('#toFieldAutoComplete').css("margin-top",-30+"px");
}
else
{
$('#FieldAutoComplete').css("margin-left",inputOffset.left-(parentOffset.left-7)+"px");
$('#FieldAutoComplete').css("margin-top",-30+"px");
}
}
function hideCal()
{}

