Array.prototype._css=function(f){if(f){for(var d in f){var e=/^(\w*)(?:-(\w*))?$/.exec(d.toLowerCase());if(e){var a=e[1];for(var c=2;c<e.length;c++){if(e[c]&&e[c].length>0){a=a+e[c].charAt(0).toUpperCase()+e[c].substring(1)}}for(var b=0;b<this.length;b++){this[b].style[a]=f[d]}}}}};Array.prototype._width=function(){if(this.length>1){var c=[this[0]]._left();var a=[this[0]]._left()+[this[0]]._width();for(var b=1;b<this.length;b++){c=Math.min(c,[this[b]]._left());a=Math.max(a,[this[b]]._left()+[this[b]]._width())}return a>c?a-c:0}else{if(this[0]==document){return Math.max(screen.availWidth,Math.max(document.body.scrollWidth,document.documentElement.scrollWidth))}else{return this[0].offsetWidth}}};Array.prototype._height=function(){if(this.length>1){var c=[this[0]]._top();var a=[this[0]]._top()+[this[0]]._height();for(var b=1;b<this.length;b++){c=Math.min(c,[this[b]]._top());a=Math.max(a,[this[b]]._top()+[this[b]]._height())}return a>c?a-c:0}else{if(this[0]==document){return Math.max(screen.availHeight,Math.max(document.body.scrollHeight,document.documentElement.scrollHeight))}else{return this[0].offsetHeight}}};Array.prototype._top=function(){if(this.length>1){var b=[this[0]]._top();for(var a=1;a<this.length;a++){b=Math.min(b,[this[a]]._top())}return b}else{if(this[0].offsetParent){return this[0].offsetTop+[this[0].offsetParent]._top()}return this[0].offsetTop}};Array.prototype._scrollTop=function(){if(this[0]==document){return Math.max(document.body.scrollTop,document.documentElement.scrollTop)}else{return this[0].scrollTop}};Array.prototype._left=function(){if(this.length>1){var b=[this[0]]._left();for(var a=1;a<this.length;a++){b=Math.min(b,[this[a]]._left())}return b}else{if(this[0].offsetParent){return this[0].offsetLeft+[this[0].offsetParent]._left()}return this[0].offsetLeft}};Array.prototype._scrollLeft=function(){if(this[0]==document){return Math.max(document.body.scrollLeft,document.documentElement.scrollLeft)}else{return this[0].scrollLeft}};Array.prototype._unload=function(a){for(var b=0;b<this.length;b++){while(this[b].childNodes.length>(a?1:0)){this[b].removeChild(this[b].lastChild)}}};Array.prototype._enable=function(){for(var a=0;a<this.length;a++){this[a].disabled=false}};Array.prototype._disable=function(){for(var a=0;a<this.length;a++){this[a].disabled=true}};_fa$=function(a){return document.getElementById(a)};_checkEmail=function(a){return/^[0-9a-zA-Z]+(?:[\.|_][0-9a-zA-Z]+)*@[0-9a-zA-Z]+(?:\.[0-9a-zA-Z]+)+$/.exec(a.value)!=null};_checkDouble=function(c){if(c.value<0){c.value=0}var b=/^\d+(?:[\.|,]\d+)?$/.exec(c.value)!=null;if(b){var a=(c.value.indexOf(",")!=-1);if(a){c.value=c.value.replace(",",".")}c.value=parseFloat(c.value).toFixed(2);if(a){c.value=c.value.replace(".",",")}}return b};function AbstractAjax(){_READY_STATE_UNINITIALIZED=0;_READY_STATE_LOADING=1;_READY_STATE_LOADED=2;_READY_STATE_INTERACTIVE=3;_READY_STATE_COMPLETE=4;var a=null;_getRequest=function(){return a};_initializeRequest=function(){a=null;try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){a=null}}if(!a&&(typeof(XMLHttpRequest)!="undefined")){a=new XMLHttpRequest()}};_executeCall=function(c){if(a){try{a.onreadystatechange=function(){if(a.readyState==_READY_STATE_COMPLETE){if((a.status==200)||(a.status==0)){_success()}else{_error()}}};a.open("POST",c,true);a.setRequestHeader("Content-Type","application/x-www-form-urlencoded");a.send(_params())}catch(b){alert(b.description?b.description:b);_error()}}else{window.status="Unable to load XMLHttpRequest object!"}};_process=function(b){_initializeRequest();_executeCall(b)};_getNode=function(e,f){var d=null;if(e){var b=e.childNodes;for(var c=0;c<b.length?b.length:0;c++){if(b[c].nodeName==f){d=b[c];break}}}return d};_getNodeValue=function(e,f){var c=null;if(e){var b=e.childNodes;for(var d=0;d<b.length?b.length:0;d++){if(b[d].nodeName==f){c=b[d].firstChild?b[d].firstChild.nodeValue:"";break}}}return c};_wait=function(f,b){if(f){if(b){_getLoaderLayer().className="farealert_loader";[_getLoaderLayer()]._css({width:[f]._width()+"px",height:[f]._height()+"px"});document.body.appendChild(_getLoaderLayer());var g=[f]._left();var d=[f]._top();[_getLoaderLayer()]._css({position:"absolute",top:d+"px",left:g+"px",opacity:0.65,filter:"alpha(opacity=65)","z-index":"9200"});var c=document.createElement("img");_getLoaderLayer().appendChild(c);c.src="/ibcomv3/images/loading.gif";var i=([_getLoaderLayer()]._height()/2)-([c]._height()/2);var j=([_getLoaderLayer()]._width()/2)-([c]._width()/2);[c]._css({position:"relative",top:i+"px",left:j+"px"})}else{_getLoaderLayer().className="farealert_loader";document.body.appendChild(_getLoaderLayer());[_getLoaderLayer()]._css({position:"absolute",width:[f]._width()+"px",height:[f]._height()+"px",left:[f]._left()+"px",top:[f]._top()+"px","z-index":"9200"});[f]._css({display:"none"});_prepareCall()}}else{_getLoaderLayer().className="farealert_loader";document.body.appendChild(_getLoaderLayer());[_getLoaderLayer()]._css({opacity:0.65,filter:"alpha(opacity=65)","z-index":"9999",position:"absolute",top:_getCombos()._top()+"px",left:_getCombos()._left()+"px",width:_getCombos()._width()+"px",height:_getCombos()._height()+"px"});var c=document.createElement("img");c.src="/ibcomv3/images/loading.gif";_getLoaderLayer().appendChild(c);var e=([_getLoaderLayer()]._height()/2)-([c]._height()/2);var h=([_getLoaderLayer()]._width()/2)-([c]._width()/2);[c]._css({position:"relative",top:e+"px",left:h+"px"})}}}function AjaxFareAlertEmail(c){_getLoaderLayer=function(){if(!e){e=document.createElement("div")}return e};_prepareCall=function(){var q=_fa$("fae_loadingMessage").innerHTML;var o=document.createElement("table");o.id="fae_title";o.className="farealert_title";e.appendChild(o);var j=document.createElement("tbody");o.appendChild(j);var p=document.createElement("tr");j.appendChild(p);var l=document.createElement("td");l.appendChild(document.createTextNode(q));p.appendChild(l);var k=document.createElement("tr");j.appendChild(k);var i=document.createElement("td");k.appendChild(i);var h=document.createElement("img");h.alt=q;h.src="/ibcomv3/images/loading.gif";i.appendChild(h);var n=([e]._width()/2)-([o]._width()/2);var m=([e]._height()/2)-([o]._height()/2);[o]._css({position:"relative",top:m+"px",left:n+"px"})};_success=function(){var j=_getNodeValue(_getNode(_getNode(_getRequest().responseXML,"info"),"configuration"),"registeredUser");var n=_getNodeValue(_getNode(_getNode(_getRequest().responseXML,"info"),"configuration"),"error");var r=null;if(n){r=a}else{if(j){f.alertId.value=d.alertId.value;f.origin.value=d.origin.options[d.origin.selectedIndex].value;var h=d.destinationType[0].value;for(var l=0;l<d.destinationType.length;l++){if(d.destinationType[l].checked){h=d.destinationType[l].value}}f.destinationType.value=h;f.destinationArea.value=d.destinationArea.options[d.destinationArea.selectedIndex].value;f.destinationSubarea.value=d.destinationSubarea.options[d.destinationSubarea.selectedIndex].value;f.destination.value=d.destination.options[d.destination.selectedIndex].value;var o=d.alertSearchType[0].value;for(var l=0;l<d.alertSearchType.length;l++){if(d.alertSearchType[l].checked){o=d.alertSearchType[l].value}}f.alertSearchType.value=o;f.departureDay.value=d.departureDay.options[d.departureDay.selectedIndex].value;f.departureMonth.value=d.departureMonth.options[d.departureMonth.selectedIndex].value;f.departureDaysBefore.value=d.departureDaysBefore.options[d.departureDaysBefore.selectedIndex].value;f.returnDay.value=d.returnDay.options[d.returnDay.selectedIndex].value;f.returnMonth.value=d.returnMonth.options[d.returnMonth.selectedIndex].value;f.returnDaysAfter.value=d.returnDaysAfter.options[d.returnDaysAfter.selectedIndex].value;f.completeMonth.value=d.completeMonth.checked;f.departureWeekendThursday.value=d.departureWeekendThursday.options[d.departureWeekendThursday.selectedIndex].value;f.departureWeekendFriday.value=d.departureWeekendFriday.options[d.departureWeekendFriday.selectedIndex].value;f.addThursday.value=d.addThursday.checked;f.returnWeekendSunday.value=d.returnWeekendSunday.options[d.returnWeekendSunday.selectedIndex].value;f.returnWeekendMonday.value=d.returnWeekendMonday.options[d.returnWeekendMonday.selectedIndex].value;f.addMonday.value=d.addMonday.checked;var k=d.recurrence[0].value;for(var l=0;l<d.recurrence.length;l++){if(d.recurrence[l].checked){k=d.recurrence[l].value}}f.recurrence.value=k;f.maxBudget.value=d.maxBudget.value;f.language.value=d.language.value;f.email.value=d.email.value;f.currency.value=d.currency.value;f.terms.value=d.terms.checked;[_fa$("fae_loginErrorLayer")]._css({display:"none"});r=g}else{r=b;var q=_getNode(_getRequest().responseXML,"info");_fa$("fae_infoOrigin").innerHTML=_getNodeValue(q,"originText");_fa$("fae_infoDestination").innerHTML=_getNodeValue(q,"destinationText");[_fa$("fae_infoDateLayer"),_fa$("fae_infoWeekendLayer"),_fa$("fae_infoMaxBudgetLayer")]._css({display:"none"});var p=_getNodeValue(q,"departureDateString");if(p){_fa$("fae_infoDeparture").innerHTML=_getNodeValue(q,"departureDateString");_fa$("fae_infoDepartureDays").innerHTML=_getNodeValue(q,"departureDaysBefore");_fa$("fae_infoReturn").innerHTML=_getNodeValue(q,"returnDateString");_fa$("fae_infoReturnDays").innerHTML=_getNodeValue(q,"returnDaysAfter");[_fa$("fae_infoDateLayer")]._css({display:"block"})}else{_fa$("fae_infoWeekendDeparture").innerHTML=_getNodeValue(q,"departureWeekendString");_fa$("fae_infoWeekendReturn").innerHTML=_getNodeValue(q,"returnWeekendString");[_fa$("fae_infoWeekendLayer")]._css({display:"block"})}var s=_getNodeValue(q,"maxBudget");if(s){[_fa$("fae_infoMaxBudgetLayer")]._css({display:"block"});_fa$("fae_infoMaxBudget").innerHTML=s}_fa$("fae_infoEmail").innerHTML=d.email.value;[_fa$("fae_infoAltaNormal")]._css({display:(d.mobileAlert.checked?"none":"block")});try{[_fa$("fae_infoAltaMobileDevice")]._css({display:(d.mobileAlert.checked?"block":"none")})}catch(m){}}}r.parentNode.removeChild(r);document.body.appendChild(r);[r]._css({position:"absolute",top:[e]._top()+"px",left:[e]._left()+"px",display:"block","z-index":"9100"});if(e.parentNode){e.parentNode.removeChild(e)}_showErrors(n)};_error=function(){alert(_getRequest().responseText);if(e.parentNode){e.parentNode.removeChild(e)}[a]._css({display:"block"})};_showErrors=function(h){if(h){_fa$("fae_errorMessage").innerHTML=h;[_fa$("fae_errorLayer")]._css({display:"block"})}};_params=function(){var n=d.recurrence[0].value;for(var j=0;j<d.recurrence.length;j++){if(d.recurrence[j].checked){n=d.recurrence[j].value}}var k=d.destinationType[0].value;for(var j=0;j<d.destinationType.length;j++){if(d.destinationType[j].checked){k=d.destinationType[j].value}}var h=d.alertSearchType[0].value;for(var j=0;j<d.alertSearchType.length;j++){if(d.alertSearchType[j].checked){h=d.alertSearchType[j].value}}var m={alertId:d.alertId.value,origin:escape(d.origin.options[d.origin.selectedIndex].value),destinationType:k,destinationArea:escape(d.destinationArea.options[d.destinationArea.selectedIndex].value),destinationSubarea:escape(d.destinationSubarea.options[d.destinationSubarea.selectedIndex].value),destination:escape(d.destination.options[d.destination.selectedIndex].value),departureDay:d.departureDay.options[d.departureDay.selectedIndex].value,departureMonth:d.departureMonth.options[d.departureMonth.selectedIndex].value,departureDaysBefore:d.departureDaysBefore.options[d.departureDaysBefore.selectedIndex].value,returnDay:d.returnDay.options[d.returnDay.selectedIndex].value,returnMonth:d.returnMonth.options[d.returnMonth.selectedIndex].value,returnDaysAfter:d.returnDaysAfter.options[d.returnDaysAfter.selectedIndex].value,completeMonth:d.completeMonth.checked,departureWeekendThursday:d.departureWeekendThursday.options[d.departureWeekendThursday.selectedIndex].value,departureWeekendFriday:d.departureWeekendFriday.options[d.departureWeekendFriday.selectedIndex].value,addThursday:d.addThursday.checked,returnWeekendSunday:d.returnWeekendSunday.options[d.returnWeekendSunday.selectedIndex].value,returnWeekendMonday:d.returnWeekendMonday.options[d.returnWeekendMonday.selectedIndex].value,addMonday:d.addMonday.checked,alertSearchType:h,recurrence:n,maxBudget:escape(d.maxBudget.value),language:escape(d.language.value),email:escape(d.email.value),terms:d.terms.checked,ffNumber:d.ffNumber.value,ffCompany:d.ffCompany.value,currency:d.currency.value,isVisitorRegistered:d.visitorRegistered.value,country:d.country.value,market:d.market.value,mobileAlert:d.mobileAlert.checked};var l="alertId="+m.alertId+"&origin="+m.origin+"&destinationType="+m.destinationType+"&destinationArea="+m.destinationArea+"&destinationSubarea="+m.destinationSubarea+"&destination="+m.destination+"&alertSearchType="+m.alertSearchType+"&departureDay="+m.departureDay+"&departureMonth="+m.departureMonth+"&departureDaysBefore="+m.departureDaysBefore+"&returnDay="+m.returnDay+"&returnMonth="+m.returnMonth+"&returnDaysAfter="+m.returnDaysAfter+"&completeMonth="+m.completeMonth+"&departureWeekendThursday="+m.departureWeekendThursday+"&departureWeekendFriday="+m.departureWeekendFriday+"&addThursday="+m.addThursday+"&returnWeekendSunday="+m.returnWeekendSunday+"&returnWeekendMonday="+m.returnWeekendMonday+"&addMonday="+m.addMonday+"&recurrence="+m.recurrence+"&maxBudget="+m.maxBudget+"&language="+m.language+"&email="+m.email+"&ffNumber="+m.ffNumber+"&currency="+m.currency+"&ffCompany="+m.ffCompany+"&terms="+m.terms+"&isVisitorRegistered="+m.isVisitorRegistered+"&country="+m.country+"&market="+m.market+"&mobileAlert="+m.mobileAlert;return l};var d=_fa$("fae_form");var a=_fa$("fae_sendLayer");var b=_fa$("fae_infoLayer");var g=_fa$("fae_registerLayer");var f=_fa$("fae_loginForm");var e=null;[b,g,_fa$("fae_errorLayer")]._css({display:"none"});_wait(a);_process(c)}AjaxFareAlertEmail.prototype=new AbstractAjax();function AjaxFareAlertRss(c){_getLoaderLayer=function(){if(!e){e=document.createElement("div")}return e};_prepareCall=function(){var o=_fa$("far_loadingMessage").innerHTML;var m=document.createElement("table");m.id="far_title";m.className="farealert_title";e.appendChild(m);var h=document.createElement("tbody");m.appendChild(h);var n=document.createElement("tr");h.appendChild(n);var j=document.createElement("td");j.appendChild(document.createTextNode(o));n.appendChild(j);var i=document.createElement("tr");h.appendChild(i);var g=document.createElement("td");i.appendChild(g);var f=document.createElement("img");f.alt=o;f.src="/ibcomv3/images/loading.gif";g.appendChild(f);var l=([e]._width()/2)-([m]._width()/2);var k=([e]._height()/2)-([m]._height()/2);[m]._css({position:"relative",top:k+"px",left:l+"px"})};_success=function(){var l=_getNodeValue(_getNode(_getNode(_getRequest().responseXML,"info"),"configuration"),"error");var o=null;if(l){o=a}else{o=b;var n=_getNode(_getRequest().responseXML,"info");_fa$("far_dynamic_rss").href=_getNodeValue(n,"rss");if(_fa$("far_rssReaders").childNodes){[_fa$("far_rssReaders")]._unload(false)}if(_getNode(n,"rss_readers")){var k=_getNode(n,"rss_readers").childNodes;var j=0;for(var g=0;g<k.length;g++){j++;var f=document.createElement("a");f.href=_getNodeValue(k[g],"url");var h=document.createElement("img");f.appendChild(h);h.src=_getNodeValue(k[g],"img");h.alt=_getNodeValue(k[g],"id");_fa$("far_rssReaders").appendChild(f);if(j==5){j=0;_fa$("far_rssReaders").appendChild(document.createElement("br"))}}}_fa$("far_infoOrigin").innerHTML=_getNodeValue(n,"originText");_fa$("far_infoDestination").innerHTML=_getNodeValue(n,"destinationText");[_fa$("far_infoDateLayer"),_fa$("far_infoWeekendLayer"),_fa$("far_infoMaxBudgetLayer")]._css({display:"none"});var m=_getNodeValue(n,"departureDateString");if(m){_fa$("far_infoDeparture").innerHTML=_getNodeValue(n,"departureDateString");_fa$("far_infoDepartureDays").innerHTML=_getNodeValue(n,"departureDaysBefore");_fa$("far_infoReturn").innerHTML=_getNodeValue(n,"returnDateString");_fa$("far_infoReturnDays").innerHTML=_getNodeValue(n,"returnDaysAfter");[_fa$("far_infoDateLayer")]._css({display:"block"})}else{_fa$("far_infoWeekendDeparture").innerHTML=_getNodeValue(n,"departureWeekendString");_fa$("far_infoWeekendReturn").innerHTML=_getNodeValue(n,"returnWeekendString");[_fa$("far_infoWeekendLayer")]._css({display:"block"})}var p=_getNodeValue(n,"maxBudget");if(p){[_fa$("far_infoMaxBudgetLayer")]._css({display:"block"});_fa$("far_infoMaxBudget").innerHTML=p}}o.parentNode.removeChild(o);document.body.appendChild(o);[o]._css({position:"absolute",top:[e]._top()+"px",left:[e]._left()+"px",display:"block","z-index":"9100"});if(e.parentNode){e.parentNode.removeChild(e)}_showErrors(l)};_error=function(){alert(_getRequest().responseText);if(e.parentNode){e.parentNode.removeChild(e)}[a]._css({display:"block"})};_showErrors=function(f){if(f){_fa$("far_errorMessage").innerHTML=f;[_fa$("far_errorLayer")]._css({display:"block"})}};_params=function(){var h=d.destinationType[0].value;for(var g=0;g<d.destinationType.length;g++){if(d.destinationType[g].checked){h=d.destinationType[g].value}}var f=d.alertSearchType[0].value;for(var g=0;g<d.alertSearchType.length;g++){if(d.alertSearchType[g].checked){f=d.alertSearchType[g].value}}var k={origin:escape(d.origin.options[d.origin.selectedIndex].value),destinationType:h,destinationArea:escape(d.destinationArea.options[d.destinationArea.selectedIndex].value),destinationSubarea:escape(d.destinationSubarea.options[d.destinationSubarea.selectedIndex].value),destination:escape(d.destination.options[d.destination.selectedIndex].value),departureDay:d.departureDay.options[d.departureDay.selectedIndex].value,departureMonth:d.departureMonth.options[d.departureMonth.selectedIndex].value,departureDaysBefore:d.departureDaysBefore.options[d.departureDaysBefore.selectedIndex].value,returnDay:d.returnDay.options[d.returnDay.selectedIndex].value,returnMonth:d.returnMonth.options[d.returnMonth.selectedIndex].value,returnDaysAfter:d.returnDaysAfter.options[d.returnDaysAfter.selectedIndex].value,completeMonth:d.completeMonth.checked,departureWeekendThursday:d.departureWeekendThursday.options[d.departureWeekendThursday.selectedIndex].value,departureWeekendFriday:d.departureWeekendFriday.options[d.departureWeekendFriday.selectedIndex].value,addThursday:d.addThursday.checked,returnWeekendSunday:d.returnWeekendSunday.options[d.returnWeekendSunday.selectedIndex].value,returnWeekendMonday:d.returnWeekendMonday.options[d.returnWeekendMonday.selectedIndex].value,addMonday:d.addMonday.checked,alertSearchType:f,maxBudget:escape(d.maxBudget.value),language:escape(d.language.value),terms:d.terms.checked,currency:d.currency.value,country:d.country.value,market:d.market.value};var j="origin="+k.origin+"&destinationType="+k.destinationType+"&destinationArea="+k.destinationArea+"&destinationSubarea="+k.destinationSubarea+"&destination="+k.destination+"&alertSearchType="+k.alertSearchType+"&departureDay="+k.departureDay+"&departureMonth="+k.departureMonth+"&departureDaysBefore="+k.departureDaysBefore+"&returnDay="+k.returnDay+"&returnMonth="+k.returnMonth+"&returnDaysAfter="+k.returnDaysAfter+"&completeMonth="+k.completeMonth+"&departureWeekendThursday="+k.departureWeekendThursday+"&departureWeekendFriday="+k.departureWeekendFriday+"&addThursday="+k.addThursday+"&returnWeekendSunday="+k.returnWeekendSunday+"&returnWeekendMonday="+k.returnWeekendMonday+"&addMonday="+k.addMonday+"&maxBudget="+k.maxBudget+"&language="+k.language+"&currency="+k.currency+"&terms="+k.terms+"&country="+k.country+"&market="+k.market;return j};var d=_fa$("far_form");var a=_fa$("far_sendLayer");var b=_fa$("far_infoLayer");var e=null;[b,_fa$("far_errorLayer")]._css({display:"none"});_wait(a);_process(c)}AjaxFareAlertRss.prototype=new AbstractAjax();function AjaxFareAlertManage(e,n,p,u,o,k,i,l,h,c){_getLoaderLayer=function(){if(!r){r=document.createElement("div")}return r};_getRow=function(v){var y=document.getElementsByTagName("tr");for(var w=0;w<y.length;w++){if(y[w].title){var x=/^fae_(\d+)$/.exec(y[w].title);if((x!=null)&&(x[1]==v)){return y[w]}}}};_success=function(){var B=true;var x=_getNodeValue(_getNode(_getNode(_getRequest().responseXML,"info"),"configuration"),"error");if(x){alert(unescape(x))}else{var v=true;var w=_fa$("fae_table").lastChild;[w]._unload(true);var C=_getNode(_getNode(_getRequest().responseXML,"info"),"alerts");if(C){var A=C.childNodes;v=_fa$("fae_maxAlerts").value>A.length;for(var z=0;z<A.length;z++){var y=A[z];w.appendChild(_createAlertRow(y,(z%2==0)))}}else{B=false}if(_fa$("fae_moreAlertsAllowed")){if(v){[_fa$("fae_moreAlertsAllowed")]._css({display:"block"})}else{[_fa$("fae_moreAlertsAllowed")]._css({display:"none"})}}}if(r&&r.parentNode){r.parentNode.removeChild(r)}[_fa$("fae_tableLayer")]._css(B==true?{display:"block"}:{display:"none"});[_fa$("fae_table")]._css({width:"100%"})};_createAlertRow=function(ab,L){var Q="#ffffff";var X="#f5f5f3";var A="#00aa00";var B="#cc6600";var G="#ff0000";var O=_getNodeValue(ab,"id");var S=_getNodeValue(ab,"alertLocked");var w=document.createElement("tr");w.id="fae_"+O;w.title=_getNodeValue(ab,"originDestinationText");[w]._css({background:(L?Q:X),"text-align":"center","vertical-align":"middle"});var F=document.createElement("td");w.appendChild(F);F.id="fae_state_"+O;if(S){[F]._css({color:G,padding:"0.3em 0",width:"10%","padding-left":"0.5em","text-align":"left"});F.appendChild(document.createTextNode(S))}else{var D=_getNodeValue(ab,"state");[F]._css({color:(D==1?A:B),padding:"0.3em 0",width:"10%","padding-left":"0.5em","text-align":"left"});F.appendChild(document.createTextNode(_getNodeValue(ab,"stateText")))}var P=document.createElement("td");w.appendChild(P);P.id="fae_odText_"+O;[P]._css({padding:"0.3em 0em",width:"60%"});var x=document.createElement("div");P.appendChild(x);[x]._css({"padding-left":"0.5em","text-align":"left"});var M=document.createElement("div");x.appendChild(M);[M]._css({"font-weight":"bold"});M.appendChild(document.createTextNode(_getNodeValue(ab,"originDestinationText")));var W=document.createElement("div");x.appendChild(W);W.appendChild(document.createTextNode(_getNodeValue(ab,"dateText")));var N=document.createElement("td");w.appendChild(N);N.id="fae_recurrence_"+O;[N]._css({padding:"0.3em 0em",width:"15%","padding-left":"0.5em","text-align":"left"});var H=_getNodeValue(ab,"alertType")=="M";if(H){var V=document.createElement("img");V.src="/ibcomv3/images/icon_iphone_bip.png";[V]._css({"vertical-align":"text-bottom"});N.appendChild(V)}else{N.appendChild(document.createTextNode(_getNodeValue(ab,"recurrenceText")))}var R=document.createElement("td");w.appendChild(R);[R]._css({padding:"0.3em 0 0.3em 0",width:"5%"});var Z=document.createElement("table");R.appendChild(Z);Z.id="fae_edit_"+O;Z.summary="";[Z]._css({width:"100%","vertical-align":"middle"});var I=document.createElement("tbody");Z.appendChild(I);var J=document.createElement("tr");I.appendChild(J);if(S){var v=document.createElement("td");J.appendChild(v);[v]._css({color:G,"padding-left":"0.5em","text-align":"left"});v.appendChild(document.createTextNode(S))}else{[J]._css({cursor:"pointer"});var v=document.createElement("td");J.appendChild(v);[v]._css({"padding-left":"0.5em","text-align":"left",color:"#5b5b5b"});v.appendChild(document.createTextNode(_getNodeValue(ab,"editText")));Z.alertId=_getNodeValue(ab,"id");Z.origin=_getNodeValue(ab,"origin");Z.destinationType=_getNodeValue(ab,"destinationType");Z.destinationArea=_getNodeValue(ab,"destinationArea");Z.destinationSubarea=_getNodeValue(ab,"destinationSubarea");Z.destination=_getNodeValue(ab,"destination");Z.departureDay=_getNodeValue(ab,"departureDay");Z.departureMonth=_getNodeValue(ab,"departureMonth");Z.departureDaysBefore=_getNodeValue(ab,"departureDaysBefore");Z.returnDay=_getNodeValue(ab,"returnDay");Z.returnMonth=_getNodeValue(ab,"returnMonth");Z.returnDaysAfter=_getNodeValue(ab,"returnDaysAfter");Z.departureWeekendThursday=_getNodeValue(ab,"departureWeekendThursday");Z.departureWeekendFriday=_getNodeValue(ab,"departureWeekendFriday");Z.weekendThursdayList=_getNodeValue(ab,"weekendThursdayList");Z.weekendFridayList=_getNodeValue(ab,"weekendFridayList");Z.returnWeekendSunday=_getNodeValue(ab,"returnWeekendSunday");Z.returnWeekendMonday=_getNodeValue(ab,"returnWeekendMonday");Z.weekendSundayList=_getNodeValue(ab,"weekendSundayList");Z.weekendMondayList=_getNodeValue(ab,"weekendMondayList");Z.alertSearchType=_getNodeValue(ab,"alertSearchType");Z.recurrence=_getNodeValue(ab,"recurrence");Z.maxBudget=_getNodeValue(ab,"maxBudget");Z.encodedEmail=_getNodeValue(ab,"encodedEmail");Z.email=_getNodeValue(ab,"email");Z.alertType=_getNodeValue(ab,"alertType");try{Z.completeMonth=parseInt(_getNodeValue(ab,"completeMonth"))!=0}catch(U){}Z.onclick=function(){new CreateFareAlert({alertId:this.alertId,origin:this.origin,destinationType:this.destinationType,destinationArea:this.destinationArea,destinationSubarea:this.destinationArea+"%"+this.destinationSubarea,destination:this.destination,departureDay:this.departureDay,departureMonth:this.departureMonth,departureDaysBefore:this.departureDaysBefore,returnDay:this.returnDay,returnMonth:this.returnMonth,returnDaysAfter:this.returnDaysAfter,departureWeekendThursday:this.departureWeekendThursday,departureWeekendFriday:this.departureWeekendFriday,weekendThursdayList:this.weekendThursdayList,weekendFridayList:this.weekendFridayList,returnWeekendSunday:this.returnWeekendSunday,returnWeekendMonday:this.returnWeekendMonday,weekendSundayList:this.weekendSundayList,weekendMondayList:this.weekendMondayList,alertSearchType:this.alertSearchType,recurrence:this.recurrence,maxBudget:this.maxBudget,encodedEmail:this.encodedEmail,email:this.email,completeMonth:this.completeMonth,alertType:this.alertType});return false}}var E=document.createElement("td");w.appendChild(E);[R]._css({padding:"0.3em 0 0.3em 0",width:"5%"});var aa=document.createElement("table");E.appendChild(aa);aa.id="fae_action_"+O;aa.summary="";[aa]._css({width:"100%","vertical-align":"middle"});var z=document.createElement("tbody");aa.appendChild(z);var Y=document.createElement("tr");z.appendChild(Y);if(S){var v=document.createElement("td");Y.appendChild(v);[v]._css({color:G,"padding-left":"0.5em","text-align":"left"});v.appendChild(document.createTextNode(S))}else{var D=_getNodeValue(ab,"state");[Y]._css({cursor:"pointer"});var v=document.createElement("td");Y.appendChild(v);[v]._css({"padding-left":"0.5em","text-align":"left",color:"#5b5b5b"});v.appendChild(document.createTextNode(_getNodeValue(ab,"actionText")));aa.alertId=_getNodeValue(ab,"id");aa.origin=_getNodeValue(ab,"origin");aa.destination=_getNodeValue(ab,"destination");aa.departureDate=_getNodeValue(ab,"departureDate");aa.returnDate=_getNodeValue(ab,"returnDate");aa.alertSearchType=_getNodeValue(ab,"alertSearchType");aa.recurrence=_getNodeValue(ab,"recurrence");aa.encodedEmail=_getNodeValue(ab,"encodedEmail");if(D==0){aa.onclick=function(){new AjaxFareAlertManage(_fa$("fa_manageAlert").href,this.encodedEmail,4,this.origin,this.destination,this.alertSearchType,this.departureDate,this.returnDate,this.recurrence,this.alertId);return false}}else{aa.onclick=function(){new AjaxFareAlertManage(_fa$("fa_manageAlert").href,this.encodedEmail,3,this.origin,this.destination,this.alertSearchType,this.departureDate,this.returnDate,this.recurrence,this.alertId);return false}}}var T=document.createElement("td");w.appendChild(T);[T]._css({padding:"0.3em 0 0.3em 0",width:"5%"});var C=document.createElement("table");T.appendChild(C);[C]._css({width:"100%","vertical-align":"middle"});var K=document.createElement("tbody");C.appendChild(K);var y=document.createElement("tr");K.appendChild(y);[y]._css({cursor:"pointer"});var v=document.createElement("td");y.appendChild(v);[v]._css({"padding-left":"0.5em","text-align":"left",color:"#5b5b5b"});v.appendChild(document.createTextNode(_getNodeValue(ab,"deleteText")));C.alertId=_getNodeValue(ab,"id");C.origin=_getNodeValue(ab,"origin");C.destination=_getNodeValue(ab,"destination");C.departureDate=_getNodeValue(ab,"departureDate");C.returnDate=_getNodeValue(ab,"returnDate");C.alertSearchType=_getNodeValue(ab,"alertSearchType");C.recurrence=_getNodeValue(ab,"recurrence");C.encodedEmail=_getNodeValue(ab,"encodedEmail");C.onclick=function(){new AjaxFareAlertManage(_fa$("fa_manageAlert").href,this.encodedEmail,5,this.origin,this.destination,this.alertSearchType,this.departureDate,this.returnDate,this.recurrence,this.alertId);return false};return w};_error=function(){alert(_getRequest().responseText);if(r&&r.parentNode){r.parentNode.removeChild(r)}};_params=function(){var w="";var v={email:escape(d),action:b,alertId:m,origin:escape(f),destination:escape(j),alertType:t,departureDate:a,returnDate:s,recurrence:q};w="email="+v.email+(v.action!=null?"&action="+v.action:"")+(v.alertId!=null?"&alertId="+v.alertId+"&origin="+v.origin+"&destination="+v.destination+"&alertType="+v.alertType+"&departureDate="+v.departureDate+"&returnDate="+v.returnDate+"&recurrence="+v.recurrence:"");return w};var r=null;var g=e;var d=n;var b=p;var m=c;var f=u;var j=o;var t=k;var a=i;var s=l;var q=h;[_fa$("fae_table")]._css({width:"100%"});_wait(_fa$("fae_tableLayer"),true);_process(g)}AjaxFareAlertManage.prototype=new AbstractAjax();_showFAText=function(a){[_fa$(a.listlink),_fa$(a.listid)]._css({display:"none"});[_fa$(a.textlink),_fa$(a.textid)]._css({display:"block"});return false};_showFAList=function(a){[_fa$(a.listlink),_fa$(a.listid)]._css({display:"block"});[_fa$(a.textlink),_fa$(a.textid)]._css({display:"none"});return false};_initializeAutoCompleteBox=function(b){var a=_fa$(b);if((a.origin.options[a.origin.selectedIndex].value!=-1)&&(a.origin.options[a.origin.selectedIndex].value!=-2)){_fa$(a.origin.id+"_textbox").value=a.origin.options[a.origin.selectedIndex].text}if((a.destinationArea.options[a.destinationArea.selectedIndex].value!=-1)&&(a.destinationArea.options[a.destinationArea.selectedIndex].value!=-2)){_fa$(a.destinationArea.id+"_textbox").value=a.destinationArea.options[a.destinationArea.selectedIndex].text}if((a.destinationSubarea.options[a.destinationSubarea.selectedIndex].value!=-1)&&(a.destinationSubarea.options[a.destinationSubarea.selectedIndex].value!=-2)){_fa$(a.destinationSubarea.id+"_textbox").value=a.destinationSubarea.options[a.destinationSubarea.selectedIndex].text}if((a.destination.options[a.destination.selectedIndex].value!=-1)&&(a.destination.options[a.destination.selectedIndex].value!=-2)){_fa$(a.destination.id+"_textbox").value=a.destination.options[a.destination.selectedIndex].text}};_showFareAlertEmailForm=function(){if(initFareAlertEmail){initFareAlertEmail()}var d=_fa$("fae_opacityLayer");d.parentNode.removeChild(d);document.body.appendChild(d);[d]._css({position:"absolute",top:"0px",left:"0px",height:[document]._height()+"px",width:[document]._width()+"px",display:"block","z-index":"9000"});var a=_fa$("fae_sendLayer");[a]._css({display:"block"});var b=(screen.availWidth/2)-([a]._width()/2)+[document]._scrollLeft();if((b+[a]._width())>[d]._width()){b=[d]._width()-[a]._width()}var c=(screen.availHeight/2)-([a]._height()/2)+[document]._scrollTop();if((c+[a]._height())>[d]._height()){c=[d]._height()-[a]._height()}a.parentNode.removeChild(a);document.body.appendChild(a);[a]._css({position:"absolute",top:c+"px",left:b+"px","z-index":"9100"});_initializeAutoCompleteBox("fae_form");_hideLandingsCombos()};_hideFareAlertEmailForm=function(c){_fa$("fae_alertId").value=-1;[_fa$("fae_opacityLayer"),_fa$("fae_sendLayer"),_fa$("fae_infoLayer"),_fa$("fae_errorLayer"),_fa$("fae_registerLayer")]._css({display:"none"});var d=document.getElementsByTagName("div");for(var b=0;b<d.length;b++){if((d[b].id)&&(/^.*_autocomplete_layer$/.exec(d[b].id)!=null)&&(d[b].parentNode)){d[b].parentNode.removeChild(d[b])}}if(faeCalendar){faeCalendar.hide()}if(c){try{refreshFareAlertHome()}catch(a){}try{new AjaxFareAlertManage(_fa$("fa_manageAlert").href,_fa$("fae_userEncodedEmail").value)}catch(a){}}_showLandingsCombos()};_checkFareAlertEmailLoginFailed=function(b){var e=_fa$("fae_opacityLayer");e.parentNode.removeChild(e);document.body.appendChild(e);[opacityLayer]._css({position:"absolute",top:"0px",left:"0px",height:[document]._height()+"px",width:[document]._width()+"px",display:"block","z-index":"9000"});var d=_fa$("fae_registerLayer");[d]._css({display:"block"});var a=(screen.availWidth/2)-([d]._width()/2)+[document]._scrollLeft();if((a+[d]._width())>[e]._width()){a=[e]._width()-[d]._width()}var c=(screen.availHeight/2)-([d]._height()/2)+[document]._scrollTop();if((c+[d]._height())>[e]._height()){c=[e]._height()-[d]._height()}d.parentNode.removeChild(d);document.body.appendChild(d);[d]._css({position:"absolute",top:c+"px",left:a+"px","z-index":"9100"});[_fa$("fae_loginErrorLayer")]._css({display:"block"});_fa$("fae_loginErrorMessage").innerHTML=b};_showFareAlertRssForm=function(){if(initFareAlertRss){initFareAlertRss()}var d=_fa$("far_opacityLayer");d.parentNode.removeChild(d);document.body.appendChild(d);[d]._css({position:"absolute",top:"0px",left:"0px",height:[document]._height()+"px",width:[document]._width()+"px",display:"block","z-index":"9000"});var a=_fa$("far_sendLayer");[a]._css({display:"block"});var b=(screen.availWidth/2)-([a]._width()/2)+[document]._scrollLeft();if((b+[a]._width())>[d]._width()){b=[d]._width()-[a]._width()}var c=(screen.availHeight/2)-([a]._height()/2)+[document]._scrollTop();if((c+[a]._height())>[d]._height()){c=[d]._height()-[a]._height()}a.parentNode.removeChild(a);document.body.appendChild(a);[a]._css({position:"absolute",top:c+"px",left:b+"px","z-index":"9100"});_initializeAutoCompleteBox("far_form");_hideLandingsCombos()};_hideFareAlertRssForm=function(){[_fa$("far_opacityLayer"),_fa$("far_sendLayer"),_fa$("far_infoLayer"),_fa$("far_errorLayer")]._css({display:"none"});var b=document.getElementsByTagName("div");for(var a=0;a<b.length;a++){if((b[a].id)&&(/^.*_autocomplete_layer$/.exec(b[a].id)!=null)&&(b[a].parentNode)){b[a].parentNode.removeChild(b[a])}}if(farCalendar){farCalendar.hide}_showLandingsCombos()};_hideLandingsCombos=function(){var a=/^.*MSIE\s(\d(?:\.\d)?).*$/.exec(navigator.appVersion);if((a!=null)&&(parseFloat(a[1])<7)){if(_fa$("ciudadOrigen_0")){[_fa$("ciudadOrigen_0")]._css({visibility:"hidden"})}if(_fa$("ciudadDestino_0")){[_fa$("ciudadDestino_0")]._css({visibility:"hidden"})}if(_fa$("diaSalida")){[_fa$("diaSalida")]._css({visibility:"hidden"})}if(_fa$("mesAnioSalida")){[_fa$("mesAnioSalida")]._css({visibility:"hidden"})}if(_fa$("horaSalida")){[_fa$("horaSalida")]._css({visibility:"hidden"})}if(_fa$("diaRegreso")){[_fa$("diaRegreso")]._css({visibility:"hidden"})}if(_fa$("mesRegreso")){[_fa$("mesRegreso")]._css({visibility:"hidden"})}if(_fa$("horaRegreso")){[_fa$("horaRegreso")]._css({visibility:"hidden"})}if(_fa$("horaSalida")){[_fa$("horaSalida")]._css({visibility:"hidden"})}if(_fa$("precio")){[_fa$("precio")]._css({visibility:"hidden"})}if(_fa$("ADT")){[_fa$("ADT")]._css({visibility:"hidden"})}if(_fa$("CHD")){[_fa$("CHD")]._css({visibility:"hidden"})}if(_fa$("INF")){[_fa$("INF")]._css({visibility:"hidden"})}}};_showLandingsCombos=function(){var a=/^.*MSIE\s(\d(?:\.\d)?).*$/.exec(navigator.appVersion);if((a!=null)&&(parseFloat(a[1])<7)){if(_fa$("ciudadOrigen_0")){[_fa$("ciudadOrigen_0")]._css({visibility:"visible"})}if(_fa$("ciudadDestino_0")){[_fa$("ciudadDestino_0")]._css({visibility:"visible"})}if(_fa$("diaSalida")){[_fa$("diaSalida")]._css({visibility:"visible"})}if(_fa$("mesAnioSalida")){[_fa$("mesAnioSalida")]._css({visibility:"visible"})}if(_fa$("horaSalida")){[_fa$("horaSalida")]._css({visibility:"visible"})}if(_fa$("diaRegreso")){[_fa$("diaRegreso")]._css({visibility:"visible"})}if(_fa$("mesRegreso")){[_fa$("mesRegreso")]._css({visibility:"visible"})}if(_fa$("horaRegreso")){[_fa$("horaRegreso")]._css({visibility:"visible"})}if(_fa$("horaSalida")){[_fa$("horaSalida")]._css({visibility:"visible"})}if(_fa$("precio")){[_fa$("precio")]._css({visibility:"visible"})}if(_fa$("ADT")){[_fa$("ADT")]._css({visibility:"visible"})}if(_fa$("CHD")){[_fa$("CHD")]._css({visibility:"visible"})}if(_fa$("INF")){[_fa$("INF")]._css({visibility:"visible"})}}};var faeWeekendThursdayList=null;var faeWeekendFridayList=null;var faeWeekendSundayList=null;var faeWeekendMondayList=null;CreateFareAlert=function(a){_loadCombo=function(h,g,c){if(c){var b=c.split("##");for(var d=0;d<b.length;d++){var f=b[d].split("#");var e=document.createElement("option");e.value=f[0];e.appendChild(document.createTextNode(f.length>1?f[1]:f[0]));h.appendChild(e)}h.disabled=false;if(g){h.value=g}}else{h.disabled=true}};_createWeekendList=function(){faeWeekendThursdayList="";faeWeekendFridayList="";faeWeekendSundayList="";faeWeekendMondayList="";var c=_fa$("fae_form");for(var b=0;b<c.departureWeekendThursday.length;b++){faeWeekendThursdayList=faeWeekendThursdayList+c.departureWeekendThursday.options[b].value+"#"+c.departureWeekendThursday.options[b].text;if(b<c.departureWeekendThursday.length-1){faeWeekendThursdayList=faeWeekendThursdayList+"##"}}for(var b=0;b<c.departureWeekendFriday.length;b++){faeWeekendFridayList=faeWeekendFridayList+c.departureWeekendFriday.options[b].value+"#"+c.departureWeekendFriday.options[b].text;if(b<c.departureWeekendFriday.length-1){faeWeekendFridayList=faeWeekendFridayList+"##"}}for(var b=0;b<c.returnWeekendSunday.length;b++){faeWeekendSundayList=faeWeekendSundayList+c.returnWeekendSunday.options[b].value+"#"+c.returnWeekendSunday.options[b].text;if(b<c.returnWeekendSunday.length-1){faeWeekendSundayList=faeWeekendSundayList+"##"}}for(var b=0;b<c.returnWeekendMonday.length;b++){faeWeekendMondayList=faeWeekendMondayList+c.returnWeekendMonday.options[b].value+"#"+c.returnWeekendMonday.options[b].text;if(b<c.returnWeekendMonday.length-1){faeWeekendMondayList=faeWeekendMondayList+"##"}}};_createNewAlert=function(){[_fa$("fae_alertSearchTypeMenu")]._css({display:"block"});[_fa$("fae_mapSelection")]._css({display:"none"});var e=_fa$("fae_form");var c=new Date();e.alertId.value=-1;e.origin.value=-1;_fa$("fae_origin_textbox").value="";e.destinationType[2].checked=true;e.destinationArea.value=-1;_fa$("fae_destinationArea_textbox").value="";e.destinationSubarea.value=-1;_fa$("fae_destinationSubarea_textbox").value="";e.destination.value=-1;_fa$("fae_destination_textbox").value="";if(faeWeekendThursdayList){[e.departureWeekendThursday,e.departureWeekendFriday,e.returnWeekendSunday,e.returnWeekendMonday]._unload(false);_loadCombo(e.departureWeekendThursday,null,faeWeekendThursdayList);_loadCombo(e.departureWeekendFriday,null,faeWeekendFridayList);_loadCombo(e.returnWeekendSunday,null,faeWeekendSundayList);_loadCombo(e.returnWeekendMonday,null,faeWeekendMondayList)}var d=String(c.getFullYear());var f=c.getMonth()<10?"0"+String(c.getMonth()+1):String(c.getMonth()+1);var b=c.getDate()<10?"0"+String(c.getDate()):String(c.getDate());e.departureDay.value=b;e.departureMonth.value=d+f;e.departureDaysBefore.value=0;e.returnDay.value=b;e.returnMonth.value=d+f;e.returnDaysAfter.value=0;e.completeMonth.checked=false;e.departureWeekendThursday.value=e.departureWeekendThursday.options[0].value;e.departureWeekendFriday.value=e.departureWeekendFriday.options[0].value;e.returnWeekendSunday.value=e.returnWeekendSunday.options[0].value;e.returnWeekendMonday.value=e.returnWeekendMonday.options[0].value;e.addThursday.checked=false;e.addMonday.checked=false;e.maxBudget.value="";e.email.value=_fa$("fae_userEmail").value;_fa$("fae_email").value=e.email.value;_fa$("fae_email").className="disabled";_fa$("fae_email").disabled=true;e.terms.checked=false;e.recurrence[0].checked=true;e.alertSearchType[0].value="B";e.alertSearchType[0].checked=true;e.mobileAlert.checked=false};_initializeForm=function(g){[_fa$("fae_alertSearchTypeMenu")]._css({display:"none"});[_fa$("fae_mapSelection")]._css({display:"none"});var e=_fa$("fae_form");e.alertId.value=g.alertId;e.origin.value=g.origin;_fa$("fae_origin_textbox").value=e.origin.options[e.origin.selectedIndex].text;if(!faeWeekendThursdayList){_createWeekendList()}[e.departureWeekendThursday,e.departureWeekendFriday,e.returnWeekendSunday,e.returnWeekendMonday]._unload(false);_loadCombo(e.departureWeekendThursday,g.departureWeekendThursday,g.weekendThursdayList);_loadCombo(e.departureWeekendFriday,g.departureWeekendFriday,g.weekendFridayList);_loadCombo(e.returnWeekendSunday,g.returnWeekendSunday,g.weekendSundayList);_loadCombo(e.returnWeekendMonday,g.returnWeekendMonday,g.weekendMondayList);e.departureDay.value=g.departureDay;e.departureMonth.value=g.departureMonth;e.departureDaysBefore.value=g.departureDaysBefore;e.addThursday.checked=new Date(parseInt(g.departureMonth.substring(0,4)),parseInt(g.departureMonth.substring(4))-1,parseInt(g.departureDay)).getDay()==4;e.returnDay.value=g.returnDay;e.returnMonth.value=g.returnMonth;e.returnDaysAfter.value=g.returnDaysAfter;e.addMonday.checked=new Date(parseInt(g.returnMonth.substring(0,4)),parseInt(g.returnMonth.substring(4))-1,parseInt(g.returnDay)).getDay()==1;e.completeMonth.checked=g.completeMonth;for(var c=0;c<e.destinationType.length;c++){if(e.destinationType[c].value==g.destinationType){e.destinationType[c].checked=true}}e.destinationArea.value=g.destinationArea;_fa$("fae_destinationArea_textbox").value=e.destinationArea.options[e.destinationArea.selectedIndex].text;e.destinationSubarea.value=g.destinationSubarea;_fa$("fae_destinationSubarea_textbox").value=e.destinationSubarea.options[e.destinationSubarea.selectedIndex].text;var f=false;if(/^MAPA.*$/.exec(g.destination)!=null){f=true;var d=_fa$("fae_mapSelection");d.value=g.destination;[d]._css({display:"block"})}e.destination.value=g.destination;_fa$("fae_destination_textbox").value=f?"":e.destination.options[e.destination.selectedIndex].text;for(var c=0;c<e.recurrence.length;c++){if(e.recurrence[c].value==g.recurrence){e.recurrence[c].checked=true}}var b=false;for(var c=0;c<e.alertSearchType.length;c++){if(e.alertSearchType[c].value==g.alertSearchType){e.alertSearchType[c].checked=true;b=true}}if(!b){_fa$("fae_alertSearchTypeNonWeekend").value=g.alertSearchType;_fa$("fae_alertSearchTypeNonWeekend").checked=true}e.maxBudget.value=g.maxBudget;_fa$("fae_email_hidden").value=g.email;_fa$("fae_email").value=g.email;_fa$("fae_email").disabled=true;e.terms.checked=false;e.mobileAlert.checked=g.alertType=="M"};if(a){_initializeForm(a)}else{_createNewAlert()}initFareAlertEmail();_showFareAlertEmailForm()};function FACalendar(e){var a=e;var d=new Date(a.today.getFullYear(),a.today.getMonth(),a.today.getDate());var c=new Date(d.getFullYear(),d.getMonth(),parseInt(d.getDate()+a.nDays));var b=new Array();var f=null;_getDay=function(g){return g.value.charAt(0)=="0"?parseInt(g.value.substr(1)):parseInt(g.value)};_getMonth=function(g){return g.value.charAt(4)=="0"?parseInt(g.value.substr(5))-1:parseInt(g.value.substr(4))-1};_getYear=function(g){return parseInt(g.value.substr(0,4))};_getDate=function(g,h){return new Date(_getYear(h),_getMonth(h),_getDay(g))};_returnDayWeek=function(h,j,i){var g=arguments.length==1?h.getDay():new Date(i,j,h).getDay();g=g==0?6:g-1;return a.weekdays[g]};_getLastMonthDay=function(g,h){switch(h){case 1:return g%100==0?g%400==0?29:28:g%4==0?29:28;case 0:case 2:case 4:case 6:case 7:case 9:case 11:return 31;default:return 30}};_checkValidDates=function(h){for(var g=0;g<h.length;g++){if(_getDay(h[g][1][0])>_getLastMonthDay(_getYear(h[g][1][1]),_getMonth(h[g][1][1]))){h[g][1][0].selectedIndex=forms.getSelectedByValue(h[g][1][0],_getLastMonthDay(_getYear(h[g][1][1]),_getMonth(h[g][1][1])).toString())}}};_getValidFirstDate=function(l){var j=new Date(_getYear(l[0][1][1]),_getMonth(l[0][1][1]),_getDay(l[0][1][0]),0,0,0);var h=new Date();var g=parseInt(new String(j.getFullYear())+new String(j.getMonth()<10?"0"+j.getMonth():j.getMonth())+new String(j.getDate()<10?"0"+j.getDate():j.getDate()));var k=parseInt(new String(h.getFullYear())+new String(h.getMonth()<10?"0"+h.getMonth():h.getMonth())+new String(h.getDate()<10?"0"+h.getDate():h.getDate()));if(g<k){if(j.getDate()<h.getDate()){var i=parseInt(h.getMonth()+2).toString();l[0][1][1].selectedIndex=forms.getSelectedByValue(l[0][1][1],i.length>1?h.getFullYear().toString()+i:h.getFullYear().toString()+"0"+i)}else{var i=parseInt(h.getMonth()+1).toString();l[0][1][1].selectedIndex=forms.getSelectedByValue(l[0][1][1],i.length>1?h.getFullYear().toString()+i:h.getFullYear().toString()+"0"+i)}_checkValidDates(l)}return new Date(_getYear(l[0][1][1]),_getMonth(l[0][1][1]),_getDay(l[0][1][0]),0,0,0)};_compareDates=function(n,g){_checkValidDates(n);var m=_getValidFirstDate(n);for(var l=0;l<n.length;l++){if((l>0)&&(l==g)){if(_getDay(n[l][1][0])<m.getDate()){var k=forms.getSelectedByValue(n[l][1][1],parseInt(n[0][1][1].value)+1);if(k!=null){n[l][1][1].selectedIndex=k}else{n[l][1][0].selectedIndex=forms.getSelectedByValue(n[l][1][0],m.getDate().toString().length>1?m.getDate().toString():"0"+m.getDate().toString())}_checkValidDates(n)}}var h=new Date(_getYear(n[l][1][1]),_getMonth(n[l][1][1]),_getDay(n[l][1][0]),0,0,0);if(h<m){n[l][1][0].selectedIndex=forms.getSelectedByValue(n[l][1][0],m.getDate().toString().length>1?m.getDate().toString():"0"+m.getDate().toString());var j=parseInt(m.getMonth()+1).toString();n[l][1][1].selectedIndex=forms.getSelectedByValue(n[l][1][1],j.length>1?m.getFullYear().toString()+j:m.getFullYear().toString()+"0"+j);_checkValidDates(n)}if(n[l][1][2]){n[l][1][2].innerHTML=_returnDayWeek(_getDay(n[l][1][0]),_getMonth(n[l][1][1]),_getYear(n[l][1][1]))}}};_create=function(l){for(var n=0;n<l.length;n++){var h=l[n];var g=l[n][1][0];var k=l[n][1][1];var j=_getDate(g,k);if(l[n][1][2]){[l[n][1][2]]._css({display:"block"});l[n][1][2].innerHTML=_returnDayWeek(j)}g._allC=l;g.dateIndex=n;g.onchange=function(){_compareDates(this._allC,this.dateIndex)};k._allC=l;k.onchange=function(){_compareDates(this._allC)};var o=document.createElement("a");o.href="#";o._obj=l[n][1];o._allC=l;o.onclick=function(){_init(this._obj,this,this._allC);return false};var m=document.createElement("img");m.src=config.urlImg+"calendar.gif";o.appendChild(m);page.$(l[n][0]).appendChild(o)}};_init=function(l,j,i){b=new Array();b.day=l[0];b.month=l[1];b.nameDay=l[2]?l[2]:null;idInput=b.day.id;var g=b.day.value;var k=parseInt(b.month.value.substr(4,6),10)-1;var h=parseInt(b.month.value.substr(0,4),10);_deleteCalendars();f=document.createElement("div");f.className="calendar";_paint(g,k,h,f,i);[f]._css({display:"block","z-index":"99999",left:xy.getX(j)+"px",top:xy.getY(j)+"px"})};_paint=function(o,g,p,n,k){var q=n.childNodes;for(var l=q.length-1;l>=0;l--){n.removeChild(q[l])}var j=document.createElement("table");j.cellPadding=0;j.cellSpacing=0;var r=document.getElementsByTagName("body")[0];r.appendChild(n);var h=document.createElement("div");h.appendChild(document.createTextNode("b"));[h]._css({height:"1px",width:"1px",border:"1px solid red",display:"inline",overflow:"hidden"});r.appendChild(h);_paintNavigation(o,g,p,n,k);n.appendChild(j);_paintDayOfWeek(a.weekdays,j);_paintMonth(o,g,p,j,k)};_deleteCalendars=function(){if((f)&&(f.parentNode)){f.parentNode.removeChild(f)}};_paintNavigation=function(q,m,o,l,k){var g=document.createElement("p");g.className="clear";var r=document.createElement("a");r.href="#";var h=document.createElement("img");h.alt=a.txtBackNextMonth[0];h.title=a.txtBackNextMonth[0];h.src=config.urlImg+"btn_calendarBack.gif";h.className="backmonth";var t=m-1;var j=o;var n=q;if(t<0){t=11;j=o-1}r.onclick=function(){_paint(n,t,j,l,k);return false};r.appendChild(h);g.appendChild(r);var s=document.createElement("span");s.className="txtmonth";s.appendChild(document.createTextNode(a.months[m]+" "+o));g.appendChild(s);var u=document.createElement("a");u.href="#";var i=document.createElement("img");i.alt=a.txtBackNextMonth[1];i.title=a.txtBackNextMonth[1];i.src=config.urlImg+"btn_calendarForward.gif";i.className="nextmonth";u.onclick=function(){var v=m+1;var p=o;if(v==12){v=0;p=o+1}_paint(n,v,p,l,k);return false};u.appendChild(i);g.appendChild(u);l.appendChild(g)};_paintDayOfWeek=function(h,j){var l=document.createElement("thead");var n=document.createElement("tr");for(var k=0;k<h.length;k++){var g=document.createElement("th");var m=document.createElement("abbr");m.title=h[k];m.appendChild(document.createTextNode(h[k].substr(0,2)));g.appendChild(m);n.appendChild(g)}l.appendChild(n);j.appendChild(l)};_paintMonth=function(B,I,u,y,p){var B=parseInt(B,10);var F=new Date(u,I,1);var t=F.getDay();var r=0;var z=0;var s=0;if(t==0){t=7}if(I>0){r=Gdate.dayMonth(I-1,u);z=I-1;s=u}else{r=Gdate.dayMonth(11,u-1);z=11;s=u-1}var h=document.createElement("tbody");var k=document.createElement("tr");for(var A=r-(t-1)+1;A<=r;A++){var l=document.createElement("td");l.className="cellOtroMes";var J=new Date(s,z,A);l.appendChild(document.createTextNode(""));k.appendChild(l)}var m=t;for(var C=1;C<=7-t+1;C++){var l=document.createElement("td");var v=document.createTextNode(C);var H=document.createElement("a");H.href="#";var J=new Date(u,I,C-1,0,0,0);if((J<=c)&&((d<=J)||(d.getDate()==C))){H.appendChild(v);if((H.firstChild.data==B)&&(I==b.month.value.substr(4,6)-1)){l.className="nullDat"}H._allC=p;H.onclick=function(){_returnSelection(this.firstChild.data,I,u);_compareDates(this._allC);return false};l.appendChild(H)}else{var o=document.createElement("span");o.appendChild(document.createTextNode(C));o.className="nullDat";l.appendChild(o)}if(J<=d){[y.parentNode.childNodes[0].getElementsByTagName("a")[0]]._css({display:"none"})}k.appendChild(l);m++}h.appendChild(k);y.appendChild(h);var G=C;var E=2;var K=0;var w=0;if(I==11){K=0;w=u+1}else{K=I+1;w=u}var D=0;while((E<=6)&&(parseInt(D)<Gdate.dayMonth(I,u))){var q=document.createElement("tr");for(var x=1;x<=7;x++){if(G<=Gdate.dayMonth(I,u)){var l=document.createElement("td");var v=document.createTextNode(G);var H=document.createElement("a");H.href="#";var J=new Date(u,I,G+1);if((J<=c)&&(d<J)||((d.getDate()==G)&&(J.getMonth()>=I)&&(J.getMonth()>=u))){H.appendChild(v);if((H.firstChild.data==B)&&(I==b.month.value.substr(4,6)-1)){l.className="nullDat"}l.appendChild(H);H._allC=p;H.onclick=function(){_returnSelection(this.firstChild.data,I,u);_compareDates(this._allC);return false}}else{var g=document.createElement("span");g.appendChild(document.createTextNode(G));g.className="nullDat";l.appendChild(g);if(J>c){[y.parentNode.childNodes[0].getElementsByTagName("a")[1]]._css({display:"none"})}}D=G;q.appendChild(l)}else{var l=document.createElement("td");l.className="cellOtroMes";l.appendChild(document.createTextNode(""));q.appendChild(l)}G++}h.appendChild(q);E++}};_returnSelection=function(l,h,n){var g=h+1;var j=b.day;var i=b.month;var k=b.nameDay;j.selectedIndex=forms.getSelectedByValue(j,l.toString().length>1?l.toString():"0"+l.toString());i.selectedIndex=forms.getSelectedByValue(i,g.toString().length>1?n.toString()+g.toString():n.toString()+"0"+g.toString());if(k){k.innerHTML=_returnDayWeek(new Date(g+"/"+l+"/"+n))}_deleteCalendars()}}FACalendar.prototype={load:function(){_create(arguments);return this},hide:function(){_deleteCalendars()}};_removeAutoCompleteLayers=function(){var c=document.getElementsByTagName("div");for(var a=0;a<c.length;a++){if(c[a].id){var b=/^.*_autocomplete_layer$/.exec(c[a].id);if(b){c[a].parentNode.removeChild(c[a])}}}};function AutoCompleteFareAlert(c){_checkKey=function(l){switch(l?l.keyCode:window.event.keyCode){case 13:_setValue();break;case 27:_hide();break;case 38:_scroll(-1);break;case 40:_scroll(1);break;default:_selected=0;_showList()}};_hide=function(){if(_fa$(f.id+"_autocomplete_layer")){_fa$(f.id+"_autocomplete_layer").parentNode.removeChild(_fa$(f.id+"_autocomplete_layer"))}};_setValue=function(){var l=_loadDataArray();if(l[AutoCompleteFareAlert[f.id]].t.indexOf(j)<0){f.value=l[AutoCompleteFareAlert[f.id]].t;d.value=l[AutoCompleteFareAlert[f.id]].v}else{f.value="";d.value=-1}_hide()};_scroll=function(p){AutoCompleteFareAlert[f.id]=AutoCompleteFareAlert[f.id]+p;if(!_fa$(f.id+"_layer_"+AutoCompleteFareAlert[f.id])){AutoCompleteFareAlert[f.id]=AutoCompleteFareAlert[f.id]-p}var o=(AutoCompleteFareAlert[f.id])%2==0;var n=o?a:e;var m=o?h:k;if(p<0){var l=[_fa$(f.id+"_layer_"+AutoCompleteFareAlert[f.id])]._top()-([_fa$(f.id+"_autocomplete_layer")]._top()+_fa$(f.id+"_autocomplete_layer").clientHeight);if(_fa$(f.id+"_autocomplete_layer").scrollTop-_fa$(f.id+"_autocomplete_layer").clientHeight>l){_fa$(f.id+"_autocomplete_layer").scrollTop=Math.min(_fa$(f.id+"_autocomplete_layer").scrollTop,l+_fa$(f.id+"_autocomplete_layer").clientHeight)}}else{var l=[_fa$(f.id+"_layer_"+AutoCompleteFareAlert[f.id])]._height()+[_fa$(f.id+"_layer_"+AutoCompleteFareAlert[f.id])]._top()-([_fa$(f.id+"_autocomplete_layer")]._top()+_fa$(f.id+"_autocomplete_layer").clientHeight);if(_fa$(f.id+"_autocomplete_layer").scrollTop<l){_fa$(f.id+"_autocomplete_layer").scrollTop=Math.min(_fa$(f.id+"_autocomplete_layer").scrollHeight,l)}}[_fa$(f.id+"_layer_"+(AutoCompleteFareAlert[f.id]-p))]._css({background:n,color:m,"font-weight":"normal"});[_fa$(f.id+"_layer_"+AutoCompleteFareAlert[f.id])]._css({background:i,color:g,"font-weight":"bold"})};_showList=function(){if(_fa$(f.id+"_autocomplete_layer")){_fa$(f.id+"_autocomplete_layer").parentNode.removeChild(_fa$(f.id+"_autocomplete_layer"))}if(f.value.length>0){if(AutoCompleteFareAlert[f.id]<0){AutoCompleteFareAlert[f.id]=0}var s=_loadDataArray();if(AutoCompleteFareAlert[f.id]>s.length-1){AutoCompleteFareAlert[f.id]=s.length-1}var l=document.createElement("div");document.body.appendChild(l);l.id=f.id+"_autocomplete_layer";if((s[0])&&(!s[0].v)){var r=document.createElement("div");l.appendChild(r);r.id=f.id+"_layer_0";[r]._css({background:e,color:k,padding:"0.2em","font-size":"1.1em","border-collapse":"collapse","font-weight":"bold","font-style":"italic"});r.appendChild(document.createTextNode(s[0].t))}else{for(var t=0;t<s.length;t++){var v=(t+1)%2==0;var m=AutoCompleteFareAlert[f.id]==t?i:v?a:e;var q=AutoCompleteFareAlert[f.id]==t?g:v?h:k;var r=document.createElement("div");l.appendChild(r);r.id=f.id+"_layer_"+t;[r]._css({background:m,color:q,padding:"0.2em","font-size":"1.1em","border-collapse":"collapse",cursor:"pointer"});var x=document.createElement("span");r.appendChild(x);x.id=f.id+"_layer_"+t+"_value";[x]._css({display:"none"});x.appendChild(document.createTextNode(s[t].v));var o=s[t].t.substring(0,s[t].bi);var p=document.createElement("span");p.appendChild(document.createTextNode(o));r.appendChild(p);[p]._css({"font-weight":"normal","border-collapse":"collapse"});var w=s[t].t.substring(s[t].bi,s[t].ei);var u=document.createElement("span");u.appendChild(document.createTextNode(w));r.appendChild(u);[u]._css({"font-weight":"bold","border-collapse":"collapse"});var y=s[t].t.substring(s[t].ei);var n=document.createElement("span");n.appendChild(document.createTextNode(y));r.appendChild(n);[n]._css({clear:"both","font-weight":"normal","border-collapse":"collapse"});r.index=t;r.value=s[t].v;r.text=s[t].text;r.selectedBgColor=i;r.selectedColor=g;r.unselectedBgColor=v?a:e;r.unselectedColor=v?h:k;r._unselect=function(){[this]._css({background:this.unselectedBgColor,color:this.unselectedColor})};r.onmouseover=function(){_fa$(f.id+"_layer_"+AutoCompleteFareAlert[f.id])._unselect();AutoCompleteFareAlert[f.id]=this.index;[this]._css({background:this.selectedBgColor,color:this.selectedColor})};r.onclick=function(){_setValue()}}}[l]._css({"font-family":"Arial",position:"absolute",top:[f]._top()+[f]._height()+"px",left:[f]._left()+"px",width:[f]._width()+"px","z-index":"9300",border:"1px solid "+i,"border-collapse":"collapse"});if(s.length>b){var z=[_fa$(f.id+"_layer_"+b)]._height();var A=z*b;[l]._css({height:A+"px",overflow:"auto"})}}};_loadDataArray=function(){var m=new Array();var q=0;var o=f.value.toLowerCase();for(var n=0;n<d.length;n++){if((/^MAPA#.*$/.exec(d.options[n].value)==null)&&(d.options[n].value!=-1)&&(d.options[n].value!=-2)&&(d.options[n].value!="")){var p=d.options[n].text.toLowerCase();var t=parseInt(p.indexOf(o));var l=t+o.length;var r=d.options[n].value;var s=d.options[n].text;if((t!=-1)&&(!_isDuplicate(m,r))){m[q]={bi:t,ei:l,t:s,v:r};q++}}}if(q==0){m[0]={bi:-1,ei:-1,t:j,v:null}}return m};_isDuplicate=function(n,m){for(var l=0;l<n.length;l++){if(n[l]&&n[l].v&&(n[l].v==m)){return true}}return false};var f=c.text;var d=c.combo;var j=c.noItemMsg;var i="#5050ff";var g="#ffffff";var a="#f5f5f3";var h="#000000";var e="#ffffff";var k="#000000";if(!AutoCompleteFareAlert[f.id]){AutoCompleteFareAlert[f.id]=0}var b=3}AutoCompleteFareAlert.prototype={check:function(a){if(a){_checkKey(a)}else{_checkKey(window.event)}}};
