$(document).ready(function(){ $("a[href*=.pdf]").click(function() { window.open( $(this).attr('href') ); return false; }); $('A[rel="external"]').click( function() { window.open( $(this).attr('href') ); return false; }); $("#tabs").tabs(); $("#first").css("padding-left","19px"); $("#last").css("padding-right","19px"); $("#nav li").hover( function(){ $("ul", this).fadeIn("slow"); }, function() { } ); if (document.all) { $("#nav li").hoverClass("sfHover"); } //$.tabs("tour_info"); $("#tour_inquiry_link").click(function(){ //alert("Go Submit the form"); var whereTo = $("#tour_inquiry_tab").attr("action"); $("#tour_inquiry_tab").submit(); }); $("#printTour").click(function(){ var tourID = $(this).attr('title'); var linkURL = '/getpdf.php?id='+tourID; //alert("you clicked print: "+ tourID); window.open( linkURL ); }); $("#send_friend_submit").click(function(){ var friendemail = $("#friendemail").val(); var friendname = $("#friendname").val(); var youremail = $("#youremail").val(); var yourname = $("#yourname").val(); var message = $("#message").val(); var URL = $("#URL").val(); var dataString = "friendemail="+ friendemail +"&friendname="+ friendname +"&youremail="+ youremail +"&yourname="+ yourname +"&message="+ message +"&URL="+ URL; //alert(dataString); if( (friendemail == "") || (friendname == "") || (youremail == "") || (yourname == "") ) { alert("Your name, your email address as well as your friends name and email address are required."); return false; } else { $.ajax({ type: "POST", url: "/dev/tour-details-send-email.php", data: dataString, success: function(){ $('#friend').hide(""); $('#friendSent').show(""); } }); return false; } }); $("input[name=travelAgent]").change(function(){ var inputVal = $(this).val(); if( inputVal == "Yes"){ $("#travelAgentData").show(); $("#findAgent").hide(); } else { $("#travelAgentData").hide(); $("#findAgent").show(); } }); $("input[name=travelAgentFind]").change(function(){ var inputVal = $(this).val(); if( inputVal == "Yes"){ $("#findAgentZipCode").show(); } else { $("#findAgentZipCode").hide(); } }); }); // For the Dropdowns in the main menu as well. $.fn.hoverClass = function(c) { return this.each(function(){ $(this).hover( function() { $(this).addClass(c); }, function() { $(this).removeClass(c); } ); }); }; function openSendFriendPop() { var linkURL = $('a[rel="send_to_friend"]').attr("href"); window.open(linkURL,"Send to a Friend","menubar=no,width=580,height=240,toolbar=no" ); return false; } function InquiryPopUp(URL) { day = new Date(); id = day.getTime(); eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=560,height=420,left = 350,top = 392');"); } /*$.tabs = function(containerId, start) { var ON_CLASS = 'on'; var id = '#' + containerId; var i = (typeof start == "number") ? start - 1 : 0; $(id + '>div:lt(' + i + ')').add(id + '>div:gt(' + i + ')').hide(); $(id + '>ul>li:nth-child(' + i + ')').addClass(ON_CLASS); $(id + '>ul>li>a').click(function() { if (!$(this.parentNode).is('.' + ON_CLASS)) { var re = /([_\-\w]+$)/i; var target = $('#' + re.exec(this.href)[1]); if (target.size() > 0) { $(id + '>div:visible').hide(); target.show(); $(id + '>ul>li').removeClass(ON_CLASS); $(this.parentNode).addClass(ON_CLASS); } else { alert('There is no such container.'); } } return false; }); };*/