$(document).ready(function() { /* */ /* */ /* */ $(".dd_poplink").unbind().click(function () { $(".dd_botcon").toggle(); $(".dd_poplink").toggleClass('dd_active'); }); $('.dd_botcon, .dd_poplink').click(function (e) { e.stopPropagation(); }); $(document).click(function () { $('.dd_botcon').hide(); $(".dd_poplink").removeClass('dd_active'); }); $(".sp_adv_search").hide(); $('.sp_adv_btn').unbind().click(function(){ $('#txtWhere').toggle(); $('#txtSearch').toggle(); $(".sp_adv_search").slideToggle('fast'); $(".sp_adv_btn").toggleClass('sp_active'); if ($(this).find('.fa').hasClass('fa-caret-up')) { $(this).find('.fa').removeClass('fa-caret-up').addClass('fa-caret-down'); } else { $(this).find('.fa').removeClass('fa-caret-down').addClass('fa-caret-up'); } return false; }); $("#forgot_bt").hide(); $(".sp_frgt_col").hide(); $('.frgt_pswrd_link').click(function(){ $(".sp_frgt_col").slideToggle('fast'); $("#login_bt").slideToggle('fast'); $("#forgot_bt").slideToggle('fast'); }); $('#cancel').click(function(){ $(".sp_frgt_col").slideToggle('fast'); $("#login_bt").slideToggle('fast'); $("#forgot_bt").slideToggle('fast'); }); $('#div_tab1').click(function(){ $('#txtSearch').show(); $('#txtWhere').hide(); }); /* */ /* */ /* */ //Auto Height $(function() { engine(); /*$(window).resize(function() { // On resize engine(); });*/ }); function engine() { if ($(window).width() > 768 && $('#hdnProudct1').val() == '') { $(".hm_tab_content:first").show(); //alert('greater than 768'); } else { $(".hm_tab_content:first").hide(); //alert('less than 768'); } } $(".hm_tab_hotel_li").unbind().click(function () { // debugger; $(".hm_tab_hotel_li").removeClass("active"); $(this).addClass("active"); return false; }); //On Click Event $(".hm_tabs_ul div").click(function () { $(".sp_adv_search").hide(); //$("#fromcityAc").val("From"); //$("#tocityAc").val("To"); //var path= $(this).find("a").html(); //if(path==='Flights') // Window.location='/Flights.html'; //else if(path==='Hotels') // Window.location='Hotels.html'; // else // Window.location="http://veena.quadlabs.net/"; $("#txtHTCity").val("Where do you want to go?"); // document.getElementById('fromcityAc').value = "From"; // document.getElementById('tocityAc').value = "To"; // document.getElementById('txtHTCity').value = "Where do you want to go?"; // document.getElementById('pk1').value = "Type City, Place, Holiday type or package to search..."; $(".hm_tabs_ul div").removeClass("hm_active"); //Remove any "active" class $(this).addClass("hm_active"); //Add "active" class to selected tab $(".hm_tab_content").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content // $(activeTab).fadeIn(); //Fade in the active ID content return false; }); // ----End here--- //On Click Event $(".hm_tabs_ul div").click(function () { $(".sp_adv_search").hide(); // $("#fromcityAc").val("From"); // $("#tocityAc").val("To"); $("#txtHTCity").val("Where do you want to go?"); $(".hm_tabs_ul div").removeClass("hm_active"); //Remove any "active" class $(this).addClass("hm_active"); //Add "active" class to selected tab $(".hm_tab_content").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content $(activeTab).fadeIn(); //Fade in the active ID content return false; }); /* */ /* */ /* */ // ------start here---------- //debugger; //When page loads... $(".hm_tab_content").hide(); //Hide all content $(".hm_tabs_ul div:first").addClass("hm_active").show(); //Activate first tab $(".hm_tab_content:first").show(); //Show first tab content // debugger; var head_click = sessionStorage.getItem('head_click'); if (head_click != null && head_click != "") { // $(".hm_tabs_ul div").removeClass("hm_active"); // $("#div_" + head_click).addClass("hm_active"); // $(".hm_tab_content").hide(); sessionStorage.setItem('head_click', ""); // $("#hm_" + head_click).fadeIn(); //return false; if(head_click=="tab2"){ $('#hdnProudct1').val("Flights"); } else if(head_click=="tab3"){ $('#hdnProudct1').val("Hotels"); } } if ($('#hdnProudct1').val()!==""){ if ($('#hdnProudct1').val() == "Flights") { //$(".hm_tab_content").hide(); $(".hm_tab_li").removeClass("hm_active"); $("#hm_tab1").hide(); $("#hm_tab3").hide(); $(".hm_tabs_ul div:first").next().addClass("hm_active").show(); //Activate first tab $(".hm_tab_content:first").next().show(); } else if ($('#hdnProudct1').val() == "Hotels") { //$(".hm_tab_content").hide(); $(".hm_tab_li").removeClass("hm_active"); $(".hm_tab1").hide(); $("#hm_tab3").hide(); $(".hm_tabs_ul div:first").next().next().addClass("hm_active").show(); //Activate first tab $(".hm_tab_content:first").next().next().show(); } else { $(".hm_tab_content").hide(); //Hide all content $(".hm_tabs_ul div:first").addClass("hm_active").show(); //Activate first tab $(".hm_tab_content:first").show(); //Show first tab content } } if ($('#hdnProudct1').val() === "FlightTickets") { $(".flight_tb div").removeClass("flight_tb_active"); $(".flight_tb_content").hide(); $(".flight_tb div:nth-child(2)").addClass("flight_tb_active").show(); $(".flight_tb_content:first").show(); document.getElementById("DirectFlight").checked = false; document.getElementById("ReturnDateInput").style.display = "block"; document.getElementById("OnewayDateInput").style.display = "block"; } /*else{ $(".flight_tb_content").hide(); //Hide all content $(".flight_tb div:first").addClass("flight_tb_active").show(); //Activate first tab $(".flight_tb_content:first").show(); //Show first tab content } */ //On Click Event $(".flight_tb div").unbind().click(function() { $(".flight_tb div").removeClass("flight_tb_active"); //Remove any "active" class $(this).addClass("flight_tb_active"); //Add "active" class to selected tab $(".flight_tb_content").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content $(activeTab).fadeIn(); //Fade in the active ID content return false; }); /* */ /* */ /* */ //When page loads... $(".etab_content").hide(); //Hide all content $("ul.etabs li:first").addClass("eactive").show(); //Activate first tab //$(".etab_content:first").show(); //Show first tab content //On Click Event $("ul.etabs li").click(function() { $("ul.etabs li").removeClass("eactive"); //Remove any "active" class $(this).addClass("eactive"); //Add "active" class to selected tab $(".etab_content").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content $(activeTab).fadeIn(); //Fade in the active ID content return false; }); /* */ /* */ /* */ //When page loads... $(".tabz_content").hide(); //Hide all content $("ul.tabz li:nth-child(1)").addClass("active").show(); //Activate first tabz $(".tabz_content:nth-child(1)").show(); //Show first tabz content //On Click Event $("ul.tabz li").click(function() { $("ul.tabz li").removeClass("active"); //Remove any "active" class $(this).addClass("active"); //Add "active" class to selected tabz $(".tabz_content").hide(); //Hide all tabz content var activetabz = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tabz + content $(activetabz).show(); //Fade in the active ID content return false; }); /* */ /* */ /* */ //When page loads... $(".mtab_content").hide(); //Hide all content $("ul.mtabs li:first").addClass("eactive").show(); //Activate first tab $(".mtab_content:first").show(); //Show first tab content //On Click Event $("ul.mtabs li").click(function() { $("ul.mtabs li").removeClass("eactive"); //Remove any "active" class $(this).addClass("eactive"); //Add "active" class to selected tab $(".mtab_content").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content $(activeTab).fadeIn(); //Fade in the active ID content return false; }); /* */ /* */ /* */ $(".enq_head").click(function () { $(".q_enq_form").slideToggle('fast'); $(".enq_head").toggleClass('enq_head_plus'); return false; }); /* */ /* */ /* */ $("#login_b").click(function () { $("#login_f, #register_t").show(); $("#login_t").hide(); return false; }); $("#register_b").click(function () { $("#login_f, #register_t").hide(); $("#login_t").show(); return false; }); /* */ /* */ /* */ $("#srch_again").click(function () { $("#sui_pannel").slideToggle(100); $("#srch_again").toggleClass('sui_search_again_active'); return false; }); /* */ /* */ /* */ $(".ui-datepicker-calendar td a").click(function () { $(".ui-datepicker-calendar td a").removeClass('active'); $(this).addClass("active"); return false; }); /* */ /* */ /* */ //Add Inactive Class To All Accordion Headers $('.htb-acrdn-header').toggleClass('inactive-header'); //Open The First Accordion Section When Page Loads $('.htb-acrdn-header').first().toggleClass('active-header').toggleClass('inactive-header'); $('.htb-acrdn-content').first().slideDown().toggleClass('open-content'); $('#cancelTab').first().toggleClass('active-header').toggleClass('inactive-header'); $('#cancelTab-content').first().slideDown().toggleClass('open-content'); // The Accordion Effect $('.htb-acrdn-header').click(function () { if ($(this).is('.inactive-header')) { $('.active-header').toggleClass('active-header').toggleClass('inactive-header').next().slideToggle('fast').toggleClass('open-content'); $(this).toggleClass('active-header').toggleClass('inactive-header'); $(this).next().slideToggle('fast').toggleClass('open-content'); } else { $(this).toggleClass('active-header').toggleClass('inactive-header'); $(this).next().slideToggle('fast').toggleClass('open-content'); } }); /* */ /* */ /* */ $('.scroll').click(function(e) { var off = -120; var target = this.hash; if ($(target).offset().top == 0) { off = 0; } $('html,body').scrollTo(target,800, { offset: off, //easing: 'easeInOutExpo' }); e.preventDefault(); }); }); /* */ /* */ function resetFields(form) { $(':input', form).each(function () { var type = this.type; var tag = this.tagName.toLowerCase(); if (type == 'text' || type == 'password' || tag == 'textarea' || type == 'file') this.value = "Enter City or Airport"; // to be done for checkbox and radio button else if (type == 'checkbox' || type == 'radio') this.checked = false; else if (tag == 'select') this.selectedIndex = 0; }); }