
$(pageSetup);
function pageSetup() {
$("#priceTable div.samplePrices, #priceTable div.samplePricesGr, #priceTable h4.arrTableHeader, #priceTable h3.depTableHeader").hide();
$("#priceTable div.italySection").show();
$("#priceTable div.greeceSection").hide();
$("#arr, #dep").show();
$("#dep").change(function () {
outputData();
});
$("#dep").keyup(function() {
outputData();
});
$("#arr").change(function () {
outputData();
});
$("#arr").keyup(function() {
outputData();
});
$("#depGr").change(function () {
outputDataGr();
});
$("#depGr").keyup(function() {
outputDataGr();
});
$("#arrGr").change(function () {
outputDataGr();
});
$("#arrGr").keyup(function() {
outputDataGr();
});
$("#italyPod").click(function() {showHide("italySection");});
$("#greecePod").click(function() {showHide("greeceSection");});
outputData();
var fromCode = getQueryValue("from").toLowerCase();
if(fromCode) {
$("#dep option[@value='" + fromCode + "']").attr("selected", "selected");
outputData();
}
}
function showHide(item) {
switch(item) {
case "italySection" : {
$("#priceTable div.greeceSection").hide();
$("#priceTable div.italySection").show();
$("#arr, #dep").show();
$("#italyPod").html('<h4><a href="#" id="it" class="selected" style="text-decoration:none;"><span style="color:#FF0000;">></span>&nbsp;<span style="color:#404490;">Italy</span></a></h4>');
$("#greecePod").html('<h4><a href="#" id="gr" style="text-decoration:none;"><span style="color:#FF0000;">></span>&nbsp;<span style="color:#404490;">View deals for Greece</span></a></h4>');
break;
}
case "greeceSection" : {
$("#priceTable div.italySection").hide();
$("#priceTable div.greeceSection").show();
$("#arrGr, #depGr").show();
$("#italyPod").html('<h4><a href="#" id="it" style="text-decoration:none;"><span style="color:#FF0000;">></span>&nbsp;<span style="color:#404490;">View deals for Italy</span></a></h4>');
$("#greecePod").html('<h4><a href="#" id="gr" class="selected" style="text-decoration:none;"><span style="color:#FF0000;">></span>&nbsp;<span style="color:#404490;">Greece</span></a></h4>');
outputDataGr();
break;
}
}
}
function outputData()
{
var priceTable = "";
var lastTable = "";
var sightTable = "";
if($("#dep option:selected").val() != "NON")
{
$("#priceTable div.samplePrices:visible").slideUp();
$("#priceTable div.hotel:visible").hide();
$("#priceTable div.sight:visible").hide();
priceTable = "#" +
$("#dep option:selected").val() +
" ." +
$("#arr option:selected").val();
hotelTable = "#hotelSection" +
" ." +
$("#arr option:selected").val();
sightTable = "#sightSection" +
" ." +
$("#arr option:selected").val();
$(priceTable).slideDown();
$(hotelTable).show();
$(sightTable).show();
}
else
{
$("#priceTable div.samplePrices:visible").slideUp();
$("#priceTable div.hotel:visible").hide();
$("#priceTable div.sight:visible").hide();
}
}
function outputDataGr()
{
var priceTable = "";
var hotelTable = "";
var sightTable = "";
if($("#depGr option:selected").val() != "NON")
{
$("#priceTable div.samplePricesGr:visible").slideUp();
$("#priceTable div.hotelGr:visible").hide();
$("#priceTable div.sightGr:visible").hide();
priceTable = "#" +
$("#depGr option:selected").val() +
" ." +
$("#arrGr option:selected").val();
hotelTable = "#hotelSectionGr" +
" ." +
$("#arrGr option:selected").val();
sightTable = "#sightSectionGr" +
" ." +
$("#arrGr option:selected").val();
$(priceTable).slideDown();
$(hotelTable).show();
$(sightTable).show();
}
else
{
$("#priceTable div.samplePricesGr:visible").slideUp();
$("#priceTable div.hotelGr:visible").hide();
$("#priceTable div.sightGr:visible").hide();
}
}
