if(!dojo._hasResource["mq.formua"]){
dojo._hasResource["mq.formua"]=true;
dojo.provide("mq.formua");
dojo.declare("mq.formUA",null,{_userAction:null,_pageViewAttribute:(mq.getCookie("pageViewAttribute")&&mq.getCookie("pageViewAttribute")!="")?mq.getCookie("pageViewAttribute"):null,_userActionMapping:{":pv":{omn:{pv:true},cs:true,ad:true},":pvNoAd":{omn:{pv:true},cs:true,ad:false},":pvForced":{omn:{pv:true},cs:true,ad:true,forced:true},":pvNoAdForced":{omn:{pv:true},cs:true,ad:false,forced:true},":MQ08OffersClose":{omn:{pv:true,an:"MQ08OffersClose"},cs:true,ad:true,forced:true},":MQ08IntroBox":{omn:{pv:true,an:"MQ08IntroBox"},cs:true,ad:false},":MQ08GasIcon":{omn:{an:"MQ08GasIcon",pause:250},cs:false},":MQ08HelpLink":{omn:{an:"MQ08HelpLink",pause:250},cs:false},":MQ08BlogLink":{omn:{an:"MQ08BlogLink",pause:250},cs:false},":MQ08BSLink":{omn:{an:"MQ08BSLink",pause:250},cs:false},":MQ08Logo":{omn:{an:"MQ08Logo",pause:250},cs:false},":MQ08SettingsHat":{omn:{an:"MQ08SettingsHat",pause:250},cs:false},":MQ08MobileIcon":{omn:{an:"MQ08MobileIcon",pause:250},cs:false},":MQ08WebTopGo":{omn:{an:"MQ08WebTopGo",pause:250},cs:false},":MQ08AOLSearch":{omn:{an:"MQ08AOLSearch",pause:250},cs:false},":MQ08RouteOptionsGo":{omn:{pva:true,an:"MQ08RouteOptionsGo"},cs:false},":MQ08FormRevise":{omn:{pva:true,an:"MQ08FormRevise"},cs:false},":MQ08GeoDiffPV":{omn:{pv:true,an:"MQ08GeoDiffPV"},cs:true},":MQ08GeoDiffGo":{omn:{pva:true,an:"MQ08GeoDiffGo"},cs:false},":MQ08AmbPV":{omn:{pv:true,an:"MQ08AmbPV"},cs:true},":MQ08AmbGo":{omn:{pva:true,an:"MQ08AmbGo"},cs:false},":MQ08DidYouMeanPV":{omn:{pv:true,an:"MQ08DidYouMeanPV"},cs:true},":MQ08DYMGo":{omn:{pva:true,an:"MQ08DYMGo"},cs:false},":MQ08NoResultsPV":{omn:{pv:true,an:"MQ08NoResultsPV"},cs:true},":MQ08ValidationErrorPV":{omn:{pv:true,an:"MQ08ValidationErrorPV"},cs:true},":MQ08SettingsEditPVA":{omn:{pva:true,an:"MQ08SettingsEdit"},cs:true,ad:false},":MQ08SettingsAddPVA":{omn:{pva:true,an:"MQ08SettingsAdd"},cs:false},":MQ08LOCMap":{omn:{pva:true,an:"MQ08LOCMap"},cs:false},":MQ08LOCDirTo":{omn:{pva:true,an:"MQ08LOCDirTo"},cs:false},":MQ08LOCDirFrom":{omn:{pva:true,an:"MQ08LOCDirFrom"},cs:false},":MQ08SearchNearbyClose":{omn:{an:"MQ08SearchNearbyClose"},cs:false},":MQ08PopSearch1PVA":{omn:{pva:true,an:"MQ08PopSearch1"},cs:false},":MQ08PopSearch2PVA":{omn:{pva:true,an:"MQ08PopSearch2"},cs:false},":MQ08PopSearch3PVA":{omn:{pva:true,an:"MQ08PopSearch3"},cs:false},":MQ08PopSearch4PVA":{omn:{pva:true,an:"MQ08PopSearch4"},cs:false},":MQ08PopSearch5PVA":{omn:{pva:true,an:"MQ08PopSearch5"},cs:false},":MQ08PopSearch6PVA":{omn:{pva:true,an:"MQ08PopSearch6"},cs:false},":MQ08SearchNearbyGoPVA":{omn:{pva:true,an:"MQ08SearchNearbyGo"},cs:false},":MQ08BUBMap":{omn:{pva:true,an:"MQ08BUBMap"}},":MQ08BUBDirFrom":{omn:{pva:true,an:"MQ08BUBDirFrom"}},":MQ08BUBDirTo":{omn:{pva:true,an:"MQ08BUBDirTo"}},":MQ08BUBAmbGo":{omn:{pva:true,an:"MQ08BUBAmbGo"}},":dummy":{omn:{pv:false,an:"dummy"},cs:false}},a:function(_1){
var _2=this._getUserActionMappingType(_1);
if(_2=="forced"){
this._userAction=_1;
debug("Forced PV for action: "+_1);
this.commit();
}else{
if(_2=="action"&&!this._userAction){
this._userAction=_1;
this.commit();
}else{
if(_2=="pageviewAction"&&!this._userAction){
this._userAction=_1;
}else{
if(_2=="pageview"&&!this._userAction){
this._userAction=_1;
}else{
if(_2=="pageviewattribute"&&!this._userAction){
var _3=mq.getCookie("pageViewAttribute");
if(!_3&&_3!=""){
mq.setCookie("pageViewAttribute",this._getAction(_1).omn.an,1,"/");
}
return;
}
}
}
}
}
},promo:function(_4){
this._invokeOmniture({an:_4,pause:250});
},commit:function(){
if(this._userAction){
this._fire(this._userAction);
this._userAction=null;
}
},_getAction:function(_5){
return this._userActionMapping[_5]||this._userActionMapping[":"];
},_getUserActionMappingType:function(_6){
var _7=this._getAction(_6);
if(_7){
if(_7["forced"]){
return "forced";
}else{
if(_7["omn"]){
if(_7["omn"].pv){
if(_7["omn"].an){
return "pageviewAction";
}else{
return "pageview";
}
}else{
if(_7["omn"].an){
if(_7["omn"].pva){
return "pageviewattribute";
}else{
return "action";
}
}
}
}
}
}else{
return "action";
}
},_fire:function(_8){
var _9=this._getAction(_8);
if(typeof (_9)=="undefined"){
_8=(_8.indexOf(":")==0)?_8=_8.substring(1,_8.length):_8;
_9={};
_9.omn={};
_9.omn.an=_8;
}
if(_9["omn"]){
this._invokeOmniture(_9["omn"]);
}
if(_9["cs"]){
this._comScore(_9["cs"],_9["omn"]);
}
if(_9["ad"]){
var _a=_8.indexOf(":")>=0?_8.substring(_8.indexOf(":")+1):_8;
this._invokeAd(_a,{});
}
if(logOmnQueryParams){
this.debug("=======================================================================");
}
},_invokeOmniture:function(_b){
try{
s_265.prop20=null;
s_265.prop21=null;
s_265.prop2="";
s_265.pageName="";
var _c=this._generatePageViewName();
var pv=_b.pv;
if(typeof (pv)=="boolean"){
pv=_c;
}
if(_b.pv){
var _e=this._generateProp2(pv);
s_265.prop2=s_265.pfxID+" : "+_e;
s_265.pageName=s_265.pfxID+" : "+pv;
var _f="";
if(_b.an){
s_265.prop20=_b.an;
_f=", an(prop20): "+_b.an;
}else{
if(this._pageViewAttribute&&this._pageViewAttribute!=""){
var pva=this._pageViewAttribute;
pva=(pva.indexOf(":")==0)?pva.substring(1,pva.length):pva;
s_265.prop20=pva;
_f=", an(prop20): "+pva;
this._pageViewAttribute=null;
mq.setCookie("pageViewAttribute","",-1,"/");
mq.deleteCookie("pageViewAttribute");
}else{
s_265.prop20="none";
}
}
s_account=s_accountCL+((mq.getServerPurpose()=="production")?",aolsvc":"");
if(typeof (testbedOmnitureValue)!="undefined"){
s_265.prop17=testbedOmnitureValue;
}
if(typeof (abOmnitureValue)!="undefined"){
s_265.eVar14=abOmnitureValue;
}
try{
this._getLogger(s_account).t();
}
catch(e){
logDebug("ua._invokeOmniture: t()",e);
}
this.debug("[omniture] pv: "+pv+", sd(prop2): '"+_e+"'"+_f);
this.debugSelenium();
}else{
s_265.prop21=_c;
if(typeof (testbedOmnitureValue)!="undefined"){
s_265.prop22=testbedOmnitureValue;
}
s_accountCL;
try{
this._getLogger(s_accountCL).tl(true,"o",_b.an);
}
catch(e){
logDebug("ua._invokeOmniture: tl()",e);
}
if(_b.pause){
var now=new Date();
var _12=now.getTime()+_b.pause;
var _13=true;
while(_13){
now=new Date();
if(now.getTime()>_12){
_13=false;
}
}
}
s_265.sa(s_account);
this.debug("[omniture] an: "+_b.an+", pv(prop21): '"+_c+"'");
}
if(logOmnQueryParams){
this._logOmnitureQueryParams();
}
s_265.prop20=null;
s_265.prop21=null;
s_265.prop22=null;
s_265.prop2="";
s_265.pageName="";
}
catch(e){
logDebug("formua._invokeOmniture",e);
}
},_initialAdSuppressionComplete:false,_invokeAd:function(_14,_15){
if(this._initialAdSuppressionComplete){
var pv=this._generatePageViewName(),e,_18;
if(typeof _15=="object"){
_18=_15.an;
}
if(!_18){
_18=_14;
}
try{
var us={};
var _1a=mq.ad.selectCurrentRegions();
mq.ad.refreshRegions(_1a,{userAction:_14,pageView:pv,userState:us});
this.debug("[ad] true");
}
catch(e){
debug("[ad] Error in ad call: ",e);
this.debug("[ad] Error in ad call.");
}
}else{
this._initialAdSuppressionComplete=true;
}
},_initialComScoreSuppressionComplete:false,_comScore:function(_1b,omn){
if(_1b){
if(this._initialComScoreSuppressionComplete){
var pv="?pv="+this._generatePageViewName();
var _1e="";
if(omn){
if(omn.an){
_1e="&an="+omn.an;
}
}
var r="&r="+Math.round((Math.random()*10000))+"&h=2";
var _20="/mqrequest.html"+pv+_1e+r;
var req=({url:_20,handleAs:"text",timeout:10000,handle:function(_22,_23){
if(_22 instanceof Error){
ua.debug("[comScore] something went horribly, horribly wrong.");
}
}});
try{
dojo.xhrGet(req);
ua.debug("[comScore] pv: "+_20);
}
catch(e){
ua.debug("[comScore] something went horribly, horribly wrong. Error: "+e);
}
}else{
ua.debug("[comScore] pv: false");
this._initialComScoreSuppressionComplete=true;
}
}
if(!_1b){
ua.debug("[comScore] pv: false");
}
},_generatePageViewName:function(){
if(mqPageContext){
if(addressPopup&&!addressPopup.closed){
if(addressPopup.name=="airports"){
return "address.airport";
}else{
if(addressPopup.name=="categories"){
return "address.category";
}else{
if(addressPopup.name=="state"){
return "address.state";
}
}
}
}else{
if(window.isAmbGeo){
return window.serverPageView;
}
}
var pn=new dojox.string.Builder();
if(mqPageContext=="homeForm"){
pn.append("home.form");
}else{
if(mqPageContext=="mapsForm"){
pn.append("map.form");
}else{
if(mqPageContext=="dirForm"){
pn.append("dir.form");
}else{
if(mqPageContext=="searchForm"){
pn.append("search.form");
}else{
if(mqPageContext=="latlngForm"){
pn.append("latlng.form");
}else{
ua.debug("Error: unable to generate pagename");
}
}
}
}
}
if($d("offersWrapper")){
pn.append(".offers");
}else{
pn.append(".scroll");
}
return pn.toString();
}else{
ua.debug("Error: unable to generate pagename");
}
},_generateProp2:function(_25){
s_265.prop2="";
var sb=new dojox.string.Builder();
var _27=_25.split(".");
if(_27[_27.length-1]=="offers"){
return "offers";
}
if(_27.length>2&&_27[_27.length-1]=="scroll"&&_27[_27.length-2].indexOf("error")>0){
return "form error";
}
if(_27.length>1){
if(_27[0]=="home"){
sb.append("home ");
}else{
if(_27[0]=="map"){
sb.append("map ");
}else{
if(_27[0]=="dir"){
sb.append("directions ");
}else{
if(_27[0]=="search"){
sb.append("search ");
}else{
if(_27[0]=="address"){
return "address";
}
}
}
}
}
if(_27[1]=="form"){
sb.append("form");
}
return sb.toString();
}else{
this.debug("Error: there was a problem generating prop2 based on pagename: "+_25);
return "";
}
},_getLogger:function(_28){
var s=s_gi(_28);
if(!s){
return;
}
(_28==s_accountCL)?s.linkTrackVars="prop21,prop22":s.linkTrackVars="None";
s.linkTrackEvents="None";
return s;
},_logOmnitureQueryParams:function(){
var _2a=s_265.d.images;
var _2b=null;
if(_2a&&_2a.length>0&&_2a[_2a.length-1].name&&_2a[_2a.length-1].name.indexOf(s_accountCL)>=0){
_2b=_2a[_2a.length-1];
}else{
if(_2a&&_2a.length>0){
for(var i=_2a.length-1;i>=0;i--){
var img=_2a[i];
if(img&&img.name&&img.name.indexOf(s_accountCL)>=0){
_2b=img;
break;
}
}
}
}
if(_2b){
try{
var _2e=_2b.src;
var _2f=_2e.substring(_2e.indexOf("?")+1,_2e.length);
var _30=_2e.substring(0,_2e.indexOf("?"));
var _31=_2f.split("&");
var _32="";
for(var i=0;i<_31.length;i++){
var tmp=_31[i].split("=");
if(tmp.length==2){
_32+=(tmp[0]+" = "+unescape(tmp[1])+"; ");
}
}
this.debug("[omniture] URL-QueryParams: host = "+_30+"; "+_32.substring(0,_32.length-2));
}
catch(e){
this.debug("[omniture] URL-QueryParams: Error in parsing Omniture query information.");
}
}else{
this.debug("[omniture] URL-QueryParams: Not able to find omniture query.");
}
},debug:function(_34){
var _35=$d("userActionDebugger");
if(_35){
var _36=_35.value;
_35.value=_36+"\n"+_34;
debug(_34);
_35.value=_35.value;
_35.scrollTop=_35.scrollHeight;
}
},debugSelenium:function(){
var _37=$d("seleniumDebugger");
if(_37){
var _38=_37.value;
_37.value=_38+"\nok";
}
},showDebugger:function(){
dojo.removeClass($d("userActionDebugger").parentNode,"hiddenButPresent");
$d("clearLogger").style.visibility="visible";
$d("closeLogger").style.visibility="visible";
},clear:function(){
$d("userActionDebugger").value="";
}});
}

mq._loader._layerLoaded('home');