function truncateString(b,a){if(b.length<=a){return b}return b.substring(0,a-1)}function URLDecode(a){return unescape(String(a).replace(/\+/g," "))}function URLEncode(a){return escape(a.replace(/\ /g,"+"))}function trimLeftZeros(a){return a.replace(/^0+/,"")}function getElement(a){return(document.all)?document.all[a]:document.getElementById(a)}function getValue(e){var a=null;if(e!=null){var d=(getValue.arguments[1]!=null)?getValue.arguments[1]:null;if(d!=null){for(var c=0;c<d[e].length;c++){if(d[e][c].checked==true){a=d[e][c].value}}}else{var b=e.selectedIndex;a=(b==null)?e.value:e.options[b].value}}return a}function setValue(e,d){if(e==null){return}var c=(setValue.arguments[2]!=null)?setValue.arguments[2]:null;if(c!=null){for(var b=0;b<c[e].length;b++){if(c[e][b].value==d){c[e][b].checked=true;break}}}else{if(e.type=="text"||e.type=="hidden"){e.value=d}else{if(e.type=="select-one"){var a=false;for(var b=0;b<e.options.length;b++){if(e.options[b].value==d){e.options[b].selected=true;a=true}}if(!a&&e.options.length>0){e.options[0].selected=true}}}}}function disable(b,a){b.disabled=a}function setVisibility(b,a){if(document.layers){b.visibility=a?"show":"hide"}else{b.style.visibility=a?"visible":"hidden"}}function setDisplay(b,a){if(document.layers){b.display=(a)?"block":"none"}else{b.style.display=(a)?"block":"none"}}function disableWidget(b,a){disable(getElement(b),a)}function getWidgetValue(d){var a=null;var c=getElement(d);var b=(getWidgetValue.arguments[1]!=null)?getWidgetValue.arguments[1]:null;if(b!=null){a=getValue(d,document.forms[b])}else{if(c!=null){a=getValue(c)}}return a}function setWidgetValue(d,c){var b=getElement(d);var a=(setWidgetValue.arguments[2]!=null)?setWidgetValue.arguments[2]:null;if(a!=null){setValue(d,c,document.forms[a])}else{if(b!=null){setValue(b,c)}}}function fillForm(g,a){var c=a.substring(1).split("&");var b=new Object();for(var f=0;f<c.length;f++){var d=c[f].split("=");var j=d[0];b[j]=d[1]}var e=g.elements;for(var f=0;f<e.length;f++){var h=b[e[f].name];if(typeof(h)!="undefined"){switch(e[f].type){case"text":case"hidden":e[f].value=URLDecode(h);break;case"radio":case"checkbox":if(URLEncode(e[f].value)==h){e[f].checked=true}else{e[f].checked=false}break}}}}if(isSite("studentuniverse")||isSite("travelocity")){loadStylesheets()}function isSite(b){var a=document.URL;if(a.indexOf(b)!=-1){return 1}return 0}function submitVerify(){var a="Before purchasing this product, please understand that the condition of this product is that travel must be begin within 2 months of the date of purchase and once travel has started it must be completed within 2 months.";document.ProductForm.onsubmit=function(){if(confirm(a)){return true}else{return false}}}function commissionVerify(){var b=document.ShipInfo.commission;var e=document.ShipInfo.agencyServiceFee;if(b==undefined||e==undefined){return true}var d=b.value;var a=e.value;var c="The current commission on this booking is $"+d+"\nPress Ok to continue the checkout process, or Cancel to go back and add an agency fee.";if(a=="0.00"||a==""){if(confirm(c)){return true}else{return false}}else{return true}}function showPopup(f){var d=420;var c=625;var b="status=1,toolbar=1,scrollbars=1,location=0,menu=1,resizable=1";var e=(showPopup.arguments[1]>0)?showPopup.arguments[1]:d;var a=(showPopup.arguments[2]>0)?showPopup.arguments[2]:c;var g=(showPopup.arguments[3])?showPopup.arguments[3]:b;popupWindow=window.open(f,"popupWindow","width="+e+",height="+a+","+g);if(popupWindow!=null){popupWindow.focus()}}function switchPage(e){var c=420;var b=625;var d=(switchPage.arguments[1]>0)?switchPage.arguments[1]:c;var a=(switchPage.arguments[2]>0)?switchPage.arguments[2]:b;window.resizeTo(d,a);window.location.href=e}function switchSite(a){if(this.opener){opener.location=a;close()}else{this.location=a}}function deletePopupClose(a){if(a==1){opener.location="$yesURL"}window.close()}function fsCategory(a){showPopup("/us/rail/fares_schedules/fare_categories/"+a+".htm",380,350,"status=1,toolbar=0,location=0,menu=1,resizable=1,scrollbars=1")}function getStylesheet(){return'<link rel=stylesheet type="text/css" href="'+((navigator.appName=="Microsoft Internet Explorer")?"/css/swiss_en.css":"/css/swiss_en_ns.css")+'">'}function processGoTo(){var a=document.goToForm.GoTo.options[document.goToForm.GoTo.selectedIndex].value;if(a!="../travel_agent.htm"){window.open(a,"_top")}else{showPopup(a,424,280,"status=0,toolbar=0,location=0,menu=0,resizable=1,scrollbars=0")}}function displayCityPopunder(a){win2=window.open(a,"city_promo","status=no,toolbar=no,location=no,menu=no,resizable=yes,scrollbars=no,width=510,height=310");win2.blur();window.focus()}function loadStylesheets(){browser_version=parseInt(navigator.appVersion);browser_type=navigator.appName;platform=navigator.platform;platform_slice=platform.slice(0,3);if(browser_type=="Microsoft Internet Explorer"&&(browser_version>=4)){document.write("<link REL='stylesheet' href='/iestyle.css' TYPE='text/css'>")}else{if(browser_type=="Netscape"&&(platform_slice=="Mac")&&(browser_version!=5)){document.write("<link REL='stylesheet' href='/macstyle.css' TYPE='text/css'>")}else{if(browser_type=="Netscape"&&(browser_version>=4)){document.write("<link REL='stylesheet' href='/nsstyle.css' TYPE='text/css'>")}}}}function MM_swapImgRestore(){var d,b,c=document.MM_sr;for(d=0;c&&d<c.length&&(b=c[d])&&b.oSrc;d++){b.src=b.oSrc}}function MM_preloadImages(){var f=document;if(f.images){if(!f.MM_p){f.MM_p=new Array()}var e,c=f.MM_p.length,b=MM_preloadImages.arguments;for(e=0;e<b.length;e++){if(b[e].indexOf("#")!=0){f.MM_p[c]=new Image;f.MM_p[c++].src=b[e]}}}}function MM_findObj(f,e){var c,b,a;if(!e){e=document}if((c=f.indexOf("?"))>0&&parent.frames.length){e=parent.frames[f.substring(c+1)].document;f=f.substring(0,c)}if(!(a=e[f])&&e.all){a=e.all[f]}for(b=0;!a&&b<e.forms.length;b++){a=e.forms[b][f]}for(b=0;!a&&e.layers&&b<e.layers.length;b++){a=MM_findObj(f,e.layers[b].document)}if(!a&&e.getElementById){a=e.getElementById(f)}return a}function MM_swapImage(){var e,d=0,b,c=MM_swapImage.arguments;document.MM_sr=new Array;for(e=0;e<(c.length-2);e+=3){if((b=MM_findObj(c[e]))!=null){document.MM_sr[d++]=b;if(!b.oSrc){b.oSrc=b.src}b.src=c[e+2]}}}function preload(){MM_preloadImages("/images/travelcuts/bookflight1.gif","/images/travelcuts/onlinetravelshop1.gif","/images/travelcuts/hotdeals1.gif","/images/travelcuts/ebulletin1.gif","/images/buttons/submit1.gif","/images/buttons/close1.gif","/images/buttons/buy_now1.gif","/images/buttons/get_fares_schedules1.gif","/images/buttons/add_to_shopping_cart_bgd1.gif","/images/buttons/add_to_shopping_cart1.gif","/images/buttons/yes1.gif")}function processing_init(){MM_preloadImages("/images/buttons/processing_order.gif","/img/misc/processing_train.gif")}function submitOrder(a){showProcessing();var b=document.forms[a];b.submit()}function showProcessing(){if(document.layers){document.submit_order.visibility="hidden";document.processing_order.visibility="visible"}if(document.all){submit_order.style.visibility="hidden";processing_order.style.visibility="visible"}if(!document.all&&document.getElementById){document.getElementById("submit_order").style.visibility="hidden";document.getElementById("processing_order").style.visibility="visible"}}function textCounter(c,a,b){if(c.value.length>b){c.value=c.value.substring(0,b)}else{if(a!=null){a.value=b-c.value.length}}}function MM_showHideLayers(){var c,e,a,d,b=MM_showHideLayers.arguments;for(c=0;c<(b.length-2);c+=3){if((d=MM_findObj(b[c]))!=null){a=b[c+2];if(d.style){d=d.style;a=(a=="show")?"visible":(a=="hide")?"hidden":a}d.visibility=a}}}function getQueryValue(a){var b=parseQuery();return b[a]}function parseQuery(){var b=new Array();var f=window.location.search.substring(1);var e=f.split("&");for(var c=0;c<e.length;c++){var g=e[c].indexOf("=");if(g>=0){var a=e[c].substring(0,g);var d=e[c].substring(g+1);b[a]=d}}return b}var RE_answers=new Array(20);function flip(c){var b=document.getElementById("que"+c);var a=document.getElementById("ans"+c);if(b==null||a==null){alert("Cotrol(s) null");return}if(RE_answers[c]==null){RE_answers[c]=b.innerHTML;b.innerHTML=RE_answers[c]+"<br/>"+a.innerHTML}else{b.innerHTML=RE_answers[c];RE_answers[c]=null}}function addOnloadEvent(a){var b=window.onload;if(typeof window.onload!="function"){window.onload=a}else{window.onload=function(){if(b){b()}a()}}}function addOnunloadEvent(b){var a=window.onunload;if(typeof window.onunload!="function"){window.onunload=b}else{window.onunload=function(){if(a){a()}b()}}}function StringBuffer(){this.buffer=[]}StringBuffer.prototype.append=function append(a){this.buffer.push(a);return this};StringBuffer.prototype.toString=function toString(){return this.buffer.join("")};var dateFormat=function(){var a=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,b=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,d=/[^-+\dA-Z]/g,c=function(f,e){f=String(f);e=e||2;while(f.length<e){f="0"+f}return f};return function(i,v,q){var g=dateFormat;if(arguments.length==1&&Object.prototype.toString.call(i)=="[object String]"&&!/\d/.test(i)){v=i;i=undefined}i=i?new Date(i):new Date;if(isNaN(i)){throw SyntaxError("invalid date")}v=String(g.masks[v]||v||g.masks["default"]);if(v.slice(0,4)=="UTC:"){v=v.slice(4);q=true}var t=q?"getUTC":"get",l=i[t+"Date"](),e=i[t+"Day"](),j=i[t+"Month"](),p=i[t+"FullYear"](),r=i[t+"Hours"](),k=i[t+"Minutes"](),u=i[t+"Seconds"](),n=i[t+"Milliseconds"](),f=q?0:i.getTimezoneOffset(),h={d:l,dd:c(l),ddd:g.i18n.dayNames[e],dddd:g.i18n.dayNames[e+7],m:j+1,mm:c(j+1),mmm:g.i18n.monthNames[j],mmmm:g.i18n.monthNames[j+12],yy:String(p).slice(2),yyyy:p,h:r%12||12,hh:c(r%12||12),H:r,HH:c(r),M:k,MM:c(k),s:u,ss:c(u),l:c(n,3),L:c(n>99?Math.round(n/10):n),t:r<12?"a":"p",tt:r<12?"am":"pm",T:r<12?"A":"P",TT:r<12?"AM":"PM",Z:q?"UTC":(String(i).match(b)||[""]).pop().replace(d,""),o:(f>0?"-":"+")+c(Math.floor(Math.abs(f)/60)*100+Math.abs(f)%60,4),S:["th","st","nd","rd"][l%10>3?0:(l%100-l%10!=10)*l%10]};return v.replace(a,function(m){return m in h?h[m]:m.slice(1,m.length-1)})}}();dateFormat.masks={"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"};dateFormat.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]};Date.prototype.format=function(a,b){return dateFormat(this,a,b)};String.prototype.strip=function(a){return this.replace(a?a:/\s/g,"")};String.prototype.startsWith=function(a){return(this.match("^"+a)==a)};String.prototype.trim=function(){return this.replace(/^\s\s*/,"").replace(/\s\s*$/,"")};