YAHOO.namespace("omnibus");YAHOO.omnibus.SpriteMap={init:function(){this.spriteMap={banco:{image:this.spriteSrc,width:25,height:25,top:0,left:0},bar:{image:this.spriteSrc,width:25,height:25,top:223,left:0},correio:{image:this.spriteSrc,width:25,height:25,top:446,left:0},escola:{image:this.spriteSrc,width:25,height:25,top:669,left:0},group:{image:this.spriteSrc,width:25,height:25,top:892,left:0},hospital:{image:this.spriteSrc,width:25,height:25,top:975,left:0},loja:{image:this.spriteSrc,width:25,height:25,top:1198,left:0},policia:{image:this.spriteSrc,width:25,height:25,top:1421,left:0},pontoturistico:{image:this.spriteSrc,width:25,height:25,top:1644,left:0},restaurante:{image:this.spriteSrc,width:25,height:25,top:1867,left:0},bus_zoom1:{image:this.spriteSrc,left:83,top:83,width:39,height:22},bus_zoom2:{image:this.spriteSrc,left:83,top:155,width:48,height:26},dest_zoom1:{image:this.spriteSrc,left:83,top:231,width:18,height:35},dest_zoom2:{image:this.spriteSrc,left:83,top:316,width:24,height:46},dest_zoom3:{image:this.spriteSrc,left:83,top:412,width:32,height:60},origem_zoom1:{image:this.spriteSrc,left:83,top:522,width:18,height:35},origem_zoom2:{image:this.spriteSrc,left:83,top:607,width:24,height:46},origem_zoom3:{image:this.spriteSrc,left:83,top:703,width:32,height:60},subway_zoom1:{image:this.spriteSrc,left:83,top:813,width:39,height:22},subway_zoom2:{image:this.spriteSrc,left:83,top:885,width:48,height:26},walk_zoom1:{image:this.spriteSrc,left:83,top:961,width:39,height:22},walk_zoom2:{image:this.spriteSrc,left:83,top:1033,width:48,height:26}};this.populateSpritePosition()},spriteNumberedMarkers:[],spriteSrc:APP_ROOT+"/Content/Images/spriteMap.png",spriteNumMarkersSrc:APP_ROOT+"/Content/Images/spriteStopMarkers.png",spriteZoomInf:[{height:12,qtd:4,widthUnidade:12,widthDezena:12,widthCentena:12},{height:13,qtd:800,widthUnidade:20,widthDezena:26,widthCentena:32},{height:14,qtd:800,widthUnidade:22,widthDezena:29,widthCentena:36},{height:15,qtd:800,widthUnidade:24,widthDezena:32,widthCentena:40},{height:18,qtd:800,widthUnidade:29,widthDezena:40,widthCentena:51}],spriteHeight:2013,spriteColumns:[0,33,66,99,132,165,198,235,272,309,346,383,420,461,502,543,584,625,666,718,770,822,874,926,978,1030],getSprite:function(d,a,b,c){a=(a==0)?false:true;if(d==0){b=1}return this.spriteNumberedMarkers["Size"+d+"Num"+b+"Hl"+a+"Type"+c]},populateSpritePosition:function(){var a=[];var h=0;var l=0;var d=0;var k="";var c="";var e=0;var b=0;for(var g=0;g<this.spriteZoomInf.length;g++){for(var f=0;f<this.spriteZoomInf[g].qtd;f++){if(l+this.spriteZoomInf[g].height>this.spriteHeight){l=0;d++}k=(f>=(this.spriteZoomInf[g].qtd/2))?"Stop":"Integ";c=(f%(this.spriteZoomInf[g].qtd/2)>=(this.spriteZoomInf[g].qtd/4));e=f%(this.spriteZoomInf[g].qtd/4)+1;b=(e<10)?this.spriteZoomInf[g].widthUnidade:((e<100)?this.spriteZoomInf[g].widthDezena:this.spriteZoomInf[g].widthCentena);this.spriteNumberedMarkers["Size"+g+"Num"+e+"Hl"+c+"Type"+k]={image:this.spriteNumMarkersSrc,top:l,left:this.spriteColumns[d],height:this.spriteZoomInf[g].height,width:b,stopMarkerZoom:g,stopMarkerHl:c,stopMarkerNum:e,stopMarkerType:k};h++;l=l+this.spriteZoomInf[g].height+1}}}};Array.prototype.contains=function(c){for(var b=0;b<this.length;b++){if(this[b]==c){return true}}return false};Function.prototype.curry=function(){var c=this,b=Array.prototype.slice.call(arguments);return function(){return c.apply(this,b.concat(Array.prototype.slice.call(arguments)))}};Function.prototype.bind=function(c){var d=this,b=function(){return d.apply(c,arguments)};return b};function getElementsByTagNameAndId(c,d,e){var b=c.getElementsByTagName(d);for(i=0;i<b.length;i++){if(b[i].id==e){return b[i]}}return null}function parseLatLngFromPermalink(d){var e=d.split(";");var c=e[0].substring(e[0].indexOf(":")+1,e[0].length);var b=e[1].substring(e[1].indexOf(":")+1,e[1].length);return new GLatLng(c,b)}function _url(b){return APP_ROOT+b}function clearElement(b){while(b.hasChildNodes()){b.removeChild(b.firstChild)}return b}function logger(){if((typeof(IS_DEBUG_MODE)!="undefined")&&(IS_DEBUG_MODE=="true")){var b=new YAHOO.widget.LogReader("compact",{verboseOutput:false,newestOnTop:false});b.formatMsg=function(d){var c=d.category;return'<p><span class="'+c+'">'+c+"</span> "+d.msg+"</p>"}}}function showGoogleQueryReturnOnlyDebug(d,b){if((typeof(IS_DEBUG_MODE)!="undefined")&&(IS_DEBUG_MODE=="True")){var c;switch(d){case 400:c="G_GEO_BAD_REQUEST";break;case 500:c="G_GEO_SERVER_ERROR";case 601:c="G_GEO_MISSING_QUERY or G_GEO_MISSING_ADDRESS ";break;case 602:c="G_GEO_UNKNOWN_ADDRESS";break;case 603:c="G_GEO_UNAVAILABLE_ADDRESS";break;case 604:c="G_GEO_UNKNOWN_DIRECTIONS";break;case 610:c="G_GEO_BAD_KEY";break;case 620:c="G_GEO_TOO_MANY_QUERIES";break;default:c=""}YAHOO.log(d+" - "+c+" Message: "+b,"error")}}function showPopup(c,d,b){if(typeof(PopupPanel)!="undefined"){$get("popupTitle").innerHTML=d;$get("popupMessage").innerHTML=c;$get("popup").className=b;PopupPanel.show();YAHOO.lang.later(10000,null,function(){PopupPanel.hide()})}else{alert(c)}}function showPopupError(b){showPopup(b,I18n.termoErro,"popupError")}function showPopupSuccess(b){showPopup(b,I18n.termoSucesso,"popupSuccess")}function parseToHoursStr(f,e){var b=(f/1000)/e;var c=(b-Math.floor(b))*60;b=Math.floor(b);var d="";if(b>0){d=b+"h "}d+=Math.floor(c)+"min";return d}function getClientOS(){var b="Unknown OS";if(navigator.appVersion.indexOf("Win")!=-1){b="Windows"}if(navigator.appVersion.indexOf("Mac")!=-1){b="MacOS"}if(navigator.appVersion.indexOf("X11")!=-1){b="UNIX"}if(navigator.appVersion.indexOf("Linux")!=-1){b="Linux"}return b}qs=[];function loadQueryString(){variaveis=location.search.replace(/\x3F/,"").replace(/\x2B/g," ").split("&");if(variaveis!=""){for(i=0;i<variaveis.length;i++){nvar=variaveis[i].split("=");qs[nvar[0]]=decodeURIComponent(nvar[1])}}}function QueryString(b){return qs[b]}function getUrl(){url=window.location.href;var b=url.split("?");url=b[0].replace("comochegar","").replace("paradas","").replace("linhas","").replace("home","");return url}function createCookie(d,e,f){var b="";if(f){var c=new Date();c.setTime(c.getTime()+(f*24*60*60*1000));b="; expires="+c.toGMTString()}document.cookie=d+"="+e+b+"; path=/"}function readCookie(d){var f=d+"=";var b=document.cookie.split(";");for(var e=0;e<b.length;e++){var g=b[e];while(g.charAt(0)==" "){g=g.substring(1,g.length)}if(g.indexOf(f)==0){return g.substring(f.length,g.length)}}return null}function eraseCookie(b){createCookie(b,"",-1)}function toHoursAndMinutes(e){var d=e%60;var b=(e-d)/60;var c="";if(b>0){c+=b+"h "}c+=d+"min";return c}function toKmAndMeters(b){if(b>1000){return(b/1000).toFixed(1).replace(".",",")+"km"}else{return b+"m"}}function bookmark_us(b,d){if(window.sidebar){window.sidebar.addPanel(d,b,"")}else{if(window.opera&&window.print){var c=document.createElement("a");c.setAttribute("href",b);c.setAttribute("title",d);c.setAttribute("rel","sidebar");c.click()}else{if(document.all){window.external.AddFavorite(b,d)}}}}String.prototype.trim=function(){a=this.replace(/^\s+/,"");return a.replace(/\s+$/,"")};String.prototype.format=function(){var c="";var b=this.toString();for(i=0;i<arguments.length;i++){c="{"+(i)+"}";while(b.indexOf(c)>=0){b=b.replace(c,arguments[i])}}return b};function elementInViewport(d){var f=d.offsetTop;var e=d.offsetLeft;var c=d.offsetWidth;var b=d.offsetHeight;while(d.offsetParent){d=d.offsetParent;f+=d.offsetTop;e+=d.offsetLeft}return(f>=window.pageYOffset&&e>=window.pageXOffset&&(f+b)<=(window.pageYOffset+window.innerHeight)&&(e+c)<=(window.pageXOffset+window.innerWidth))}function onFail(b){if((typeof(IS_DEBUG_MODE)!="undefined")&&(IS_DEBUG_MODE=="true")){showPopupError(b.get_message())}else{showPopupError(I18n.termoErroBusca)}if(typeof(WaitDialog)!="undefined"){WaitDialog.hideLoading()}}function onFailOnlyDebug(b){if((typeof(IS_DEBUG_MODE)!="undefined")&&(IS_DEBUG_MODE=="true")){showPopupError(b.get_message())}if(typeof(WaitDialog)!="undefined"){WaitDialog.hideLoading()}}var ENTER_CODE=13;function getKeyCode(b){var c;if(window.event){c=b.keyCode}else{if(b.which){c=b.which}}return c}function onEnterKeyPress(c,b){var d=getKeyCode(b);if(d==ENTER_CODE){c();return false}}function dummy(){}var specificLocationListener=function(){loadQueryString();if(QueryString("specl")=="false"){window.name="speclOFF"}else{if(QueryString("specl")=="true"){window.name=""}}};var roundedCorners=function(){curvyCorners.redraw()};var applyForcedFocus=function(){var b=document.getElementsByTagName("input");for(i=0;i<b.length;i++){if(b[i].type=="text"){YAHOO.util.Event.addListener(b[i],"focus",function(){YAHOO.util.Dom.addClass(this,"forcedFocus")});YAHOO.util.Event.addListener(b[i],"blur",function(){YAHOO.util.Dom.removeClass(this,"forcedFocus")})}}};YAHOO.namespace("omnibus");YAHOO.omnibus.Globalization=function(b){var a=this;if(typeof(b)==="undefined"){a.checkLanguageCookie()}else{a.setCurrentLanguage(b)}YAHOO.util.Event.addListener("pt-BR","click",this.setCurrentLanguageAndReloadPage.curry("pt-BR"),this,true);YAHOO.util.Event.addListener("en-US","click",this.setCurrentLanguageAndReloadPage.curry("en-US"),this,true)};YAHOO.omnibus.Globalization.DEFAULT_LANGUAGE="pt-BR";YAHOO.omnibus.Globalization.ENGLISH_LANGUAGE="en-US";YAHOO.omnibus.Globalization.COOKIE_NAME="languageOnibusRecife";YAHOO.omnibus.Globalization.prototype.currentLanguage=null;YAHOO.omnibus.Globalization.prototype.sentences=null;YAHOO.omnibus.Globalization.prototype.setCurrentLanguage=function(a){var b=this;var c="";switch(a){case YAHOO.omnibus.Globalization.ENGLISH_LANGUAGE:c=YAHOO.omnibus.Globalization.ENGLISH_LANGUAGE;b.currentLanguage=YAHOO.omnibus.Globalization.ENGLISH_LANGUAGE;break;default:c=YAHOO.omnibus.Globalization.DEFAULT_LANGUAGE;b.currentLanguage=YAHOO.omnibus.Globalization.DEFAULT_LANGUAGE}eraseCookie(YAHOO.omnibus.Globalization.COOKIE_NAME);createCookie(YAHOO.omnibus.Globalization.COOKIE_NAME,c,360)};YAHOO.omnibus.Globalization.prototype.setCurrentLanguageAndReloadPage=function(a){var b=this;b.setCurrentLanguage(a);window.location.href=window.location.href};YAHOO.omnibus.Globalization.prototype.getCurrentLanguage=function(){var a=this;return a.currentLanguage};YAHOO.omnibus.Globalization.prototype.checkLanguageCookie=function(){var b=this;var a=readCookie(YAHOO.omnibus.Globalization.COOKIE_NAME);switch(a){case YAHOO.omnibus.Globalization.ENGLISH_LANGUAGE:b.setCurrentLanguage(YAHOO.omnibus.Globalization.ENGLISH_LANGUAGE);break;default:b.setCurrentLanguage(YAHOO.omnibus.Globalization.DEFAULT_LANGUAGE)}return a};YAHOO.namespace("omnibus");YAHOO.omnibus.AutocompleteHelper={oDataSource:null,GetAutocompleteAddressDS:function(b){var a="";if(!b||typeof(b)==="undefined"){a=_url("/Webservices/Autocomplete.asmx/GetAddresses")}else{a=b+"/Webservices/Autocomplete.asmx/GetAddresses"}if(this.oDataSource===null){this.oDataSource=new YAHOO.widget.DS_XHR(a);this.oDataSource.responseType=YAHOO.widget.DS_XHR.TYPE_XML;this.oDataSource.responseSchema={resultNode:"Address",fields:["Street","District","City","AdditionalInfo","Latitude","Longitude"]}}return this.oDataSource},formatResult:function(e,h,d){var c=e.Street;var g=e.District;var b=e.City;var a=e.AdditionalInfo;var f="<strong>"+c+"</strong>";if(b!==""){f+='<br/><span class="autocompleteDistrict">'+g.trim()+", "+b.trim()+"</span>"}else{f+='<br/><span class="autocompleteDistrict">'+a.trim()+"</span>"}return(f)},formatAddress:function(b){var a=b.Street.trim();if(b.District!==""){a+=", "+b.District.trim()}if(b.City!==""){a+=", "+b.City.trim()}return a}};Function.__typeName="Function";Function.__class=true;Function.createCallback=function(c,d){return function(){var a=arguments.length;if(a>0){var b=[];for(var f=0;f<a;f++){b[f]=arguments[f]}b[a]=d;return c.apply(this,b)}return c.call(this,d)}};Function.createDelegate=function(d,c){return function(){return c.apply(d,arguments)}};Function.emptyFunction=Function.emptyMethod=function(){};Function._validateParams=function(k,m){var h;h=Function._validateParameterCount(k,m);if(h){h.popStackFrame();return h}for(var g=0;g<k.length;g++){var l=m[Math.min(g,m.length-1)],j=l.name;if(l.parameterArray){j+="["+(g-m.length+1)+"]"}h=Function._validateParameter(k[g],l,j);if(h){h.popStackFrame();return h}}return null};Function._validateParameterCount=function(k,h){var m=h.length,l=0;for(var g=0;g<h.length;g++){if(h[g].parameterArray){m=Number.MAX_VALUE}else{if(!h[g].optional){l++}}}if(k.length<l||k.length>m){var j=Error.parameterCount();j.popStackFrame();return j}return null};Function._validateParameter=function(z,B,u){var A,v=B.type,q=!!B.integer,r=!!B.domElement,p=!!B.mayBeNull;A=Function._validateParameterType(z,v,q,r,p,u);if(A){A.popStackFrame();return A}var x=B.elementType,w=!!B.elementMayBeNull;if(v===Array&&typeof z!=="undefined"&&z!==null&&(x||!w)){var s=!!B.elementInteger,t=!!B.elementDomElement;for(var y=0;y<z.length;y++){var o=z[y];A=Function._validateParameterType(o,x,s,t,w,u+"["+y+"]");if(A){A.popStackFrame();return A}}}return null};Function._validateParameterType=function(B,z,o,p,r,y){var A;if(typeof B==="undefined"){if(r){return null}else{A=Error.argumentUndefined(y);A.popStackFrame();return A}}if(B===null){if(r){return null}else{A=Error.argumentNull(y);A.popStackFrame();return A}}if(z&&z.__enum){if(typeof B!=="number"){A=Error.argumentType(y,Object.getType(B),z);A.popStackFrame();return A}if(B%1===0){var x=z.prototype;if(!z.__flags||B===0){for(var t in x){if(x[t]===B){return null}}}else{var q=B;for(var t in x){var w=x[t];if(w===0){continue}if((w&B)===w){q-=w}if(q===0){return null}}}}A=Error.argumentOutOfRange(y,B,String.format(Sys.Res.enumInvalidValue,B,z.getName()));A.popStackFrame();return A}if(p){var u;if(typeof B.nodeType!=="number"){var v=B.ownerDocument||B.document||B;if(v!=B){var s=v.defaultView||v.parentWindow;u=s!=B&&!(s.document&&B.document&&s.document===B.document)}else{u=typeof v.body==="undefined"}}else{u=B.nodeType===3}if(u){A=Error.argument(y,Sys.Res.argumentDomElement);A.popStackFrame();return A}}if(z&&!z.isInstanceOfType(B)){A=Error.argumentType(y,Object.getType(B),z);A.popStackFrame();return A}if(z===Number&&o){if(B%1!==0){A=Error.argumentOutOfRange(y,B,Sys.Res.argumentInteger);A.popStackFrame();return A}}return null};Error.__typeName="Error";Error.__class=true;Error.create=function(g,e){var f=new Error(g);f.message=g;if(e){for(var h in e){f[h]=e[h]}}f.popStackFrame();return f};Error.argument=function(f,h){var e="Sys.ArgumentException: "+(h?h:Sys.Res.argument);if(f){e+="\n"+String.format(Sys.Res.paramName,f)}var g=Error.create(e,{name:"Sys.ArgumentException",paramName:f});g.popStackFrame();return g};Error.argumentNull=function(f,h){var e="Sys.ArgumentNullException: "+(h?h:Sys.Res.argumentNull);if(f){e+="\n"+String.format(Sys.Res.paramName,f)}var g=Error.create(e,{name:"Sys.ArgumentNullException",paramName:f});g.popStackFrame();return g};Error.argumentOutOfRange=function(k,g,j){var f="Sys.ArgumentOutOfRangeException: "+(j?j:Sys.Res.argumentOutOfRange);if(k){f+="\n"+String.format(Sys.Res.paramName,k)}if(typeof g!=="undefined"&&g!==null){f+="\n"+String.format(Sys.Res.actualValue,g)}var h=Error.create(f,{name:"Sys.ArgumentOutOfRangeException",paramName:k,actualValue:g});h.popStackFrame();return h};Error.argumentType=function(l,m,g,k){var h="Sys.ArgumentTypeException: ";if(k){h+=k}else{if(m&&g){h+=String.format(Sys.Res.argumentTypeWithTypes,m.getName(),g.getName())}else{h+=Sys.Res.argumentType}}if(l){h+="\n"+String.format(Sys.Res.paramName,l)}var j=Error.create(h,{name:"Sys.ArgumentTypeException",paramName:l,actualType:m,expectedType:g});j.popStackFrame();return j};Error.argumentUndefined=function(f,h){var e="Sys.ArgumentUndefinedException: "+(h?h:Sys.Res.argumentUndefined);if(f){e+="\n"+String.format(Sys.Res.paramName,f)}var g=Error.create(e,{name:"Sys.ArgumentUndefinedException",paramName:f});g.popStackFrame();return g};Error.format=function(e){var f="Sys.FormatException: "+(e?e:Sys.Res.format),d=Error.create(f,{name:"Sys.FormatException"});d.popStackFrame();return d};Error.invalidOperation=function(e){var f="Sys.InvalidOperationException: "+(e?e:Sys.Res.invalidOperation),d=Error.create(f,{name:"Sys.InvalidOperationException"});d.popStackFrame();return d};Error.notImplemented=function(e){var f="Sys.NotImplementedException: "+(e?e:Sys.Res.notImplemented),d=Error.create(f,{name:"Sys.NotImplementedException"});d.popStackFrame();return d};Error.parameterCount=function(e){var f="Sys.ParameterCountException: "+(e?e:Sys.Res.parameterCount),d=Error.create(f,{name:"Sys.ParameterCountException"});d.popStackFrame();return d};Error.prototype.popStackFrame=function(){if(typeof this.stack==="undefined"||this.stack===null||typeof this.fileName==="undefined"||this.fileName===null||typeof this.lineNumber==="undefined"||this.lineNumber===null){return}var g=this.stack.split("\n"),k=g[0],h=this.fileName+":"+this.lineNumber;while(typeof k!=="undefined"&&k!==null&&k.indexOf(h)===-1){g.shift();k=g[0]}var j=g[1];if(typeof j==="undefined"||j===null){return}var f=j.match(/@(.*):(\d+)$/);if(typeof f==="undefined"||f===null){return}this.fileName=f[1];this.lineNumber=parseInt(f[2]);g.shift();this.stack=g.join("\n")};Object.__typeName="Object";Object.__class=true;Object.getType=function(c){var d=c.constructor;if(!d||typeof d!=="function"||!d.__typeName||d.__typeName==="Object"){return Object}return d};Object.getTypeName=function(b){return Object.getType(b).getName()};String.__typeName="String";String.__class=true;String.prototype.endsWith=function(b){return this.substr(this.length-b.length)===b};String.prototype.startsWith=function(b){return this.substr(0,b.length)===b};String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};String.prototype.trimEnd=function(){return this.replace(/\s+$/,"")};String.prototype.trimStart=function(){return this.replace(/^\s+/,"")};String.format=function(){return String._toFormattedString(false,arguments)};String.localeFormat=function(){return String._toFormattedString(true,arguments)};String._toFormattedString=function(m,o){var v="",t=o[0];for(var x=0;true;){var s=t.indexOf("{",x),u=t.indexOf("}",x);if(s<0&&u<0){v+=t.slice(x);break}if(u>0&&(u<s||s<0)){v+=t.slice(x,u+1);x=u+2;continue}v+=t.slice(x,s);x=s+1;if(t.charAt(x)==="{"){v+="{";x++;continue}if(u<0){break}var q=t.substring(x,u),r=q.indexOf(":"),n=parseInt(r<0?q:q.substring(0,r),10)+1,p=r<0?"":q.substring(r+1),w=o[n];if(typeof w==="undefined"||w===null){w=""}if(w.toFormattedString){v+=w.toFormattedString(p)}else{if(m&&w.localeFormat){v+=w.localeFormat(p)}else{if(w.format){v+=w.format(p)}else{v+=w.toString()}}}x=u+1}return v};Boolean.__typeName="Boolean";Boolean.__class=true;Boolean.parse=function(c){var d=c.trim().toLowerCase();if(d==="false"){return false}if(d==="true"){return true}};Date.__typeName="Date";Date.__class=true;Date._appendPreOrPostMatch=function(m,h){var n=0,j=false;for(var o=0,k=m.length;o<k;o++){var l=m.charAt(o);switch(l){case"'":if(j){h.append("'")}else{n++}j=false;break;case"\\":if(j){h.append("\\")}j=!j;break;default:h.append(l);j=false}}return n};Date._expandFormat=function(d,c){if(!c){c="F"}if(c.length===1){switch(c){case"d":return d.ShortDatePattern;case"D":return d.LongDatePattern;case"t":return d.ShortTimePattern;case"T":return d.LongTimePattern;case"F":return d.FullDateTimePattern;case"M":case"m":return d.MonthDayPattern;case"s":return d.SortableDateTimePattern;case"Y":case"y":return d.YearMonthPattern;default:throw Error.format(Sys.Res.formatInvalidString)}}return c};Date._expandYear=function(f,e){if(e<100){var d=(new Date).getFullYear();e+=d-d%100;if(e>f.Calendar.TwoDigitYearMax){return e-100}}return e};Date._getParseRegExp=function(w,t){if(!w._parseRegExp){w._parseRegExp={}}else{if(w._parseRegExp[t]){return w._parseRegExp[t]}}var v=Date._expandFormat(w,t);v=v.replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g,"\\\\$1");var x=new Sys.StringBuilder("^"),o=[],s=0,p=0,q=Date._getTokenRegExp(),u;while((u=q.exec(v))!==null){var m=v.slice(s,u.index);s=q.lastIndex;p+=Date._appendPreOrPostMatch(m,x);if(p%2===1){x.append(u[0]);continue}switch(u[0]){case"dddd":case"ddd":case"MMMM":case"MMM":x.append("(\\D+)");break;case"tt":case"t":x.append("(\\D*)");break;case"yyyy":x.append("(\\d{4})");break;case"fff":x.append("(\\d{3})");break;case"ff":x.append("(\\d{2})");break;case"f":x.append("(\\d)");break;case"dd":case"d":case"MM":case"M":case"yy":case"y":case"HH":case"H":case"hh":case"h":case"mm":case"m":case"ss":case"s":x.append("(\\d\\d?)");break;case"zzz":x.append("([+-]?\\d\\d?:\\d{2})");break;case"zz":case"z":x.append("([+-]?\\d\\d?)")}Array.add(o,u[0])}Date._appendPreOrPostMatch(v.slice(s),x);x.append("$");var n=x.toString().replace(/\s+/g,"\\s+"),r={regExp:n,groups:o};w._parseRegExp[t]=r;return r};Date._getTokenRegExp=function(){return/dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z/g};Date.parseLocale=function(b){return Date._parse(b,Sys.CultureInfo.CurrentCulture,arguments)};Date.parseInvariant=function(b){return Date._parse(b,Sys.CultureInfo.InvariantCulture,arguments)};Date._parse=function(l,p,k){var n=false;for(var r=1,j=k.length;r<j;r++){var m=k[r];if(m){n=true;var q=Date._parseExact(l,m,p);if(q){return q}}}if(!n){var o=p._getDateTimeFormats();for(var r=0,j=o.length;r<j;r++){var q=Date._parseExact(l,o[r],p);if(q){return q}}}return null};Date._parseExact=function(H,B,Q){H=H.trim();var N=Q.dateTimeFormat,E=Date._getParseRegExp(N,B),C=(new RegExp(E.regExp)).exec(H);if(C===null){return null}var D=E.groups,U=null,X=null,S=null,T=null,W=0,M=0,L=0,V=0,P=null,I=false;for(var K=0,A=D.length;K<A;K++){var Z=C[K+1];if(Z){switch(D[K]){case"dd":case"d":S=parseInt(Z,10);if(S<1||S>31){return null}break;case"MMMM":X=Q._getMonthIndex(Z);if(X<0||X>11){return null}break;case"MMM":X=Q._getAbbrMonthIndex(Z);if(X<0||X>11){return null}break;case"M":case"MM":var X=parseInt(Z,10)-1;if(X<0||X>11){return null}break;case"y":case"yy":U=Date._expandYear(N,parseInt(Z,10));if(U<0||U>9999){return null}break;case"yyyy":U=parseInt(Z,10);if(U<0||U>9999){return null}break;case"h":case"hh":W=parseInt(Z,10);if(W===12){W=0}if(W<0||W>11){return null}break;case"H":case"HH":W=parseInt(Z,10);if(W<0||W>23){return null}break;case"m":case"mm":M=parseInt(Z,10);if(M<0||M>59){return null}break;case"s":case"ss":L=parseInt(Z,10);if(L<0||L>59){return null}break;case"tt":case"t":var F=Z.toUpperCase();I=F===N.PMDesignator.toUpperCase();if(!I&&F!==N.AMDesignator.toUpperCase()){return null}break;case"f":V=parseInt(Z,10)*100;if(V<0||V>999){return null}break;case"ff":V=parseInt(Z,10)*10;if(V<0||V>999){return null}break;case"fff":V=parseInt(Z,10);if(V<0||V>999){return null}break;case"dddd":T=Q._getDayIndex(Z);if(T<0||T>6){return null}break;case"ddd":T=Q._getAbbrDayIndex(Z);if(T<0||T>6){return null}break;case"zzz":var J=Z.split(/:/);if(J.length!==2){return null}var R=parseInt(J[0],10);if(R<-12||R>13){return null}var O=parseInt(J[1],10);if(O<0||O>59){return null}P=R*60+(Z.startsWith("-")?-O:O);break;case"z":case"zz":var R=parseInt(Z,10);if(R<-12||R>13){return null}P=R*60}}}var Y=new Date;if(U===null){U=Y.getFullYear()}if(X===null){X=Y.getMonth()}if(S===null){S=Y.getDate()}Y.setFullYear(U,X,S);if(Y.getDate()!==S){return null}if(T!==null&&Y.getDay()!==T){return null}if(I&&W<12){W+=12}Y.setHours(W,M,L,V);if(P!==null){var G=Y.getMinutes()-(P+Y.getTimezoneOffset());Y.setHours(Y.getHours()+parseInt(G/60,10),G%60)}return Y};Date.prototype.format=function(b){return this._toFormattedString(b,Sys.CultureInfo.InvariantCulture)};Date.prototype.localeFormat=function(b){return this._toFormattedString(b,Sys.CultureInfo.CurrentCulture)};Date.prototype._toFormattedString=function(t,q){if(!t||t.length===0||t==="i"){if(q&&q.name.length>0){return this.toLocaleString()}else{return this.toString()}}var u=q.dateTimeFormat;t=Date._expandFormat(u,t);var x=new Sys.StringBuilder,w;function v(b){if(b<10){return"0"+b}return b.toString()}function r(b){if(b<10){return"00"+b}if(b<100){return"0"+b}return b.toString()}var o=0,p=Date._getTokenRegExp();for(;true;){var m=p.lastIndex,s=p.exec(t),n=t.slice(m,s?s.index:t.length);o+=Date._appendPreOrPostMatch(n,x);if(!s){break}if(o%2===1){x.append(s[0]);continue}switch(s[0]){case"dddd":x.append(u.DayNames[this.getDay()]);break;case"ddd":x.append(u.AbbreviatedDayNames[this.getDay()]);break;case"dd":x.append(v(this.getDate()));break;case"d":x.append(this.getDate());break;case"MMMM":x.append(u.MonthNames[this.getMonth()]);break;case"MMM":x.append(u.AbbreviatedMonthNames[this.getMonth()]);break;case"MM":x.append(v(this.getMonth()+1));break;case"M":x.append(this.getMonth()+1);break;case"yyyy":x.append(this.getFullYear());break;case"yy":x.append(v(this.getFullYear()%100));break;case"y":x.append(this.getFullYear()%100);break;case"hh":w=this.getHours()%12;if(w===0){w=12}x.append(v(w));break;case"h":w=this.getHours()%12;if(w===0){w=12}x.append(w);break;case"HH":x.append(v(this.getHours()));break;case"H":x.append(this.getHours());break;case"mm":x.append(v(this.getMinutes()));break;case"m":x.append(this.getMinutes());break;case"ss":x.append(v(this.getSeconds()));break;case"s":x.append(this.getSeconds());break;case"tt":x.append(this.getHours()<12?u.AMDesignator:u.PMDesignator);break;case"t":x.append((this.getHours()<12?u.AMDesignator:u.PMDesignator).charAt(0));break;case"f":x.append(r(this.getMilliseconds()).charAt(0));break;case"ff":x.append(r(this.getMilliseconds()).substr(0,2));break;case"fff":x.append(r(this.getMilliseconds()));break;case"z":w=this.getTimezoneOffset()/60;x.append((w<=0?"+":"-")+Math.floor(Math.abs(w)));break;case"zz":w=this.getTimezoneOffset()/60;x.append((w<=0?"+":"-")+v(Math.floor(Math.abs(w))));break;case"zzz":w=this.getTimezoneOffset()/60;x.append((w<=0?"+":"-")+v(Math.floor(Math.abs(w)))+u.TimeSeparator+v(Math.abs(this.getTimezoneOffset()%60)))}}return x.toString()};Number.__typeName="Number";Number.__class=true;Number.parseLocale=function(b){return Number._parse(b,Sys.CultureInfo.CurrentCulture)};Number.parseInvariant=function(b){return Number._parse(b,Sys.CultureInfo.InvariantCulture)};Number._parse=function(A,o){A=A.trim();if(A.match(/^[+-]?infinity$/i)){return parseFloat(A)}if(A.match(/^0x[a-f0-9]+$/i)){return parseInt(A)}var B=o.numberFormat,w=Number._parseNumberNegativePattern(A,B,B.NumberNegativePattern),u=w[0],y=w[1];if(u===""&&B.NumberNegativePattern!==1){w=Number._parseNumberNegativePattern(A,B,1);u=w[0];y=w[1]}if(u===""){u="+"}var s,z,x=y.indexOf("e");if(x<0){x=y.indexOf("E")}if(x<0){z=y;s=null}else{z=y.substr(0,x);s=y.substr(x+1)}var v,r,p=z.indexOf(B.NumberDecimalSeparator);if(p<0){v=z;r=null}else{v=z.substr(0,p);r=z.substr(p+B.NumberDecimalSeparator.length)}v=v.split(B.NumberGroupSeparator).join("");var q=u+v;if(r!==null){q+="."+r}if(s!==null){var t=Number._parseNumberNegativePattern(s,B,1);if(t[0]===""){t[0]="+"}q+="e"+t[0]+t[1]}if(q.match(/^[+-]?\d*\.?\d*(e[+-]?\d+)?$/)){return parseFloat(q)}return Number.NaN};Number._parseNumberNegativePattern=function(g,j,h){var f=j.NegativeSign,k=j.PositiveSign;switch(h){case 4:f=" "+f;k=" "+k;case 3:if(g.endsWith(f)){return["-",g.substr(0,g.length-f.length)]}else{if(g.endsWith(k)){return["+",g.substr(0,g.length-k.length)]}}break;case 2:f+=" ";k+=" ";case 1:if(g.startsWith(f)){return["-",g.substr(f.length)]}else{if(g.startsWith(k)){return["+",g.substr(k.length)]}}break;case 0:if(g.startsWith("(")&&g.endsWith(")")){return["-",g.substr(1,g.length-2)]}}return["",g]};Number.prototype.format=function(b){return this._toFormattedString(b,Sys.CultureInfo.InvariantCulture)};Number.prototype.localeFormat=function(b){return this._toFormattedString(b,Sys.CultureInfo.CurrentCulture)};Number.prototype._toFormattedString=function(I,C){if(!I||I.length===0||I==="i"){if(C&&C.name.length>0){return this.toLocaleString()}else{return this.toString()}}var v=["n %","n%","%n"],w=["-n %","-n%","-%n"],u=["(n)","-n","- n","n-","n -"],x=["$n","n$","$ n","n $"],y=["($n)","-$n","$-n","$n-","(n$)","-n$","n-$","n$-","-n $","-$ n","n $-","$ n-","$ -n","n- $","($ n)","(n $)"];function D(q,O,P,N,r){var U=P[0],S=1,W=q.toString(),Y="",M="",Q=W.split(".");if(Q.length>1){W=Q[0];Y=Q[1];var R=Y.split(/e/i);if(R.length>1){Y=R[0];M="e"+R[1]}}if(O>0){var T=Y.length-O;if(T>0){Y=Y.slice(0,O)}else{if(T<0){for(var s=0;s<Math.abs(T);s++){Y+="0"}}}Y=r+Y}else{Y=""}Y+=M;var X=W.length-1,V="";while(X>=0){if(U===0||U>X){if(V.length>0){return W.slice(0,X+1)+N+V+Y}else{return W.slice(0,X+1)+Y}}if(V.length>0){V=W.slice(X-U+1,X+1)+N+V}else{V=W.slice(X-U+1,X+1)}X-=U;if(S<P.length){U=P[S];S++}}return W.slice(0,X+1)+N+V+Y}var L=C.numberFormat,H=Math.abs(this);if(!I){I="D"}var K=-1;if(I.length>1){K=parseInt(I.slice(1),10)}var J;switch(I.charAt(0)){case"d":case"D":J="n";if(K!==-1){var F=""+H,B=K-F.length;if(B>0){for(var z=0;z<B;z++){F="0"+F}}H=F}if(this<0){H=-H}break;case"c":case"C":if(this<0){J=y[L.CurrencyNegativePattern]}else{J=x[L.CurrencyPositivePattern]}if(K===-1){K=L.CurrencyDecimalDigits}H=D(Math.abs(this),K,L.CurrencyGroupSizes,L.CurrencyGroupSeparator,L.CurrencyDecimalSeparator);break;case"n":case"N":if(this<0){J=u[L.NumberNegativePattern]}else{J="n"}if(K===-1){K=L.NumberDecimalDigits}H=D(Math.abs(this),K,L.NumberGroupSizes,L.NumberGroupSeparator,L.NumberDecimalSeparator);break;case"p":case"P":if(this<0){J=w[L.PercentNegativePattern]}else{J=v[L.PercentPositivePattern]}if(K===-1){K=L.PercentDecimalDigits}H=D(Math.abs(this),K,L.PercentGroupSizes,L.PercentGroupSeparator,L.PercentDecimalSeparator);break;default:throw Error.format(Sys.Res.formatBadFormatSpecifier)}var A=/n|\$|-|%/g,G="";for(;true;){var t=A.lastIndex,E=A.exec(J);G+=J.slice(t,E?E.index:J.length);if(!E){break}switch(E[0]){case"n":G+=H;break;case"$":G+=L.CurrencySymbol;break;case"-":G+=L.NegativeSign;break;case"%":G+=L.PercentSymbol}}return G};RegExp.__typeName="RegExp";RegExp.__class=true;Array.__typeName="Array";Array.__class=true;Array.add=Array.enqueue=function(d,c){d[d.length]=c};Array.addRange=function(d,c){d.push.apply(d,c)};Array.clear=function(b){b.length=0};Array.clone=function(b){if(b.length===1){return[b[0]]}else{return Array.apply(null,b)}};Array.contains=function(d,c){return Array.indexOf(d,c)>=0};Array.dequeue=function(b){return b.shift()};Array.forEach=function(g,k,l){for(var h=0,j=g.length;h<j;h++){var m=g[h];if(typeof m!=="undefined"){k.call(l,m,h,g)}}};Array.indexOf=function(j,h,g){if(typeof h==="undefined"){return -1}var k=j.length;if(k!==0){g=g-0;if(isNaN(g)){g=0}else{if(isFinite(g)){g=g-g%1}if(g<0){g=Math.max(0,k+g)}}for(var f=g;f<k;f++){if(typeof j[f]!=="undefined"&&j[f]===h){return f}}}return -1};Array.insert=function(e,d,f){e.splice(d,0,f)};Array.parse=function(value){if(!value){return[]}return eval(value)};Array.remove=function(d,f){var e=Array.indexOf(d,f);if(e>=0){d.splice(e,1)}return e>=0};Array.removeAt=function(d,c){d.splice(c,1)};if(!window){this.window=this}window.Type=Function;Type.prototype.callBaseMethod=function(f,g,e){var h=this.getBaseMethod(f,g);if(!e){return h.apply(f)}else{return h.apply(f,e)}};Type.prototype.getBaseMethod=function(g,h){var e=this.getBaseType();if(e){var f=e.prototype[h];return f instanceof Function?f:null}return null};Type.prototype.getBaseType=function(){return typeof this.__baseType==="undefined"?null:this.__baseType};Type.prototype.getInterfaces=function(){var h=[],g=this;while(g){var m=g.__interfaces;if(m){for(var l=0,j=m.length;l<j;l++){var k=m[l];if(!Array.contains(h,k)){h[h.length]=k}}}g=g.__baseType}return h};Type.prototype.getName=function(){return typeof this.__typeName==="undefined"?"":this.__typeName};Type.prototype.implementsInterface=function(l){this.resolveInheritance();var m=l.getName(),h=this.__interfaceCache;if(h){var k=h[m];if(typeof k!=="undefined"){return k}}else{h=this.__interfaceCache={}}var g=this;while(g){var j=g.__interfaces;if(j){if(Array.indexOf(j,l)!==-1){return h[m]=true}}g=g.__baseType}return h[m]=false};Type.prototype.inheritsFrom=function(c){this.resolveInheritance();var d=this.__baseType;while(d){if(d===c){return true}d=d.__baseType}return false};Type.prototype.initializeBase=function(d,c){this.resolveInheritance();if(this.__baseType){if(!c){this.__baseType.apply(d)}else{this.__baseType.apply(d,c)}}return d};Type.prototype.isImplementedBy=function(d){if(typeof d==="undefined"||d===null){return false}var c=Object.getType(d);return !!(c.implementsInterface&&c.implementsInterface(this))};Type.prototype.isInstanceOfType=function(c){if(typeof c==="undefined"||c===null){return false}if(c instanceof this){return true}var d=Object.getType(c);return !!(d===this)||d.inheritsFrom&&d.inheritsFrom(this)||d.implementsInterface&&d.implementsInterface(this)};Type.prototype.registerClass=function(m,g,l){this.prototype.constructor=this;this.__typeName=m;this.__class=true;if(g){this.__baseType=g;this.__basePrototypePending=true}Sys.__upperCaseTypes[m.toUpperCase()]=this;if(l){this.__interfaces=[];for(var h=2,j=arguments.length;h<j;h++){var k=arguments[h];this.__interfaces.push(k)}}return this};Type.prototype.registerInterface=function(b){Sys.__upperCaseTypes[b.toUpperCase()]=this;this.prototype.constructor=this;this.__typeName=b;this.__interface=true;return this};Type.prototype.resolveInheritance=function(){if(this.__basePrototypePending){var d=this.__baseType;d.resolveInheritance();for(var e in d.prototype){var f=d.prototype[e];if(!this.prototype[e]){this.prototype[e]=f}}delete this.__basePrototypePending}};Type.getRootNamespaces=function(){return Array.clone(Sys.__rootNamespaces)};Type.isClass=function(b){if(typeof b==="undefined"||b===null){return false}return !!b.__class};Type.isInterface=function(b){if(typeof b==="undefined"||b===null){return false}return !!b.__interface};Type.isNamespace=function(b){if(typeof b==="undefined"||b===null){return false}return !!b.__namespace};Type.parse=function(typeName,ns){var fn;if(ns){fn=Sys.__upperCaseTypes[ns.getName().toUpperCase()+"."+typeName.toUpperCase()];return fn||null}if(!typeName){return null}if(!Type.__htClasses){Type.__htClasses={}}fn=Type.__htClasses[typeName];if(!fn){fn=eval(typeName);Type.__htClasses[typeName]=fn}return fn};Type.registerNamespace=function(j){var l=window,m=j.split(".");for(var g=0;g<m.length;g++){var k=m[g],h=l[k];if(!h){h=l[k]={__namespace:true,__typeName:m.slice(0,g+1).join(".")};if(g===0){Sys.__rootNamespaces[Sys.__rootNamespaces.length]=h}h.getName=function(){return this.__typeName}}l=h}};window.Sys={__namespace:true,__typeName:"Sys",getName:function(){return"Sys"},__upperCaseTypes:{}};Sys.__rootNamespaces=[Sys];Sys.IDisposable=function(){};Sys.IDisposable.prototype={};Sys.IDisposable.registerInterface("Sys.IDisposable");Sys.StringBuilder=function(b){this._parts=typeof b!=="undefined"&&b!==null&&b!==""?[b.toString()]:[];this._value={};this._len=0};Sys.StringBuilder.prototype={append:function(b){this._parts[this._parts.length]=b},appendLine:function(b){this._parts[this._parts.length]=typeof b==="undefined"||b===null||b===""?"\r\n":b+"\r\n"},clear:function(){this._parts=[];this._value={};this._len=0},isEmpty:function(){if(this._parts.length===0){return true}return this.toString()===""},toString:function(f){f=f||"";var e=this._parts;if(this._len!==e.length){this._value={};this._len=e.length}var g=this._value;if(typeof g[f]==="undefined"){if(f!==""){for(var h=0;h<e.length;){if(typeof e[h]==="undefined"||e[h]===""||e[h]===null){e.splice(h,1)}else{h++}}}g[f]=this._parts.join(f)}return g[f]}};Sys.StringBuilder.registerClass("Sys.StringBuilder");if(!window.XMLHttpRequest){window.XMLHttpRequest=function(){var e=["Mxsml2.XMLHTTP.3.0","Msxml2.XMLHTTP"];for(var f=0,h=e.length;f<h;f++){try{return new ActiveXObject(e[f])}catch(g){}}return null}}Sys.Browser={};Sys.Browser.InternetExplorer={};Sys.Browser.Firefox={};Sys.Browser.Safari={};Sys.Browser.Opera={};Sys.Browser.agent=null;Sys.Browser.hasDebuggerStatement=false;Sys.Browser.name=navigator.appName;Sys.Browser.version=parseFloat(navigator.appVersion);if(navigator.userAgent.indexOf(" MSIE ")>-1){Sys.Browser.agent=Sys.Browser.InternetExplorer;Sys.Browser.version=parseFloat(navigator.userAgent.match(/MSIE (\d+\.\d+)/)[1]);Sys.Browser.hasDebuggerStatement=true}else{if(navigator.userAgent.indexOf(" Firefox/")>-1){Sys.Browser.agent=Sys.Browser.Firefox;Sys.Browser.version=parseFloat(navigator.userAgent.match(/Firefox\/(\d+\.\d+)/)[1]);Sys.Browser.name="Firefox";Sys.Browser.hasDebuggerStatement=true}else{if(navigator.userAgent.indexOf(" Safari/")>-1){Sys.Browser.agent=Sys.Browser.Safari;Sys.Browser.version=parseFloat(navigator.userAgent.match(/Safari\/(\d+(\.\d+)?)/)[1]);Sys.Browser.name="Safari"}else{if(navigator.userAgent.indexOf("Opera/")>-1){Sys.Browser.agent=Sys.Browser.Opera}}}}Type.registerNamespace("Sys.UI");Sys._Debug=function(){};Sys._Debug.prototype={_appendConsole:function(b){if(typeof Debug!=="undefined"&&Debug.writeln){Debug.writeln(b)}if(window.console&&window.console.log){window.console.log(b)}if(window.opera){window.opera.postError(b)}if(window.debugService){window.debugService.trace(b)}},_appendTrace:function(c){var d=document.getElementById("TraceConsole");if(d&&d.tagName.toUpperCase()==="TEXTAREA"){d.value+=c+"\n"}},assert:function(f,e,d){if(!f){e=d&&this.assert.caller?String.format(Sys.Res.assertFailedCaller,e,this.assert.caller):String.format(Sys.Res.assertFailed,e);if(confirm(String.format(Sys.Res.breakIntoDebugger,e))){this.fail(e)}}},clearTrace:function(){var b=document.getElementById("TraceConsole");if(b&&b.tagName.toUpperCase()==="TEXTAREA"){b.value=""}},fail:function(message){this._appendConsole(message);if(Sys.Browser.hasDebuggerStatement){eval("debugger")}},trace:function(b){this._appendConsole(b);this._appendTrace(b)},traceDump:function(e,d){var f=this._traceDump(e,d,true)},_traceDump:function(x,v,s,w,u){v=v?v:"traceDump";w=w?w:"";if(x===null){this.trace(w+v+": null");return}switch(typeof x){case"undefined":this.trace(w+v+": Undefined");break;case"number":case"string":case"boolean":this.trace(w+v+": "+x);break;default:if(Date.isInstanceOfType(x)||RegExp.isInstanceOfType(x)){this.trace(w+v+": "+x.toString());break}if(!u){u=[]}else{if(Array.contains(u,x)){this.trace(w+v+": ...");return}}Array.add(u,x);if(x==window||x===document||window.HTMLElement&&x instanceof HTMLElement||typeof x.nodeName==="string"){var n=x.tagName?x.tagName:"DomElement";if(x.id){n+=" - "+x.id}this.trace(w+v+" {"+n+"}")}else{var p=Object.getTypeName(x);this.trace(w+v+(typeof p==="string"?" {"+p+"}":""));if(w===""||s){w+="    ";var t,o,m,r,q;if(Array.isInstanceOfType(x)){o=x.length;for(t=0;t<o;t++){this._traceDump(x[t],"["+t+"]",s,w,u)}}else{for(r in x){q=x[r];if(!Function.isInstanceOfType(q)){this._traceDump(q,r,s,w,u)}}}}}Array.remove(u,x)}}};Sys._Debug.registerClass("Sys._Debug");Sys.Debug=new Sys._Debug;Sys.Debug.isDebug=false;function Sys$Enum$parse(t,r){var v,u,n;if(r){v=this.__lowerCaseValues;if(!v){this.__lowerCaseValues=v={};var p=this.prototype;for(var q in p){v[q.toLowerCase()]=p[q]}}}else{v=this.prototype}if(!this.__flags){n=r?t.toLowerCase():t;u=v[n.trim()];if(typeof u!=="number"){throw Error.argument("value",String.format(Sys.Res.enumInvalidValue,t,this.__typeName))}return u}else{var o=(r?t.toLowerCase():t).split(","),m=0;for(var s=o.length-1;s>=0;s--){var l=o[s].trim();u=v[l];if(typeof u!=="number"){throw Error.argument("value",String.format(Sys.Res.enumInvalidValue,t.split(",")[s].trim(),this.__typeName))}m|=u}return m}}function Sys$Enum$toString(q){if(typeof q==="undefined"||q===null){return this.__string}var p=this.prototype,k;if(!this.__flags||q===0){for(k in p){if(p[k]===q){return k}}}else{var j=this.__sortedValues;if(!j){j=[];for(k in p){j[j.length]={key:k,value:p[k]}}j.sort(function(d,c){return d.value-c.value});this.__sortedValues=j}var o=[],m=q;for(k=j.length-1;k>=0;k--){var l=j[k],n=l.value;if(n===0){continue}if((n&q)===n){o[o.length]=l.key;m-=n;if(m===0){break}}}if(o.length&&m===0){return o.reverse().join(", ")}}return""}Type.prototype.registerEnum=function(d,f){Sys.__upperCaseTypes[d.toUpperCase()]=this;for(var e in this.prototype){this[e]=this.prototype[e]}this.__typeName=d;this.parse=Sys$Enum$parse;this.__string=this.toString();this.toString=Sys$Enum$toString;this.__flags=f;this.__enum=true};Type.isEnum=function(b){if(typeof b==="undefined"||b===null){return false}return !!b.__enum};Type.isFlags=function(b){if(typeof b==="undefined"||b===null){return false}return !!b.__flags};Sys.EventHandlerList=function(){this._list={}};Sys.EventHandlerList.prototype={addHandler:function(c,d){Array.add(this._getEvent(c,true),d)},removeHandler:function(f,d){var e=this._getEvent(f);if(!e){return}Array.remove(e,d)},getHandler:function(c){var d=this._getEvent(c);if(!d||d.length===0){return null}d=Array.clone(d);return function(h,g){for(var a=0,f=d.length;a<f;a++){d[a](h,g)}}},_getEvent:function(d,c){if(!this._list[d]){if(!c){return null}this._list[d]=[]}return this._list[d]}};Sys.EventHandlerList.registerClass("Sys.EventHandlerList");Sys.EventArgs=function(){};Sys.EventArgs.registerClass("Sys.EventArgs");Sys.EventArgs.Empty=new Sys.EventArgs;Sys.CancelEventArgs=function(){Sys.CancelEventArgs.initializeBase(this);this._cancel=false};Sys.CancelEventArgs.prototype={get_cancel:function(){return this._cancel},set_cancel:function(b){this._cancel=b}};Sys.CancelEventArgs.registerClass("Sys.CancelEventArgs",Sys.EventArgs);Sys.INotifyPropertyChange=function(){};Sys.INotifyPropertyChange.prototype={};Sys.INotifyPropertyChange.registerInterface("Sys.INotifyPropertyChange");Sys.PropertyChangedEventArgs=function(b){Sys.PropertyChangedEventArgs.initializeBase(this);this._propertyName=b};Sys.PropertyChangedEventArgs.prototype={get_propertyName:function(){return this._propertyName}};Sys.PropertyChangedEventArgs.registerClass("Sys.PropertyChangedEventArgs",Sys.EventArgs);Sys.INotifyDisposing=function(){};Sys.INotifyDisposing.prototype={};Sys.INotifyDisposing.registerInterface("Sys.INotifyDisposing");Sys.Component=function(){if(Sys.Application){Sys.Application.registerDisposableObject(this)}};Sys.Component.prototype={_id:null,_initialized:false,_updating:false,get_events:function(){if(!this._events){this._events=new Sys.EventHandlerList}return this._events},get_id:function(){return this._id},set_id:function(b){this._id=b},get_isInitialized:function(){return this._initialized},get_isUpdating:function(){return this._updating},add_disposing:function(b){this.get_events().addHandler("disposing",b)},remove_disposing:function(b){this.get_events().removeHandler("disposing",b)},add_propertyChanged:function(b){this.get_events().addHandler("propertyChanged",b)},remove_propertyChanged:function(b){this.get_events().removeHandler("propertyChanged",b)},beginUpdate:function(){this._updating=true},dispose:function(){if(this._events){var b=this._events.getHandler("disposing");if(b){b(this,Sys.EventArgs.Empty)}}delete this._events;Sys.Application.unregisterDisposableObject(this);Sys.Application.removeComponent(this)},endUpdate:function(){this._updating=false;if(!this._initialized){this.initialize()}this.updated()},initialize:function(){this._initialized=true},raisePropertyChanged:function(c){if(!this._events){return}var d=this._events.getHandler("propertyChanged");if(d){d(this,new Sys.PropertyChangedEventArgs(c))}},updated:function(){}};Sys.Component.registerClass("Sys.Component",null,Sys.IDisposable,Sys.INotifyPropertyChange,Sys.INotifyDisposing);function Sys$Component$_setProperties(B,t){var y,s=Object.getType(B),x=s===Object||s===Sys.UI.DomElement,u=Sys.Component.isInstanceOfType(B)&&!B.get_isUpdating();if(u){B.beginUpdate()}for(var z in t){var A=t[z],w=x?null:B["get_"+z];if(x||typeof w!=="function"){var r=B[z];if(!A||typeof A!=="object"||x&&!r){B[z]=A}else{Sys$Component$_setProperties(r,A)}}else{var q=B["set_"+z];if(typeof q==="function"){q.apply(B,[A])}else{if(A instanceof Array){y=w.apply(B);for(var v=0,p=y.length,o=A.length;v<o;v++,p++){y[p]=A[v]}}else{if(typeof A==="object"&&Object.getType(A)===Object){y=w.apply(B);Sys$Component$_setProperties(y,A)}}}}}if(u){B.endUpdate()}}function Sys$Component$_setReferences(k,f){for(var g in f){var h=k["set_"+g],j=$find(f[g]);h.apply(k,[j])}}var $create=Sys.Component.create=function(k,m,o,p,l){var r=l?new k(l):new k,q=Sys.Application,j=q.get_isCreatingComponents();r.beginUpdate();if(m){Sys$Component$_setProperties(r,m)}if(o){for(var n in o){r["add_"+n](o[n])}}if(r.get_id()){q.addComponent(r)}if(j){q._createdComponents[q._createdComponents.length]=r;if(p){q._addComponentToSecondPass(r,p)}else{r.endUpdate()}}else{if(p){Sys$Component$_setReferences(r,p)}r.endUpdate()}return r};Sys.UI.MouseButton=function(){throw Error.notImplemented()};Sys.UI.MouseButton.prototype={leftButton:0,middleButton:1,rightButton:2};Sys.UI.MouseButton.registerEnum("Sys.UI.MouseButton");Sys.UI.Key=function(){throw Error.notImplemented()};Sys.UI.Key.prototype={backspace:8,tab:9,enter:13,esc:27,space:32,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,del:127};Sys.UI.Key.registerEnum("Sys.UI.Key");Sys.UI.Point=function(d,c){this.x=d;this.y=c};Sys.UI.Point.registerClass("Sys.UI.Point");Sys.UI.Bounds=function(h,g,e,f){this.x=h;this.y=g;this.height=f;this.width=e};Sys.UI.Bounds.registerClass("Sys.UI.Bounds");Sys.UI.DomEvent=function(g){var f=g;this.rawEvent=f;this.altKey=f.altKey;if(typeof f.button!=="undefined"){this.button=typeof f.which!=="undefined"?f.button:f.button===4?Sys.UI.MouseButton.middleButton:f.button===2?Sys.UI.MouseButton.rightButton:Sys.UI.MouseButton.leftButton}if(f.type==="keypress"){this.charCode=f.charCode||f.keyCode}else{if(f.keyCode&&f.keyCode===46){this.keyCode=127}else{this.keyCode=f.keyCode}}this.clientX=f.clientX;this.clientY=f.clientY;this.ctrlKey=f.ctrlKey;this.target=f.target?f.target:f.srcElement;if(typeof f.offsetX!=="undefined"&&typeof f.offsetY!=="undefined"){this.offsetX=f.offsetX;this.offsetY=f.offsetY}else{if(this.target&&this.target.nodeType!==3&&typeof f.clientX==="number"){var e=Sys.UI.DomElement.getLocation(this.target),h=Sys.UI.DomElement._getWindow(this.target);this.offsetX=(h.pageXOffset||0)+f.clientX-e.x;this.offsetY=(h.pageYOffset||0)+f.clientY-e.y}}this.screenX=f.screenX;this.screenY=f.screenY;this.shiftKey=f.shiftKey;this.type=f.type};Sys.UI.DomEvent.prototype={preventDefault:function(){if(this.rawEvent.preventDefault){this.rawEvent.preventDefault()}else{if(window.event){this.rawEvent.returnValue=false}}},stopPropagation:function(){if(this.rawEvent.stopPropagation){this.rawEvent.stopPropagation()}else{if(window.event){this.rawEvent.cancelBubble=true}}}};Sys.UI.DomEvent.registerClass("Sys.UI.DomEvent");var $addHandler=Sys.UI.DomEvent.addHandler=function(g,j,h){if(!g._events){g._events={}}var k=g._events[j];if(!k){g._events[j]=k=[]}var f;if(g.addEventListener){f=function(a){return h.call(g,new Sys.UI.DomEvent(a))};g.addEventListener(j,f,false)}else{if(g.attachEvent){f=function(){var a={};try{a=Sys.UI.DomElement._getWindow(g).event}catch(d){}return h.call(g,new Sys.UI.DomEvent(a))};g.attachEvent("on"+j,f)}}k[k.length]={handler:h,browserHandler:f}},$addHandlers=Sys.UI.DomEvent.addHandlers=function(h,j,k){for(var f in j){var g=j[f];if(k){g=Function.createDelegate(k,g)}$addHandler(h,f,g)}},$clearHandlers=Sys.UI.DomEvent.clearHandlers=function(g){if(g._events){var h=g._events;for(var f in h){var j=h[f];for(var k=j.length-1;k>=0;k--){$removeHandler(g,f,j[k].handler)}}g._events=null}},$removeHandler=Sys.UI.DomEvent.removeHandler=function(j,m,l){var n=null,o=j._events[m];for(var h=0,k=o.length;h<k;h++){if(o[h].handler===l){n=o[h].browserHandler;break}}if(j.removeEventListener){j.removeEventListener(m,n,false)}else{if(j.detachEvent){j.detachEvent("on"+m,n)}}o.splice(h,1)};Sys.UI.DomElement=function(){};Sys.UI.DomElement.registerClass("Sys.UI.DomElement");Sys.UI.DomElement.addCssClass=function(d,c){if(!Sys.UI.DomElement.containsCssClass(d,c)){if(d.className===""){d.className=c}else{d.className+=" "+c}}};Sys.UI.DomElement.containsCssClass=function(c,d){return Array.contains(c.className.split(" "),d)};Sys.UI.DomElement.getBounds=function(d){var c=Sys.UI.DomElement.getLocation(d);return new Sys.UI.Bounds(c.x,c.y,d.offsetWidth||0,d.offsetHeight||0)};var $get=Sys.UI.DomElement.getElementById=function(j,k){if(!k){return document.getElementById(j)}if(k.getElementById){return k.getElementById(j)}var m=[],l=k.childNodes;for(var g=0;g<l.length;g++){var h=l[g];if(h.nodeType==1){m[m.length]=h}}while(m.length){h=m.shift();if(h.id==j){return h}l=h.childNodes;for(g=0;g<l.length;g++){h=l[g];if(h.nodeType==1){m[m.length]=h}}}return null};switch(Sys.Browser.agent){case Sys.Browser.InternetExplorer:Sys.UI.DomElement.getLocation=function(k){if(k.self||k.nodeType===9){return new Sys.UI.Point(0,0)}var j=k.getBoundingClientRect();if(!j){return new Sys.UI.Point(0,0)}var p=k.ownerDocument.documentElement,o=j.left-2+p.scrollLeft,n=j.top-2+p.scrollTop;try{var q=k.ownerDocument.parentWindow.frameElement||null;if(q){var m=q.frameBorder==="0"||q.frameBorder==="no"?2:0;o+=m;n+=m}}catch(l){}return new Sys.UI.Point(o,n)};break;case Sys.Browser.Safari:Sys.UI.DomElement.getLocation=function(r){if(r.window&&r.window===r||r.nodeType===9){return new Sys.UI.Point(0,0)}var o=0,n=0,k=null,p=null,s;for(var t=r;t;k=t,(p=s,t=t.offsetParent)){s=Sys.UI.DomElement._getCurrentStyle(t);var q=t.tagName;if((t.offsetLeft||t.offsetTop)&&(q!=="BODY"||(!p||p.position!=="absolute"))){o+=t.offsetLeft;n+=t.offsetTop}}s=Sys.UI.DomElement._getCurrentStyle(r);var m=s?s.position:null;if(!m||m!=="absolute"){for(var t=r.parentNode;t;t=t.parentNode){q=t.tagName;if(q!=="BODY"&&q!=="HTML"&&(t.scrollLeft||t.scrollTop)){o-=t.scrollLeft||0;n-=t.scrollTop||0}s=Sys.UI.DomElement._getCurrentStyle(t);var l=s?s.position:null;if(l&&l==="absolute"){break}}}return new Sys.UI.Point(o,n)};break;case Sys.Browser.Opera:Sys.UI.DomElement.getLocation=function(q){if(q.window&&q.window===q||q.nodeType===9){return new Sys.UI.Point(0,0)}var o=0,n=0,j=null;for(var r=q;r;j=r,r=r.offsetParent){var m=r.tagName;o+=r.offsetLeft||0;n+=r.offsetTop||0}var l=q.style.position,p=l&&l!=="static";for(var r=q.parentNode;r;r=r.parentNode){m=r.tagName;if(m!=="BODY"&&m!=="HTML"&&(r.scrollLeft||r.scrollTop)&&(p&&(r.style.overflow==="scroll"||r.style.overflow==="auto"))){o-=r.scrollLeft||0;n-=r.scrollTop||0}var k=r&&r.style?r.style.position:null;p=p||k&&k!=="static"}return new Sys.UI.Point(o,n)};break;default:Sys.UI.DomElement.getLocation=function(o){if(o.window&&o.window===o||o.nodeType===9){return new Sys.UI.Point(0,0)}var n=0,m=0,j=null,l=null,q=null;for(var r=o;r;j=r,(l=q,r=r.offsetParent)){var p=r.tagName;q=Sys.UI.DomElement._getCurrentStyle(r);if((r.offsetLeft||r.offsetTop)&&!(p==="BODY"&&(!l||l.position!=="absolute"))){n+=r.offsetLeft;m+=r.offsetTop}if(j!==null&&q){if(p!=="TABLE"&&p!=="TD"&&p!=="HTML"){n+=parseInt(q.borderLeftWidth)||0;m+=parseInt(q.borderTopWidth)||0}if(p==="TABLE"&&(q.position==="relative"||q.position==="absolute")){n+=parseInt(q.marginLeft)||0;m+=parseInt(q.marginTop)||0}}}q=Sys.UI.DomElement._getCurrentStyle(o);var k=q?q.position:null;if(!k||k!=="absolute"){for(var r=o.parentNode;r;r=r.parentNode){p=r.tagName;if(p!=="BODY"&&p!=="HTML"&&(r.scrollLeft||r.scrollTop)){n-=r.scrollLeft||0;m-=r.scrollTop||0;q=Sys.UI.DomElement._getCurrentStyle(r);if(q){n+=parseInt(q.borderLeftWidth)||0;m+=parseInt(q.borderTopWidth)||0}}}}return new Sys.UI.Point(n,m)}}Sys.UI.DomElement.removeCssClass=function(g,h){var f=" "+g.className+" ",e=f.indexOf(" "+h+" ");if(e>=0){g.className=(f.substr(0,e)+" "+f.substring(e+h.length+1,f.length)).trim()}};Sys.UI.DomElement.setLocation=function(e,h,g){var f=e.style;f.position="absolute";f.left=h+"px";f.top=g+"px"};Sys.UI.DomElement.toggleCssClass=function(c,d){if(Sys.UI.DomElement.containsCssClass(c,d)){Sys.UI.DomElement.removeCssClass(c,d)}else{Sys.UI.DomElement.addCssClass(c,d)}};Sys.UI.DomElement.getVisibilityMode=function(b){return b._visibilityMode===Sys.UI.VisibilityMode.hide?Sys.UI.VisibilityMode.hide:Sys.UI.VisibilityMode.collapse};Sys.UI.DomElement.setVisibilityMode=function(d,c){Sys.UI.DomElement._ensureOldDisplayMode(d);if(d._visibilityMode!==c){d._visibilityMode=c;if(Sys.UI.DomElement.getVisible(d)===false){if(d._visibilityMode===Sys.UI.VisibilityMode.hide){d.style.display=d._oldDisplayMode}else{d.style.display="none"}}d._visibilityMode=c}};Sys.UI.DomElement.getVisible=function(c){var d=c.currentStyle||Sys.UI.DomElement._getCurrentStyle(c);if(!d){return true}return d.visibility!=="hidden"&&d.display!=="none"};Sys.UI.DomElement.setVisible=function(d,c){if(c!==Sys.UI.DomElement.getVisible(d)){Sys.UI.DomElement._ensureOldDisplayMode(d);d.style.visibility=c?"visible":"hidden";if(c||d._visibilityMode===Sys.UI.VisibilityMode.hide){d.style.display=d._oldDisplayMode}else{d.style.display="none"}}};Sys.UI.DomElement._ensureOldDisplayMode=function(d){if(!d._oldDisplayMode){var c=d.currentStyle||Sys.UI.DomElement._getCurrentStyle(d);d._oldDisplayMode=c?c.display:null;if(!d._oldDisplayMode||d._oldDisplayMode==="none"){switch(d.tagName.toUpperCase()){case"DIV":case"P":case"ADDRESS":case"BLOCKQUOTE":case"BODY":case"COL":case"COLGROUP":case"DD":case"DL":case"DT":case"FIELDSET":case"FORM":case"H1":case"H2":case"H3":case"H4":case"H5":case"H6":case"HR":case"IFRAME":case"LEGEND":case"OL":case"PRE":case"TABLE":case"TD":case"TH":case"TR":case"UL":d._oldDisplayMode="block";break;case"LI":d._oldDisplayMode="list-item";break;default:d._oldDisplayMode="inline"}}}};Sys.UI.DomElement._getWindow=function(d){var c=d.ownerDocument||d.document||d;return c.defaultView||c.parentWindow};Sys.UI.DomElement._getCurrentStyle=function(j){if(j.nodeType===3){return null}var o=Sys.UI.DomElement._getWindow(j);if(j.documentElement){j=j.documentElement}var h=o&&j!==o&&o.getComputedStyle?o.getComputedStyle(j,null):j.currentStyle||j.style;if(!h&&Sys.Browser.agent===Sys.Browser.Safari&&j.style){var k=j.style.display,l=j.style.position;j.style.position="absolute";j.style.display="block";var m=o.getComputedStyle(j,null);j.style.display=k;j.style.position=l;h={};for(var n in m){h[n]=m[n]}h.display="none"}return h};Sys.IContainer=function(){};Sys.IContainer.prototype={};Sys.IContainer.registerInterface("Sys.IContainer");Sys._ScriptLoader=function(){this._scriptsToLoad=null;this._scriptLoadedDelegate=Function.createDelegate(this,this._scriptLoadedHandler)};Sys._ScriptLoader.prototype={dispose:function(){this._stopLoading();if(this._events){delete this._events}this._scriptLoadedDelegate=null},loadScripts:function(f,h,g,e){this._loading=true;this._allScriptsLoadedCallback=h;this._scriptLoadFailedCallback=g;this._scriptLoadTimeoutCallback=e;if(f>0){this._timeoutCookie=window.setTimeout(Function.createDelegate(this,this._scriptLoadTimeoutHandler),f*1000)}this._loadScriptsInternal()},notifyScriptLoaded:function(){if(!this._loading){return}this._currentTask._notified++;if(Sys.Browser.agent===Sys.Browser.Safari){if(this._currentTask._notified===1){window.setTimeout(Function.createDelegate(this,function(){this._scriptLoadedHandler(this._currentTask.get_scriptElement(),true)}),0)}}},queueCustomScriptTag:function(b){if(!this._scriptsToLoad){this._scriptsToLoad=[]}Array.add(this._scriptsToLoad,b)},queueScriptBlock:function(b){if(!this._scriptsToLoad){this._scriptsToLoad=[]}Array.add(this._scriptsToLoad,{text:b})},queueScriptReference:function(b){if(!this._scriptsToLoad){this._scriptsToLoad=[]}Array.add(this._scriptsToLoad,{src:b})},_createScriptElement:function(f){var e=document.createElement("SCRIPT");e.type="text/javascript";for(var d in f){e[d]=f[d]}return e},_loadScriptsInternal:function(){if(this._scriptsToLoad&&this._scriptsToLoad.length>0){var e=Array.dequeue(this._scriptsToLoad),f=this._createScriptElement(e);if(f.text&&Sys.Browser.agent===Sys.Browser.Safari){f.innerHTML=f.text;delete f.text}if(typeof e.src==="string"){this._currentTask=new Sys._ScriptLoaderTask(f,this._scriptLoadedDelegate);this._currentTask.execute()}else{document.getElementsByTagName("HEAD")[0].appendChild(f);var g=this;window.setTimeout(function(){Sys._ScriptLoader._clearScript(f);g._loadScriptsInternal()},0)}}else{var h=this._allScriptsLoadedCallback;this._stopLoading();if(h){h(this)}}},_raiseError:function(e){var f=this._scriptLoadFailedCallback,d=this._currentTask.get_scriptElement();this._stopLoading();if(f){f(this,d,e)}else{throw Sys._ScriptLoader._errorScriptLoadFailed(d.src,e)}},_scriptLoadedHandler:function(d,c){if(c&&this._currentTask._notified){if(this._currentTask._notified>1){this._raiseError(true)}else{Array.add(Sys._ScriptLoader._getLoadedScripts(),d.src);this._currentTask.dispose();this._currentTask=null;this._loadScriptsInternal()}}else{this._raiseError(false)}},_scriptLoadTimeoutHandler:function(){var b=this._scriptLoadTimeoutCallback;this._stopLoading();if(b){b(this)}},_stopLoading:function(){if(this._timeoutCookie){window.clearTimeout(this._timeoutCookie);this._timeoutCookie=null}if(this._currentTask){this._currentTask.dispose();this._currentTask=null}this._scriptsToLoad=null;this._loading=null;this._allScriptsLoadedCallback=null;this._scriptLoadFailedCallback=null;this._scriptLoadTimeoutCallback=null}};Sys._ScriptLoader.registerClass("Sys._ScriptLoader",null,Sys.IDisposable);Sys._ScriptLoader.getInstance=function(){var b=Sys._ScriptLoader._activeInstance;if(!b){b=Sys._ScriptLoader._activeInstance=new Sys._ScriptLoader}return b};Sys._ScriptLoader.isScriptLoaded=function(c){var d=document.createElement("script");d.src=c;return Array.contains(Sys._ScriptLoader._getLoadedScripts(),d.src)};Sys._ScriptLoader.readLoadedScripts=function(){if(!Sys._ScriptLoader._referencedScripts){var e=Sys._ScriptLoader._referencedScripts=[],h=document.getElementsByTagName("SCRIPT");for(i=h.length-1;i>=0;i--){var g=h[i],f=g.src;if(f.length){if(!Array.contains(e,f)){Array.add(e,f)}}}}};Sys._ScriptLoader._clearScript=function(b){if(!Sys.Debug.isDebug){b.parentNode.removeChild(b)}};Sys._ScriptLoader._errorScriptLoadFailed=function(f,j){var g;if(j){g=Sys.Res.scriptLoadMultipleCallbacks}else{g=Sys.Res.scriptLoadFailed}var h="Sys.ScriptLoadFailedException: "+String.format(g,f),k=Error.create(h,{name:"Sys.ScriptLoadFailedException",scriptUrl:f});k.popStackFrame();return k};Sys._ScriptLoader._getLoadedScripts=function(){if(!Sys._ScriptLoader._referencedScripts){Sys._ScriptLoader._referencedScripts=[];Sys._ScriptLoader.readLoadedScripts()}return Sys._ScriptLoader._referencedScripts};Sys._ScriptLoaderTask=function(c,d){this._scriptElement=c;this._completedCallback=d;this._notified=0};Sys._ScriptLoaderTask.prototype={get_scriptElement:function(){return this._scriptElement},dispose:function(){if(this._disposed){return}this._disposed=true;this._removeScriptElementHandlers();Sys._ScriptLoader._clearScript(this._scriptElement);this._scriptElement=null},execute:function(){this._addScriptElementHandlers();document.getElementsByTagName("HEAD")[0].appendChild(this._scriptElement)},_addScriptElementHandlers:function(){this._scriptLoadDelegate=Function.createDelegate(this,this._scriptLoadHandler);if(Sys.Browser.agent!==Sys.Browser.InternetExplorer){this._scriptElement.readyState="loaded";$addHandler(this._scriptElement,"load",this._scriptLoadDelegate)}else{$addHandler(this._scriptElement,"readystatechange",this._scriptLoadDelegate)}if(this._scriptElement.addEventListener){this._scriptErrorDelegate=Function.createDelegate(this,this._scriptErrorHandler);this._scriptElement.addEventListener("error",this._scriptErrorDelegate,false)}},_removeScriptElementHandlers:function(){if(this._scriptLoadDelegate){var b=this.get_scriptElement();if(Sys.Browser.agent!==Sys.Browser.InternetExplorer){$removeHandler(b,"load",this._scriptLoadDelegate)}else{$removeHandler(b,"readystatechange",this._scriptLoadDelegate)}if(this._scriptErrorDelegate){this._scriptElement.removeEventListener("error",this._scriptErrorDelegate,false);this._scriptErrorDelegate=null}this._scriptLoadDelegate=null}},_scriptErrorHandler:function(){if(this._disposed){return}this._completedCallback(this.get_scriptElement(),false)},_scriptLoadHandler:function(){if(this._disposed){return}var d=this.get_scriptElement();if(d.readyState!=="loaded"&&d.readyState!=="complete"){return}var c=this;window.setTimeout(function(){c._completedCallback(d,true)},0)}};Sys._ScriptLoaderTask.registerClass("Sys._ScriptLoaderTask",null,Sys.IDisposable);Sys.ApplicationLoadEventArgs=function(c,d){Sys.ApplicationLoadEventArgs.initializeBase(this);this._components=c;this._isPartialLoad=d};Sys.ApplicationLoadEventArgs.prototype={get_components:function(){return this._components},get_isPartialLoad:function(){return this._isPartialLoad}};Sys.ApplicationLoadEventArgs.registerClass("Sys.ApplicationLoadEventArgs",Sys.EventArgs);Sys._Application=function(){Sys._Application.initializeBase(this);this._disposableObjects=[];this._components={};this._createdComponents=[];this._secondPassComponents=[];this._unloadHandlerDelegate=Function.createDelegate(this,this._unloadHandler);this._loadHandlerDelegate=Function.createDelegate(this,this._loadHandler);Sys.UI.DomEvent.addHandler(window,"unload",this._unloadHandlerDelegate);Sys.UI.DomEvent.addHandler(window,"load",this._loadHandlerDelegate)};Sys._Application.prototype={_creatingComponents:false,_disposing:false,get_isCreatingComponents:function(){return this._creatingComponents},add_load:function(b){this.get_events().addHandler("load",b)},remove_load:function(b){this.get_events().removeHandler("load",b)},add_init:function(b){if(this._initialized){b(this,Sys.EventArgs.Empty)}else{this.get_events().addHandler("init",b)}},remove_init:function(b){this.get_events().removeHandler("init",b)},add_unload:function(b){this.get_events().addHandler("unload",b)},remove_unload:function(b){this.get_events().removeHandler("unload",b)},addComponent:function(b){this._components[b.get_id()]=b},beginCreateComponents:function(){this._creatingComponents=true},dispose:function(){if(!this._disposing){this._disposing=true;if(window.pageUnload){window.pageUnload(this,Sys.EventArgs.Empty)}var k=this.get_events().getHandler("unload");if(k){k(this,Sys.EventArgs.Empty)}var f=Array.clone(this._disposableObjects);for(var g=0,h=f.length;g<h;g++){f[g].dispose()}Array.clear(this._disposableObjects);Sys.UI.DomEvent.removeHandler(window,"unload",this._unloadHandlerDelegate);if(this._loadHandlerDelegate){Sys.UI.DomEvent.removeHandler(window,"load",this._loadHandlerDelegate);this._loadHandlerDelegate=null}var j=Sys._ScriptLoader.getInstance();if(j){j.dispose()}Sys._Application.callBaseMethod(this,"dispose")}},endCreateComponents:function(){var e=this._secondPassComponents;for(var f=0,g=e.length;f<g;f++){var h=e[f].component;Sys$Component$_setReferences(h,e[f].references);h.endUpdate()}this._secondPassComponents=[];this._creatingComponents=false},findComponent:function(c,d){return d?Sys.IContainer.isInstanceOfType(d)?d.findComponent(c):d[c]||null:Sys.Application._components[c]||null},getComponents:function(){var e=[],d=this._components;for(var f in d){e[e.length]=d[f]}return e},initialize:function(){if(!this._initialized&&!this._initializing){this._initializing=true;window.setTimeout(Function.createDelegate(this,this._doInitialize),0)}},notifyScriptLoaded:function(){var b=Sys._ScriptLoader.getInstance();if(b){b.notifyScriptLoaded()}},registerDisposableObject:function(b){if(!this._disposing){this._disposableObjects[this._disposableObjects.length]=b}},raiseLoad:function(){var c=this.get_events().getHandler("load"),d=new Sys.ApplicationLoadEventArgs(Array.clone(this._createdComponents),!this._initializing);if(c){c(this,d)}if(window.pageLoad){window.pageLoad(this,d)}this._createdComponents=[]},removeComponent:function(c){var d=c.get_id();if(d){delete this._components[d]}},unregisterDisposableObject:function(b){if(!this._disposing){Array.remove(this._disposableObjects,b)}},_addComponentToSecondPass:function(c,d){this._secondPassComponents[this._secondPassComponents.length]={component:c,references:d}},_doInitialize:function(){Sys._Application.callBaseMethod(this,"initialize");var b=this.get_events().getHandler("init");if(b){this.beginCreateComponents();b(this,Sys.EventArgs.Empty);this.endCreateComponents()}this.raiseLoad();this._initializing=false},_loadHandler:function(){if(this._loadHandlerDelegate){Sys.UI.DomEvent.removeHandler(window,"load",this._loadHandlerDelegate);this._loadHandlerDelegate=null}this.initialize()},_unloadHandler:function(){this.dispose()}};Sys._Application.registerClass("Sys._Application",Sys.Component,Sys.IContainer);Sys.Application=new Sys._Application;var $find=Sys.Application.findComponent;Type.registerNamespace("Sys.Net");Sys.Net.WebRequestExecutor=function(){this._webRequest=null;this._resultObject=null};Sys.Net.WebRequestExecutor.prototype={get_webRequest:function(){return this._webRequest},_set_webRequest:function(b){this._webRequest=b},get_started:function(){throw Error.notImplemented()},get_responseAvailable:function(){throw Error.notImplemented()},get_timedOut:function(){throw Error.notImplemented()},get_aborted:function(){throw Error.notImplemented()},get_responseData:function(){throw Error.notImplemented()},get_statusCode:function(){throw Error.notImplemented()},get_statusText:function(){throw Error.notImplemented()},get_xml:function(){throw Error.notImplemented()},get_object:function(){if(!this._resultObject){this._resultObject=Sys.Serialization.JavaScriptSerializer.deserialize(this.get_responseData())}return this._resultObject},executeRequest:function(){throw Error.notImplemented()},abort:function(){throw Error.notImplemented()},getResponseHeader:function(){throw Error.notImplemented()},getAllResponseHeaders:function(){throw Error.notImplemented()}};Sys.Net.WebRequestExecutor.registerClass("Sys.Net.WebRequestExecutor");Sys.Net.XMLDOM=function(n){if(!window.DOMParser){var o=["Msxml2.DOMDocument.3.0","Msxml2.DOMDocument"];for(var h=0,l=o.length;h<l;h++){try{var j=new ActiveXObject(o[h]);j.async=false;j.loadXML(n);j.setProperty("SelectionLanguage","XPath");return j}catch(k){}}}else{try{var m=new window.DOMParser;return m.parseFromString(n,"text/xml")}catch(k){}}return null};Sys.Net.XMLHttpExecutor=function(){Sys.Net.XMLHttpExecutor.initializeBase(this);var b=this;this._xmlHttpRequest=null;this._webRequest=null;this._responseAvailable=false;this._timedOut=false;this._timer=null;this._aborted=false;this._started=false;this._onReadyStateChange=function(){if(b._xmlHttpRequest.readyState===4){try{if(typeof b._xmlHttpRequest.status==="undefined"){return}}catch(a){return}b._clearTimer();b._responseAvailable=true;b._webRequest.completed(Sys.EventArgs.Empty);if(b._xmlHttpRequest!=null){b._xmlHttpRequest.onreadystatechange=Function.emptyMethod;b._xmlHttpRequest=null}}};this._clearTimer=function(){if(b._timer!=null){window.clearTimeout(b._timer);b._timer=null}};this._onTimeout=function(){if(!b._responseAvailable){b._clearTimer();b._timedOut=true;b._xmlHttpRequest.onreadystatechange=Function.emptyMethod;b._xmlHttpRequest.abort();b._webRequest.completed(Sys.EventArgs.Empty);b._xmlHttpRequest=null}}};Sys.Net.XMLHttpExecutor.prototype={get_timedOut:function(){return this._timedOut},get_started:function(){return this._started},get_responseAvailable:function(){return this._responseAvailable},get_aborted:function(){return this._aborted},executeRequest:function(){this._webRequest=this.get_webRequest();var m=this._webRequest.get_body(),h=this._webRequest.get_headers();this._xmlHttpRequest=new XMLHttpRequest;this._xmlHttpRequest.onreadystatechange=this._onReadyStateChange;var k=this._webRequest.get_httpVerb();this._xmlHttpRequest.open(k,this._webRequest.getResolvedUrl(),true);if(h){for(var g in h){var j=h[g];if(typeof j!=="function"){this._xmlHttpRequest.setRequestHeader(g,j)}}}if(k.toLowerCase()==="post"){if(h===null||!h["Content-Type"]){this._xmlHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8")}if(!m){m=""}}var l=this._webRequest.get_timeout();if(l>0){this._timer=window.setTimeout(Function.createDelegate(this,this._onTimeout),l)}this._xmlHttpRequest.send(m);this._started=true},getResponseHeader:function(d){var e;try{e=this._xmlHttpRequest.getResponseHeader(d)}catch(f){}if(!e){e=""}return e},getAllResponseHeaders:function(){return this._xmlHttpRequest.getAllResponseHeaders()},get_responseData:function(){return this._xmlHttpRequest.responseText},get_statusCode:function(){var d=0;try{d=this._xmlHttpRequest.status}catch(c){}return d},get_statusText:function(){return this._xmlHttpRequest.statusText},get_xml:function(){var b=this._xmlHttpRequest.responseXML;if(!b||!b.documentElement){b=Sys.Net.XMLDOM(this._xmlHttpRequest.responseText);if(!b||!b.documentElement){return null}}else{if(navigator.userAgent.indexOf("MSIE")!==-1){b.setProperty("SelectionLanguage","XPath")}}if(b.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml"&&b.documentElement.tagName==="parsererror"){return null}if(b.documentElement.firstChild&&b.documentElement.firstChild.tagName==="parsererror"){return null}return b},abort:function(){if(this._aborted||this._responseAvailable||this._timedOut){return}this._aborted=true;this._clearTimer();if(this._xmlHttpRequest&&!this._responseAvailable){this._xmlHttpRequest.onreadystatechange=Function.emptyMethod;this._xmlHttpRequest.abort();this._xmlHttpRequest=null;this._webRequest.completed(Sys.EventArgs.Empty)}}};Sys.Net.XMLHttpExecutor.registerClass("Sys.Net.XMLHttpExecutor",Sys.Net.WebRequestExecutor);Sys.Net._WebRequestManager=function(){this._this=this;this._defaultTimeout=0;this._defaultExecutorType="Sys.Net.XMLHttpExecutor"};Sys.Net._WebRequestManager.prototype={add_invokingRequest:function(b){this._get_eventHandlerList().addHandler("invokingRequest",b)},remove_invokingRequest:function(b){this._get_eventHandlerList().removeHandler("invokingRequest",b)},add_completedRequest:function(b){this._get_eventHandlerList().addHandler("completedRequest",b)},remove_completedRequest:function(b){this._get_eventHandlerList().removeHandler("completedRequest",b)},_get_eventHandlerList:function(){if(!this._events){this._events=new Sys.EventHandlerList}return this._events},get_defaultTimeout:function(){return this._defaultTimeout},set_defaultTimeout:function(b){this._defaultTimeout=b},get_defaultExecutorType:function(){return this._defaultExecutorType},set_defaultExecutorType:function(b){this._defaultExecutorType=b},executeRequest:function(webRequest){var executor=webRequest.get_executor();if(!executor){var failed=false;try{var executorType=eval(this._defaultExecutorType);executor=new executorType}catch(a){failed=true}webRequest.set_executor(executor)}if(executor.get_aborted()){return}var evArgs=new Sys.Net.NetworkRequestEventArgs(webRequest),handler=this._get_eventHandlerList().getHandler("invokingRequest");if(handler){handler(this,evArgs)}if(!evArgs.get_cancel()){executor.executeRequest()}}};Sys.Net._WebRequestManager.registerClass("Sys.Net._WebRequestManager");Sys.Net.WebRequestManager=new Sys.Net._WebRequestManager;Sys.Net.NetworkRequestEventArgs=function(b){Sys.Net.NetworkRequestEventArgs.initializeBase(this);this._webRequest=b};Sys.Net.NetworkRequestEventArgs.prototype={get_webRequest:function(){return this._webRequest}};Sys.Net.NetworkRequestEventArgs.registerClass("Sys.Net.NetworkRequestEventArgs",Sys.CancelEventArgs);Sys.Net.WebRequest=function(){this._url="";this._headers={};this._body=null;this._userContext=null;this._httpVerb=null;this._executor=null;this._invokeCalled=false;this._timeout=0};Sys.Net.WebRequest.prototype={add_completed:function(b){this._get_eventHandlerList().addHandler("completed",b)},remove_completed:function(b){this._get_eventHandlerList().removeHandler("completed",b)},completed:function(c){var d=Sys.Net.WebRequestManager._get_eventHandlerList().getHandler("completedRequest");if(d){d(this._executor,c)}d=this._get_eventHandlerList().getHandler("completed");if(d){d(this._executor,c)}},_get_eventHandlerList:function(){if(!this._events){this._events=new Sys.EventHandlerList}return this._events},get_url:function(){return this._url},set_url:function(b){this._url=b},get_headers:function(){return this._headers},get_httpVerb:function(){if(this._httpVerb===null){if(this._body===null){return"GET"}return"POST"}return this._httpVerb},set_httpVerb:function(b){this._httpVerb=b},get_body:function(){return this._body},set_body:function(b){this._body=b},get_userContext:function(){return this._userContext},set_userContext:function(b){this._userContext=b},get_executor:function(){return this._executor},set_executor:function(b){this._executor=b;this._executor._set_webRequest(this)},get_timeout:function(){if(this._timeout===0){return Sys.Net.WebRequestManager.get_defaultTimeout()}return this._timeout},set_timeout:function(b){this._timeout=b},getResolvedUrl:function(){return Sys.Net.WebRequest._resolveUrl(this._url)},invoke:function(){Sys.Net.WebRequestManager.executeRequest(this);this._invokeCalled=true}};Sys.Net.WebRequest._resolveUrl=function(h,j){if(h&&h.indexOf("://")!==-1){return h}if(!j||j.length===0){var o=document.getElementsByTagName("base")[0];if(o&&o.href&&o.href.length>0){j=o.href}else{j=document.URL}}var n=j.indexOf("?");if(n!==-1){j=j.substr(0,n)}j=j.substr(0,j.lastIndexOf("/")+1);if(!h||h.length===0){return j}if(h.charAt(0)==="/"){var m=j.indexOf("://"),k=j.indexOf("/",m+3);return j.substr(0,k)+h}else{var l=j.lastIndexOf("/");return j.substr(0,l+1)+h}};Sys.Net.WebRequest._createQueryString=function(n,h){if(!h){h=encodeURIComponent}var j=new Sys.StringBuilder,l=0;for(var o in n){var m=n[o];if(typeof m==="function"){continue}var k=Sys.Serialization.JavaScriptSerializer.serialize(m);if(l!==0){j.append("&")}j.append(o);j.append("=");j.append(h(k));l++}return j.toString()};Sys.Net.WebRequest._createUrl=function(f,e){if(!e){return f}var g=Sys.Net.WebRequest._createQueryString(e);if(g.length>0){var h="?";if(f&&f.indexOf("?")!==-1){h="&"}return f+h+g}else{return f}};Sys.Net.WebRequest.registerClass("Sys.Net.WebRequest");Sys.Net.WebServiceProxy=function(){};Sys.Net.WebServiceProxy.prototype={get_timeout:function(){return this._timeout},set_timeout:function(b){if(b<0){throw Error.argumentOutOfRange("value",b,Sys.Res.invalidTimeout)}this._timeout=b},get_defaultUserContext:function(){return this._userContext},set_defaultUserContext:function(b){this._userContext=b},get_defaultSucceededCallback:function(){return this._succeeded},set_defaultSucceededCallback:function(b){this._succeeded=b},get_defaultFailedCallback:function(){return this._failed},set_defaultFailedCallback:function(b){this._failed=b},get_path:function(){return this._path},set_path:function(b){this._path=b},_invoke:function(n,m,k,l,o,h,j){if(o===null||typeof o==="undefined"){o=this.get_defaultSucceededCallback()}if(h===null||typeof h==="undefined"){h=this.get_defaultFailedCallback()}if(j===null||typeof j==="undefined"){j=this.get_defaultUserContext()}return Sys.Net.WebServiceProxy.invoke(n,m,k,l,o,h,j,this.get_timeout())}};Sys.Net.WebServiceProxy.registerClass("Sys.Net.WebServiceProxy");Sys.Net.WebServiceProxy.invoke=function(n,x,o,u,p,v,s,q){var w=new Sys.Net.WebRequest;w.get_headers()["Content-Type"]="application/json; charset=utf-8";if(!u){u={}}var r=u;if(!o||!r){r={}}w.set_url(Sys.Net.WebRequest._createUrl(n+"/"+encodeURIComponent(x),r));var t=null;if(!o){t=Sys.Serialization.JavaScriptSerializer.serialize(u);if(t==="{}"){t=""}}w.set_body(t);w.add_completed(m);if(q&&q>0){w.set_timeout(q)}w.invoke();function m(B){if(B.get_responseAvailable()){var z=B.get_statusCode(),c=null;try{var A=B.getResponseHeader("Content-Type");if(A.startsWith("application/json")){c=B.get_object()}else{if(A.startsWith("text/xml")){c=B.get_xml()}else{c=B.get_responseData()}}}catch(a){}var f=B.getResponseHeader("jsonerror"),y=f==="true";if(y){if(c){c=new Sys.Net.WebServiceError(false,c.Message,c.StackTrace,c.ExceptionType)}}else{if(A.startsWith("application/json")){c=c.d}}if(z<200||z>=300||y){if(v){if(!c||!y){c=new Sys.Net.WebServiceError(false,String.format(Sys.Res.webServiceFailedNoMsg,x),"","")}c._statusCode=z;v(c,s,x)}}else{if(p){p(c,s,x)}}}else{var l;if(B.get_timedOut()){l=String.format(Sys.Res.webServiceTimedOut,x)}else{l=String.format(Sys.Res.webServiceFailedNoMsg,x)}if(v){v(new Sys.Net.WebServiceError(B.get_timedOut(),l,"",""),s,x)}}}return w};Sys.Net.WebServiceProxy._generateTypedConstructor=function(b){return function(a){if(a){for(var d in a){this[d]=a[d]}}this.__type=b}};Sys.Net.WebServiceError=function(h,g,e,f){this._timedOut=h;this._message=g;this._stackTrace=e;this._exceptionType=f;this._statusCode=-1};Sys.Net.WebServiceError.prototype={get_timedOut:function(){return this._timedOut},get_statusCode:function(){return this._statusCode},get_message:function(){return this._message},get_stackTrace:function(){return this._stackTrace},get_exceptionType:function(){return this._exceptionType}};Sys.Net.WebServiceError.registerClass("Sys.Net.WebServiceError");Type.registerNamespace("Sys.Services");Sys.Services._ProfileService=function(){Sys.Services._ProfileService.initializeBase(this);this.properties={}};Sys.Services._ProfileService.DefaultWebServicePath="";Sys.Services._ProfileService.prototype={_defaultLoadCompletedCallback:null,_defaultSaveCompletedCallback:null,_path:"",_timeout:0,get_defaultLoadCompletedCallback:function(){return this._defaultLoadCompletedCallback},set_defaultLoadCompletedCallback:function(b){this._defaultLoadCompletedCallback=b},get_defaultSaveCompletedCallback:function(){return this._defaultSaveCompletedCallback},set_defaultSaveCompletedCallback:function(b){this._defaultSaveCompletedCallback=b},get_path:function(){return this._path||""},load:function(m,l,k,j){var g,h;if(!m){h="GetAllPropertiesForCurrentUser";g={authenticatedUserOnly:false}}else{h="GetPropertiesForCurrentUser";g={properties:this._clonePropertyNames(m),authenticatedUserOnly:false}}this._invoke(this._get_path(),h,false,g,Function.createDelegate(this,this._onLoadComplete),Function.createDelegate(this,this._onLoadFailed),[l,k,j])},save:function(j,f,k,h){var g=this._flattenProperties(j,this.properties);this._invoke(this._get_path(),"SetPropertiesForCurrentUser",false,{values:g.value,authenticatedUserOnly:false},Function.createDelegate(this,this._onSaveComplete),Function.createDelegate(this,this._onSaveFailed),[f,k,h,g.count])},_clonePropertyNames:function(h){var k=[],j={};for(var f=0;f<h.length;f++){var g=h[f];if(!j[g]){Array.add(k,g);j[g]=true}}return k},_flattenProperties:function(x,p,o){var w={},t,u,r=0;if(x&&x.length===0){return{value:w,count:0}}for(var v in p){t=p[v];u=o?o+"."+v:v;if(Sys.Services.ProfileGroup.isInstanceOfType(t)){var n=this._flattenProperties(x,t,u),q=n.value;r+=n.count;for(var s in q){var m=q[s];w[s]=m}}else{if(!x||Array.indexOf(x,u)!==-1){w[u]=t;r++}}}return{value:w,count:r}},_get_path:function(){var b=this.get_path();if(!b.length){b=Sys.Services._ProfileService.DefaultWebServicePath}if(!b||!b.length){throw Error.invalidOperation(Sys.Res.servicePathNotSet)}return b},_onLoadComplete:function(j,m,k){if(typeof j!=="object"){throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,k,"Object"))}var o=this._unflattenProperties(j);for(var h in o){this.properties[h]=o[h]}var n=m[0]||this.get_defaultLoadCompletedCallback()||this.get_defaultSucceededCallback();if(n){var l=m[2]||this.get_defaultUserContext();n(j.length,l,"Sys.Services.ProfileService.load")}},_onLoadFailed:function(g,e){var f=e[1]||this.get_defaultFailedCallback();if(f){var h=e[2]||this.get_defaultUserContext();f(g,h,"Sys.Services.ProfileService.load")}},_onSaveComplete:function(h,g,j){var m=g[3];if(h!==null){if(h instanceof Array){m-=h.length}else{if(typeof h==="number"){m=h}else{throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,j,"Array"))}}}var l=g[0]||this.get_defaultSaveCompletedCallback()||this.get_defaultSucceededCallback();if(l){var k=g[2]||this.get_defaultUserContext();l(m,k,"Sys.Services.ProfileService.save")}},_onSaveFailed:function(g,e){var f=e[1]||this.get_defaultFailedCallback();if(f){var h=e[2]||this.get_defaultUserContext();f(g,h,"Sys.Services.ProfileService.save")}},_unflattenProperties:function(o){var q={},p,n,l=0;for(var k in o){l++;n=o[k];p=k.indexOf(".");if(p!==-1){var m=k.substr(0,p);k=k.substr(p+1);var j=q[m];if(!j||!Sys.Services.ProfileGroup.isInstanceOfType(j)){j=new Sys.Services.ProfileGroup;q[m]=j}j[k]=n}else{q[k]=n}}o.length=l;return q}};Sys.Services._ProfileService.registerClass("Sys.Services._ProfileService",Sys.Net.WebServiceProxy);Sys.Services.ProfileService=new Sys.Services._ProfileService;Sys.Services.ProfileGroup=function(d){if(d){for(var c in d){this[c]=d[c]}}};Sys.Services.ProfileGroup.registerClass("Sys.Services.ProfileGroup");Sys.Services._AuthenticationService=function(){Sys.Services._AuthenticationService.initializeBase(this)};Sys.Services._AuthenticationService.DefaultWebServicePath="";Sys.Services._AuthenticationService.prototype={_defaultLoginCompletedCallback:null,_defaultLogoutCompletedCallback:null,_path:"",_timeout:0,_authenticated:false,get_defaultLoginCompletedCallback:function(){return this._defaultLoginCompletedCallback},set_defaultLoginCompletedCallback:function(b){this._defaultLoginCompletedCallback=b},get_defaultLogoutCompletedCallback:function(){return this._defaultLogoutCompletedCallback},set_defaultLogoutCompletedCallback:function(b){this._defaultLogoutCompletedCallback=b},get_isLoggedIn:function(){return this._authenticated},get_path:function(){return this._path||""},login:function(q,j,k,l,n,p,o,m){this._invoke(this._get_path(),"Login",false,{userName:q,password:j,createPersistentCookie:k},Function.createDelegate(this,this._onLoginComplete),Function.createDelegate(this,this._onLoginFailed),[q,j,k,l,n,p,o,m])},logout:function(h,f,e,g){this._invoke(this._get_path(),"Logout",false,{},Function.createDelegate(this,this._onLogoutComplete),Function.createDelegate(this,this._onLogoutFailed),[h,f,e,g])},_get_path:function(){var b=this.get_path();if(!b.length){b=Sys.Services._AuthenticationService.DefaultWebServicePath}if(!b||!b.length){throw Error.invalidOperation(Sys.Res.servicePathNotSet)}return b},_onLoginComplete:function(k,m,j){if(typeof k!=="boolean"){throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,j,"Boolean"))}var g=m[4],l=m[7]||this.get_defaultUserContext(),h=m[5]||this.get_defaultLoginCompletedCallback()||this.get_defaultSucceededCallback();if(k){this._authenticated=true;if(h){h(true,l,"Sys.Services.AuthenticationService.login")}if(typeof g!=="undefined"&&g!==null){window.location.href=g}}else{if(h){h(false,l,"Sys.Services.AuthenticationService.login")}}},_onLoginFailed:function(g,e){var f=e[6]||this.get_defaultFailedCallback();if(f){var h=e[7]||this.get_defaultUserContext();f(g,h,"Sys.Services.AuthenticationService.login")}},_onLogoutComplete:function(j,h,k){if(j!==null){throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,k,"null"))}var g=h[0],l=h[3]||this.get_defaultUserContext(),m=h[1]||this.get_defaultLogoutCompletedCallback()||this.get_defaultSucceededCallback();this._authenticated=false;if(m){m(null,l,"Sys.Services.AuthenticationService.logout")}if(!g){window.location.reload()}else{window.location.href=g}},_onLogoutFailed:function(f,d){var e=d[2]||this.get_defaultFailedCallback();if(e){e(f,d[3],"Sys.Services.AuthenticationService.logout")}},_setAuthenticated:function(b){this._authenticated=b}};Sys.Services._AuthenticationService.registerClass("Sys.Services._AuthenticationService",Sys.Net.WebServiceProxy);Sys.Services.AuthenticationService=new Sys.Services._AuthenticationService;Sys.Services._RoleService=function(){Sys.Services._RoleService.initializeBase(this);this._roles=[]};Sys.Services._RoleService.DefaultWebServicePath="";Sys.Services._RoleService.prototype={_defaultLoadCompletedCallback:null,_rolesIndex:null,_timeout:0,_path:"",get_defaultLoadCompletedCallback:function(){return this._defaultLoadCompletedCallback},set_defaultLoadCompletedCallback:function(b){this._defaultLoadCompletedCallback=b},get_path:function(){return this._path||""},get_roles:function(){return Array.clone(this._roles)},isUserInRole:function(d){var c=this._get_rolesIndex()[d.trim().toLowerCase()];return !!c},load:function(e,d,f){Sys.Net.WebServiceProxy.invoke(this._get_path(),"GetRolesForCurrentUser",false,{},Function.createDelegate(this,this._onLoadComplete),Function.createDelegate(this,this._onLoadFailed),[e,d,f],this.get_timeout())},_get_path:function(){var b=this.get_path();if(!b||!b.length){b=Sys.Services._RoleService.DefaultWebServicePath}if(!b||!b.length){throw Error.invalidOperation(Sys.Res.servicePathNotSet)}return b},_get_rolesIndex:function(){if(!this._rolesIndex){var c={};for(var d=0;d<this._roles.length;d++){c[this._roles[d].toLowerCase()]=true}this._rolesIndex=c}return this._rolesIndex},_onLoadComplete:function(h,m,j){if(h&&!(h instanceof Array)){throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,j,"Array"))}this._roles=h;this._rolesIndex=null;var g=m[0]||this.get_defaultLoadCompletedCallback()||this.get_defaultSucceededCallback();if(g){var k=m[2]||this.get_defaultUserContext(),l=Array.clone(h);g(l,k,"Sys.Services.RoleService.load")}},_onLoadFailed:function(g,e){var f=e[1]||this.get_defaultFailedCallback();if(f){var h=e[2]||this.get_defaultUserContext();f(g,h,"Sys.Services.RoleService.load")}}};Sys.Services._RoleService.registerClass("Sys.Services._RoleService",Sys.Net.WebServiceProxy);Sys.Services.RoleService=new Sys.Services._RoleService;Type.registerNamespace("Sys.Serialization");Sys.Serialization.JavaScriptSerializer=function(){};Sys.Serialization.JavaScriptSerializer.registerClass("Sys.Serialization.JavaScriptSerializer");Sys.Serialization.JavaScriptSerializer._serverTypeFieldName="__type";Sys.Serialization.JavaScriptSerializer._stringRegEx=new RegExp('["\\b\\f\\n\\r\\t\\\\\\x00-\\x1F]',"i");Sys.Serialization.JavaScriptSerializer._dateRegEx=new RegExp('(^|[^\\\\])\\"\\\\/Date\\((-?[0-9]+)(?:[a-zA-Z]|(?:\\+|-)[0-9]{4})?\\)\\\\/\\"',"g");Sys.Serialization.JavaScriptSerializer._jsonRegEx=new RegExp("[^,:{}\\[\\]0-9.\\-+Eaeflnr-u \\n\\r\\t]","g");Sys.Serialization.JavaScriptSerializer._jsonStringRegEx=new RegExp('"(\\\\.|[^"\\\\])*"',"g");Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder=function(c,d){d.append(c.toString())};Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder=function(d,c){if(isFinite(d)){c.append(String(d))}else{throw Error.invalidOperation(Sys.Res.cannotSerializeNonFiniteNumbers)}};Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder=function(h,f){f.append('"');if(Sys.Serialization.JavaScriptSerializer._stringRegEx.test(h)){var g=h.length;for(i=0;i<g;++i){var e=h.charAt(i);if(e>=" "){if(e==="\\"||e==='"'){f.append("\\")}f.append(e)}else{switch(e){case"\b":f.append("\\b");break;case"\f":f.append("\\f");break;case"\n":f.append("\\n");break;case"\r":f.append("\\r");break;case"\t":f.append("\\t");break;default:f.append("\\u00");if(e.charCodeAt()<16){f.append("0")}f.append(e.charCodeAt().toString(16))}}}}else{f.append(h)}f.append('"')};Sys.Serialization.JavaScriptSerializer._serializeWithBuilder=function(s,t,l,n){var r;switch(typeof s){case"object":if(s){if(Number.isInstanceOfType(s)){Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder(s,t)}else{if(Boolean.isInstanceOfType(s)){Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder(s,t)}else{if(String.isInstanceOfType(s)){Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder(s,t)}else{if(Array.isInstanceOfType(s)){t.append("[");for(r=0;r<s.length;++r){if(r>0){t.append(",")}Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(s[r],t,false,n)}t.append("]")}else{if(Date.isInstanceOfType(s)){t.append('"\\/Date(');t.append(s.getTime());t.append(')\\/"');break}var q=[],o=0;for(var p in s){if(p.startsWith("$")){continue}if(p===Sys.Serialization.JavaScriptSerializer._serverTypeFieldName&&o!==0){q[o++]=q[0];q[0]=p}else{q[o++]=p}}if(l){q.sort()}t.append("{");var k=false;for(r=0;r<o;r++){var m=s[q[r]];if(typeof m!=="undefined"&&typeof m!=="function"){if(k){t.append(",")}else{k=true}Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(q[r],t,l,n);t.append(":");Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(m,t,l,n)}}t.append("}")}}}}}else{t.append("null")}break;case"number":Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder(s,t);break;case"string":Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder(s,t);break;case"boolean":Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder(s,t);break;default:t.append("null")}};Sys.Serialization.JavaScriptSerializer.serialize=function(c){var d=new Sys.StringBuilder;Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(c,d,false);return d.toString()};Sys.Serialization.JavaScriptSerializer.deserialize=function(data,secure){if(data.length===0){throw Error.argument("data",Sys.Res.cannotDeserializeEmptyString)}try{var exp=data.replace(Sys.Serialization.JavaScriptSerializer._dateRegEx,"$1new Date($2)");if(secure&&Sys.Serialization.JavaScriptSerializer._jsonRegEx.test(exp.replace(Sys.Serialization.JavaScriptSerializer._jsonStringRegEx,""))){throw null}return eval("("+exp+")")}catch(a){throw Error.argument("data",Sys.Res.cannotDeserializeInvalidJson)}};Sys.CultureInfo=function(f,d,e){this.name=f;this.numberFormat=d;this.dateTimeFormat=e};Sys.CultureInfo.prototype={_getDateTimeFormats:function(){if(!this._dateTimeFormats){var b=this.dateTimeFormat;this._dateTimeFormats=[b.MonthDayPattern,b.YearMonthPattern,b.ShortDatePattern,b.ShortTimePattern,b.LongDatePattern,b.LongTimePattern,b.FullDateTimePattern,b.RFC1123Pattern,b.SortableDateTimePattern,b.UniversalSortableDateTimePattern]}return this._dateTimeFormats},_getMonthIndex:function(b){if(!this._upperMonths){this._upperMonths=this._toUpperArray(this.dateTimeFormat.MonthNames)}return Array.indexOf(this._upperMonths,this._toUpper(b))},_getAbbrMonthIndex:function(b){if(!this._upperAbbrMonths){this._upperAbbrMonths=this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames)}return Array.indexOf(this._upperAbbrMonths,this._toUpper(b))},_getDayIndex:function(b){if(!this._upperDays){this._upperDays=this._toUpperArray(this.dateTimeFormat.DayNames)}return Array.indexOf(this._upperDays,this._toUpper(b))},_getAbbrDayIndex:function(b){if(!this._upperAbbrDays){this._upperAbbrDays=this._toUpperArray(this.dateTimeFormat.AbbreviatedDayNames)}return Array.indexOf(this._upperAbbrDays,this._toUpper(b))},_toUpperArray:function(h){var e=[];for(var f=0,g=h.length;f<g;f++){e[f]=this._toUpper(h[f])}return e},_toUpper:function(b){return b.split("\u00a0").join(" ").toUpperCase()}};Sys.CultureInfo._parse=function(c){var d=Sys.Serialization.JavaScriptSerializer.deserialize(c);return new Sys.CultureInfo(d.name,d.numberFormat,d.dateTimeFormat)};Sys.CultureInfo.registerClass("Sys.CultureInfo");Sys.CultureInfo.InvariantCulture=Sys.CultureInfo._parse('{"name":"","numberFormat":{"CurrencyDecimalDigits":2,"CurrencyDecimalSeparator":".","IsReadOnly":true,"CurrencyGroupSizes":[3],"NumberGroupSizes":[3],"PercentGroupSizes":[3],"CurrencyGroupSeparator":",","CurrencySymbol":"\u00a4","NaNSymbol":"NaN","CurrencyNegativePattern":0,"NumberNegativePattern":1,"PercentPositivePattern":0,"PercentNegativePattern":0,"NegativeInfinitySymbol":"-Infinity","NegativeSign":"-","NumberDecimalDigits":2,"NumberDecimalSeparator":".","NumberGroupSeparator":",","CurrencyPositivePattern":0,"PositiveInfinitySymbol":"Infinity","PositiveSign":"+","PercentDecimalDigits":2,"PercentDecimalSeparator":".","PercentGroupSeparator":",","PercentSymbol":"%","PerMilleSymbol":"\u2030","NativeDigits":["0","1","2","3","4","5","6","7","8","9"],"DigitSubstitution":1},"dateTimeFormat":{"AMDesignator":"AM","Calendar":{"MinSupportedDateTime":"@-62135568000000@","MaxSupportedDateTime":"@253402300799999@","AlgorithmType":1,"CalendarType":1,"Eras":[1],"TwoDigitYearMax":2029,"IsReadOnly":true},"DateSeparator":"/","FirstDayOfWeek":0,"CalendarWeekRule":0,"FullDateTimePattern":"dddd, dd MMMM yyyy HH:mm:ss","LongDatePattern":"dddd, dd MMMM yyyy","LongTimePattern":"HH:mm:ss","MonthDayPattern":"MMMM dd","PMDesignator":"PM","RFC1123Pattern":"ddd, dd MMM yyyy HH\':\'mm\':\'ss \'GMT\'","ShortDatePattern":"MM/dd/yyyy","ShortTimePattern":"HH:mm","SortableDateTimePattern":"yyyy\'-\'MM\'-\'dd\'T\'HH\':\'mm\':\'ss","TimeSeparator":":","UniversalSortableDateTimePattern":"yyyy\'-\'MM\'-\'dd HH\':\'mm\':\'ss\'Z\'","YearMonthPattern":"yyyy MMMM","AbbreviatedDayNames":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"ShortestDayNames":["Su","Mo","Tu","We","Th","Fr","Sa"],"DayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"AbbreviatedMonthNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthNames":["January","February","March","April","May","June","July","August","September","October","November","December",""],"IsReadOnly":true,"NativeCalendarName":"Gregorian Calendar","AbbreviatedMonthGenitiveNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthGenitiveNames":["January","February","March","April","May","June","July","August","September","October","November","December",""]}}');if(typeof __cultureInfo==="undefined"){var __cultureInfo='{"name":"en-US","numberFormat":{"CurrencyDecimalDigits":2,"CurrencyDecimalSeparator":".","IsReadOnly":false,"CurrencyGroupSizes":[3],"NumberGroupSizes":[3],"PercentGroupSizes":[3],"CurrencyGroupSeparator":",","CurrencySymbol":"$","NaNSymbol":"NaN","CurrencyNegativePattern":0,"NumberNegativePattern":1,"PercentPositivePattern":0,"PercentNegativePattern":0,"NegativeInfinitySymbol":"-Infinity","NegativeSign":"-","NumberDecimalDigits":2,"NumberDecimalSeparator":".","NumberGroupSeparator":",","CurrencyPositivePattern":0,"PositiveInfinitySymbol":"Infinity","PositiveSign":"+","PercentDecimalDigits":2,"PercentDecimalSeparator":".","PercentGroupSeparator":",","PercentSymbol":"%","PerMilleSymbol":"\u2030","NativeDigits":["0","1","2","3","4","5","6","7","8","9"],"DigitSubstitution":1},"dateTimeFormat":{"AMDesignator":"AM","Calendar":{"MinSupportedDateTime":"@-62135568000000@","MaxSupportedDateTime":"@253402300799999@","AlgorithmType":1,"CalendarType":1,"Eras":[1],"TwoDigitYearMax":2029,"IsReadOnly":false},"DateSeparator":"/","FirstDayOfWeek":0,"CalendarWeekRule":0,"FullDateTimePattern":"dddd, MMMM dd, yyyy h:mm:ss tt","LongDatePattern":"dddd, MMMM dd, yyyy","LongTimePattern":"h:mm:ss tt","MonthDayPattern":"MMMM dd","PMDesignator":"PM","RFC1123Pattern":"ddd, dd MMM yyyy HH\':\'mm\':\'ss \'GMT\'","ShortDatePattern":"M/d/yyyy","ShortTimePattern":"h:mm tt","SortableDateTimePattern":"yyyy\'-\'MM\'-\'dd\'T\'HH\':\'mm\':\'ss","TimeSeparator":":","UniversalSortableDateTimePattern":"yyyy\'-\'MM\'-\'dd HH\':\'mm\':\'ss\'Z\'","YearMonthPattern":"MMMM, yyyy","AbbreviatedDayNames":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"ShortestDayNames":["Su","Mo","Tu","We","Th","Fr","Sa"],"DayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"AbbreviatedMonthNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthNames":["January","February","March","April","May","June","July","August","September","October","November","December",""],"IsReadOnly":false,"NativeCalendarName":"Gregorian Calendar","AbbreviatedMonthGenitiveNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthGenitiveNames":["January","February","March","April","May","June","July","August","September","October","November","December",""]}}'}Sys.CultureInfo.CurrentCulture=Sys.CultureInfo._parse(__cultureInfo);delete __cultureInfo;Sys.UI.Behavior=function(c){Sys.UI.Behavior.initializeBase(this);this._element=c;var d=c._behaviors;if(!d){c._behaviors=[this]}else{d[d.length]=this}};Sys.UI.Behavior.prototype={_name:null,get_element:function(){return this._element},get_id:function(){var b=Sys.UI.Behavior.callBaseMethod(this,"get_id");if(b){return b}if(!this._element||!this._element.id){return""}return this._element.id+"$"+this.get_name()},get_name:function(){if(this._name){return this._name}var d=Object.getTypeName(this),c=d.lastIndexOf(".");if(c!=-1){d=d.substr(c+1)}if(!this.get_isInitialized()){this._name=d}return d},set_name:function(b){this._name=b},initialize:function(){Sys.UI.Behavior.callBaseMethod(this,"initialize");var b=this.get_name();if(b){this._element[b]=this}},dispose:function(){Sys.UI.Behavior.callBaseMethod(this,"dispose");if(this._element){var b=this.get_name();if(b){this._element[b]=null}Array.remove(this._element._behaviors,this);delete this._element}}};Sys.UI.Behavior.registerClass("Sys.UI.Behavior",Sys.Component);Sys.UI.Behavior.getBehaviorByName=function(d,f){var e=d[f];return e&&Sys.UI.Behavior.isInstanceOfType(e)?e:null};Sys.UI.Behavior.getBehaviors=function(b){if(!b._behaviors){return[]}return Array.clone(b._behaviors)};Sys.UI.Behavior.getBehaviorsByType=function(l,k){var h=l._behaviors,m=[];if(h){for(var g=0,j=h.length;g<j;g++){if(k.isInstanceOfType(h[g])){m[m.length]=h[g]}}}return m};Sys.UI.VisibilityMode=function(){throw Error.notImplemented()};Sys.UI.VisibilityMode.prototype={hide:0,collapse:1};Sys.UI.VisibilityMode.registerEnum("Sys.UI.VisibilityMode");Sys.UI.Control=function(b){Sys.UI.Control.initializeBase(this);this._element=b;b.control=this};Sys.UI.Control.prototype={_parent:null,_visibilityMode:Sys.UI.VisibilityMode.hide,get_element:function(){return this._element},get_id:function(){if(!this._element){return""}return this._element.id},set_id:function(){throw Error.invalidOperation(Sys.Res.cantSetId)},get_parent:function(){if(this._parent){return this._parent}if(!this._element){return null}var b=this._element.parentNode;while(b){if(b.control){return b.control}b=b.parentNode}return null},set_parent:function(b){this._parent=b},get_visibilityMode:function(){return Sys.UI.DomElement.getVisibilityMode(this._element)},set_visibilityMode:function(b){Sys.UI.DomElement.setVisibilityMode(this._element,b)},get_visible:function(){return Sys.UI.DomElement.getVisible(this._element)},set_visible:function(b){Sys.UI.DomElement.setVisible(this._element,b)},addCssClass:function(b){Sys.UI.DomElement.addCssClass(this._element,b)},dispose:function(){Sys.UI.Control.callBaseMethod(this,"dispose");if(this._element){this._element.control=undefined;delete this._element}if(this._parent){delete this._parent}},onBubbleEvent:function(){return false},raiseBubbleEvent:function(d,f){var e=this.get_parent();while(e){if(e.onBubbleEvent(d,f)){return}e=e.get_parent()}},removeCssClass:function(b){Sys.UI.DomElement.removeCssClass(this._element,b)},toggleCssClass:function(b){Sys.UI.DomElement.toggleCssClass(this._element,b)}};Sys.UI.Control.registerClass("Sys.UI.Control",Sys.Component);Type.registerNamespace("Sys");Sys.Res={argumentInteger:"Value must be an integer.",scriptLoadMultipleCallbacks:"The script '{0}' contains multiple calls to Sys.Application.notifyScriptLoaded(). Only one is allowed.",invokeCalledTwice:"Cannot call invoke more than once.",webServiceFailed:"The server method '{0}' failed with the following error: {1}",webServiceInvalidJsonWrapper:"The server method '{0}' returned invalid data. The 'd' property is missing from the JSON wrapper.",argumentType:"Object cannot be converted to the required type.",argumentNull:"Value cannot be null.",controlCantSetId:"The id property can't be set on a control.",formatBadFormatSpecifier:"Format specifier was invalid.",webServiceFailedNoMsg:"The server method '{0}' failed.",argumentDomElement:"Value must be a DOM element.",invalidExecutorType:"Could not create a valid Sys.Net.WebRequestExecutor from: {0}.",cannotCallBeforeResponse:"Cannot call {0} when responseAvailable is false.",actualValue:"Actual value was {0}.",enumInvalidValue:"'{0}' is not a valid value for enum {1}.",scriptLoadFailed:"The script '{0}' could not be loaded.",parameterCount:"Parameter count mismatch.",cannotDeserializeEmptyString:"Cannot deserialize empty string.",formatInvalidString:"Input string was not in a correct format.",invalidTimeout:"Value must be greater than or equal to zero.",cannotAbortBeforeStart:"Cannot abort when executor has not started.",argument:"Value does not fall within the expected range.",cannotDeserializeInvalidJson:"Cannot deserialize. The data does not correspond to valid JSON.",invalidHttpVerb:"httpVerb cannot be set to an empty or null string.",nullWebRequest:"Cannot call executeRequest with a null webRequest.",eventHandlerInvalid:"Handler was not added through the Sys.UI.DomEvent.addHandler method.",cannotSerializeNonFiniteNumbers:"Cannot serialize non finite numbers.",argumentUndefined:"Value cannot be undefined.",webServiceInvalidReturnType:"The server method '{0}' returned an invalid type. Expected type: {1}",servicePathNotSet:"The path to the web service has not been set.",argumentTypeWithTypes:"Object of type '{0}' cannot be converted to type '{1}'.",cannotCallOnceStarted:"Cannot call {0} once started.",badBaseUrl1:"Base URL does not contain ://.",badBaseUrl2:"Base URL does not contain another /.",badBaseUrl3:"Cannot find last / in base URL.",setExecutorAfterActive:"Cannot set executor after it has become active.",paramName:"Parameter name: {0}",cannotCallOutsideHandler:"Cannot call {0} outside of a completed event handler.",cannotSerializeObjectWithCycle:"Cannot serialize object with cyclic reference within child properties.",format:"One of the identified items was in an invalid format.",assertFailedCaller:"Assertion Failed: {0}\r\nat {1}",argumentOutOfRange:"Specified argument was out of the range of valid values.",webServiceTimedOut:"The server method '{0}' timed out.",notImplemented:"The method or operation is not implemented.",assertFailed:"Assertion Failed: {0}",invalidOperation:"Operation is not valid due to the current state of the object.",breakIntoDebugger:"{0}\r\n\r\nBreak into debugger?"};if(typeof(Sys)!=="undefined"){Sys.Application.notifyScriptLoaded()};Type.registerNamespace("Omnibus");G_PHYSICAL_MAP.getMinimumResolution=function(){return 11};G_NORMAL_MAP.getMinimumResolution=function(){return 11};G_SATELLITE_MAP.getMinimumResolution=function(){return 11};G_HYBRID_MAP.getMinimumResolution=function(){return 11};Omnibus.Gmaps=function(a,c,d,b){this._currentLat=c;this._currentLong=d;this._containerId=a;this._map=null;this._handlers=b;if(typeof(b)=="undefined"){this._handlers={}}};Omnibus.Gmaps.prototype={load:function(){if(GBrowserIsCompatible()){var a=new GLatLng(this._currentLat,this._currentLong);this._map=new GMap2($get(this._containerId));this._map.enableScrollWheelZoom();this._map.setCenter(a,15);this._map.addControl(new GLargeMapControl3D());var c=new GControlPosition(G_ANCHOR_BOTTOM_RIGHT,new GSize(10,20));this._map.addControl(new GHierarchicalMapTypeControl(),c);for(var b in this._handlers){GEvent.addListener(this._map,b,this._handlers[b])}}},getBounds:function(d){if(!d[0]){return this._map.getBounds()}var e=new GLatLngBounds(d[0].getBounds().getSouthWest(),d[0].getBounds().getNorthEast());var a=null;var f=null;var b=null;for(var c=0;c<d.length;c++){b=d[c];a=b.getBounds().getSouthWest();f=b.getBounds().getNorthEast();if(!e.containsLatLng(a)){e.extend(a)}if(!e.containsLatLng(f)){e.extend(f)}}return e},addColaborationMarker:function(a,d,f,c,e,g){var b=this.addMarkerWithIcon(a,d,f,c);b.getPoint().busLine=e;b.getPoint().busStop=g;var h=YAHOO.omnibus.GeoAdvertisement.onMarkerClick.curry(g,b.getPoint(),{type:"stop",busLineId:e.Id,image:d});GEvent.addListener(b,"click",h);return b},addBusMarkerWithUrl:function(a,d,e){var c=new GSize(20,31);var b=new GPoint(1,30);if(e==null){e=1}return this.addMarkerWithIcon(a,d,c,b,false,e)},addMarker:function(a){var b=new GMarker(a);this._map.addOverlay(b);return b},addDraggableMarker:function(a){var b=new GMarker(a,{draggable:true});this._map.addOverlay(b);return b},addBusMarker:function(a){var b=_url("/Content/Images/ico_bus_stop.gif");return this.addBusMarkerWithUrl(a,b)},addOrangeBusMarker:function(a){var b=_url("/Content/Images/ico_bus_stop_orange.gif");return this.addBusMarkerWithUrl(a,b,1000)},addMarkerWithIcon:function(b,e,f,d,a,g){var c=this.createMarkerWithIcon(b,e,f,d,a,g);this._map.addOverlay(c);return c},createMarkerWithIcon:function(b,e,f,d,a,g){if(f!=null){adIcon=new GIcon(G_DEFAULT_ICON)}else{adIcon=new GIcon()}adIcon.shadow="";adIcon.image=e;if(f!=null){adIcon.iconSize=f}if(d!=null){adIcon.iconAnchor=d}var c={icon:adIcon};if(g!=null){c.zIndexProcess=function(){return g}}if(a!=null&&a==true){c.draggable=true}marker=new GMarker(b,c);return marker},createMarkerWithSprite:function(b,f,e,d,a,g){adIcon=new GIcon(G_DEFAULT_ICON);adIcon.shadow="";adIcon.sprite=f;adIcon.iconSize=new GSize(f.width,f.height);if(d!=null){adIcon.iconAnchor=d}var c={icon:adIcon};if(g!=null){c.zIndexProcess=function(){return g}}if(a!=null&&a==true){c.draggable=true}marker=new GMarker(b,c);return marker},qtdIteracoesTotal:{},qtdThreadJoinTotal:{},polylines:[],busLineIdsToRender:[],renderBusLine:function(n,d,c,k){var e=[];this.qtdIteracoesTotal[n.Id]=0;this.qtdThreadJoinTotal[n.Id]=0;if(typeof(k)=="undefined"){k=true}var s=n.Stops;var p=function(u,j){for(var t=0;t<j.length;t++){if(j[t].Id==u.Id){return t}}};if(typeof(d)!="undefined"){if(typeof(c)!="undefined"){s=s.slice(d,c+1)}else{s=s.slice(d)}}var h=n.CustomPolylines;var m=[];if(n.IsSubway){var b=[];for(var g=0;g<s.length;g++){b.push(new GLatLng(s[g].Latitude,s[g].Longitude))}var l=new GPolyline(b,"#008800");this._map.addOverlay(l);if(k){var a=l.getBounds();this._map.setCenter(a.getCenter(),this._map.getBoundsZoomLevel(a))}}else{var r=0;for(var g=0;g<s.length-1;g++){var o=s[g];var q=s[g+1];for(var f=0;f<h.length;f++){if(h[f].IdFirstStop===o.Id&&h[f].IdSecondStop===q.Id){this.qtdIteracoesTotal[n.Id]++;this.renderPolylinesBetweenIndexes(s,r,g,n);r=g+1;m.push(h[f].Id)}}}this.qtdIteracoesTotal[n.Id]++;this.renderPolylinesBetweenIndexes(s,r,s.length-1,n);this.qtdIteracoesTotal[n.Id]++;this.renderCustomPolylinesBetweenStops(m,true,n)}},renderPolylinesBetweenIndexes:function(o,d,n,f){var a=18;if(typeof(centermap)=="undefined"){centermap=true}var q=0;var p=Math.ceil((n-d+1)/a);if(p==0){this.qtdThreadJoinTotal[f.Id]++}for(var e=0;e<p;e++){var m=e*a+d;var g=m+a;if(g>n){g=n}var k=[];var c="";for(var b=m;b<=g&&b<o.length;b++){k.push(o[b].Latitude+", "+o[b].Longitude);c+=b+", "}var l=this;var h=new GDirections();GEvent.addListener(h,"error",function(j){q++;var s=new GLatLng(o[m].Latitude,o[m].Longitude);var i=new GLatLng(o[g].Latitude,o[g].Longitude);var r=[s,i];l.polylines.push(new GPolyline(r));if(q==p){l.qtdThreadJoinTotal[f.Id]++;l.renderIfReady(centermap)}});GEvent.addListener(h,"load",function(i){l.polylines.push(i.getPolyline());q++;if(q==p){l.qtdThreadJoinTotal[f.Id]++;l.renderIfReady(centermap)}});h.loadFromWaypoints(k,{locale:"pt_BR",getPolyline:true})}},renderIfReady:function(c){var b=true;for(var a=0;a<this.busLineIdsToRender.length;a++){if(this.qtdIteracoesTotal[this.busLineIdsToRender[a]]!=this.qtdThreadJoinTotal[this.busLineIdsToRender[a]]){b=false}}if(b){this.renderPolylines(this.polylines,centermap)}},renderCustomPolylinesBetweenStops:function(b,c,a){Sys.Net.WebServiceProxy.invoke(_url("/Webservices/OmnibusWebServices.asmx"),"GetPolylinesByIds",false,{idsPolylines:b},this.renderPolylineFromLocationList.bind(this).curry(c,a),onFail)},renderCustomPolylineBetweenStopsToEdit:function(b,a){Sys.Net.WebServiceProxy.invoke(_url("/Webservices/OmnibusWebServices.asmx"),"GetPolylinesByIds",false,{idsPolylines:b},this.renderPolylinesToEditFromLocationList.bind(this).curry(a),onFail)},renderPolylineFromLocationList:function(e,d,f){for(var c=0;c<f.length;c++){var a=f[c];var b=this.createPolylineFromLocation(a);this.polylines.push(b)}this.qtdThreadJoinTotal[d.Id]++;this.renderIfReady(e)},renderPolylinesToEditFromLocationList:function(d,e){for(var c=0;c<e.length;c++){var a=e[c];var b=this.createPolylineFromLocation(a);this._map.addOverlay(b);if(typeof(d)!="undefined"){d(b)}}},createPolylineFromLocation:function(b){var d=[];for(var c=0;c<b.length;c++){var a=new GLatLng(b[c].Latitude,b[c].Longitude);d.push(a)}return new GPolyline(d)},renderPolylines:function(c,e){var f=function(k,m){var l=Math.min(k.lat(),m.lat());var i=Math.min(k.lng(),m.lng());return new GLatLng(l,i)};var h=function(k,m){var l=Math.max(k.lat(),m.lat());var i=Math.max(k.lng(),m.lng());return new GLatLng(l,i)};var g=null;var b=null;for(var d=0;d<c.length;d++){var j=c[d];if(j){if(g==null){g=j.getBounds().getCenter();b=j.getBounds().getCenter()}this._map.addOverlay(j);if(e){g=f(g,j.getBounds().getSouthWest());b=h(b,j.getBounds().getNorthEast())}}}if(e){var a=new GLatLngBounds(g,b);this._map.setCenter(a.getCenter(),this._map.getBoundsZoomLevel(a))}},getLocationQuery:function(a,b){return("from: "+a.Latitude+", "+a.Longitude+" to: "+b.Latitude+", "+b.Longitude)},createCircle:function(location,circleRadius){var center=new GLatLng(location.Latitude,location.Longitude);var circlePoints=[];with(Math){var d=(circleRadius/1000)/6378.8;var lat1=(PI/180)*center.lat();var lng1=(PI/180)*center.lng();for(var a=0;a<361;a++){var tc=(PI/180)*a;var y=asin(sin(lat1)*cos(d)+cos(lat1)*sin(d)*cos(tc));var dlng=atan2(sin(tc)*sin(d)*cos(lat1),cos(d)-sin(lat1)*sin(y));var x=((lng1-dlng+PI)%(2*PI))-PI;var point=new GLatLng(parseFloat(y*(180/PI)),parseFloat(x*(180/PI)));circlePoints.push(point)}if(d<1.5678565720686044){circle=new GPolygon(circlePoints,"#0A67DB",2,1,"#0A67DB",0.25)}else{circle=new GPolygon(circlePoints,"#0A67DB",2,1)}return circle}},renderRoute:function(g){var m;var p;this._map.clearOverlays();var n=this;var k=0;var l=g.Segments.length;var h=new Array();var f=function(j,i){return j+"-"+i};var a=function(r,i){var j=f(r,i);return(h[j]==true)};var b=function(r,i){var j=f(r,i);h[j]=true};this.polylines=[];var c=0;for(var e=0;e<g.Segments.length;e++){if(g.Segments[e].BusLine){this.busLineIdsToRender[c]=g.Segments[e].BusLine.Id;c++}}for(var e=0;e<g.Segments.length;e++){var o="";var q=new GSize(30,30);var d=new GPoint(0,30);if(g.Segments[e].BusLine){g.Segments[e].render=function(){n.renderBusLine(this.BusLine,this.SequenceOrigin,this.SequenceDestination,false);if(g.Segments[e].BusLine.IsSubway){o="Content/Images/RouterMarkers/marker_calloutleft_train.png"}else{o="Content/Images/RouterMarkers/marker_calloutleft_bus.png"}p=new GLatLng(this.Origin.Latitude,this.Origin.Longitude);n.addColaborationMarker(p,o,q,d,this.BusLine,this.OriginStop);b(this.Origin.Latitude,this.Origin.Longitude)}}else{g.Segments[e].render=function(){n.renderDirectionsPolyline(this.Origin,this.Destination,"#ff0000",true);o="Content/Images/RouterMarkers/marker_calloutleft_walker.png";n.addMarkerWithIcon(new GLatLng(this.Origin.Latitude,this.Origin.Longitude),o,q,new GPoint(0,30))}}}for(var e=0;e<g.Segments.length;e++){g.Segments[e].render()}this._map.setCenter(new GLatLng(g.Segments[0].Origin.Latitude,g.Segments[0].Origin.Longitude))},renderDirectionsPolyline:function(d,b,c,a){var e=this;query=e.getLocationQuery(d,b);var f=new GDirections(null,document.createElement("div"));GEvent.addListener(f,"error",function(h){var j=new GLatLng(d.Latitude,d.Longitude);var g=new GLatLng(b.Latitude,b.Longitude);var i=[j,g];e._map.addOverlay(new GPolyline(i,c))});GEvent.addListener(f,"load",function(h){var g=h.getPolyline();e._map.addOverlay(g);g.setStrokeStyle({color:c})});if(typeof(a)!="undefined"&&a==true){f.load(query,{locale:"pt_BR",getPolyline:true,travelMode:G_TRAVEL_MODE_WALKING})}else{f.load(query,{locale:"pt_BR",getPolyline:true})}},centerMapToLine:function(a){this._map.setCenter(a.getBounds().getCenter(),this._map.getBoundsZoomLevel(a.getBounds()))},clear:function(){this._map.clearOverlays();this.polylines=[]},setCenter:function(a,b){this._map.setCenter(a,b)},getCenter:function(){return this._map.getCenter()},panTo:function(a){this._map.panTo(a)},get_Bounds:function(){return this._map.getBounds()},get_map:function(){return this._map},setZoom:function(a){this._map.setZoom(a)},getZoom:function(){return this._map.getZoom()},clearOverlays:function(){this._map.clearOverlays();this.polylines=[]},openInfoWindowHtml:function(a,b){this._map.openInfoWindowHtml(a,b)}};Omnibus.Gmaps.registerClass("Omnibus.Gmaps",null);Omnibus.StaticGmaps=function(){this._center=null;this._zoom=null;this._size="200x150";this._originMarker=null;this._originMarkerChar=null;this._destinationMarker=null;this._destinationMarkerChar=null;this._path=null;this._pathRGBA="0xff000080";this._key=GMapKey||"ABQIAAAAUKQv9MUIqykWxyGjYEHg4BTCzquyA7T5TiYxo5NXmIyr9sadFhSLUZw6M7CmwL0FiDpdTAsE3FuDsg"};Omnibus.StaticGmaps.prototype={setCenter:function(a){this._center=a},setZoom:function(a){this._zoom=a},setSize:function(a){this._size=a},setOriginMarker:function(a){this._originMarker=a},setDestinationMarker:function(a){this._destinationMarker=a},setOriginMarkerChar:function(a){this._originMarkerChar=a},setDestinationMarkerChar:function(a){this._destinationMarkerChar=a},setPath:function(a){this._path=a},setPathRGBA:function(a){this._pathRGBA=a},getStaticImgSrc:function(){var c="http://maps.google.com/staticmap?";var f=[];if(this._center){f.push("center="+this._center.toUrlValue())}if(this._originMarker){var e="markers="+this._originMarker.toUrlValue(5)+",midblue"+this._originMarkerChar;if(this._destinationMarker){e+="|"+this._destinationMarker.toUrlValue(5)+",midblue"+this._destinationMarkerChar}f.push(e)}if(this._zoom){f.push("zoom="+this._zoom)}if(this._size){f.push("size="+this._size)}if(this._path&&this._path.getVertexCount()<=100){var d=this._path;var b="rgba:"+this._pathRGBA+",weight:5|";var g=[];for(var a=0;a<d.getVertexCount();a++){g.push(d.getVertex(a).toUrlValue(5))}f.push("path="+b+g.join("|"))}return c+f.join("&")+"&key="+this._key}};Omnibus.StaticGmaps.registerClass("Omnibus.StaticGmaps",null);function MarkerManager(g,h){var e=this;e.map_=g;e.mapZoom_=g.getZoom();e.projection_=g.getCurrentMapType().getProjection();h=h||{};e.tileSize_=MarkerManager.DEFAULT_TILE_SIZE_;var b=g.getMapTypes();var a=b[0].getMaximumResolution();for(var c=0;c<b.length;c++){var d=b[c].getMaximumResolution();if(d>a){a=d}}e.maxZoom_=h.maxZoom||a;e.trackMarkers_=h.trackMarkers;e.show_=h.show||true;var f;if(typeof h.borderPadding==="number"){f=h.borderPadding}else{f=MarkerManager.DEFAULT_BORDER_PADDING_}e.swPadding_=new GSize(-f,f);e.nePadding_=new GSize(f,-f);e.borderPadding_=f;e.gridWidth_=[];e.grid_=[];e.grid_[e.maxZoom_]=[];e.numMarkers_=[];e.numMarkers_[e.maxZoom_]=0;GEvent.bind(g,"moveend",e,e.onMapMoveEnd_);e.removeOverlay_=function(i){g.removeOverlay(i);e.shownMarkers_--};e.addOverlay_=function(i){if(e.show_){g.addOverlay(i);e.shownMarkers_++}};e.resetManager_();e.shownMarkers_=0;e.shownBounds_=e.getMapGridBounds_()}MarkerManager.DEFAULT_TILE_SIZE_=1024;MarkerManager.DEFAULT_BORDER_PADDING_=100;MarkerManager.MERCATOR_ZOOM_LEVEL_ZERO_RANGE=256;MarkerManager.prototype.resetManager_=function(){var c=this;var a=MarkerManager.MERCATOR_ZOOM_LEVEL_ZERO_RANGE;for(var b=0;b<=c.maxZoom_;++b){c.grid_[b]=[];c.numMarkers_[b]=0;c.gridWidth_[b]=Math.ceil(a/c.tileSize_);a<<=1}};MarkerManager.prototype.clearMarkers=function(){var a=this;a.processAll_(a.shownBounds_,a.removeOverlay_);a.resetManager_()};MarkerManager.prototype.getTilePoint_=function(d,b,c){var a=this.projection_.fromLatLngToPixel(d,b);return new GPoint(Math.floor((a.x+c.width)/this.tileSize_),Math.floor((a.y+c.height)/this.tileSize_))};MarkerManager.prototype.addMarkerBatch_=function(c,g,b){var f=c.getPoint();c.MarkerManager_minZoom=g;if(this.trackMarkers_){GEvent.bind(c,"changed",this,this.onMarkerMoved_)}var d=this.getTilePoint_(f,b,GSize.ZERO);for(var e=b;e>=g;e--){var a=this.getGridCellCreate_(d.x,d.y,e);a.push(c);d.x=d.x>>1;d.y=d.y>>1}};MarkerManager.prototype.isGridPointVisible_=function(b){var f=this;var d=f.shownBounds_.minY<=b.y&&b.y<=f.shownBounds_.maxY;var a=f.shownBounds_.minX;var c=a<=b.x&&b.x<=f.shownBounds_.maxX;if(!c&&a<0){var e=f.gridWidth_[f.shownBounds_.z];c=a+e<=b.x&&b.x<=e-1}return d&&c};MarkerManager.prototype.onMarkerMoved_=function(e,a,c){var g=this;var i=g.maxZoom_;var d=false;var b=g.getTilePoint_(a,i,GSize.ZERO);var f=g.getTilePoint_(c,i,GSize.ZERO);while(i>=0&&(b.x!==f.x||b.y!==f.y)){var h=g.getGridCellNoCreate_(b.x,b.y,i);if(h){if(g.removeFromArray_(h,e)){g.getGridCellCreate_(f.x,f.y,i).push(e)}}if(i===g.mapZoom_){if(g.isGridPointVisible_(b)){if(!g.isGridPointVisible_(f)){g.removeOverlay_(e);d=true}}else{if(g.isGridPointVisible_(f)){g.addOverlay_(e);d=true}}}b.x=b.x>>1;b.y=b.y>>1;f.x=f.x>>1;f.y=f.y>>1;--i}if(d){g.notifyListeners_()}};MarkerManager.prototype.removeMarker=function(c){var f=this;var e=f.maxZoom_;var g=false;var b=c.getPoint();var d=f.getTilePoint_(b,e,GSize.ZERO);while(e>=0){var a=f.getGridCellNoCreate_(d.x,d.y,e);if(a){f.removeFromArray_(a,c)}if(e===f.mapZoom_){if(f.isGridPointVisible_(d)){f.removeOverlay_(c);g=true}}d.x=d.x>>1;d.y=d.y>>1;--e}if(g){f.notifyListeners_()}f.numMarkers_[c.MarkerManager_minZoom]--};MarkerManager.prototype.addMarkers=function(d,e,c){var a=this.getOptMaxZoom_(c);for(var b=d.length-1;b>=0;b--){this.addMarkerBatch_(d[b],e,a)}this.numMarkers_[e]+=d.length};MarkerManager.prototype.getOptMaxZoom_=function(a){return a||this.maxZoom_};MarkerManager.prototype.getMarkerCount=function(b){var a=0;for(var c=0;c<=b;c++){a+=this.numMarkers_[c]}return a};MarkerManager.prototype.getMarker=function(e,h,j){var f=this;var a=new GLatLng(e,h);var b=f.getTilePoint_(a,j,GSize.ZERO);var d=new GMarker(a);var g=f.getGridCellNoCreate_(b.x,b.y,j);if(g!=undefined){for(var c=0;c<g.length;c++){if(e==g[c].getLatLng().lat()&&h==g[c].getLatLng().lng()){d=g[c]}}}return d};MarkerManager.prototype.addMarker=function(b,f,d){var e=this;var a=this.getOptMaxZoom_(d);e.addMarkerBatch_(b,f,a);var c=e.getTilePoint_(b.getPoint(),e.mapZoom_,GSize.ZERO);if(e.isGridPointVisible_(c)&&f<=e.shownBounds_.z&&e.shownBounds_.z<=a){e.addOverlay_(b);e.notifyListeners_()}this.numMarkers_[f]++};GBounds.prototype.containsPoint=function(a){var b=this;return(b.minX<=a.x&&b.maxX>=a.x&&b.minY<=a.y&&b.maxY>=a.y)};MarkerManager.prototype.getGridCellCreate_=function(a,f,e){var c=this.grid_[e];if(a<0){a+=this.gridWidth_[e]}var b=c[a];if(!b){b=c[a]=[];return(b[f]=[])}var d=b[f];if(!d){return(b[f]=[])}return d};MarkerManager.prototype.getGridCellNoCreate_=function(a,e,d){var c=this.grid_[d];if(a<0){a+=this.gridWidth_[d]}var b=c[a];return b?b[e]:undefined};MarkerManager.prototype.getGridBounds_=function(a,i,h,f){i=Math.min(i,this.maxZoom_);var b=a.getSouthWest();var e=a.getNorthEast();var g=this.getTilePoint_(b,i,h);var d=this.getTilePoint_(e,i,f);var j=this.gridWidth_[i];if(e.lng()<b.lng()||d.x<g.x){g.x-=j}if(d.x-g.x+1>=j){g.x=0;d.x=j-1}var c=new GBounds([g,d]);c.z=i;return c};MarkerManager.prototype.getMapGridBounds_=function(){var a=this;return a.getGridBounds_(a.map_.getBounds(),a.mapZoom_,a.swPadding_,a.nePadding_)};MarkerManager.prototype.onMapMoveEnd_=function(){var a=this;a.objectSetTimeout_(this,this.updateMarkers_,0)};MarkerManager.prototype.objectSetTimeout_=function(b,c,a){return window.setTimeout(function(){c.call(b)},a)};MarkerManager.prototype.visible=function(){return this.show_?true:false};MarkerManager.prototype.isHidden=function(){return !this.show_};MarkerManager.prototype.show=function(){this.show_=true;this.refresh()};MarkerManager.prototype.hide=function(){this.show_=false;this.refresh()};MarkerManager.prototype.toggle=function(){this.show_=!this.show_;this.refresh()};MarkerManager.prototype.refresh=function(){var a=this;if(a.shownMarkers_>0){a.processAll_(a.shownBounds_,a.removeOverlay_)}if(a.show_){a.processAll_(a.shownBounds_,a.addOverlay_)}a.notifyListeners_()};MarkerManager.prototype.updateMarkers_=function(){var a=this;a.mapZoom_=this.map_.getZoom();var b=a.getMapGridBounds_();if(b.equals(a.shownBounds_)&&b.z===a.shownBounds_.z){return}if(b.z!==a.shownBounds_.z){a.processAll_(a.shownBounds_,a.removeOverlay_);if(a.show_){a.processAll_(b,a.addOverlay_)}}else{a.rectangleDiff_(a.shownBounds_,b,a.removeCellMarkers_);if(a.show_){a.rectangleDiff_(b,a.shownBounds_,a.addCellMarkers_)}}a.shownBounds_=b;a.notifyListeners_()};MarkerManager.prototype.notifyListeners_=function(){GEvent.trigger(this,"changed",this.shownBounds_,this.shownMarkers_)};MarkerManager.prototype.processAll_=function(b,d){for(var a=b.minX;a<=b.maxX;a++){for(var c=b.minY;c<=b.maxY;c++){this.processCellMarkers_(a,c,b.z,d)}}};MarkerManager.prototype.processCellMarkers_=function(b,f,d,e){var a=this.getGridCellNoCreate_(b,f,d);if(a){for(var c=a.length-1;c>=0;c--){e(a[c])}}};MarkerManager.prototype.removeCellMarkers_=function(a,c,b){this.processCellMarkers_(a,c,b,this.removeOverlay_)};MarkerManager.prototype.addCellMarkers_=function(a,c,b){this.processCellMarkers_(a,c,b,this.addOverlay_)};MarkerManager.prototype.rectangleDiff_=function(b,a,d){var c=this;c.rectangleDiffCoords_(b,a,function(e,f){d.apply(c,[e,f,b.z])})};MarkerManager.prototype.rectangleDiffCoords_=function(b,a,l){var f=b.minX;var m=b.minY;var h=b.maxX;var d=b.maxY;var e=a.minX;var k=a.minY;var g=a.maxX;var c=a.maxY;var j,i;for(j=f;j<=h;j++){for(i=m;i<=d&&i<k;i++){l(j,i)}for(i=Math.max(c+1,m);i<=d;i++){l(j,i)}}for(i=Math.max(m,k);i<=Math.min(d,c);i++){for(j=Math.min(h+1,e)-1;j>=f;j--){l(j,i)}for(j=Math.max(f,g+1);j<=h;j++){l(j,i)}}};MarkerManager.prototype.removeFromArray_=function(e,c,d){var a=0;for(var b=0;b<e.length;++b){if(e[b]===c||(d&&e[b]===c)){e.splice(b--,1);a++}}return a};var map=null;var geocoder=null;var point=null;var _currentRouteProperties=null;var WINDOW_OFFSET=206;var markers=[];function loadMap(){resizeMap();var a=readCookie("centerMapLat");var b=readCookie("centerMapLng");if(a&&b){map=new Omnibus.Gmaps("map",a,b,{click:clickMap})}else{map=new Omnibus.Gmaps("map",-8.060164439078557,-34.887213706970215,{click:clickMap})}map.load();GEvent.addListener(map.get_map(),"clearoverlays",function(){markers=[]});geocoder=new GClientGeocoder()}function clickMap(b,c,a){}function getWindowHeight(){var a=0;if(typeof(window.innerHeight)=="number"){a=window.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){a=document.documentElement.clientHeight}else{if(document.body&&document.body.clientHeight){a=document.body.clientHeight}}}return a}function resizeMap(){var a=getWindowHeight()-WINDOW_OFFSET;a+="px";$get("map").style.height=a}function renderPolylineBusLine(a,b){Sys.Net.WebServiceProxy.invoke(_url("/Webservices/OmnibusWebServices.asmx"),"GetBusLine",false,{busLineCode:a},renderRouteNumberedStops.curry(b),onFail);WaitDialog.showLoading()}function renderRouteNumberedStops(b,a){map.clear();map.renderBusLine(a);renderNumberedStops(a);if(typeof(b)==="function"){b(a)}WaitDialog.hideLoading()}function renderNumberedStops(d){var e=d.Stops;for(var c=0;c<e.length;c++){var a=new GLatLng(e[c].Latitude,e[c].Longitude);var f="../../Content/Images/GreenMarkers/marker"+(c+1)+".png";var b=map.addMarkerWithIcon(a,f)}}var arrayStreet=null;var arrayStopName=null;function findStreetOrStopName(c){var b=[];for(var a=0;a<arrayStreet.length;a++){if(arrayStreet[a].toLowerCase().indexOf(c.toLowerCase())!=-1||arrayStopName[a].toLowerCase().indexOf(c.toLowerCase())!=-1){b.push("stop"+a)}}return b}function sendFeedBack(a){if(a==true){showPopupSuccess(I18n.termoMensagemEnviada)}else{showPopupError(I18n.termoErroMensagemNaoEnviada)}}function onReportFail(a){var b=$get("labelFeedBack");b.innerHTML=a.get_message()}function sendReport(e,b,d){if(e==""){e=0}$get("labelFeedBack").innerHTML="";var h=$get("dllError").value;var f=$get("txtSendError").value;var c=Sys.Browser.name+", v"+Sys.Browser.version;var a=screen.width+"x"+screen.height;var g=getClientOS();Sys.Net.WebServiceProxy.invoke(_url("/Webservices/OmnibusWebServices.asmx"),"AddUserReport",false,{busLineId:e,stopId:b,title:h,message:f,search:d,latitude:0,longitude:0,browser:c,screenResolution:a,osName:g},sendFeedBack,onReportFail)}function searchBusStopsWithinMap(b){var e=[];if(typeof(b)!="undefined"){e=b}var c=map.get_map().getBounds();var d=c.getNorthEast();var a=c.getSouthWest();Sys.Net.WebServiceProxy.invoke(_url("/Webservices/OmnibusWebServices.asmx"),"GetStopsWithinArea",false,{northEastLat:d.lat(),northEastLng:d.lng(),southWestLat:a.lat(),southWestLng:a.lng(),idsToInclude:e},renderBusStops,onFail)}function addBusStopMarker(b){var a=null;var c=_url("/Content/Images/ico_bus_stop.gif");stopUrl=(stopUrl==null)?c:stopUrl;if(stopUrl==c){a=map.addBusMarker(b)}else{var e=new GSize(11,17);var d=new GPoint(1,16);a=map.addMarkerWithIcon(b,stopUrl,e,d,false,1)}return a}var moveListener=false;function renderBusStops(d){var e;var b;var a;for(var c=0;c<d.length;c++){e=d[c];if(markers[e.Id]){continue}b=new GLatLng(e.Latitude,(e.Longitude));a=addBusStopMarker(b);markers[e.Id]=a;a.getPoint().busStop=e;a.getPoint().validated=e.Validated;GEvent.addListener(a,"click",clickMarker)}if(!moveListener){GEvent.addListener(map.get_map(),"moveend",moveHandler);moveListener=true}}var lastZoom=0;var stopUrl=null;function moveHandler(){var a=map.getZoom();if(a>=14){if(lastZoom==13){map.clearOverlays()}stopUrl=_url("/Content/Images/ico_bus_stop.gif")}if(a<=13){if(lastZoom==14){map.clearOverlays()}stopUrl=_url("/Content/Images/busStops/bus_stop02.gif")}lastZoom=a;searchBusStopsWithinMap()}var originPoint=null;var destPoint=null;var walkingSegment=0;var onibusSegment=2;var metroSegment=9;var noIcon=10;function findStopsOnRoute(g){var l=[];var f=0;for(var e=0;e<g.Segments.length;e++){if(g.Segments[e].BusLine){var h=g.Segments[e].BusLine.Stops;var k=g.Segments[e].OriginStop.Id;var b=g.Segments[e].DestinationStop.Id;var c=false;var a=false;for(var d=0;!c&&d<h.length;d++){if(!a&&h[d].Id==k){a=true}if(a&&h[d].Id!=b){l[f]=h[d];f++}if(h[d].Id==b){l[f]=h[d];f++;c=true}}}}return l}var clickedRoute=0;function newAlternative(c){var e=c.split(";");var d=e[0];var a=e[1];var b=e[2];var f=e[3];return{Code:d,ShortName:a,Fare:b,IsSubway:f}}function createAlternativesRoute(c){var e=c.AlternativeBusLines;if(e.length==0){return""}var a="<li>";var f="alternatives_"+(Math.random()*1000).toFixed(0);a+="<a id='a_"+f+"' href='javascript:void(0);' onclick=\"javasctipt:document.getElementById('"+f+"').style.display='block';this.style.display='none';\">"+I18n.termoMostrarMaisOpcoes.toLowerCase()+"</a>";a+="<ul id='"+f+"' style='display:none;'>";for(var b=0;b<e.length;b++){var d=newAlternative(e[b]);a+="<li>";a+='<div class="linesClick linesClickBus" title="'+I18n.altVerItinerario+'" onclick="BusLine.openTabAndDoSearch('+d.Code+')">';a+=(d.IsSubway)?"":d.Code+" - ";a+=d.ShortName;a+="</div>";a+=" - Pre&ccedil;o "+d.Fare;a+="</li>"}a+="<a class='noPrint' href='javascript:void(0);' onclick=\"javasctipt:document.getElementById('"+f+"').style.display='none';document.getElementById('a_"+f+"').style.display='block';\">"+I18n.termoOcultarOpcoes.toLowerCase()+"</a>";a+="</ul>";a+="</li>";return a}function toCurrency(a){return(a.toFixed(2)+"").replace(".",",")}function poiDescription(a){if(a.ArrayOfPoi&&a.ArrayOfPoi.length>0&&a.ArrayOfPoi[0]!=""){return" ("+I18n.palavraReferencia+": <b>"+a.ArrayOfPoi[0]+"</b>)"}return""}function createElement(b,c,d){var a=document.createElement(b);a.className=c;a.innerHTML=d;return a}function createHeader(j,o,n,a,c){j.innerHTML="";var p=createElement("div","resOpcao",o);var m=createElement("div","resPreco","R$"+c);var h=new YAHOO.widget.Tooltip("resPrecoTooltip"+o,{context:m,text:I18n.termoPrecoTotal,showDelay:500,effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.15}});var g=createElement("div","resDuracao"," "+I18n.termoDuracaoEstimada+": "+toHoursAndMinutes(a.toFixed(0)));var f=new YAHOO.widget.Tooltip("resDuracaoTooltip"+o,{context:g,text:I18n.termoDuracaoEstimada,showDelay:500,effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.15}});var b="";for(var e=0;e<n.Segments.length;e++){var i=n.Segments[e].BusLine;if(i){b+=(i.IsSubway)?'<div class="spt spt-ico_metro" alt=""></div>':'<div alt="" class="spt spt-ico_onibus"></div>'}}var d=createElement("div","resImagens",b);var l=new YAHOO.widget.Tooltip("resImagensTooltip"+o,{context:d,text:I18n.termoQuantidadeOnibus,showDelay:500,effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.15}});j.appendChild(p);j.appendChild(m);j.appendChild(g);j.appendChild(d)}function createYAHOOAnchorIcon(c,b,d,a){var e=new YAHOO.util.Element(document.createElement("div"));e.set("title",c);e.addClass("icoInstrucao");e.addClass(b);e.on("click",a);e.on("mouseover",function(f){e.replaceClass(b,d)});e.on("mouseout",function(f){e.replaceClass(d,b)});return e}function turnOffEvent(){if(map){moveListener=false;GEvent.clearListeners(map.get_map(),"moveend")}};YAHOO.namespace("omnibus");YAHOO.omnibus.MapLayer=function(a){this.markerManager=new MarkerManager(a.get_map());this.map=a;this.overlays=[];this.markers=[];this.zoomLevel=15;this.centerPoint=this.map.get_map().getCenter()};YAHOO.omnibus.MapLayer.MIN_ZOOM_MARKERS=12;YAHOO.omnibus.MapLayer.prototype.zoomLevel=null;YAHOO.omnibus.MapLayer.prototype.centerPoint=null;YAHOO.omnibus.MapLayer.prototype.markerManager=null;YAHOO.omnibus.MapLayer.prototype.overlays=null;YAHOO.omnibus.MapLayer.prototype.map=null;YAHOO.omnibus.MapLayer.prototype.markers=null;YAHOO.omnibus.MapLayer.prototype.show=function(){this.map.get_map().setCenter(this.centerPoint,this.zoomLevel);for(var a=0;a<this.overlays.length;a++){this.map.get_map().addOverlay(this.overlays[a])}for(var a=0;a<this.markers.length;a++){this.markerManager.addMarker(this.markers[a].marker,this.markers[a].minZoom,this.markers[a].maxZoom)}this.markerManager.refresh()};YAHOO.omnibus.MapLayer.prototype.hide=function(){this.zoomLevel=this.map.getZoom();this.centerPoint=this.map.get_map().getCenter();this.clear()};YAHOO.omnibus.MapLayer.prototype.isEmpty=function(){if(this.markers.length==0&&this.overlays.length==0){return true}return false};YAHOO.omnibus.MapLayer.prototype.addMarker=function(b,c,d){if(typeof(c)==="undefined"){c=YAHOO.omnibus.MapLayer.MIN_ZOOM_MARKERS}var a={marker:b,minZoom:c,maxZoom:d};this.markers.push(a)};YAHOO.omnibus.MapLayer.prototype.addOverlay=function(a){this.overlays.push(a)};YAHOO.omnibus.MapLayer.prototype.reset=function(){this.clear();this.zoomLevel=null;this.centerPoint=null;for(var a=0;a<this.overlays.length;a++){GEvent.clearListeners(this.overlays[a])}this.overlays=[];for(var a=0;a<this.markers.length;a++){GEvent.clearListeners(this.markers[a])}this.markers=[]};YAHOO.omnibus.MapLayer.prototype.clear=function(){for(var a=0;a<this.overlays.length;a++){this.map.get_map().removeOverlay(this.overlays[a])}this.markerManager.clearMarkers()};YAHOO.omnibus.MapLayer.prototype.refreshMarkers=function(){this.markerManager.refresh()};YAHOO.omnibus.MapLayer.prototype.centerAndZoom=function(){var a=this.map.getBounds(this.overlays);this.map.get_map().setCenter(a.getCenter(),this.map.get_map().getBoundsZoomLevel(a))};YAHOO.namespace("omnibus");YAHOO.omnibus.BuslinePolylineCreator=function(b,a){this.qtdIteracoesTotal={};this.qtdThreadJoinTotal={};this.polylines=[];this.busLineIdsToRender=[];if(b instanceof Omnibus.Gmaps){this.map=b.get_map()}else{this.map=b}this.deliverPolylines=a};YAHOO.omnibus.BuslinePolylineCreator.prototype.qtdIteracoesTotal=null;YAHOO.omnibus.BuslinePolylineCreator.prototype.qtdThreadJoinTotal=null;YAHOO.omnibus.BuslinePolylineCreator.prototype.polylines=null;YAHOO.omnibus.BuslinePolylineCreator.prototype.markers=null;YAHOO.omnibus.BuslinePolylineCreator.prototype.busLineIdsToRender=null;YAHOO.omnibus.BuslinePolylineCreator.prototype.map=null;YAHOO.omnibus.BuslinePolylineCreator.prototype.deliverPolylines=function(a){};YAHOO.omnibus.BuslinePolylineCreator.prototype.qtdWalkSegRec=0;YAHOO.omnibus.BuslinePolylineCreator.prototype.qtdWalkSegTotal=0;YAHOO.omnibus.BuslinePolylineCreator.prototype.createBusLine=function(h,b,a){var c=null;var p;var f;if(h!=null){this.qtdIteracoesTotal[h.Id]=0;this.qtdThreadJoinTotal[h.Id]=0;p=h.Stops;f=h.CustomPolylines}var m=function(r,j){for(var q=0;q<j.length;q++){if(j[q].Id==r.Id){return q}}};if(typeof(b)!="undefined"){if(typeof(a)!="undefined"){p=p.slice(b,a+1)}else{p=p.slice(b)}}var l=function(q,t,v,u,s){var j=[];for(var r=t;r<=v;r++){j.push(new GLatLng(parseFloat(q[r].Latitude),parseFloat(q[r].Longitude)))}var w=new GPolyline(j,u,6,0.8);s.push(w)};var g=[];if(h!=null){if(h.IsSubway){c="#7dc08d"}else{c="#5d59eb"}var o=0;for(var e=0;e<p.length-1;e++){var k=p[e];var n=p[e+1];for(var d=0;d<f.length;d++){if(f[d].IdFirstStop===k.Id&&f[d].IdSecondStop===n.Id){if(o!=e){if(!h.IsSubway){this.qtdIteracoesTotal[h.Id]++;this.createPolylinesBetweenIndexes(p,o,e,h,c);YAHOO.log("createPolylinesBetweenIndexes inside 'for' "+o+" : "+e)}else{l(p,o,e,c,this.polylines);this.renderIfReady()}}o=e+1;g.push(f[d].Id)}}}if(o<(p.length-1)){if(!h.IsSubway){this.qtdIteracoesTotal[h.Id]++;this.createPolylinesBetweenIndexes(p,o,p.length-1,h,c);YAHOO.log("createPolylinesBetweenIndexes "+o+" : "+p.length-1)}else{l(p,o,p.length-1,c,this.polylines);this.renderIfReady()}}this.qtdIteracoesTotal[h.Id]++;this.createCustomPolylinesBetweenStops(g,h,c)}};YAHOO.omnibus.BuslinePolylineCreator.prototype.createPolylinesBetweenIndexes=function(n,e,m,f,c){var a=18;var o=Math.ceil((m-e+1)/a);this.qtdIteracoesTotal[f.Id]+=o-1;if(o==0){this.qtdThreadJoinTotal[f.Id]++}var b=function(i){YAHOO.log("createPolylinesBetweenIndexes:"+i.getStatus().code);GEvent.clearListeners(i);var q;var p;if(typeof(i.getPolyline().k)!="undefined"){q=i.getPolyline().k;this.polylines.push(new GPolyline(q,c,6,0.8))}else{p=i.getPolyline();p.setStrokeStyle({color:c,weight:6,opacity:0.8});this.polylines.push(p)}this.qtdThreadJoinTotal[f.Id]++;this.renderIfReady()};var k=function(s,q,p){showGoogleQueryReturnOnlyDebug(p.getStatus().code,"bus_tentativa"+p.oRConfig.tentativas);GEvent.clearListeners(p);if(p.oRConfig.tentativas<=3){p.oRConfig.tentativas=p.oRConfig.tentativas+1;showGoogleQueryReturnOnlyDebug(p.getStatus().code,"bus_tentativa"+p.oRConfig.tentativas);GEvent.addListener(j,"error",k.curry(p.oRConfig.startIndex,p.oRConfig.endIndex).bind(this));GEvent.addListener(j,"load",b.bind(this));p.loadFromWaypoints(p.query,{locale:"pt_BR",getPolyline:true})}else{showGoogleQueryReturnOnlyDebug(p.getStatus().code,"stop indexes:"+s+" :"+q);var t=new GLatLng(parseFloat(n[s].Latitude),parseFloat(n[s].Longitude));var i=new GLatLng(parseFloat(n[q].Latitude),parseFloat(n[q].Longitude));var r=[t,i];this.polylines.push(new GPolyline(r,c,6,0.8));this.qtdThreadJoinTotal[f.Id]++;this.renderIfReady()}};var l=e;var g;for(var d=0;d<o;d++){g=l+a-1;if(g>m){g=m}var j=new GDirections();j.oRConfig={startIndex:l,endIndex:g,tentativas:1};GEvent.addListener(j,"error",k.curry(l,g).bind(this));GEvent.addListener(j,"load",b.bind(this));var h=this.createQueryFromStops(n,l,g);j.query=h;j.loadFromWaypoints(h,{locale:"pt_BR",getPolyline:true});l=g}};YAHOO.omnibus.BuslinePolylineCreator.prototype.createQueryFromStops=function(a,d,b){var e=[];for(var c=d;c<=b&&c<a.length;c++){e.push(a[c].Latitude+", "+a[c].Longitude)}return e};YAHOO.omnibus.BuslinePolylineCreator.prototype.renderIfReady=function(){var b=true;for(var a=0;a<this.busLineIdsToRender.length;a++){if(this.qtdIteracoesTotal[this.busLineIdsToRender[a]]!=this.qtdThreadJoinTotal[this.busLineIdsToRender[a]]){b=false}}if(this.qtdWalkSegTotal>0&&this.qtdWalkSegTotal!==this.qtdWalkSegRec){b=false}if(b){this.deliverPolylines(this.polylines);this.polylines=[]}};YAHOO.omnibus.BuslinePolylineCreator.prototype.renderWalkingSegmentsIfReady=function(){if(this.qtdWalkSegTotal==this.walkingPolylines.length){this.deliverPolylines(this.walkingPolylines);this.walkingPolylines=[]}};YAHOO.omnibus.BuslinePolylineCreator.prototype.createCustomPolylinesBetweenStops=function(c,b,a){Sys.Net.WebServiceProxy.invoke(_url("/Webservices/OmnibusWebServices.asmx"),"GetPolylinesByIds",false,{idsPolylines:c},this.createPolylineFromLocationList.curry(b,a).bind(this),onFail)};YAHOO.omnibus.BuslinePolylineCreator.prototype.createPolylineFromLocationList=function(e,c,f){if(typeof(f)!="undefined"&&f.length!=0){for(var d=0;d<f.length;d++){var a=f[d];var b=this.createPolylineFromLocation(a,c);this.polylines.push(b)}}this.qtdThreadJoinTotal[e.Id]++;this.renderIfReady()};YAHOO.omnibus.BuslinePolylineCreator.prototype.createPolylineFromLocation=function(b,c){var e=[];for(var d=0;d<b.length;d++){var a=new GLatLng(parseFloat(b[d].Latitude),parseFloat(b[d].Longitude));e.push(a)}return new GPolyline(e,c,6,0.8)};YAHOO.omnibus.BuslinePolylineCreator.prototype.createRoute=function(c){var a=0;for(var b=0;b<c.Segments.length;b++){if(c.Segments[b].BusLine){this.busLineIdsToRender[a]=c.Segments[b].BusLine.Id;a++}else{this.qtdWalkSegTotal++}}for(var b=0;b<c.Segments.length;b++){if(c.Segments[b].BusLine){this.createBusLine(c.Segments[b].BusLine,c.Segments[b].SequenceOrigin,c.Segments[b].SequenceDestination)}else{this.createWalkingPolyline(c.Segments[b].Origin,c.Segments[b].Destination,"#e06060",true)}}};YAHOO.omnibus.BuslinePolylineCreator.prototype.createWalkingPolyline=function(d,b,c,a,e){var f=this;query=f.getLocationQuery(d,b);var g=new GDirections(null,document.createElement("div"));if(typeof(e)!="undefined"){g.oRConfig={origem:d,destino:b,cor:c,andar:a,tentativas:e}}else{g.oRConfig={origem:d,destino:b,cor:c,andar:a,tentativas:1}}GEvent.addListener(g,"error",function(i){GEvent.clearListeners(i);if(i.oRConfig.tentativas<=3){showGoogleQueryReturnOnlyDebug(i.getStatus().code+"Tentativa:"+i.oRConfig.tentativas+1);f.createWalkingPolyline(i.oRConfig.origem,i.oRConfig.destino,i.oRConfig.cor,i.oRConfig.andar,i.oRConfig.tentativas+1)}else{showGoogleQueryReturnOnlyDebug(i.getStatus().code);var k=new GLatLng(parseFloat(d.Latitude),parseFloat(d.Longitude));var h=new GLatLng(parseFloat(b.Latitude),parseFloat(b.Longitude));var j=[k,h];f.polylines.push(new GPolyline(j,c,6,0.8));f.qtdWalkSegRec++;f.renderIfReady()}});GEvent.addListener(g,"load",function(i){GEvent.clearListeners(i);var h;var j;if(typeof(i.getPolyline().k)!="undefined"){j=i.getPolyline().k;f.polylines.push(new GPolyline(j,c,6,0.8))}else{h=i.getPolyline();h.setStrokeStyle({color:c,weight:6,opacity:0.8});f.polylines.push(h)}f.qtdWalkSegRec++;f.renderIfReady()});if(typeof(a)!="undefined"&&a==true){g.load(query,{locale:"pt_BR",getPolyline:true,travelMode:G_TRAVEL_MODE_WALKING})}else{g.load(query,{locale:"pt_BR",getPolyline:true})}};YAHOO.omnibus.BuslinePolylineCreator.prototype.getLocationQuery=function(a,b){return("from: "+a.Latitude+", "+a.Longitude+" to: "+b.Latitude+", "+b.Longitude)};YAHOO.namespace("omnibus");YAHOO.omnibus.BusRoute=function(i,a,f,j,h,g,b,e,c,d){this.permalink=i;this.headerArray=new Array($get("headerOpcao1"),$get("headerOpcao2"),$get("headerOpcao3"));this.bodyArray=new Array($get("bodyOpcao1"),$get("bodyOpcao2"),$get("bodyOpcao3"));this.passosArray=new Array($get("passosOpcao1"),$get("passosOpcao2"),$get("passosOpcao3"));if(typeof(a)!=="undefined"){this.originField=a;this.destinationField=f;this.walking=j;this.criteria=h;this.subway=g;this.travelRadio=b}if(YAHOO.util.Dom.inDocument(e)){if(YAHOO.lang.isString(e)){this.btnSearch=document.getElementById(e)}else{this.btnSearch=e}}if(YAHOO.util.Dom.inDocument(c)){if(YAHOO.lang.isString(c)){this.routeResultContainer=document.getElementById(c)}else{this.routeResultContainer=c}}this.activeResultContainer=this.routeResultContainer;this.mapLayers=[new YAHOO.omnibus.MapLayer(d),new YAHOO.omnibus.MapLayer(d),new YAHOO.omnibus.MapLayer(d)];this.activeMapLayer=this.mapLayers[0];this.map=d;this.createContextMenu();YAHOO.util.Event.addListener(this.btnSearch,"click",this.searchRouteFromInput,this,true);YAHOO.util.Event.on("btImprimir","click",this.printInstructions,this,true);YAHOO.util.Event.on("printVersion1","click",this.printInstructions,this,true);YAHOO.util.Event.on("printVersion2","click",this.printInstructions,this,true);YAHOO.util.Event.on("printVersion3","click",this.printInstructions,this,true);YAHOO.util.Event.on(this.originField.textbox,"keypress",onEnterKeyPress.curry(this.searchRouteFromInput.bind(this)));YAHOO.util.Event.on(this.destinationField.textbox,"keypress",onEnterKeyPress.curry(this.searchRouteFromInput.bind(this)))};YAHOO.omnibus.BusRoute.minZoomRouteIconsAppears=14;YAHOO.omnibus.BusRoute.createOriginDestMarkers=function(k,c,b,m,d,n,i){var f=[];var h=new GSize(18,35);var g=new GPoint(9,35);var j=new GSize(24,46);var l=new GPoint(12,46);var a=new GSize(32,60);var e=new GPoint(16,60);f[0]=d.createMarkerWithSprite(m,k,h,g,n,i);f[1]=d.createMarkerWithSprite(m,c,j,l,n,i);f[2]=d.createMarkerWithSprite(m,b,a,e,n,i);return f};YAHOO.omnibus.BusRoute.createOriginMarkers=function(b,g,a,h){var f=[];var e=YAHOO.omnibus.SpriteMap.spriteMap.origem_zoom1;var c=YAHOO.omnibus.SpriteMap.spriteMap.origem_zoom2;var d=YAHOO.omnibus.SpriteMap.spriteMap.origem_zoom3;return YAHOO.omnibus.BusRoute.createOriginDestMarkers(e,c,d,b,g,a,h)};YAHOO.omnibus.BusRoute.createDestinationMarkers=function(b,g,a,h){var f=[];var e=YAHOO.omnibus.SpriteMap.spriteMap.dest_zoom1;var c=YAHOO.omnibus.SpriteMap.spriteMap.dest_zoom2;var d=YAHOO.omnibus.SpriteMap.spriteMap.dest_zoom3;return YAHOO.omnibus.BusRoute.createOriginDestMarkers(e,c,d,b,g,a,h)};YAHOO.omnibus.BusRoute.insertOriginMarkers=function(a,b){var c=YAHOO.omnibus.BusRoute.createOriginMarkers(a,b.map,99999);b.addMarker(c[0],11,14);b.addMarker(c[1],15,17);b.addMarker(c[2],18,19)};YAHOO.omnibus.BusRoute.insertDestinationMarkers=function(a,b){var c=YAHOO.omnibus.BusRoute.createDestinationMarkers(a,b.map,99999);b.addMarker(c[0],11,14);b.addMarker(c[1],15,17);b.addMarker(c[2],18,19)};YAHOO.omnibus.BusRoute.createOrigDestMarkers=function(b,a,c){YAHOO.omnibus.BusRoute.insertDestinationMarkers(a,c);YAHOO.omnibus.BusRoute.insertOriginMarkers(b,c)};YAHOO.omnibus.BusRoute.prototype.mapLayers=null;YAHOO.omnibus.BusRoute.prototype.map=null;YAHOO.omnibus.BusRoute.prototype.originField=null;YAHOO.omnibus.BusRoute.prototype.destinationField=null;YAHOO.omnibus.BusRoute.prototype.walking=null;YAHOO.omnibus.BusRoute.prototype.criteria=null;YAHOO.omnibus.BusRoute.prototype.subway=null;YAHOO.omnibus.BusRoute.prototype.travelRadio=null;YAHOO.omnibus.BusRoute.prototype.permalink=null;YAHOO.omnibus.BusRoute.prototype.btnSearch=null;YAHOO.omnibus.BusRoute.prototype.isValid=true;YAHOO.omnibus.BusRoute.prototype.headerArray=null;YAHOO.omnibus.BusRoute.prototype.bodyArray=null;YAHOO.omnibus.BusRoute.prototype.passosArray=null;YAHOO.omnibus.BusRoute.prototype.RouteArray=null;YAHOO.omnibus.BusRoute.prototype.scrollPosition=0;YAHOO.omnibus.BusRoute.prototype.routeResultContainer=null;YAHOO.omnibus.BusRoute.prototype.qtdOptions=0;YAHOO.omnibus.BusRoute.prototype.activeMapLayer=null;YAHOO.omnibus.BusRoute.prototype.activeResultContainer=null;YAHOO.omnibus.BusRoute.prototype.contextMenu=null;YAHOO.omnibus.BusRoute.prototype.createContextMenu=function(){this.contextMenu=new YAHOO.omnibus.ContextMapMenu(map.get_map());this.contextMenu.createSingleMenu(I18n.termoUsarComoOrigem,this.contextClicked.curry(this.originField).bind(this));this.contextMenu.createSingleMenu(I18n.termoUsarComoDestino,this.contextClicked.curry(this.destinationField).bind(this));this.contextMenu.createSingleMenu(I18n.termoSalvarPontoInicial,this.contextMenu.startMapHere.bind(this.contextMenu));this.contextMenu.createSingleMenu(I18n.termoAdicionarPontoReferencia,this.contextMenu.addPoi.bind(this.contextMenu))};YAHOO.omnibus.BusRoute.prototype.contextClicked=function(a){a.setFieldPixel(this.contextMenu.clickedPixel)};YAHOO.omnibus.BusRoute.prototype.searchRouteFromInput=function(){var a=this;if(!a.originField.verifyAndTreatEmptyAddress()&!a.destinationField.verifyAndTreatEmptyAddress()){a.originField.searchDidYouMean();a.destinationField.searchDidYouMean();if(a.originField.isAmbiguous||a.destinationField.isAmbiguous){setTimeout(function(){if(!a.originField.isAmbiguous&&!a.destinationField.isAmbiguous){a.doSearch()}},1000)}else{a.doSearch()}}};YAHOO.omnibus.BusRoute.prototype.doSearch=function(){var e=this;var d=e.originField.getPermalinkValue();var b=e.destinationField.getPermalinkValue();var a=e.walking.value;var h=e.criteria.value;var c=e.subway.checked;var f=e.travelRadio;var g=f[0].checked?f[0].value:f[1].value;e.setPermalinkValues(d,b,a,h,c,"permalink",g);e.searchRoute(e.permalink.saddr,e.permalink.daddr,e.permalink.walking,e.permalink.criteria,e.permalink.subway,e.permalink.cameFrom,e.permalink.travelMode)};YAHOO.omnibus.BusRoute.prototype.getParameters=function(){var a=this;a.permalink.resolveURLParameters(a.originField,a.destinationField);if(a.permalink.isEmptyAddress()){a.originField.showMarker();a.destinationField.showMarker()}else{a.searchForAmbiguity()}};YAHOO.omnibus.BusRoute.prototype.searchForAmbiguity=function(){var b=this;var a=b.searchRouteIfPossible.bind(b);b.originField.searchDidYouMean(b.permalink.saddr,executeAfterDesambiguation.curry(a));b.destinationField.searchDidYouMean(b.permalink.daddr,executeAfterDesambiguation.curry(a))};YAHOO.omnibus.BusRoute.prototype.searchRouteIfPossible=function(){var a=this;if(!a.originField.isAmbiguous&&!a.destinationField.isAmbiguous){a.searchRoute(a.permalink.saddr,a.permalink.daddr,a.permalink.walking,a.permalink.criteria,a.permalink.subway,a.permalink.cameFrom,a.permalink.travelMode)}else{a.originField.animateDidYouMean();a.destinationField.animateDidYouMean()}};YAHOO.omnibus.BusRoute.prototype.searchRoute=function(d,c,b,h,e,g,a){var f=this;f.setPermalinkValues(d,c,b,h,e,g,a);if(divAdvancedOptionsIsVisible){toggleAdvancedOptions()}f.mapLayers[0].reset();f.mapLayers[1].reset();f.mapLayers[2].reset();$get("opcoesDeRota").style.display="none";$get("dataMsg").style.display="none";TaxiUI.onDeactivate();if(a==="taxi"){f.searchTaxiRoute(d,c)}else{this.activeResultContainer=this.routeResultContainer;this.activeResultContainer.style.display="block";f.getRoute(d,c,b,h,e)}};YAHOO.omnibus.BusRoute.prototype.searchTaxiRoute=function(b,a){this.originField.removeMarker();this.destinationField.removeMarker();this.activeMapLayer=TaxiUI.mapLayer;this.activeResultContainer=TaxiUI.resultContainer;TaxiUI.searchRoute(b,a)};YAHOO.omnibus.BusRoute.prototype.searchOrShowTaxiRoute=function(b,a){if(TaxiUI.mapLayer.isEmpty()){this.searchTaxiRoute(b,a)}else{this.originField.removeMarker();this.destinationField.removeMarker();this.activeMapLayer=TaxiUI.mapLayer;this.activeMapLayer.show();this.activeResultContainer.style.display="none";this.activeResultContainer=TaxiUI.resultContainer;this.activeResultContainer.style.display="block"}};YAHOO.omnibus.BusRoute.prototype.getRoute=function(c,e,b,f,d){var a=this;a.isValid=true;Sys.Net.WebServiceProxy.invoke(_url("/Webservices/OmnibusWebServices.asmx"),"GetBestRoute",false,{from:c,to:e,walkingDistance:b,criteria:f,useSubway:d},a.prepareRoutes.bind(a),onFailOnlyDebug);WaitDialog.showLoading($get("WelcomeRoute"),$get("resultado"))};YAHOO.omnibus.BusRoute.prototype.prepareRoutes=function(b){this.originField.removeMarker();this.destinationField.removeMarker();this.renderTree(b);$get("dataMsg").style.display="block";var a=new YAHOO.omnibus.BuslinePolylineCreator(this.map,this.renderPolylines.curry(this.mapLayers[0]).bind(this));this.createMarkers(b[0],this.mapLayers[0]);a.createRoute(b[0]);$get("resultado").style.display="block";$get("arvore").style.display="block"};YAHOO.omnibus.BusRoute.prototype.setPermalinkValues=function(d,c,b,h,e,g,a){var f=this;f.permalink.setValues(d,c,b,h,e,g,a)};YAHOO.omnibus.BusRoute.prototype.getPermalink=function(){var a=this;return a.permalink.getURL()};YAHOO.omnibus.BusRoute.prototype.taxiLinkClick=function(){this.onDeactivate();this.travelRadio[1].checked=true;this.setPermalinkValues(this.permalink.saddr,this.permalink.daddr,500,0,false,this.permalink.cameFrom,"taxi");this.searchOrShowTaxiRoute(this.permalink.saddr,this.permalink.daddr);TaxiUI.onActivate()};YAHOO.omnibus.BusRoute.prototype.busLinkClick=function(){TaxiUI.onDeactivate();this.travelRadio[0].checked=true;this.permalink.setTravelMode("onibus");this.activeMapLayer=this.mapLayers[0];this.activeResultContainer.style.display="none";this.activeResultContainer=this.routeResultContainer;this.activeResultContainer.style.display="block";this.onActivate();if(this.activeMapLayer.isEmpty()){this.setPermalinkValues(this.permalink.saddr,this.permalink.daddr,500,0,true,this.permalink.cameFrom,"onibus");this.searchRoute(this.permalink.saddr,this.permalink.daddr,this.permalink.walking,this.permalink.criteria,this.permalink.subway,this.permalink.cameFrom,this.permalink.travelMode)}else{this.activeMapLayer.show()}};YAHOO.omnibus.BusRoute.prototype.showCriarLink=function(){var a=this;var b=$get("linkText");b.value=a.getPermalink().replace(/ /gi,"").replace(/linhas/gi,"").replace(/paradas/gi,"");EmailPanel.hide();LinkPanel.show();b.focus();b.select()};YAHOO.omnibus.BusRoute.prototype.hideCriarLink=function(){LinkPanel.hide()};YAHOO.omnibus.BusRoute.prototype.renderPolylines=function(a,c){for(var b=0;b<c.length;b++){a.addOverlay(c[b])}if(this.isValid==true&&a===this.activeMapLayer){a.show();a.centerAndZoom()}WaitDialog.hideLoading()};YAHOO.omnibus.BusRoute.prototype.createMarkers=function(r,q){var p=null;var c=null;var j=null;var l="";var a="";var b=new GSize(39,22);var n=new GSize(48,26);var d=new GPoint(7,11);var g=new GPoint(8,13);var f=null;for(var e=0;e<r.Segments.length;e++){f=r.Segments[e];p=new GLatLng(f.Origin.Latitude,f.Origin.Longitude);if(f.BusLine){if(f.BusLine.IsSubway){l=YAHOO.omnibus.SpriteMap.spriteMap.subway_zoom1;a=YAHOO.omnibus.SpriteMap.spriteMap.subway_zoom2}else{l=YAHOO.omnibus.SpriteMap.spriteMap.bus_zoom1;a=YAHOO.omnibus.SpriteMap.spriteMap.bus_zoom2}c=this.createColaborationMarker(p,l,b,d,f.BusLine,f.OriginStop);j=this.createColaborationMarker(p,a,n,g,f.BusLine,f.OriginStop)}else{l=YAHOO.omnibus.SpriteMap.spriteMap.walk_zoom1;a=YAHOO.omnibus.SpriteMap.spriteMap.walk_zoom2;c=this.map.createMarkerWithSprite(p,l,b,d,false,999);j=this.map.createMarkerWithSprite(p,a,n,g,false,999)}q.addMarker(c,YAHOO.omnibus.BusRoute.minZoomRouteIconsAppears,16);q.addMarker(j,17,19)}var h=r.Segments[0].Origin;var k=r.Segments[r.Segments.length-1].Destination;var o=new GLatLng(h.Latitude,h.Longitude);var m=new GLatLng(k.Latitude,k.Longitude);YAHOO.omnibus.BusRoute.createOrigDestMarkers(o,m,q)};YAHOO.omnibus.BusRoute.prototype.createColaborationMarker=function(a,d,f,c,e,g){var b=this.map.createMarkerWithSprite(a,d,f,c,false,999);b.getPoint().busLine=e;b.getPoint().busStop=g;var h=YAHOO.omnibus.GeoAdvertisement.onMarkerClick.curry(g,b.getPoint(),{type:"stop",busLineId:e.Id,image:d});GEvent.addListener(b,"click",h);return b};YAHOO.omnibus.BusRoute.prototype.renderTree=function(e){var d=this;d.RouteArray=e;this.qtdOptions=0;d.headerArray[0]=$get("headerOpcao1");d.headerArray[1]=$get("headerOpcao2");d.headerArray[2]=$get("headerOpcao3");setVisibility("headerOpcao1","visible");setVisibility("headerOpcao2","visible");setVisibility("headerOpcao3","visible");d.clearResultTree();var c=(OriginField.getStreetName()!=null)?OriginField.getStreetName():OriginField.textbox.value;var b=(DestinationField.getStreetName()!=null)?DestinationField.getStreetName():DestinationField.textbox.value;var a=I18n.termoRotasSugeridas.format("<strong>"+c+"</strong>","<strong>"+b+"</strong>");$get("rotasSugeridas").innerHTML=a;setVisibility("mapButtons","visible");this.getRouteInstructions(d.RouteArray[2],d.headerArray[2],I18n.palavraRota+" 3:",d.passosArray[2]);this.getRouteInstructions(d.RouteArray[1],d.headerArray[1],I18n.palavraRota+" 2:",d.passosArray[1]);this.getRouteInstructions(d.RouteArray[0],d.headerArray[0],I18n.palavraRota+" 1:",d.passosArray[0]);YAHOO.util.Event.addListener(d.headerArray[2],"click",d.openOption.bind(d).curry(2,e));YAHOO.util.Event.addListener(d.headerArray[1],"click",d.openOption.bind(d).curry(1,e));YAHOO.util.Event.addListener(d.headerArray[0],"click",d.openOption.bind(d).curry(0,e));d.unselectPane(d.headerArray[0],d.bodyArray[0]);d.unselectPane(d.headerArray[1],d.bodyArray[1]);d.unselectPane(d.headerArray[2],d.bodyArray[2]);d.selectPane(d.headerArray[0],d.bodyArray[0]);d.activeMapLayer=this.mapLayers[0];$get("opcoesDeRota").style.display="block"};YAHOO.omnibus.BusRoute.prototype.getRouteInstructions=function(b,w,s,h){if(!b){YAHOO.util.Dom.setStyle(w,"visibility","hidden");YAHOO.util.Dom.setStyle(w,"display","none");return}YAHOO.util.Dom.setStyle(w,"display","block");var b=this.setupRoute(b);var q=0;var l;var k=b.TotalPrice;var d=0;var r=0;var t=[];var n=function(D,i,j,C,F,E){return{Icon:D,Instruction:i,StopId:j,BusLineId:C,Latitude:F,Longitude:E}};var v=0;for(var x=0;x<b.Segments.length;x++){if(b.Segments[x].BusLine){var e=((b.Segments[x].Distance)/1000)/(25)*60;d+=e;var B=b.Segments[x].OriginStop.Id;var o=b.Segments[x].BusLine.Id;var p=b.Segments[x].Origin.Latitude;var m=b.Segments[x].Origin.Longitude;var g=new Omnibus.StaticGmaps();var f=new GLatLng(b.Segments[x].Origin.Latitude,b.Segments[x].Origin.Longitude);g.setOriginMarker(f);g.setOriginMarkerChar(v+1);var a=g.getStaticImgSrc();var u=I18n.termoPreco;if(b.Segments[x].OriginStop.StopType!="Standard"&&b.Segments[x-1]!=null&&b.Segments[x-1].DestinationStop&&b.Segments[x].OriginStop.StopType==b.Segments[x-1].DestinationStop.StopType){u+="0,00 ("+I18n.termoIntegracao+")"}else{if(b.Segments[x].OriginStop.StopType!="SubwayIntegration"){u+=toCurrency(b.Segments[x].BusLine.Fare.Cost)}else{u+="1,40 "}}u+="";var A=null;var z=null;if(!b.Segments[x].BusLine.IsSubway){A=onibusSegment;z="<li><strong>"+I18n.palavraOnibus+"</strong> - "+b.Segments[x].BusLine.Code+'</li><li><div class="linesClick linesClickBus" title="'+I18n.altVerItinerario+'" onclick="BusLine.openTabAndDoSearch(\''+b.Segments[x].BusLine.Code+'\')" target="_self">'+b.Segments[x].BusLine.ShortName+"</div></b> - <strong>"+u+"</strong></li>"+createAlternativesRoute(b.Segments[x])+"<li>"+I18n.passosDaRotaEmbarque+"<b> "+b.Segments[x].OriginStop.Name+"</b> "+poiDescription(b.Segments[x].OriginStop)+" </li><li>"+I18n.passosDaRotaDesembarque+"<b> "+b.Segments[x].DestinationStop.Name+"</b> "+poiDescription(b.Segments[x].DestinationStop)+'</li><li class="tempo_viagem">'+I18n.passosDaRotaTempoDeViagem.format(e.toFixed(0))+"</li>"}else{A=metroSegment;z="<li><strong>"+I18n.palavraMetro+"</strong> - "+b.Segments[x].BusLine.Code+'</li><li><div class="linesClick linesClickMetro" title="'+I18n.altVerItinerario+'" onclick="BusLine.openTabAndDoSearch(\''+b.Segments[x].BusLine.Code+'\')" target="_self">'+b.Segments[x].BusLine.ShortName+"</div></b> - <strong>"+u+"</strong></li>"+createAlternativesRoute(b.Segments[x])+"<li>"+I18n.passosDaRotaEmbarque+"<b> "+b.Segments[x].OriginStop.Name+"</b> "+poiDescription(b.Segments[x].OriginStop)+" </li><li>"+I18n.passosDaRotaDesembarque+"<b> "+b.Segments[x].DestinationStop.Name+'</b></li><li class="tempo_viagem">'+I18n.passosDaRotaTempoDeViagem.format(e.toFixed(0))+"</li>"}t[v]=n(A,z,B,o,p,m);t[v].imgSrc=""}else{var A=walkingSegment;d+=((b.Segments[x].Distance)/1000)/(25)*60;var c=map.getLocationQuery(b.Segments[x].Origin,b.Segments[x].Destination);l=new GDirections(null,document.createElement("div"));var y=function(C){q++;var I="";showGoogleQueryReturnOnlyDebug(C.getStatus().code,"Walking Dir");if(C.getStatus().code==G_GEO_SUCCESS){var j=C.getRoute(0);for(var D=0;D<j.getNumSteps();D++){I+="<li>"+j.getStep(D).getDescriptionHtml()+"; &nbsp;";I+="("+j.getStep(D).getDistance().meters+"m) </li>"}}else{I+="<li>"+I18n.termoErroAPe+"</li>"}I=I.substring(0,I.length-6);var F=new GLatLng(b.Segments[C.i].Origin.Latitude,b.Segments[C.i].Origin.Longitude);var G=new GLatLng(b.Segments[C.i].Destination.Latitude,b.Segments[C.i].Destination.Longitude);var E=new Omnibus.StaticGmaps();if(C.getStatus().code==G_GEO_SUCCESS){E.setPath(C.getPolyline())}E.setPathRGBA("0xff000080");E.setOriginMarker(F);E.setDestinationMarker(G);var H=b.Segments[C.i].Origin.Latitude;var i=b.Segments[C.i].Origin.Longitude;if(C.i==0){t[C.j]=n(A,I,null,null,H,i);E.setOriginMarkerChar(C.j+1);E.setDestinationMarkerChar(C.j+2);t[C.j].imgSrc=E.getStaticImgSrc()}else{t[C.j]=n(A,I,null,null,H,i);E.setOriginMarkerChar(C.j);E.setDestinationMarkerChar(C.j+1);t[C.j].imgSrc=E.getStaticImgSrc()}if(q==b.QtdWalkingSegments){this.outputInstructions(b,t,k,r,d,w,s,h)}};GEvent.addListener(l,"error",y.bind(this));GEvent.addListener(l,"load",y.bind(this));l.i=x;l.j=v;l.size=b.Segments.length;l.load(c,{locale:culture.currentLanguage.replace("-","_"),getSteps:true,getPolyline:true,travelMode:G_TRAVEL_MODE_WALKING})}v++}};YAHOO.omnibus.BusRoute.prototype.setupRoute=function(c){var a=0;for(var b=0;b<c.Segments.length;b++){if(!c.Segments[b].BusLine){a++}}c.QtdWalkingSegments=a;return c};YAHOO.omnibus.BusRoute.prototype.outputInstructions=function(b,r,h,p,d,s,q,g){this.qtdOptions++;h=h.toFixed(2).replace(".",",");createHeader(s,q,b,d,h);g.innerHTML="";var a=createElement("ul","ulPassos","");g.appendChild(a);var f=false;centerMapOnIconClick=function(y,x){var i=new GLatLng(y,x);if(map.getZoom()<YAHOO.omnibus.BusRoute.minZoomRouteIconsAppears){map.setZoom(YAHOO.omnibus.BusRoute.minZoomRouteIconsAppears)}map.panTo(i)};for(var t=0;t<r.length;t++){if(f){f=false;continue}var k=document.createElement("li");var v=r[t].Icon;var n=r[t].Latitude;var l=r[t].Longitude;var u=true;var c=new YAHOO.util.Element(k);var e=null;switch(v){case walkingSegment:e=createYAHOOAnchorIcon(I18n.termoPercursoPe,"spt spt-search_walk","spt spt-search_walk",centerMapOnIconClick.curry(n,l));c.appendChild(e);u=false;break;case onibusSegment:e=createYAHOOAnchorIcon(I18n.termoPegarOnibus,"spt spt-search_bus","spt spt-search_bus",centerMapOnIconClick.curry(n,l));c.appendChild(e);break;case metroSegment:e=createYAHOOAnchorIcon(I18n.termoPegarMetro,"spt spt-search_subway","spt spt-search_subway",centerMapOnIconClick.curry(n,l));c.appendChild(e);break}var j=document.createElement("ul");if(f&&(t!=(r.length-1))){j.innerHTML=r[t].Instruction+r[t+1].Instruction}else{j.innerHTML=r[t].Instruction}k.appendChild(j);var w=document.createElement("br");k.appendChild(w);if(r[t].imgSrc){var m=document.createElement("div");m.id="div_mapa_"+t;m.className="mapa_comentario";k.appendChild(m);var o=document.createElement("div");o.className="stepButtons";o.innerHTML='<a class="printOnly" alt="'+I18n.termoEscreverAnotacoes.toLowerCase()+'" href="javascript:void(0)" onmousedown="javascript:showCommentBox(event.currentTarget)"  stepIndex="'+t+'" >'+I18n.termoEscreverAnotacoes.toLowerCase()+'</a><a class="printOnly" alt="'+I18n.termoMapaTrecho.toLowerCase()+'" href="javascript:void(0)" onmousedown="javascript:showMiniMap(event.currentTarget)" addrParam="'+r[t].imgSrc+'" stepIndex="'+t+'">'+I18n.termoExibirMapa.toLowerCase()+"</a>";k.appendChild(o)}else{var o=document.createElement("div");o.className="stepButtons";k.appendChild(o)}a.appendChild(k)}};YAHOO.omnibus.BusRoute.prototype.clearResultTree=function(){var a=this;$get("resultado").style.display="none";$get("WelcomeRoute").style.display="none";setVisibility("mapButtons","hidden");a.ClearElementsOfOption(0);a.ClearElementsOfOption(1);a.ClearElementsOfOption(2)};YAHOO.omnibus.BusRoute.prototype.ClearElementsOfOption=function(b){var a=this;YAHOO.util.Event.removeListener(a.headerArray[b],"click");a.unselectPane(a.headerArray[b],a.bodyArray[b]);clearElement(a.headerArray[b]);clearElement(a.passosArray[b])};YAHOO.omnibus.BusRoute.prototype.selectPane=function(b,a){YAHOO.util.Dom.addClass(b,"selected");YAHOO.util.Dom.addClass(a,"open");YAHOO.util.Dom.setStyle(a,"height","auto")};YAHOO.omnibus.BusRoute.prototype.unselectPane=function(b,a){YAHOO.util.Dom.removeClass(b,"selected");YAHOO.util.Dom.setStyle(a,"height",0);YAHOO.util.Dom.removeClass(a,"open")};YAHOO.omnibus.BusRoute.prototype.openOption=function(c,b){if(this.mapLayers[c].isEmpty()){var a=new YAHOO.omnibus.BuslinePolylineCreator(this.map,this.renderPolylines.curry(this.mapLayers[c]).bind(this));this.createMarkers(b[c],this.mapLayers[c]);a.createRoute(b[c])}this.unselectPane(this.headerArray[0],this.bodyArray[0]);this.unselectPane(this.headerArray[1],this.bodyArray[1]);this.unselectPane(this.headerArray[2],this.bodyArray[2]);this.selectPane(this.headerArray[c],this.bodyArray[c]);this.activeMapLayer=this.mapLayers[c];this.mapLayers[0].hide();this.mapLayers[1].hide();this.mapLayers[2].hide();this.mapLayers[c].show()};YAHOO.omnibus.BusRoute.prototype.printInstructions=function(){var b={origin:OriginField.textbox.value,destination:DestinationField.textbox.value};var a=window.open(_url("/Print.aspx?travel="+this.permalink.travelMode),"_blank");a.params=b};YAHOO.omnibus.BusRoute.prototype.onDeactivate=function(){this.scrollPosition=$get("ResultsPane").scrollTop;this.isValid=false;this.activeMapLayer.hide();this.activeResultContainer.style.display="none";setVisibility("mapButtons","hidden");YAHOO.util.Event.removeListener("btCriarLink","click");$get("btCriarLink").style.display="none";$get("btEnviarEmail").style.display="none";$get("btImprimir").style.display="none";this.contextMenu.removeListener();this.hideCriarLink()};YAHOO.omnibus.BusRoute.prototype.onActivate=function(){this.activeMapLayer.show();this.isValid=true;if(!this.activeMapLayer.isEmpty()){setVisibility("mapButtons","visible")}YAHOO.util.Event.addListener("btCriarLink","click",this.showCriarLink.bind(this));$get("btCriarLink").style.display="inline";$get("btEnviarEmail").style.display="inline";$get("btImprimir").style.display="inline";this.activeResultContainer.style.display="block";this.contextMenu.addListeners();$get("ResultsPane").scrollTop=this.scrollPosition};var Watermark={sInputClass:"watermark",init:function(){if(!document.getElementById||!document.createTextNode){return}var e=new YAHOO.util.Element(document);var b=YAHOO.util.Dom.getElementsByClassName(Watermark.sInputClass);var f=b.length;var c;for(var a=0;a<f;a++){c=b[a];c.enabled=true;if(c.type!="text"&&c.tagName.toLowerCase()!="textarea"){continue}if((c.value=="")&&(c.title!="")){c.value=c.title}if(c.value!=c.title){YAHOO.util.Dom.removeClass(c,Watermark.sInputClass)}c.blur();YAHOO.util.Event.addListener(c,"focus",function(d){if(this.value==this.title&&this.enabled){this.value="";YAHOO.util.Dom.removeClass(this,Watermark.sInputClass);this.select()}});YAHOO.util.Event.addListener(c,"blur",function(d){if(!this.value.length&&this.enabled){this.value=this.title;YAHOO.util.Dom.addClass(this,Watermark.sInputClass)}})}},disable:function(a){if(a.enabled){a.enabled=false;YAHOO.util.Dom.removeClass(a,"watermark");if(a.value===a.title){a.value=""}}}};YAHOO.util.Event.onDOMReady(Watermark.init);MaskInput=function(d,a){function b(n){var h={"1":/[A-Z]/i,"2":/[0-9]/,"4":/[\xC0-\xFF]/i,"8":/./},p={a:3,A:7,"9":2,C:5,c:1,"*":8};function j(q,l){for(var e=1,k=p[l]||0;e<=k;e<<=1){if(k&e&&h[e].test(q)){break}}return e<=k||q==l}var m,g,f,o=String.fromCharCode(m=n.key),i=d.value.length;(!m||m==8?1:(f=/^(.)\^(.*)$/.exec(a))&&(f[0]=f[2].indexOf(o)+1)+1?f[1]=="O"?f[0]:f[1]=="E"?!f[0]:j(o,f[1])||f[0]:(i=(d.value+=a.substr(i,(f=/[A|9|C|\*]/i.exec(a.substr(i)))?f.index:i)).length)<a.length&&j(o,a.charAt(i)))||n.preventDefault()}for(var c in !/^(.)\^(.*)$/.test(a)&&(d.maxLength=a.length),{keypress:0,keyup:1}){addEvent(d,c,b)}};addEvent=function(l,j,i,g){var h=l[h="_"+(j="on"+j)]=l[h]||(l[j]?[[l[j],l]]:[]),b,m,k;h[h.length]=[i,g||l],l[j]=function(c){try{(c=c||event).preventDefault||(c.preventDefault=function(){c.returnValue=false});c.stopPropagation||(c.stopPropagation=function(){c.cancelBubble=true});c.target||(c.target=c.srcElement||null);c.key=(c.which+1||c.keyCode+1)-1||0}catch(a){}for(k=1,a=h.length;a;h[--a]&&(b=h[a][0],l=h[a][1],b.call?m=b.call(l,c):(l._=b,m=l._(c),l._=null),k&=m!==false)){}return c=null,!!k}};removeEvent=function(g,d,c,b){for(var a=(d=g["_on"+d]||[]).length;a;){if(d[--a]&&d[a][0]==c&&(b||g)==d[a][1]){return delete d[a]}}return false};YAHOO.namespace("omnibus");YAHOO.omnibus.ParserHTML=function(){};YAHOO.omnibus.ParserHTML.prototype.fromDidYouMeanLocList=function(e,d){var k=new YAHOO.util.Element(document.createElement("div"));var g=document.createElement("div");g.setAttribute("class","spt spt-seta_panel_desambiguacao");g.setAttribute("id","arrowDesPanel");k.appendChild(g);var j=document.createElement("span");j.innerHTML=I18n.termoVoceQuisDizer+":";j.style.display="block";k.appendChild(j);var f=new YAHOO.util.Element(document.createElement("ol"));k.appendChild(f);for(var b=0;b<e.length;b++){var c=e[b];var h=new YAHOO.util.Element(document.createElement("li"));var a=new YAHOO.util.Element(document.createElement("a"));a.set("title",I18n.termoCliqueParaEscolher);a.set("href","javascript:void(0)");a.on("click",d,c);a.set("innerHTML",c.Name);h.appendChild(a);f.appendChild(h)}return k};YAHOO.namespace("omnibus");YAHOO.omnibus.DidYouMeanBusiness=function(){};YAHOO.omnibus.DidYouMeanBusiness.prototype.addressBeforeCallWS=null;YAHOO.omnibus.DidYouMeanBusiness.prototype.searchDidYouMean=function(e,d,a){var b=this;b.addressBeforeCallWS=e;var c=_url("/Webservices/OmnibusWebServices.asmx");Sys.Net.WebServiceProxy.invoke(c,"GetAddresses",false,{address:e},function(f){d(f)},a)};YAHOO.namespace("omnibus");YAHOO.omnibus.AddressField=function(g,b,h,e,a,d,f){this.textbox=this.elementHTMLSetter(g);this.errorDiv=this.elementHTMLSetter(b,"none");this.didYouMeanDiv=this.elementHTMLSetter(h,"none");this.showOnMapAnchor=this.elementHTMLSetter(e);if(typeof(d)!=="undefined"){this.emptyErrorContainer=$get(d)}if(typeof(a.context)!=="undefined"){this.context=a.context}if(a.marker=="origin"){this.createMarkers=YAHOO.omnibus.BusRoute.createOriginMarkers}else{this.createMarkers=YAHOO.omnibus.BusRoute.createDestinationMarkers}if(f instanceof Omnibus.Gmaps){this.gmap=f.get_map()}else{this.gmap=f}this.markerManager=new MarkerManager(this.gmap);var c=this;c.didYouMean=new YAHOO.omnibus.DidYouMeanBusiness();c.parserHTML=new YAHOO.omnibus.ParserHTML();YAHOO.util.Event.addListener(c.showOnMapAnchor,"click",c.onAnchorClick,c);YAHOO.util.Event.addListener(c.textbox,"keyup",c.onTextboxKeyPress,c)};YAHOO.omnibus.AddressField.GREEN_MARKER_URL=_url("/Content/Images/marker_green.png");YAHOO.omnibus.AddressField.RED_MARKER_URL=_url("/Content/Images/marker_red.png");YAHOO.omnibus.AddressField.prototype.textbox=null;YAHOO.omnibus.AddressField.prototype.showOnMapAnchor=null;YAHOO.omnibus.AddressField.prototype.markerManager=null;YAHOO.omnibus.AddressField.prototype.lastMarkers=null;YAHOO.omnibus.AddressField.prototype.isSetFromMap=false;YAHOO.omnibus.AddressField.prototype.isCenterError=false;YAHOO.omnibus.AddressField.prototype.gmap=null;YAHOO.omnibus.AddressField.prototype.createMarkers=function(){};YAHOO.omnibus.AddressField.prototype.markerUrl=null;YAHOO.omnibus.AddressField.prototype.addressStreetName=null;YAHOO.omnibus.AddressField.prototype.geoPoint=null;YAHOO.omnibus.AddressField.prototype.isAmbiguous=true;YAHOO.omnibus.AddressField.prototype.firstLocationOption=null;YAHOO.omnibus.AddressField.prototype.didYouMean=null;YAHOO.omnibus.AddressField.prototype.parserHTML=null;YAHOO.omnibus.AddressField.prototype.didYouMeanDiv=null;YAHOO.omnibus.AddressField.prototype.errorDiv=null;YAHOO.omnibus.AddressField.prototype.context="rotas";YAHOO.omnibus.AddressField.prototype.emptyErrorContainer=null;YAHOO.omnibus.AddressField.prototype.elementHTMLSetter=function(c,b){var a=null;if(YAHOO.util.Dom.inDocument(c)){if(YAHOO.lang.isString(c)){a=document.getElementById(c)}else{a=c}if(typeof(b)!=="undefined"){a.style.display=b}}return a};YAHOO.omnibus.AddressField.prototype.hideDidYouMean=function(){var a=this;clearElement(a.didYouMeanDiv);a.hideHighlightDidYouMean();this.didYouMeanDiv.style.display="none"};YAHOO.omnibus.AddressField.prototype.showDidYouMean=function(){var a=this;a.didYouMeanDiv.style.display="block";a.showHighlightDidYouMean()};YAHOO.omnibus.AddressField.prototype.hideError=function(){var a=this;a.errorDiv.style.display="none"};YAHOO.omnibus.AddressField.prototype.showError=function(){var a=this;a.errorDiv.style.display="block"};YAHOO.omnibus.AddressField.prototype.notifyAddressNotFound=function(){var a=this;if(a.textbox.value!=a.didYouMean.addressBeforeCallWS){a.searchDidYouMean()}else{a.showError()}};YAHOO.omnibus.AddressField.prototype.onAnchorClick=function(a,b){b.showMarker()};YAHOO.omnibus.AddressField.prototype.showMarker=function(){if(this.context=="paradas"){return}var b=this;b.hideError();b.hideDidYouMean();var a=b.textbox.value;if(b.isFieldFilled()){if(b.geoPoint!=null){var d={Latitude:b.geoPoint.lat(),Longitude:b.geoPoint.lng()};b.center(d)}else{var c=_url("/Webservices/OmnibusWebServices.asmx");b.didYouMean.addressBeforeCallWS=a;Sys.Net.WebServiceProxy.invoke(c,"GetAddresses",false,{address:a},function(e){b.showOnMap(e)},function(){b.notifyAddressNotFound()})}}};YAHOO.omnibus.AddressField.prototype.onTextboxKeyPress=function(a,b){var c=13;if(a.keyCode!=c){b.hideDidYouMean();b.isAmbiguous=true;b.hideEmptyAddressError();b.hideError()}};YAHOO.omnibus.AddressField.prototype.getPermalinkValue=function(){var a=this.textbox.value;if(this.isAmbiguous&&this.firstLocationOption!=null){var b=this.firstLocationOption.Location;this.geoPoint=new GLatLng(b.Latitude,b.Longitude);a=this.firstLocationOption.Name}if(this.geoPoint!=null){a="latitude: "+this.geoPoint.lat()+";longitude: "+this.geoPoint.lng()}return a};YAHOO.omnibus.AddressField.prototype.isEmpty=function(){return this.textbox.value==this.textbox.title||this.textbox.value.trim()==""};YAHOO.omnibus.AddressField.prototype.isFieldFilled=function(){return !this.isEmpty()&&this.textbox.value!="Procurando..."};YAHOO.omnibus.AddressField.prototype.isReady=function(){return !this.isEmpty()};YAHOO.omnibus.AddressField.prototype.verifyAndTreatEmptyAddress=function(){var a=this;var b=a.isEmpty();if(b){a.showEmptyAddressError()}return b};YAHOO.omnibus.AddressField.prototype.showEmptyAddressError=function(){if(this.emptyErrorContainer!=null){this.emptyErrorContainer.style.display="block"}};YAHOO.omnibus.AddressField.prototype.hideEmptyAddressError=function(){if(this.emptyErrorContainer!=null){this.emptyErrorContainer.style.display="none"}};YAHOO.omnibus.AddressField.prototype.showOnMap=function(a){var b=this;b.hideDidYouMean();if(a==null||a.length==0){b.notifyAddressNotFound();return}if(a.length==1||!b.isAmbiguous){b.center(a[0].Location);b.isAmbiguous=false;return}b.didYouMean.showDidYouMeanOptions(a)};YAHOO.omnibus.AddressField.prototype.center=function(f){var e=this;if(f!=null){e.removeMarker();var a=new GLatLng(f.Latitude,f.Longitude);var c=e.markerUrl;var d=new GSize(20,34);var b=new GPoint(10,33);e.geoPoint=a;e.isCenterError=false;e.gmap.panTo(a);e.lastMarkers=this.createMarkers(a,map,true);e.markerManager.addMarker(e.lastMarkers[0],11,14);e.markerManager.addMarker(e.lastMarkers[1],15,17);e.markerManager.addMarker(e.lastMarkers[2],18,19);GEvent.addListener(e.lastMarkers[0],"dragend",function(g){e.isSetFromMap=true;e.getGoogleAddressFrom(g)});GEvent.addListener(e.lastMarkers[1],"dragend",function(g){e.isSetFromMap=true;e.getGoogleAddressFrom(g)});GEvent.addListener(e.lastMarkers[2],"dragend",function(g){e.isSetFromMap=true;e.getGoogleAddressFrom(g)});e.hideDidYouMean()}else{e.isCenterError=true;e.notifyAddressNotFound()}};YAHOO.omnibus.AddressField.prototype.removeMarker=function(){if(this.lastMarkers!=null){GEvent.clearListeners(this.lastMarkers[0]);GEvent.clearListeners(this.lastMarkers[1]);GEvent.clearListeners(this.lastMarkers[2]);this.markerManager.clearMarkers()}};YAHOO.omnibus.AddressField.prototype.getGoogleAddressFrom=function(a){var b=this;this.setFieldText("Procurando...");b.geoPoint=a;geocoder.getLocations(a,function(e){if(e.Status.code==200){var d=e.Placemark[0];var c=d.address;b.isAmbiguous=false;b.hideError();b.hideDidYouMean();b.setFieldText(c);b.showMarker();if(b.context=="rotas"){if((typeof(d.AddressDetails.Country.AdministrativeArea.Locality.DependentLocality)!=="undefined")&&(typeof(d.AddressDetails.Country.AdministrativeArea.Locality.DependentLocality.Thoroughfare)!=="undefined")){b.addressStreetName=d.AddressDetails.Country.AdministrativeArea.Locality.DependentLocality.Thoroughfare.ThoroughfareName}}}else{b.setFieldText("")}})};YAHOO.omnibus.AddressField.prototype.setFieldAddress=function(a){if(a){var b={Latitude:a.lat(),Longitude:a.lng()};this.isSetFromMap=true;this.getGoogleAddressFrom(a);this.center(b)}};YAHOO.omnibus.AddressField.prototype.setFieldPixel=function(b){if(b){var a=this.gmap.fromContainerPixelToLatLng(b);this.setFieldAddress(a)}};YAHOO.omnibus.AddressField.prototype.setupForSearch=function(a){this.setFieldText(a);this.addressStreetName=a};YAHOO.omnibus.AddressField.prototype.setFieldText=function(c){var a=this;if(YAHOO.util.Dom.hasClass(a.textbox,"watermark")){try{a.textbox.focus()}catch(b){}a.textbox.value=c;YAHOO.util.Dom.removeClass(a.textbox,"watermark");try{a.textbox.blur()}catch(b){}}else{a.textbox.value=c}};YAHOO.omnibus.AddressField.prototype.swapValues=function(a){var b=this.textbox.value;var c=this.textbox.title;var d=this.geoPoint;this.textbox.value=a.textbox.value;this.textbox.title=a.textbox.title;this.geoPoint=a.geoPoint;a.textbox.value=b;a.textbox.title=c;a.geoPoint=d;this.hideDidYouMean();a.hideDidYouMean()};YAHOO.omnibus.AddressField.prototype.getInputValue=function(){return this.textbox.value};YAHOO.omnibus.AddressField.prototype.getStreetName=function(){return this.addressStreetName};YAHOO.omnibus.AddressField.prototype.showDidYouMeanOptions=function(a){var b=this;b.hideDidYouMean();if(a==null||a.length==0){b.notifyAddressNotFound();return}if(a.length==1){b.isAmbiguous=false;b.geoPoint=new GLatLng(a[0].Location.Latitude,a[0].Location.Longitude);if(b.context=="rotas"){if(!OriginField.isAmbiguous&&!DestinationField.isAmbiguous){if(OriginField.textbox.value!=DestinationField.textbox.value){BusRoute.doSearch()}else{showPopupError(I18n.termoErroOrigemDestinoIguais)}}}else{if(b.context=="paradas"){BusStopRadius.getBusStops()}}return}b.firstLocationOption=a[0];b.isAmbiguous=true;var c=new YAHOO.util.Element(b.didYouMeanDiv);clickAnchor=function(e,d){b.isSetFromMap=true;b.isAmbiguous=false;b.setFieldText(d.Name);if(b.context=="rotas"){b.center(d.Location);if(!OriginField.isAmbiguous&&!DestinationField.isAmbiguous){if(OriginField.textbox.value!=DestinationField.textbox.value){BusRoute.doSearch()}else{showPopupError(I18n.termoErroOrigemDestinoIguais)}}}else{if(b.context=="paradas"){b.hideDidYouMean();BusStopRadius.getBusStops()}}};c.appendChild(b.parserHTML.fromDidYouMeanLocList(a,clickAnchor));this.showDidYouMean()};YAHOO.omnibus.AddressField.prototype.sucessSearchDidYouMean=function(c,a){var b=this;WaitDialog.hideLoading();b.showDidYouMeanOptions(a);if(!typeof c==="undefined"){c(b)}};YAHOO.omnibus.AddressField.prototype.failSearchDidYouMean=function(b){var a=this;a.notifyAddressNotFound();if(!typeof b==="undefined"){b(a)}};YAHOO.omnibus.AddressField.prototype.searchDidYouMean=function(c,b){WaitDialog.showTopLoading();var a=this;a.hideError();a.hideDidYouMean();a.isCenterError=false;a.isSetFromMap=false;if(typeof(c)==="undefined"){c=a.textbox.value}if(typeof(b)==="undefined"){b=dummy}if(a.isAmbiguous){if(a.isFieldFilled()){a.didYouMean.searchDidYouMean(c,a.sucessSearchDidYouMean.bind(a).curry(b),a.failSearchDidYouMean.bind(a).curry(b))}}else{b(a)}};YAHOO.omnibus.AddressField.prototype.showHighlightDidYouMean=function(){var a=this;YAHOO.util.Dom.addClass(a.textbox,"ambiguityAddressField")};YAHOO.omnibus.AddressField.prototype.hideHighlightDidYouMean=function(){var a=this;YAHOO.util.Dom.removeClass(a.textbox,"ambiguityAddressField")};YAHOO.namespace("omnibus");YAHOO.omnibus.GeoAdvertisement={map:null,markerManager:null,geoAdsTemp:null,useTemp:"false",init:function(a){if(typeof(a)!="undefined"&&a!=null){this.map=a;this.markerManager=new MarkerManager(map.get_map());GEvent.addListener(this.map.get_map(),"clearoverlays",this.onClearOverlays.bind(this));this.searchAds()}else{alert("Impossível utilizar GeoAds. Necessita do Omnibus.Gmaps.\n Tipo do parâmetro _map: "+typeof(a))}return this},onClearOverlays:function(){if(this.useTemp=="true"&&this.geoAdsTemp!=null){this.processGeoAds(this.geoAdsTemp)}else{this.searchAds()}this.useTemp="false"},setLoadFromTempOn:function(){this.useTemp="true"},searchAds:function(){var a=_url("/Webservices/OmnibusWebServices.asmx");Sys.Net.WebServiceProxy.invoke(a,"GetGeoAds",false,{},this.processGeoAds.bind(this),onFailOnlyDebug)},addMarker:function(a,e){var d=new GSize(33,33);var c=new GPoint(33,33);var b=this.map.createMarkerWithIcon(a,e,d,c,false);this.markerManager.addMarker(b,13);return b},processGeoAds:function(e){this.geoAdsTemp=e;for(var c=0;c<e.length;c++){var f=e[c];var a=new GLatLng(f.Location.Latitude,f.Location.Longitude);var d=f.IconURL;var b=YAHOO.omnibus.GeoAdvertisement.addMarker(a,d);GEvent.addListener(b,"click",YAHOO.omnibus.GeoAdvertisement.onMarkerClick.curry(f,a))}},onMarkerClick:function(h,a,f){var d=YAHOO.omnibus.GeoAdvertisement;var e=_url("/InfoWindows/Description/View.aspx?idGeoAd="+h.Id);if(f){if(f.type){if(f.type=="stop"){e=_url("/InfoWindows/Description/View.aspx?idStop="+h.Id)}else{if(f.type=="poi"){e=_url("/InfoWindows/Description/View.aspx?idPoi="+h.Id)}else{e=_url("/InfoWindows/Description/View.aspx?idGeoAd="+h.Id)}}}if(f.busLineId){e+="&busLine="+f.busLineId;if(f.image){e+="&imageUrl="+f.image}}}var g=YAHOO.omnibus.GeoAdvertisement.map.get_map();var c=document.createElement("iframe");c.src=e;c.width="270px";c.height="190px";c.id="iframeInfoWindow";c.frameBorder="0";c.target="_self";c.style.borderWidth=0;var b=function(){var i=document.getElementById("iframeInfoWindow");var l;if(i.Document){l=i.Document}else{l=i.contentDocument}var j=l.getElementById("outdoor_daqui");YAHOO.util.Event.on(j,"click",d.onDaquiClick.curry(a));var k=l.getElementById("outdoor_praca");YAHOO.util.Event.on(k,"click",d.onPraCaClick.curry(a))};YAHOO.util.Event.on(c,"load",b);g.openInfoWindow(a,c)},onDaquiClick:null,onPraCaClick:null};Clusterer=function(a){this.map=a;this.markers=[];this.clusters=[];this.timeout=null;this.currentZoomLevel=a.getZoom();this.maxVisibleMarkers=Clusterer.defaultMaxVisibleMarkers;this.gridSize=Clusterer.defaultGridSize;this.minMarkersPerCluster=Clusterer.defaultMinMarkersPerCluster;this.maxLinesPerInfoBox=Clusterer.defaultMaxLinesPerInfoBox;this.icon=Clusterer.defaultIcon;GEvent.addListener(a,"zoomend",Clusterer.MakeCaller(Clusterer.Display,this));GEvent.addListener(a,"moveend",Clusterer.MakeCaller(Clusterer.Display,this));GEvent.addListener(a,"infowindowclose",Clusterer.MakeCaller(Clusterer.PopDown,this))};Clusterer.defaultMaxVisibleMarkers=150;Clusterer.defaultGridSize=5;Clusterer.defaultMinMarkersPerCluster=5;Clusterer.defaultMaxLinesPerInfoBox=10;Clusterer.defaultIcon=new GIcon();Clusterer.defaultIcon.image="http://www.acme.com/resources/images/markers/blue_large.PNG";Clusterer.defaultIcon.shadow="http://www.acme.com/resources/images/markers/shadow_large.PNG";Clusterer.defaultIcon.iconSize=new GSize(30,51);Clusterer.defaultIcon.shadowSize=new GSize(56,51);Clusterer.defaultIcon.iconAnchor=new GPoint(13,34);Clusterer.defaultIcon.infoWindowAnchor=new GPoint(13,3);Clusterer.defaultIcon.infoShadowAnchor=new GPoint(27,37);Clusterer.prototype.SetIcon=function(a){this.icon=a};Clusterer.prototype.SetMaxVisibleMarkers=function(a){this.maxVisibleMarkers=a};Clusterer.prototype.SetMinMarkersPerCluster=function(a){this.minMarkersPerCluster=a};Clusterer.prototype.SetMaxLinesPerInfoBox=function(a){this.maxLinesPerInfoBox=a};Clusterer.prototype.AddMarker=function(a,b){if(a.setMap!=null){a.setMap(this.map)}a.title=b;a.onMap=false;this.markers.push(a);this.DisplayLater()};Clusterer.prototype.RemoveMarker=function(b){for(var e=0;e<this.markers.length;++e){if(this.markers[e]==b){if(b.onMap){this.map.removeOverlay(b)}for(var d=0;d<this.clusters.length;++d){var a=this.clusters[d];if(a!=null){for(var c=0;c<a.markers.length;++c){if(a.markers[c]==b){a.markers[c]=null;--a.markerCount;break}}if(a.markerCount==0){this.ClearCluster(a);this.clusters[d]=null}else{if(a==this.poppedUpCluster){Clusterer.RePop(this)}}}}this.markers[e]=null;break}}this.DisplayLater()};Clusterer.prototype.DisplayLater=function(){if(this.timeout!=null){clearTimeout(this.timeout)}this.timeout=setTimeout(Clusterer.MakeCaller(Clusterer.Display,this),50)};Clusterer.Display=function(s){var u,t,l,v;clearTimeout(s.timeout);var f=s.map.getZoom();if(f!=s.currentZoomLevel){for(u=0;u<s.clusters.length;++u){if(s.clusters[u]!=null){s.ClearCluster(s.clusters[u]);s.clusters[u]=null}}s.clusters.length=0;s.currentZoomLevel=f}var k=s.map.getBounds();var q=k.getSouthWest();var h=k.getNorthEast();var o=h.lng()-q.lng();var n=h.lat()-q.lat();if(o<300&&n<150){o*=0.1;n*=0.1;k=new GLatLngBounds(new GLatLng(q.lat()-n,q.lng()-o),new GLatLng(h.lat()+n,h.lng()+o))}var p=[];var m=[];for(u=0;u<s.markers.length;++u){l=s.markers[u];if(l!=null){if(k.contains(l.getPoint())){p.push(l)}else{m.push(l)}}}for(u=0;u<m.length;++u){l=m[u];if(l.onMap){s.map.removeOverlay(l);l.onMap=false}}for(u=0;u<s.clusters.length;++u){v=s.clusters[u];if(v!=null&&!k.contains(v.marker.getPoint())&&v.onMap){s.map.removeOverlay(v.marker);v.onMap=false}}if(p.length>s.maxVisibleMarkers){var r=k.getNorthEast().lat()-k.getSouthWest().lat();var c=r/s.gridSize;var e=c/Math.cos((k.getNorthEast().lat()+k.getSouthWest().lat())/2*Math.PI/180);for(var g=k.getSouthWest().lat();g<=k.getNorthEast().lat();g+=c){for(var w=k.getSouthWest().lng();w<=k.getNorthEast().lng();w+=e){v=new Object();v.clusterer=s;v.bounds=new GLatLngBounds(new GLatLng(g,w),new GLatLng(g+c,w+e));v.markers=[];v.markerCount=0;v.onMap=false;v.marker=null;s.clusters.push(v)}}for(u=0;u<p.length;++u){l=p[u];if(l!=null&&!l.inCluster){for(t=0;t<s.clusters.length;++t){v=s.clusters[t];if(v!=null&&v.bounds.contains(l.getPoint())){v.markers.push(l);++v.markerCount;l.inCluster=true}}}}for(u=0;u<s.clusters.length;++u){if(s.clusters[u]!=null&&s.clusters[u].markerCount<s.minMarkersPerCluster){s.ClearCluster(s.clusters[u]);s.clusters[u]=null}}for(u=s.clusters.length-1;u>=0;--u){if(s.clusters[u]!=null){break}else{--s.clusters.length}}for(u=0;u<s.clusters.length;++u){v=s.clusters[u];if(v!=null){for(t=0;t<v.markers.length;++t){l=v.markers[t];if(l!=null&&l.onMap){s.map.removeOverlay(l);l.onMap=false}}}}for(u=0;u<s.clusters.length;++u){v=s.clusters[u];if(v!=null&&v.marker==null){var a=0,d=0;for(t=0;t<v.markers.length;++t){l=v.markers[t];if(l!=null){a+=(+l.getPoint().lng());d+=(+l.getPoint().lat())}}var b=new GLatLng(d/v.markerCount,a/v.markerCount);l=new GMarker(b,{icon:s.icon});v.marker=l;GEvent.addListener(l,"click",Clusterer.MakeCaller(Clusterer.PopUp,v))}}}for(u=0;u<p.length;++u){l=p[u];if(l!=null&&!l.onMap&&!l.inCluster){s.map.addOverlay(l);if(l.addedToMap!=null){l.addedToMap()}l.onMap=true}}for(u=0;u<s.clusters.length;++u){v=s.clusters[u];if(v!=null&&!v.onMap&&k.contains(v.marker.getPoint())){s.map.addOverlay(v.marker);v.onMap=true}}Clusterer.RePop(s)};Clusterer.PopUp=function(a){var c=a.clusterer;var e='<table width="300">';var f=0;for(var d=0;d<a.markers.length;++d){var b=a.markers[d];if(b!=null){++f;e+="<tr><td>";if(b.getIcon().smallImage!=null){e+='<img src="'+b.getIcon().smallImage+'">'}else{e+='<img src="'+b.getIcon().image+'" width="'+(b.getIcon().iconSize.width/2)+'" height="'+(b.getIcon().iconSize.height/2)+'">'}e+="</td><td>"+b.title+"</td></tr>";if(f==c.maxLinesPerInfoBox-1&&a.markerCount>c.maxLinesPerInfoBox){e+='<tr><td colspan="2">...and '+(a.markerCount-f)+" more</td></tr>";break}}}e+="</table>";c.map.closeInfoWindow();a.marker.openInfoWindowHtml(e);c.poppedUpCluster=a};Clusterer.RePop=function(a){if(a.poppedUpCluster!=null){Clusterer.PopUp(a.poppedUpCluster)}};Clusterer.PopDown=function(a){a.poppedUpCluster=null};Clusterer.prototype.ClearCluster=function(a){var c,b;for(c=0;c<a.markers.length;++c){if(a.markers[c]!=null){a.markers[c].inCluster=false;a.markers[c]=null}}a.markers.length=0;a.markerCount=0;if(a==this.poppedUpCluster){this.map.closeInfoWindow()}if(a.onMap){this.map.removeOverlay(a.marker);a.onMap=false}};Clusterer.MakeCaller=function(b,a){return function(){b(a)}};GMarker.prototype.setMap=function(a){this.map=a};GMarker.prototype.addedToMap=function(){this.map=null};GMarker.prototype.origOpenInfoWindow=GMarker.prototype.openInfoWindow;GMarker.prototype.openInfoWindow=function(b,a){if(this.map!=null){return this.map.openInfoWindow(this.getPoint(),b,a)}else{return this.origOpenInfoWindow(b,a)}};GMarker.prototype.origOpenInfoWindowHtml=GMarker.prototype.openInfoWindowHtml;GMarker.prototype.openInfoWindowHtml=function(a,b){if(this.map!=null){return this.map.openInfoWindowHtml(this.getPoint(),a,b)}else{return this.origOpenInfoWindowHtml(a,b)}};GMarker.prototype.origOpenInfoWindowTabs=GMarker.prototype.openInfoWindowTabs;GMarker.prototype.openInfoWindowTabs=function(b,a){if(this.map!=null){return this.map.openInfoWindowTabs(this.getPoint(),b,a)}else{return this.origOpenInfoWindowTabs(b,a)}};GMarker.prototype.origOpenInfoWindowTabsHtml=GMarker.prototype.openInfoWindowTabsHtml;GMarker.prototype.openInfoWindowTabsHtml=function(a,b){if(this.map!=null){return this.map.openInfoWindowTabsHtml(this.getPoint(),a,b)}else{return this.origOpenInfoWindowTabsHtml(a,b)}};GMarker.prototype.origShowMapBlowup=GMarker.prototype.showMapBlowup;GMarker.prototype.showMapBlowup=function(a){if(this.map!=null){return this.map.showMapBlowup(this.getPoint(),a)}else{return this.origShowMapBlowup(a)}};YAHOO.namespace("omnibus");YAHOO.omnibus.SpecificLocation={map:null,idsAdded:null,clusterer:null,markers:[],specLocsTemp:null,useTemp:"false",MAX_POLYGON_AREA:5000,init:function(b){if(typeof(b)!="undefined"&&b!=null){this.map=b;this.idsAdded=[];this.clusterer=new Clusterer(map.get_map());var a=new GIcon();a.image=APP_ROOT+"/Content/Images/POI_Icons/ico_poi_group.gif";a.iconSize=new GSize(33,33);a.iconAnchor=new GPoint(33,33);a.infoWindowAnchor=new GPoint(33,33);this.clusterer.SetIcon(a);this.clusterer.SetMaxVisibleMarkers(20);this.clusterer.SetMinMarkersPerCluster(3);this.clusterer.SetMaxLinesPerInfoBox(5);if(window.name!="speclOFF"){GEvent.addListener(this.map.get_map(),"clearoverlays",this.onClearOverlays.bind(this));GEvent.addListener(this.map.get_map(),"moveend",this.searchSpecLocs.bind(this));this.searchSpecLocs()}}else{alert("Impossível utilizar SpecLoc. Necessita do Omnibus.Gmaps.\n Tipo do parâmetro _map: "+typeof(b))}return this},searchSpecLocs:function(){var e=_url("/Webservices/OmnibusWebServices.asmx");var d=this.map.get_map().getBounds();var c=d.getSouthWest();var b=d.getNorthEast();var a=(b.lat()-c.lat())*(b.lng()-c.lng());if(a<=this.MAX_POLYGON_AREA){Sys.Net.WebServiceProxy.invoke(e,"GetSpecificLocations",false,{northEastLat:b.lat(),northEastLng:b.lng(),southWestLat:c.lat(),southWestLng:c.lng()},this.processSpecLocs.bind(this),onFailOnlyDebug)}},onClearOverlays:function(){this.idsAdded=[];this.clusterer=new Clusterer(map.get_map());var a=new GIcon();a.image=APP_ROOT+"/Content/Images/POI_Icons/ico_poi_group.gif";a.iconSize=new GSize(33,33);a.iconAnchor=new GPoint(33,33);a.infoWindowAnchor=new GPoint(33,33);this.clusterer.SetIcon(a);this.clusterer.SetMaxVisibleMarkers(20);this.clusterer.SetMinMarkersPerCluster(3);this.clusterer.SetMaxLinesPerInfoBox(5);if(this.useTemp=="true"&&this.specLocsTemp!=null){this.processSpecLocs(this.specLocsTemp)}else{this.searchSpecLocs()}this.useTemp="false"},setLoadFromTempOn:function(){this.useTemp="true"},addMarker:function(a,g,c){var e=new GSize(25,25);var d=new GPoint(25,25);var b=null;var h=g;var f=h.replace("ico_poi_","").replace(".gif","").split("/");f=f[f.length-1];if(typeof(YAHOO.omnibus.SpriteMap.spriteMap[f])!="undefined"){b=this.map.createMarkerWithSprite(a,YAHOO.omnibus.SpriteMap.spriteMap[f],e,d,false)}b.id=c.Id;b.getIcon().smallImage=g.slice(0,g.length-4)+"_group.gif";this.clusterer.AddMarker(b,c.Name);this.markers[c.Id]=b;return b},processSpecLocs:function(d){this.specLocsTemp=d;for(var e=0;e<d.length;e++){var c=d[e];if(c.IconURL!==""&&!this.idsAdded.contains(c.Id)){var a=new GLatLng(c.Location.Latitude,c.Location.Longitude);var f=APP_ROOT+"/Content/Images/POI_Icons/"+c.IconURL;var b=YAHOO.omnibus.SpecificLocation.addMarker(a,f,c);this.idsAdded.push(c.Id);GEvent.addListener(b,"click",YAHOO.omnibus.GeoAdvertisement.onMarkerClick.curry(c,a,{type:"poi"}))}}}};Clusterer.PopUp=function(a){var c=a.clusterer;var e='<ul id="group">';var f=0;for(var d=0;d<a.markers.length;++d){var b=a.markers[d];if(b!=null){++f;e+="<li>";if(b.getIcon().smallImage!=null){e+='<img src="'+b.getIcon().smallImage+'">'}else{e+='<img src="'+b.getIcon().image+'" width="'+(b.getIcon().iconSize.width/1.5)+'" height="'+(b.getIcon().iconSize.height/1.5)+'">'}e+='<a href="javascript:void(0)" onclick="goToPoint('+b.id+');">'+b.title+"</a></li>";if(f==c.maxLinesPerInfoBox-1&&a.markerCount>c.maxLinesPerInfoBox){e+="<li>e mais "+(a.markerCount-f)+"</li>";break}}}e+="</ul>";c.map.closeInfoWindow();a.marker.openInfoWindowHtml(e);c.poppedUpCluster=a};goToPoint=function(b){var a=YAHOO.omnibus.SpecificLocation.markers[b];YAHOO.omnibus.SpecificLocation.map.setCenter(a.getPoint(),16);GEvent.trigger(a,"click",a.getPoint())};YAHOO.namespace("omnibus");YAHOO.omnibus.Taxi=function(a,e,c,b,d){if(YAHOO.util.Dom.inDocument(a)){if(YAHOO.lang.isString(a)){this.resultContainer=document.getElementById(a)}else{this.resultContainer=a}}if(YAHOO.util.Dom.inDocument(e)){if(YAHOO.lang.isString(e)){this.routeResultContainer=document.getElementById(e)}else{this.routeResultContainer=e}}this.originAddressField=c;this.destinationAddressField=b;this.headerResultado=createElement("dt","cabecalho selected","");this.bodyResultado=createElement("dd","taxi_result open passos","");this.resultContainer.appendChild(this.headerResultado);this.resultContainer.appendChild(this.bodyResultado);this.Gmaps=d;this.mapLayer=new YAHOO.omnibus.MapLayer(d)};YAHOO.omnibus.Taxi.BANDEIRADA=3.5;YAHOO.omnibus.Taxi.BANDEIRA_1_KM=1.7;YAHOO.omnibus.Taxi.BANDEIRA_2_KM=2.04;YAHOO.omnibus.Taxi.INCREMENTO_TAXIMETRO_CENTS=25;YAHOO.omnibus.Taxi.SPEED=40;YAHOO.omnibus.Taxi.prototype.divTaxiLink=null;YAHOO.omnibus.Taxi.prototype.bodyResultado=null;YAHOO.omnibus.Taxi.prototype.headerResultado=null;YAHOO.omnibus.Taxi.prototype.divResultado=null;YAHOO.omnibus.Taxi.prototype.originAddressField=null;YAHOO.omnibus.Taxi.prototype.destinationAddressField=null;YAHOO.omnibus.Taxi.prototype.welcomeContainer=null;YAHOO.omnibus.Taxi.prototype.resultContainer=null;YAHOO.omnibus.Taxi.prototype.routeResultContainer=null;YAHOO.omnibus.Taxi.prototype.Gmaps=null;YAHOO.omnibus.Taxi.prototype.mapLayer=null;YAHOO.omnibus.Taxi.prototype.originPoint=null;YAHOO.omnibus.Taxi.prototype.destinationPoint=null;YAHOO.omnibus.Taxi.prototype.roundPrice=function(a){var b=YAHOO.omnibus.Taxi.INCREMENTO_TAXIMETRO_CENTS;return(Math.floor((a*100)/b)*b)/100};YAHOO.omnibus.Taxi.prototype.getBandeira1Price=function(b){var a=(((b/1000)*YAHOO.omnibus.Taxi.BANDEIRA_1_KM)+YAHOO.omnibus.Taxi.BANDEIRADA);return this.roundPrice(a).toFixed(2)};YAHOO.omnibus.Taxi.prototype.getBandeira2Price=function(b){var a=(((b/1000)*YAHOO.omnibus.Taxi.BANDEIRA_2_KM)+YAHOO.omnibus.Taxi.BANDEIRADA);return this.roundPrice(a).toFixed(2)};YAHOO.omnibus.Taxi.prototype.setOriginPoint=function(a){this.originPoint=a};YAHOO.omnibus.Taxi.prototype.setDestinationPoint=function(a){this.destinationPoint=a};YAHOO.omnibus.Taxi.prototype.isLocationSet=function(){return this.destinationPoint!==null&&this.originPoint!==null};YAHOO.omnibus.Taxi.prototype.searchRoute=function(b,a){this.routeResultContainer.style.display="none";WaitDialog.showLoading();this.originPoint=null;this.destinationPoint=null;if(b.match("latitude")){this.originPoint=parseLatLngFromPermalink(b)}else{this.callGeocoder(b,this.setOriginPoint.bind(this))}if(a.match("latitude")){this.destinationPoint=parseLatLngFromPermalink(a)}else{this.callGeocoder(a,this.setDestinationPoint.bind(this))}if(this.isLocationSet()){this.doSearch()}};YAHOO.omnibus.Taxi.prototype.callGeocoder=function(a,b){Sys.Net.WebServiceProxy.invoke(_url("/Webservices/OmnibusWebServices.asmx"),"GetPointFromAddress",false,{address:a},this.onGeocoderSuccess.curry(b).bind(this),onFail)};YAHOO.omnibus.Taxi.prototype.onGeocoderSuccess=function(b,a){if(a===null){return}b(new GLatLng(a.Latitude,a.Longitude));if(this.isLocationSet()){this.doSearch()}};YAHOO.omnibus.Taxi.prototype.doSearch=function(){var a=new GDirections();GEvent.addListener(a,"load",this.directionLoadCallback.bind(this));GEvent.addListener(a,"error",function(b){showPopupError(I18n.termoMensagemErroTaxi);WaitDialog.hideLoading()});a.loadFromWaypoints([this.originPoint,this.destinationPoint],{locale:culture.currentLanguage.replace("-","_"),getSteps:true,getPolyline:true})};YAHOO.omnibus.Taxi.prototype.directionLoadCallback=function(a){this.mapLayer.reset();this.renderHeader(a.getRoute(0));this.renderResultSteps(a.getRoute(0));this.createMapRoute(a.getRoute(0),a.getPolyline());this.showResult()};YAHOO.omnibus.Taxi.prototype.renderHeader=function(k){var e=k.getDistance().meters;var j=toKmAndMeters(e);var a=this.getBandeira1Price(e);clearElement(this.headerResultado);this.headerResultado.appendChild(createElement("div","resOpcao",I18n.palavraTaxi));var g='<div alt="" class="spt spt-ico_taxi"></div>';this.headerResultado.appendChild(createElement("div","resImagens",g));var c="R$ "+a.replace(".",",");var d=createElement("div","resPreco",c);this.headerResultado.appendChild(d);var b=j+" ("+parseToHoursStr(e,YAHOO.omnibus.Taxi.SPEED)+")";var i=createElement("div","resDuracao",b);this.headerResultado.appendChild(i);var h=this.createToolTip("resPrecoTooltip",d,I18n.termoPrecoAproximado);var f=this.createToolTip("resDuracaoTooltip",i,I18n.termoTempoViagem);this.updateCurrentRoute(a,e);setVisibility("mapButtons","visible")};YAHOO.omnibus.Taxi.prototype.renderResultSteps=function(g){clearElement(this.bodyResultado);var k=this.getBandeira2Price(g.getDistance().meters);var h=(this.originAddressField.getStreetName()!=null)?this.originAddressField.getStreetName():this.originAddressField.textbox.value;var f=(this.destinationAddressField.getStreetName()!=null)?this.destinationAddressField.getStreetName():this.destinationAddressField.textbox.value;var j=I18n.termoMensagemBandeiraTaxi.format("<strong>","</strong>",k.replace(".",","));var e=createElement("div","disclaimer",j);e.id="taxiPrice2";this.bodyResultado.appendChild(e);var b=document.createElement("ul");var a=null;var d=null;for(var c=0;c<g.getNumSteps();c++){a=g.getStep(c);d=document.createElement("li");d.innerHTML=a.getDescriptionHtml()+" ("+toKmAndMeters(a.getDistance().meters)+")";b.appendChild(d)}this.bodyResultado.appendChild(b);this.bodyResultado.appendChild(this.createPrintVersionButton())};YAHOO.omnibus.Taxi.prototype.createPrintVersionButton=function(){var b=createElement("div","print_version","");b.style.clear="both";b.style.padding.top="15px";var a=createElement("div","ico_imprimir","");b.appendChild(a);var c=createElement("a","",I18n.termoVersaoImpressao);c.href="#";c.title=I18n.termoVersaoImpressao;b.appendChild(c);YAHOO.util.Event.on(b,"click",BusRoute.printInstructions,BusRoute,true);return b};YAHOO.omnibus.Taxi.prototype.createMapRoute=function(d,c){var b=d.getStep(0).getLatLng();var a=d.getEndLatLng();YAHOO.omnibus.BusRoute.createOrigDestMarkers(b,a,this.mapLayer);this.mapLayer.addOverlay(c)};YAHOO.omnibus.Taxi.prototype.showResult=function(){WaitDialog.hideLoading();this.mapLayer.show();this.mapLayer.centerAndZoom();this.routeResultContainer.style.display="none";this.resultContainer.style.display="block"};YAHOO.omnibus.Taxi.prototype.createToolTip=function(b,a,d){var c=new YAHOO.widget.Tooltip(b,{context:a,text:d,showDelay:500,effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.15}});return c};YAHOO.omnibus.Taxi.prototype.updateCurrentRoute=function(a,b){if(typeof(_currentRouteProperties)!=="undefined"){_currentRouteProperties={TotalFare:a,TotalTime:((b/1000)/50)*60}}};YAHOO.omnibus.Taxi.prototype.onDeactivate=function(){this.mapLayer.hide();this.resultContainer.style.display="none"};YAHOO.omnibus.Taxi.prototype.onActivate=function(){setVisibility("mapButtons","visible");YAHOO.util.Event.addListener("btCriarLink","click",BusRoute.showCriarLink.bind(BusRoute));$get("btCriarLink").style.display="inline";$get("btEnviarEmail").style.display="inline";$get("btImprimir").style.display="inline"};YAHOO.namespace("omnibus");YAHOO.omnibus.Permalink=function(){loadQueryString();var f=QueryString("saddr");var g=QueryString("daddr");var d=QueryString("walking");var c=QueryString("criteria");var e=QueryString("subway");var b=QueryString("cameFrom");var a=QueryString("travel");this.setValues(f,g,d,c,e,b,a)};YAHOO.omnibus.Permalink.prototype.saddr=null;YAHOO.omnibus.Permalink.prototype.daddr=null;YAHOO.omnibus.Permalink.prototype.walking=null;YAHOO.omnibus.Permalink.prototype.criteria=null;YAHOO.omnibus.Permalink.prototype.subway=null;YAHOO.omnibus.Permalink.prototype.cameFrom=null;YAHOO.omnibus.Permalink.prototype.travelMode=null;YAHOO.omnibus.Permalink.DEFAULT_WALKING=500;YAHOO.omnibus.Permalink.DEFAULT_CRITERIA=0;YAHOO.omnibus.Permalink.DEFAULT_SUBWAY="true";YAHOO.omnibus.Permalink.DEFAULT_CAMEFROM="permalink";YAHOO.omnibus.Permalink.DEFAULT_TRAVELMODE="onibus";YAHOO.omnibus.Permalink.prototype.setValues=function(c,b,g,a,d,e,f){this.saddr=c||"";this.daddr=b||"";this.walking=g||YAHOO.omnibus.Permalink.DEFAULT_WALKING;this.criteria=a||YAHOO.omnibus.Permalink.DEFAULT_CRITERIA;this.subway=(typeof(d)==="undefined")?true:d;this.cameFrom=e||YAHOO.omnibus.Permalink.DEFAULT_CAMEFROM;this.travelMode=f||YAHOO.omnibus.Permalink.DEFAULT_TRAVELMODE};YAHOO.omnibus.Permalink.prototype.wasAmbiguityVerified=function(){return this.cameFrom!="widget"&&this.cameFrom!="home"&&this.cameFrom!="widgetcarnaval"};YAHOO.omnibus.Permalink.prototype.setTravelMode=function(a){this.travelMode=a};YAHOO.omnibus.Permalink.prototype.getURL=function(){url=window.location.href;var a=url.split("?");url=a[0]+"?saddr="+this.saddr+"&daddr="+this.daddr+"&walking="+this.walking+"&criteria="+this.criteria+"&subway="+this.subway+"&cameFrom="+this.cameFrom+"&travel="+this.travelMode;return url};YAHOO.omnibus.Permalink.prototype.isEmptyAddress=function(){return this.saddr===""||this.daddr===""};YAHOO.omnibus.Permalink.prototype.setLatLngBehavior=function(b,a){var c=parseLatLngFromPermalink(b);a.getGoogleAddressFrom(c);a.isAmbiguous=false};YAHOO.omnibus.Permalink.prototype.verifyAddressParam=function(b,a){if(b.match("latitude")){this.setLatLngBehavior(b,a);return}a.setupForSearch(b)};YAHOO.omnibus.Permalink.prototype.prepareAddressField=function(a,c){if(a!==""){var b=decodeURIComponent(a);this.verifyAddressParam(b,c);return b}return a};YAHOO.omnibus.Permalink.prototype.resolveURLParameters=function(b,a){if(this.wasAmbiguityVerified(this.cameFrom)){b.isAmbiguous=false;a.isAmbiguous=false}this.saddr=this.prepareAddressField(this.saddr,b);this.daddr=this.prepareAddressField(this.daddr,a)};YAHOO.namespace("omnibus");YAHOO.omnibus.ContextMapMenu=function(a){this.gmap=a;this.createContextMenu()};YAHOO.omnibus.ContextMapMenu.prototype.clickedPixel=0;YAHOO.omnibus.ContextMapMenu.prototype.contextmenu=null;YAHOO.omnibus.ContextMapMenu.prototype.gmap=null;YAHOO.omnibus.ContextMapMenu.prototype.singlerightclickListener=null;YAHOO.omnibus.ContextMapMenu.prototype.clickListener=null;YAHOO.omnibus.ContextMapMenu.prototype.mouseoutListener=null;YAHOO.omnibus.ContextMapMenu.prototype.createMenuContent=function(a){return'<div class="context" >&nbsp;&nbsp;'+a+"&nbsp;&nbsp;</div>"};YAHOO.omnibus.ContextMapMenu.prototype.createSingleMenu=function(b,a){var c=this;var d=new YAHOO.util.Element(document.createElement("a"));d.set("href","javascript:void(0);");d.set("innerHTML",this.createMenuContent(b));d.on("click",function(){c.contextmenu.setStyle("visibility","hidden");a()});this.contextmenu.appendChild(d);return d};YAHOO.omnibus.ContextMapMenu.prototype.createContextMenu=function(){this.contextmenu=new YAHOO.util.Element(document.createElement("div"));this.contextmenu.addClass("contextContainer");this.contextmenu.setStyle("visibility","hidden");this.contextmenu.set("id","contextMenuId");this.gmap.getContainer().appendChild(this.contextmenu.get("element"));this.addListeners()};YAHOO.omnibus.ContextMapMenu.prototype.addListeners=function(){if(this.singlerightclickListener!=null||this.clickListener!=null||this.mouseoutListener!=null){this.removeListener()}this.singlerightclickListener=GEvent.addListener(this.gmap,"singlerightclick",this.showMenu.bind(this));this.clickListener=GEvent.addListener(this.gmap,"click",this.hideMenu.bind(this));this.mouseoutListener=GEvent.addListener(this.gmap,"mouseout",this.hideMenu.bind(this))};YAHOO.omnibus.ContextMapMenu.prototype.removeListener=function(){GEvent.removeListener(this.singlerightclickListener);GEvent.removeListener(this.clickListener);GEvent.removeListener(this.mouseoutListener);this.hideMenu()};YAHOO.omnibus.ContextMapMenu.prototype.showMenu=function(b,c){this.clickedPixel=b;var a=b.x;var e=b.y;if(a>this.gmap.getSize().width-81){a=this.gmap.getSize().width-81}if(e>this.gmap.getSize().height-43){e=this.gmap.getSize().height-43}var d=new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(a,e));d.apply(this.contextmenu.get("element"));this.contextmenu.setStyle("visibility","visible")};YAHOO.omnibus.ContextMapMenu.prototype.hideMenu=function(){this.contextmenu.setStyle("visibility","hidden")};YAHOO.omnibus.ContextMapMenu.prototype.addPoi=function(){var c=map.get_map().fromContainerPixelToLatLng(this.clickedPixel);var b=APP_ROOT+"/InfoWindows/Description/AddUserPoi.aspx?lat="+c.lat()+"&lng="+c.lng();var a=document.createElement("iframe");a.src=b;a.width="270px";a.height="225px";a.id="iframeInfoWindow";a.frameBorder="0";a.target="_self";a.style.borderWidth=0;map.get_map().openInfoWindow(c,a)};YAHOO.omnibus.ContextMapMenu.prototype.getPoint=function(){var a=map.get_map().fromContainerPixelToLatLng(this.clickedPixel);return{Latitude:a.lat(),Longitude:a.lng()}};YAHOO.omnibus.ContextMapMenu.prototype.startMapHere=function(){var a=map.get_map().fromContainerPixelToLatLng(this.clickedPixel);createCookie("centerMapLat",a.lat(),360);createCookie("centerMapLng",a.lng(),360)};YAHOO.namespace("omnibus");YAHOO.omnibus.BusStopRadius=function(g,e,a,f,i,c,h,b,d){if(typeof(d)!="undefined"&&d!=null){this.map=d}else{alert("Impossível utilizar GeoAds. Necessita do Omnibus.Gmaps.\n Tipo do parâmetro _map: "+typeof(d))}if(YAHOO.util.Dom.inDocument(g)){if(YAHOO.lang.isString(g)){this.txtAddress=document.getElementById(g)}else{this.txtAddress=g}}if(YAHOO.util.Dom.inDocument(e)){if(YAHOO.lang.isString(e)){this.selRadius=document.getElementById(e)}else{this.selRadius=e}}if(YAHOO.util.Dom.inDocument(a)){if(YAHOO.lang.isString(a)){this.btSearch=document.getElementById(a)}else{this.btSearch=e}}if(YAHOO.util.Dom.inDocument(f)){if(YAHOO.lang.isString(f)){this.divContent=document.getElementById(f)}else{this.divContent=f}}if(YAHOO.util.Dom.inDocument(i)){if(YAHOO.lang.isString(i)){this.welcomeContainer=document.getElementById(i)}else{this.welcomeContainer=i}}if(YAHOO.util.Dom.inDocument(c)){if(YAHOO.lang.isString(c)){this.resultContainer=document.getElementById(c)}else{this.resultContainer=c}}this.mapLayer=new YAHOO.omnibus.MapLayer(d);this.busStopsManager=new YAHOO.omnibus.BusStopsDisplayManager("ResultsPane","StpTreeView",d,this.mapLayer,"WelcomeStops");this.addressField=new YAHOO.omnibus.AddressField(this.txtAddress,"errorAddrStops","desambiguacaoParadas","originMapAnchor",{marker:"origin",context:"paradas"},h,d);this.swfVideo=new YAHOO.widget.SWF(b,_url("/Content/Videos/pesquisarParadas.swf"),{version:7,useExpressInstall:false,fixedAttributes:{play:true,loop:false}});this.createContextMenu();this.contextMenu.removeListener();YAHOO.util.Event.addListener(this.btSearch,"click",this.onSearchClick,this,true);YAHOO.util.Event.addListener(this.selRadius,"change",this.onSelectChange,this,true);YAHOO.util.Event.addListener(this.txtAddress,"keypress",onEnterKeyPress.curry(this.onSearchClick.bind(this)))};YAHOO.omnibus.BusStopRadius.smallMarkerOptions={size:new GSize(11,17),anchor:new GPoint(1,16),iconUrl:_url("/Content/Images/busStops/bus_stop02.gif"),minZoom:1,maxZoom:14};YAHOO.omnibus.BusStopRadius.bigMarkerOptions={size:new GSize(30,30),size2:new GSize(22,33),anchor:new GPoint(1,30),anchor2:new GPoint(1,32),iconUrl:_url("/Content/Images/ico_bus_stop.gif"),iconUrl2:_url("/Content/Images/bus_stop_info.gif"),minZoom:15};YAHOO.omnibus.BusStopRadius.centralMarkerOptions={size:null,zIndex:5,draggable:true};YAHOO.omnibus.BusStopRadius.centralMarkers=[];YAHOO.omnibus.BusStopRadius.centralMarkers[0]={anchor:new GPoint(9,29),iconUrl:_url("/Content/Images/StopMarkers/map_marker_zoom15.png")};YAHOO.omnibus.BusStopRadius.centralMarkers[1]={anchor:new GPoint(11,35),iconUrl:_url("/Content/Images/StopMarkers/map_marker_zoom16.png")};YAHOO.omnibus.BusStopRadius.centralMarkers[2]={anchor:new GPoint(13,41),iconUrl:_url("/Content/Images/StopMarkers/map_marker_zoom17.png")};YAHOO.omnibus.BusStopRadius.centralMarkers[3]={anchor:new GPoint(15,45),iconUrl:_url("/Content/Images/StopMarkers/map_marker_zoom18.png")};YAHOO.omnibus.BusStopRadius.centralMarkers[4]={anchor:new GPoint(16,49),iconUrl:_url("/Content/Images/StopMarkers/map_marker_zoom19.png")};YAHOO.omnibus.BusStopRadius.prototype.contextMenu=null;YAHOO.omnibus.BusStopRadius.prototype.txtAddress=null;YAHOO.omnibus.BusStopRadius.prototype.selRadius=null;YAHOO.omnibus.BusStopRadius.prototype.btSearch=null;YAHOO.omnibus.BusStopRadius.prototype.divContent=null;YAHOO.omnibus.BusStopRadius.prototype.busStopsManager=null;YAHOO.omnibus.BusStopRadius.prototype.welcomeContainer=null;YAHOO.omnibus.BusStopRadius.prototype.resultContainer=null;YAHOO.omnibus.BusStopRadius.prototype.swfVideo=null;YAHOO.omnibus.BusStopRadius.prototype.addressField=null;YAHOO.omnibus.BusStopRadius.prototype.map=null;YAHOO.omnibus.BusStopRadius.prototype.mapLayer=null;YAHOO.omnibus.BusStopRadius.prototype.circle=null;YAHOO.omnibus.BusStopRadius.prototype.circleMarker=null;YAHOO.omnibus.BusStopRadius.prototype.isValid=true;YAHOO.omnibus.BusStopRadius.prototype.scrollPosition=0;YAHOO.omnibus.BusStopRadius.prototype.onSelectChange=function(d,c){c.isValid=true;if(c.circleMarker!==null){var a=c.circleMarker.getPoint();var b={Latitude:a.lat(),Longitude:a.lng()};c.searchBusStopsWithinRadius(b,c.selRadius.value);clearElement($get("StpTreeViewLabel"));clearElement($get("StpTreeView"))}};YAHOO.omnibus.BusStopRadius.prototype.onSearchClick=function(b){var a=this;var c=function(){a.mapLayer.reset();a.getBusStops()};this.addressField.hideEmptyAddressError();if(!this.addressField.verifyAndTreatEmptyAddress()&&this.addressField.isAmbiguous){WaitDialog.showLoading(this.welcomeContainer,this.innerResultContainer);this.addressField.searchDidYouMean(this.txtAddress.value,c)}};YAHOO.omnibus.BusStopRadius.prototype.createContextMenu=function(){this.contextMenu=new YAHOO.omnibus.ContextMapMenu(map.get_map());this.contextMenu.createSingleMenu(I18n.termoPesquisarParadasAqui,this.getBusStopsFromContextMenu.curry(this.contextMenu).bind(this));this.contextMenu.createSingleMenu(I18n.termoSalvarPontoInicial,this.contextMenu.startMapHere.bind(this.contextMenu));this.contextMenu.createSingleMenu(I18n.termoAdicionarPontoReferencia,this.contextMenu.addPoi.bind(this.contextMenu))};YAHOO.omnibus.BusStopRadius.prototype.getBusStopsFromContextMenu=function(a){this.getBusStops(a.getPoint())};YAHOO.omnibus.BusStopRadius.prototype.getBusStops=function(d,e){var c=this.txtAddress.value;var b=parseInt(this.selRadius.value);if(typeof(e)==="undefined"){e=b}var f=this;f.isValid=true;if(typeof(d)!="undefined"){this.geocodeMaps(d,e);return}if(c===""){var a=f.map.get_map().getCenter();var g={Latitude:a.lat(),Longitude:a.lng()};this.geocodeMaps(g,b);return}Sys.Net.WebServiceProxy.invoke(_url("/Webservices/OmnibusWebServices.asmx"),"GetPointFromAddress",false,{address:c},function(h){f.geocodeMaps(h,b)},function(){showPopupError(I18n.termoErroEnderecoNaoEncontrado.format(c))})};YAHOO.omnibus.BusStopRadius.prototype.geocodeMaps=function(c,b){var d=this;if(c==null){showPopupError(I18n.msgEnderecoNaoEncontrado);WaitDialog.hideLoading();return}var a=new GLatLng(c.Latitude,c.Longitude);d.map.setCenter(a);d.searchBusStopsWithinRadius(c,b)};YAHOO.omnibus.BusStopRadius.prototype.searchBusStopsWithinRadius=function(b,a){var c=this;Sys.Net.WebServiceProxy.invoke(_url("/Webservices/OmnibusWebServices.asmx"),"GetStopsWithinRadius",false,{latitude:b.Latitude,longitude:b.Longitude,radius:a},function(d){c.searchBusStopsCallBack(b,a,d)},onFail);clearElement($get("StpTreeViewLabel"));clearElement($get("StpTreeView"));WaitDialog.showLoading(this.welcomeContainer,this.innerResultContainer)};YAHOO.omnibus.BusStopRadius.prototype.searchBusStopsCallBack=function(f,b,h){var d=this;this.mapLayer.reset();this.circle=this.map.createCircle(f,b);this.mapLayer.addOverlay(this.circle);var g=new GLatLng(f.Latitude,f.Longitude);this.addressField.getGoogleAddressFrom(g);var k=YAHOO.omnibus.BusStopRadius.centralMarkerOptions;var c=YAHOO.omnibus.BusStopRadius.centralMarkers;var e=null;for(var a=0;a<c.length;a++){e=this.map.createMarkerWithIcon(g,c[a].iconUrl,k.size,c[a].anchor,k.draggable,1);this.mapLayer.addMarker(e,15+a,15+a);GEvent.addListener(e,"dragend",function(i){var l={Latitude:i.lat(),Longitude:i.lng()};d.isValid=true;d.searchBusStopsWithinRadius(l,b)})}var j=[];for(var a=0;a<h.length;a++){if(h[a].BusLines.length>0){j.push(h[a])}}if(j.length==0){$get("StpTreeViewLabel").innerHTML=I18n.msgNenhumaParadaEncontrada}else{if(j.length==1){$get("StpTreeViewLabel").innerHTML=I18n.msgParadaEncontrada}else{$get("StpTreeViewLabel").innerHTML=I18n.msgParadasEncontradas.format(h.length)}}WaitDialog.hideLoading();this.busStopsManager.manageBusStops(j);setVisibility("mapButtons","visible");if(d.isValid){this.mapLayer.show()}};YAHOO.omnibus.BusStopRadius.prototype.showCriarLink=function(){var a=this;EmailPanel.hide();LinkPanel.show();var b=$get("linkText");b.value=getUrl()+"paradas?lat="+a.addressField.geoPoint.lat()+"&lng="+a.addressField.geoPoint.lng()+"&uGP="+true+"&radius="+a.selRadius.value;b.focus();b.select()};YAHOO.omnibus.BusStopRadius.prototype.hideCriarLink=function(){LinkPanel.hide()};YAHOO.omnibus.BusStopRadius.prototype.onDeactivate=function(a){this.scrollPosition=$get("ResultsPane").scrollTop;this.isValid=false;this.mapLayer.hide();this.contextMenu.removeListener();this.hideCriarLink();YAHOO.util.Event.removeListener("btCriarLink","click");$get("btCriarLink").style.display="none";$get("btEnviarEmail").style.display="none";$get("btImprimir").style.display="none";setVisibility("mapButtons","hidden");$get("resultFindStops").style.display="none"};YAHOO.omnibus.BusStopRadius.prototype.onActivate=function(b){var a=this;a.mapLayer.show();if(!a.mapLayer.isEmpty()){setVisibility("mapButtons","visible")}YAHOO.util.Event.addListener("btCriarLink","click",a.showCriarLink.bind(a));$get("btCriarLink").style.display="inline";$get("btEnviarEmail").style.display="none";$get("btImprimir").style.display="none";$get("resultFindStops").style.display="block";$get("ResultsPane").scrollTop=this.scrollPosition;this.contextMenu.addListeners()};YAHOO.omnibus.BusStopsDisplayManager=function(d,c,e,b,a){if(YAHOO.util.Dom.inDocument(d)){if(YAHOO.lang.isString(d)){this.divCollaboration=document.getElementById(d)}else{this.divCollaboration=d}}if(YAHOO.util.Dom.inDocument(a)){if(YAHOO.lang.isString(a)){this.divWelcome=document.getElementById(a)}else{this.divWelcome=a}}if(YAHOO.util.Dom.inDocument(c)){if(YAHOO.lang.isString(c)){this.divTreeView=document.getElementById(c)}else{this.divTreeView=c}}this.map=e;this.mapLayer=b};YAHOO.omnibus.BusStopsDisplayManager.prototype.divCollaboration=null;YAHOO.omnibus.BusStopsDisplayManager.prototype.divTreeView=null;YAHOO.omnibus.BusStopsDisplayManager.prototype.map=null;YAHOO.omnibus.BusStopsDisplayManager.prototype.mapLayer=null;YAHOO.omnibus.BusStopsDisplayManager.prototype.divWelcome=null;YAHOO.omnibus.BusStopsDisplayManager.prototype.tree=null;YAHOO.omnibus.BusStopsDisplayManager.prototype.markedNode=null;YAHOO.omnibus.BusStopsDisplayManager.prototype.manageBusStops=function(h){var j=this;clearElement(j.divTreeView);var n=document.createElement("div");j.divTreeView.appendChild(n);j.tree=new YAHOO.widget.TreeView(n);j.tree.singleNodeHighlight=true;var s=j.tree.getRoot();j.divCollaboration.scrollTop=0;var c=YAHOO.omnibus.BusLine.markerOptions.anchor;var g=YAHOO.omnibus.BusLine.markerOptions.number;var p="";var r=[];var i=h;var u=false;var o=false;var A=[];for(var e=0;e<i.length;e++){var z=false;var v=null;o=false;if(typeof(i[e].BusStop)!=="undefined"){z=true;u=true;v=i[e].BusLines;if(v.length<=0){o=true}if(!o){i[e]=i[e].BusStop}}if(!o){var l=i[e].Street;var B=i[e].Name;var d=e+1;r[e]=[];var m=new GLatLng(i[e].Latitude,i[e].Longitude);var y=i[e].StopType=="Standard"?"Stop":"Integ";for(var f=0;f<g;f++){p=YAHOO.omnibus.SpriteMap.getSprite(f,0,d,y);r[e][f]=j.map.createMarkerWithSprite(m,p,null,c[f],false);j.mapLayer.addMarker(r[e][f],15+f,15+f)}var b;var t;if(i[e].StopType=="Standard"){b="iconBusStops spt spt-bus_resultado_pesquisa";t=""}else{b="iconIntegBusStops spt spt-bus_integ_resultado_pesquisa";t=" - "+I18n.termoIntegracao}var x=(B=="")?l:B;var a={label:d+" - "+x+t,stop:i[e],number:d,markers:r[e],hl:false};var q=new YAHOO.widget.TextNode(a,s);q.labelStyle=(i[e].StopType=="Standard")?"iconBusStops spt spt-bus_resultado_pesquisa":"iconIntegBusStops spt spt-bus_integ_resultado_pesquisa";if(z){for(var w=0;w<v.length;w++){var k=new YAHOO.widget.HTMLNode("<div class='click linesHoverUnderline' onclick='BusLine.openTabAndDoSearch("+v[w].Code+")'>"+v[w].Code+" - "+v[w].Name+"</div>",q)}}for(var f=0;f<g;f++){if(u){GEvent.addListener(r[e][f],"click",j.markerClickAndExpandCallback.curry(q).bind(j))}else{GEvent.addListener(r[e][f],"click",j.markerClickCallback.curry(q).bind(j))}}}}j.mapLayer.refreshMarkers();j.tree.subscribe("focusChanged",j.nodeClickCallback.bind(j));j.tree.render();if(u){j.setTreeStyle(j.tree)}};YAHOO.omnibus.BusStopsDisplayManager.prototype.markerClickCallback=function(a){this.divCollaboration.scrollTop=a.data.number*a.getEl().clientHeight;a.focus()};YAHOO.omnibus.BusStopsDisplayManager.prototype.markerClickAndExpandCallback=function(a){a.expand();this.divCollaboration.scrollTop=this.divCollaboration.scrollHeight;a.focus()};YAHOO.omnibus.BusStopsDisplayManager.prototype.nodeClickCallback=function(b){if(b.newNode==null){return}var a=this;YAHOO.util.Dom.addClass(b.newNode.getEl(),"marked");if(this.markedNode!=null){YAHOO.util.Dom.removeClass(this.markedNode.getEl(),"marked");a.toggleHighlight(this.markedNode,false)}a.toggleHighlight(b.newNode,true);a.mapLayer.refreshMarkers();this.markedNode=b.newNode};YAHOO.omnibus.BusStopsDisplayManager.prototype.toggleHighlight=function(d,a){var e=this;var c="";if(d!=null){if(a){if(this.map.getZoom()<15){map.setZoom(15)}e.map.setCenter(d.data.markers[0].getPoint())}for(var b=0;b<d.data.markers.length;b++){c=d.data.markers[b].getIcon().sprite;c=YAHOO.omnibus.SpriteMap.getSprite(c.stopMarkerZoom,(1-c.stopMarkerHl),c.stopMarkerNum,c.stopMarkerType);d.data.markers[b].getIcon().sprite=c}}};YAHOO.omnibus.BusStopsDisplayManager.prototype.setTreeStyle=function(a){this.divWelcome.style.display="none";var b=a.getRoot().children;for(var d=0;d<b.length;d++){var e=b[d].children;for(var c=0;c<e.length;c++){if(c%2==0){e[c].className="evenTreeNode"}else{e[c].className="oddTreeNode"}}}};YAHOO.namespace("omnibus");YAHOO.omnibus.BusLine=function(b,g,e,c,f,d,a){if(YAHOO.util.Dom.inDocument(b)){if(YAHOO.lang.isString(b)){this.lineCodeTxtBox=$get(b)}else{this.lineCodeTxtBox=b}}if(YAHOO.util.Dom.inDocument(g)){if(YAHOO.lang.isString(g)){this.lineComboBox=$get(g)}else{this.lineComboBox=g}}if(YAHOO.util.Dom.inDocument(e)){if(YAHOO.lang.isString(e)){this.btSearch=$get(e)}else{this.btSearch=e}}if(YAHOO.util.Dom.inDocument(c)){if(YAHOO.lang.isString(c)){this.outterResultContainer=document.getElementById(c)}else{this.outterResultContainer=c}}if(YAHOO.util.Dom.inDocument(f)){if(YAHOO.lang.isString(f)){this.welcomeContainer=document.getElementById(f)}else{this.welcomeContainer=f}}if(YAHOO.util.Dom.inDocument(d)){if(YAHOO.lang.isString(d)){this.innerResultContainer=document.getElementById(d)}else{this.innerResultContainer=d}}this.mapLayer=new YAHOO.omnibus.MapLayer(a);this.busStopsManager=new YAHOO.omnibus.BusStopsDisplayManager(this.outterResultContainer,"LnTreeView",map,this.mapLayer,this.welcomeContainer);this.emptyLineCodeContainer=this.createErrorDiv(this.lineCodeTxtBox,I18n.labelEmptyCode);this.wrongLineCodeContainer=this.createErrorDiv(this.lineCodeTxtBox,I18n.msgLinhaNaoEncontrada);this.emptyComboBoxContainer=this.createErrorDiv(this.lineComboBox,I18n.labelEmptyLinha);YAHOO.util.Event.addListener(this.lineComboBox,"change",this.onComboBoxChange,this,true);YAHOO.util.Event.addListener(this.lineCodeTxtBox,"keyup",this.onTxtBoxChange,this,true);YAHOO.util.Event.addListener(this.lineCodeTxtBox,"keypress",onEnterKeyPress.curry(this.onBtSeachClick.bind(this)));YAHOO.util.Event.addListener(this.btSearch,"click",this.onBtSeachClick,this,true);this.createContextMenu();this.contextMenu.removeListener()};YAHOO.omnibus.BusLine.prototype.contextMenu=null;YAHOO.omnibus.BusLine.prototype.lineCodeTxtBox=null;YAHOO.omnibus.BusLine.prototype.lineComboBox=null;YAHOO.omnibus.BusLine.prototype.btSearch=null;YAHOO.omnibus.BusLine.prototype.emptyLineCodeContainer=null;YAHOO.omnibus.BusLine.prototype.wrongLineCodeContainer=null;YAHOO.omnibus.BusLine.prototype.emptyComboBoxContainer=null;YAHOO.omnibus.BusLine.prototype.outterResultContainer=null;YAHOO.omnibus.BusLine.prototype.innerResultContainer=null;YAHOO.omnibus.BusLine.prototype.welcomeContainer=null;YAHOO.omnibus.BusLine.prototype.mapLayer=null;YAHOO.omnibus.BusLine.prototype.busStopsManager=null;YAHOO.omnibus.BusLine.prototype.isValid=true;YAHOO.omnibus.BusLine.prototype.scrollPosition=0;YAHOO.omnibus.BusLine.markerOptions={anchor:[new GPoint(6,12),new GPoint(1,13),new GPoint(1,14),new GPoint(1,15),new GPoint(1,18)],number:5};YAHOO.omnibus.BusLine.prototype.onComboBoxChange=function(a){this.clearErrors();this.lineCodeTxtBox.value=this.lineComboBox.value;this.onBtSeachClick()};YAHOO.omnibus.BusLine.prototype.onTxtBoxChange=function(a){this.lineComboBox.value="";if(this.lineCodeTxtBox.value.length<=4){this.lineComboBox.value=this.lineCodeTxtBox.value.toUpperCase();if(this.lineComboBox.value.length!=this.lineCodeTxtBox.value.length){this.lineComboBox.value=parseInt(this.lineCodeTxtBox.value,10)}if(this.lineComboBox.value!=""){this.clearErrors()}}};YAHOO.omnibus.BusLine.prototype.onBtSeachClick=function(a){this.clearErrors();this.clearResults();if(this.lineCodeTxtBox.value===""){this.emptyLineCodeContainer.style.display="block";this.emptyComboBoxContainer.style.display="block";return}else{if(this.lineComboBox.value!=""){this.searchBusLine(this.lineComboBox.value)}else{this.wrongLineCodeContainer.style.display="block"}}};YAHOO.omnibus.BusLine.prototype.clearErrors=function(){this.emptyLineCodeContainer.style.display="none";this.wrongLineCodeContainer.style.display="none";this.emptyComboBoxContainer.style.display="none"};YAHOO.omnibus.BusLine.prototype.clearResults=function(){clearElement($get("LnTreeViewLabel"));clearElement($get("LnTreeView"))};YAHOO.omnibus.BusLine.prototype.searchBusLine=function(a){this.getBusLine(a,null,this.outterResultContainer)};YAHOO.omnibus.BusLine.prototype.showCriarLink=function(){var a=this;EmailPanel.hide();LinkPanel.show();var b=$get("linkText");b.value=getUrl()+"linhas?lineCode="+parseInt(a.lineCodeTxtBox.value,10);b.focus();b.select()};YAHOO.omnibus.BusLine.prototype.hideCriarLink=function(){LinkPanel.hide()};YAHOO.omnibus.BusLine.prototype.createContextMenu=function(){this.contextMenu=new YAHOO.omnibus.ContextMapMenu(map.get_map());this.contextMenu.createSingleMenu(I18n.termoSalvarPontoInicial,this.contextMenu.startMapHere.bind(this.contextMenu));this.contextMenu.createSingleMenu(I18n.termoAdicionarPontoReferencia,this.contextMenu.addPoi.bind(this.contextMenu))};YAHOO.omnibus.BusLine.prototype.onDeactivate=function(){this.scrollPosition=$get("ResultsPane").scrollTop;this.isValid=false;YAHOO.util.Event.removeListener("btCriarLink","click");$get("btCriarLink").style.display="none";$get("btEnviarEmail").style.display="none";$get("btImprimir").style.display="none";this.contextMenu.removeListener();this.hideCriarLink();setVisibility("mapButtons","hidden");this.outterResultContainer.style.display="none";this.mapLayer.hide()};YAHOO.omnibus.BusLine.prototype.onActivate=function(){var a=this;a.isValid=true;if(!a.mapLayer.isEmpty()){setVisibility("mapButtons","visible")}YAHOO.util.Event.addListener("btCriarLink","click",a.showCriarLink.bind(a));$get("btCriarLink").style.display="inline";$get("btEnviarEmail").style.display="none";$get("btImprimir").style.display="none";a.outterResultContainer.style.display="block";a.mapLayer.show();$get("ResultsPane").scrollTop=this.scrollPosition;this.contextMenu.addListeners()};YAHOO.omnibus.BusLine.prototype.openTabAndDoSearch=function(a){tabViewManager.openTab(1);this.setLineCode(a);this.searchBusLine(a)};YAHOO.omnibus.BusLine.prototype.getBusLine=function(a,d,c){var b=this;b.isValid=true;this.mapLayer.reset();Sys.Net.WebServiceProxy.invoke(_url("/Webservices/OmnibusWebServices.asmx"),"GetBusLine",false,{busLineCode:a},b.renderRouteOnMap.curry(d,c).bind(b),onFail);WaitDialog.showLoading(this.welcomeContainer,this.innerResultContainer)};YAHOO.omnibus.BusLine.prototype.setLineCode=function(a){this.lineCodeTxtBox.value=a;this.lineComboBox.value=a};YAHOO.omnibus.BusLine.prototype.renderRouteOnMap=function(e,d,a){var c=this;if(!a){WaitDialog.hideLoading();this.wrongLineCodeContainer.style.display="block";c.isValid=false}WaitDialog.forceHideBarLoading();if(a!=null){this.busStopsManager.manageBusStops(a.Stops)}var b=new YAHOO.omnibus.BuslinePolylineCreator(this.mapLayer.map,this.renderPolylines.bind(this));if(a!=null){b.createBusLine(a);$get("LnTreeViewLabel").innerHTML=I18n.labelTarifa+" "+a.Fare.Zone+" - R$ "+a.Fare.Cost}setVisibility("mapButtons","visible")};YAHOO.omnibus.BusLine.prototype.createErrorDiv=function(a,f){var c=document.createElement("div");YAHOO.util.Dom.addClass(c,"cl spt spt-endereco_incompleto_seta");var b=document.createElement("div");YAHOO.util.Dom.addClass(b,"erroLabel");b.innerHTML=f;var e=document.createElement("div");YAHOO.util.Dom.addClass(e,"cr spt spt-endereco_incompleto_canto");var d=document.createElement("div");YAHOO.util.Dom.addClass(d,"errorAddressField");d.style.display="none";d.appendChild(c);d.appendChild(b);d.appendChild(e);YAHOO.util.Dom.insertAfter(d,a);return d};YAHOO.omnibus.BusLine.prototype.renderPolylines=function(b){for(var a=0;a<b.length;a++){this.mapLayer.addOverlay(b[a])}if(this.isValid==true){this.mapLayer.show();this.mapLayer.centerAndZoom()}WaitDialog.hideLoading()};YAHOO.namespace("omnibus");YAHOO.omnibus.WaitDialog=function(a){if(YAHOO.util.Dom.inDocument(a)){if(YAHOO.lang.isString(a)){this.waitResultBar=document.getElementById(a)}else{this.waitResultBar=a}}this.LeftWaitOverlay=new YAHOO.widget.Overlay(this.waitResultBar,{width:"115px",height:"39px",zindex:999,visible:false,effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25},context:["layoutResultColumm","tl","tl",["beforeShow","windowResize"],[130,0]]});this.LeftWaitOverlay.render();this.TopWaitOverlay=new YAHOO.widget.Overlay("top_loading_container",{width:"150px",zindex:999,visible:false,effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25}});this.TopWaitOverlay.subscribe("beforeShow",this.centerTopBar);YAHOO.util.Event.addListener(window,"resize",this.centerTopBar,this.TopWaitOverlay,true);this.TopWaitOverlay.render()};YAHOO.omnibus.WaitDialog.prototype.TopWaitOverlay=null;YAHOO.omnibus.WaitDialog.prototype.LeftWaitOverlay=null;YAHOO.omnibus.WaitDialog.prototype.waitResultBar=null;YAHOO.omnibus.WaitDialog.prototype.welcomeDiv=null;YAHOO.omnibus.WaitDialog.prototype.resultDiv=null;YAHOO.omnibus.WaitDialog.prototype.centerTopBar=function(a){this.center();this.cfg.setProperty("y",27)};YAHOO.omnibus.WaitDialog.prototype.showLoading=function(c,b){this.welcomeDiv=YAHOO.lang.isUndefined(c)?null:c;this.resultDiv=YAHOO.lang.isUndefined(b)?null:b;var a=this;if(!YAHOO.lang.isNull(this.welcomeDiv)){this.welcomeDiv.style.display="none"}if(!YAHOO.lang.isNull(this.resultDiv)){this.resultDiv.style.visibility="hidden"}this.TopWaitOverlay.show();this.LeftWaitOverlay.show()};YAHOO.omnibus.WaitDialog.prototype.hideLoading=function(){this.TopWaitOverlay.hide();this.LeftWaitOverlay.hide();if(!YAHOO.lang.isNull(this.resultDiv)){this.resultDiv.style.visibility="visible"}};YAHOO.omnibus.WaitDialog.prototype.showTopLoading=function(){this.TopWaitOverlay.show()};YAHOO.omnibus.WaitDialog.prototype.forceHideBarLoading=function(){this.LeftWaitOverlay.hide()};function browserdetect(){var a=navigator.userAgent.toLowerCase();this.isIE=a.indexOf("msie")>-1;this.ieVer=this.isIE?/msie\s(\d\.\d)/.exec(a)[1]:0;this.isMoz=a.indexOf("firefox")!=-1;this.isSafari=a.indexOf("safari")!=-1;this.quirksMode=this.isIE&&(!document.compatMode||document.compatMode.indexOf("BackCompat")>-1);this.isOp="opera" in window;this.isWebKit=a.indexOf("webkit")!=-1;if(this.isIE){this.get_style=function(d,b){if(!(b in d.currentStyle)){return""}var f=/^([\d.]+)(\w*)/.exec(d.currentStyle[b]);if(!f){return d.currentStyle[b]}if(f[1]==0){return"0"}if(f[2]&&f[2]!=="px"){var g=d.style.left;var c=d.runtimeStyle.left;d.runtimeStyle.left=d.currentStyle.left;d.style.left=f[1]+f[2];f[0]=d.style.pixelLeft;d.style.left=g;d.runtimeStyle.left=c}return f[0]}}else{this.get_style=function(c,b){b=b.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return document.defaultView.getComputedStyle(c,"").getPropertyValue(b)}}}var curvyBrowser=new browserdetect;if(curvyBrowser.isIE){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}function curvyCnrSpec(a){this.selectorText=a;this.tlR=this.trR=this.blR=this.brR=0;this.tlu=this.tru=this.blu=this.bru="";this.antiAlias=true}curvyCnrSpec.prototype.setcorner=function(d,c,a,b){if(!d){this.tlR=this.trR=this.blR=this.brR=parseInt(a);this.tlu=this.tru=this.blu=this.bru=b}else{propname=d.charAt(0)+c.charAt(0);this[propname+"R"]=parseInt(a);this[propname+"u"]=b}};curvyCnrSpec.prototype.get=function(b){if(/^(t|b)(l|r)(R|u)$/.test(b)){return this[b]}if(/^(t|b)(l|r)Ru$/.test(b)){var c=b.charAt(0)+b.charAt(1);return this[c+"R"]+this[c+"u"]}if(/^(t|b)Ru?$/.test(b)){var d=b.charAt(0);d+=this[d+"lR"]>this[d+"rR"]?"l":"r";var a=this[d+"R"];if(b.length===3&&b.charAt(2)==="u"){a+=this[d="u"]}return a}throw new Error("Don't recognize property "+b)};curvyCnrSpec.prototype.radiusdiff=function(a){if(a!=="t"&&a!=="b"){throw new Error("Param must be 't' or 'b'")}return Math.abs(this[a+"lR"]-this[a+"rR"])};curvyCnrSpec.prototype.setfrom=function(a){this.tlu=this.tru=this.blu=this.bru="px";if("tl" in a){this.tlR=a.tl.radius}if("tr" in a){this.trR=a.tr.radius}if("bl" in a){this.blR=a.bl.radius}if("br" in a){this.brR=a.br.radius}if("antiAlias" in a){this.antiAlias=a.antiAlias}};curvyCnrSpec.prototype.cloneOn=function(c){var f=["tl","tr","bl","br"];var b=0;var h,a;for(h in f){if(!isNaN(h)){a=this[f[h]+"u"];if(a!==""&&a!=="px"){b=new curvyCnrSpec;break}}}if(!b){b=this}else{var i,g,d=curvyBrowser.get_style(c,"left");for(h in f){if(!isNaN(h)){i=f[h];a=this[i+"u"];g=this[i+"R"];if(a!=="px"){var d=c.style.left;c.style.left=g+a;g=c.style.pixelLeft;c.style.left=d}b[i+"R"]=g;b[i+"u"]="px"}}c.style.left=d}return b};curvyCnrSpec.prototype.radiusSum=function(a){if(a!=="t"&&a!=="b"){throw new Error("Param must be 't' or 'b'")}return this[a+"lR"]+this[a+"rR"]};curvyCnrSpec.prototype.radiusCount=function(a){var b=0;if(this[a+"lR"]){++b}if(this[a+"rR"]){++b}return b};curvyCnrSpec.prototype.cornerNames=function(){var a=[];if(this.tlR){a.push("tl")}if(this.trR){a.push("tr")}if(this.blR){a.push("bl")}if(this.brR){a.push("br")}return a};function operasheet(g){var a=document.styleSheets.item(g).ownerNode.text;a=a.replace(/\/\*(\n|\r|.)*?\*\//g,"");var f=new RegExp("^s*([\\w.#][-\\w.#, ]+)[\\n\\s]*\\{([^}]+border-((top|bottom)-(left|right)-)?radius[^}]*)\\}","mg");var b;this.rules=[];while((b=f.exec(a))!==null){var c=new RegExp("(..)border-((top|bottom)-(left|right)-)?radius:\\s*([\\d.]+)(in|em|px|ex|pt)","g");var d,h=new curvyCnrSpec(b[1]);while((d=c.exec(b[2]))!==null){if(d[1]!=="z-"){h.setcorner(d[3],d[4],d[5],d[6])}}this.rules.push(h)}}operasheet.contains_border_radius=function(a){return/border-((top|bottom)-(left|right)-)?radius/.test(document.styleSheets.item(a).ownerNode.text)};function curvyCorners(){var j,a,l,c,g;if(typeof arguments[0]!=="object"){throw curvyCorners.newError("First parameter of curvyCorners() must be an object.")}if(arguments[0] instanceof curvyCnrSpec){c=arguments[0];if(!c.selectorText&&typeof arguments[1]==="string"){c.selectorText=arguments[1]}}else{if(typeof arguments[1]!=="object"&&typeof arguments[1]!=="string"){throw curvyCorners.newError("Second parameter of curvyCorners() must be an object or a class name.")}a=arguments[1];if(typeof a!=="string"){a=""}if(a!==""&&a.charAt(0)!=="."&&"autoPad" in arguments[0]){a="."+a}c=new curvyCnrSpec(a);c.setfrom(arguments[0])}if(c.selectorText){g=0;var h=c.selectorText.replace(/\s+$/,"").split(/,\s*/);l=new Array;function d(n){var m=n.split("#");return(m.length===2?"#":"")+m.pop()}for(j=0;j<h.length;++j){var f=d(h[j]);var i=f.split(" ");switch(f.charAt(0)){case"#":a=i.length===1?f:i[0];a=document.getElementById(a.substr(1));if(a===null){curvyCorners.alert("No object with ID "+f+" exists yet.\nCall curvyCorners(settings, obj) when it is created.")}else{if(i.length===1){l.push(a)}else{l=l.concat(curvyCorners.getElementsByClass(i[1],a))}}break;default:if(i.length===1){l=l.concat(curvyCorners.getElementsByClass(f))}else{var b=curvyCorners.getElementsByClass(i[0]);for(a=0;a<b.length;++a){l=l.concat(curvyCorners.getElementsByClass(i[1],b))}}}}}else{g=1;l=arguments}for(j=g,a=l.length;j<a;++j){if(l[j]&&(!("IEborderRadius" in l[j].style)||l[j].style.IEborderRadius!="set")){if(l[j].className&&l[j].className.indexOf("curvyRedraw")!==-1){if(typeof curvyCorners.redrawList==="undefined"){curvyCorners.redrawList=new Array}curvyCorners.redrawList.push({node:l[j],spec:c,copy:l[j].cloneNode(false)})}l[j].style.IEborderRadius="set";var k=new curvyObject(c,l[j]);k.applyCorners()}}}curvyCorners.prototype.applyCornersToAll=function(){curvyCorners.alert("This function is now redundant. Just call curvyCorners(). See documentation.")};curvyCorners.redraw=function(){if(!curvyBrowser.isOp&&!curvyBrowser.isIE){return}if(!curvyCorners.redrawList){throw curvyCorners.newError("curvyCorners.redraw() has nothing to redraw.")}var b=curvyCorners.bock_redraw;curvyCorners.block_redraw=true;for(var a in curvyCorners.redrawList){if(isNaN(a)){continue}var c=curvyCorners.redrawList[a];if(!c.node.clientWidth){continue}var f=c.copy.cloneNode(false);for(var d=c.node.firstChild;d!=null;d=d.nextSibling){if(d.className==="autoPadDiv"){break}}if(!d){curvyCorners.alert("Couldn't find autoPad DIV");break}c.node.parentNode.replaceChild(f,c.node);while(d.firstChild){f.appendChild(d.removeChild(d.firstChild))}c=new curvyObject(c.spec,c.node=f);c.applyCorners()}curvyCorners.block_redraw=b};curvyCorners.adjust=function(obj,prop,newval){if(curvyBrowser.isOp||curvyBrowser.isIE){if(!curvyCorners.redrawList){throw curvyCorners.newError("curvyCorners.adjust() has nothing to adjust.")}var i,j=curvyCorners.redrawList.length;for(i=0;i<j;++i){if(curvyCorners.redrawList[i].node===obj){break}}if(i===j){throw curvyCorners.newError("Object not redrawable")}obj=curvyCorners.redrawList[i].copy}if(prop.indexOf(".")===-1){obj[prop]=newval}else{eval("obj."+prop+"='"+newval+"'")}};curvyCorners.handleWinResize=function(){if(!curvyCorners.block_redraw){curvyCorners.redraw()}};curvyCorners.setWinResize=function(a){curvyCorners.block_redraw=!a};curvyCorners.newError=function(a){return new Error("curvyCorners Error:\n"+a)};curvyCorners.alert=function(a){if(typeof curvyCornersVerbose==="undefined"||curvyCornersVerbose){alert(a)}};function curvyObject(){var j;this.box=arguments[1];this.settings=arguments[0];this.topContainer=this.bottomContainer=this.shell=j=null;var t=this.box.clientWidth;if(!t&&curvyBrowser.isIE){this.box.style.zoom=1;t=this.box.clientWidth}if(!t){if(!this.box.parentNode){throw this.newError("box has no parent!")}for(j=this.box;;j=j.parentNode){if(!j||j.tagName==="BODY"){this.applyCorners=function(){};curvyCorners.alert(this.errmsg("zero-width box with no accountable parent","warning"));return}if(j.style.display==="none"){break}}j.style.display="block";t=this.box.clientWidth}if(arguments[0] instanceof curvyCnrSpec){this.spec=arguments[0].cloneOn(this.box)}else{this.spec=new curvyCnrSpec("");this.spec.setfrom(this.settings)}var ag=curvyBrowser.get_style(this.box,"borderTopWidth");var u=curvyBrowser.get_style(this.box,"borderBottomWidth");var ab=curvyBrowser.get_style(this.box,"borderLeftWidth");var ad=curvyBrowser.get_style(this.box,"borderRightWidth");var v=curvyBrowser.get_style(this.box,"borderTopColor");var x=curvyBrowser.get_style(this.box,"borderBottomColor");var ae=curvyBrowser.get_style(this.box,"borderLeftColor");var aa=curvyBrowser.get_style(this.box,"backgroundColor");var ac=curvyBrowser.get_style(this.box,"backgroundImage");var f=curvyBrowser.get_style(this.box,"backgroundRepeat");if(this.box.currentStyle&&this.box.currentStyle.backgroundPositionX){var m=curvyBrowser.get_style(this.box,"backgroundPositionX");var o=curvyBrowser.get_style(this.box,"backgroundPositionY")}else{var m=curvyBrowser.get_style(this.box,"backgroundPosition");m=m.split(" ");var o=m[1];m=m[0]}var p=curvyBrowser.get_style(this.box,"position");var d=curvyBrowser.get_style(this.box,"paddingTop");var af=curvyBrowser.get_style(this.box,"paddingBottom");var n=curvyBrowser.get_style(this.box,"paddingLeft");var ah=curvyBrowser.get_style(this.box,"paddingRight");var l=curvyBrowser.get_style(this.box,"border");filter=curvyBrowser.ieVer>7?curvyBrowser.get_style(this.box,"filter"):null;var w=this.spec.get("tR");var r=this.spec.get("bR");var h=function(a){if(typeof a==="number"){return a}if(typeof a!=="string"){throw new Error("unexpected styleToNPx type "+typeof a)}var b=/^[-\d.]([a-z]+)$/.exec(a);if(b&&b[1]!="px"){throw new Error("Unexpected unit "+b[1])}if(isNaN(a=parseInt(a))){a=0}return a};var k=function(a){return a<=0?"0":a+"px"};try{this.borderWidth=h(ag);this.borderWidthB=h(u);this.borderWidthL=h(ab);this.borderWidthR=h(ad);this.boxColour=curvyObject.format_colour(aa);this.topPadding=h(d);this.bottomPadding=h(af);this.leftPadding=h(n);this.rightPadding=h(ah);this.boxWidth=t;this.boxHeight=this.box.clientHeight;this.borderColour=curvyObject.format_colour(v);this.borderColourB=curvyObject.format_colour(x);this.borderColourL=curvyObject.format_colour(ae);this.borderString=this.borderWidth+"px solid "+this.borderColour;this.borderStringB=this.borderWidthB+"px solid "+this.borderColourB;this.backgroundImage=((ac!="none")?ac:"");this.backgroundRepeat=f}catch(g){throw this.newError("getMessage" in g?g.getMessage():g.message)}var y=this.boxHeight;var i=t;if(curvyBrowser.isOp){m=h(m);o=h(o);if(m){var q=i+this.borderWidthL+this.borderWidthR;if(m>q){m=q}m=(q/m*100)+"%"}if(o){var q=y+this.borderWidth+this.borderWidthB;if(o>q){o=q}o=(q/o*100)+"%"}}if(curvyBrowser.quirksMode){}else{this.boxWidth-=this.leftPadding+this.rightPadding;this.boxHeight-=this.topPadding+this.bottomPadding}this.contentContainer=document.createElement("div");if(filter){this.contentContainer.style.filter=filter}while(this.box.firstChild){this.contentContainer.appendChild(this.box.removeChild(this.box.firstChild))}if(p!="absolute"){this.box.style.position="relative"}this.box.style.padding="0";this.box.style.border=this.box.style.backgroundImage="none";this.box.style.backgroundColor="transparent";this.box.style.width=(i+this.borderWidthL+this.borderWidthR)+"px";this.box.style.height=(y+this.borderWidth+this.borderWidthB)+"px";var s=document.createElement("div");s.style.position="absolute";if(filter){s.style.filter=filter}if(curvyBrowser.quirksMode){s.style.width=(i+this.borderWidthL+this.borderWidthR)+"px"}else{s.style.width=i+"px"}s.style.height=k(y+this.borderWidth+this.borderWidthB-w-r);s.style.padding="0";s.style.top=w+"px";s.style.left="0";if(this.borderWidthL){s.style.borderLeft=this.borderWidthL+"px solid "+this.borderColourL}if(this.borderWidth&&!w){s.style.borderTop=this.borderWidth+"px solid "+this.borderColour}if(this.borderWidthR){s.style.borderRight=this.borderWidthR+"px solid "+this.borderColourL}if(this.borderWidthB&&!r){s.style.borderBottom=this.borderWidthB+"px solid "+this.borderColourB}s.style.backgroundColor=aa;s.style.backgroundImage=this.backgroundImage;s.style.backgroundRepeat=this.backgroundRepeat;this.shell=this.box.appendChild(s);t=curvyBrowser.get_style(this.shell,"width");if(t===""||t==="auto"||t.indexOf("%")!==-1){throw this.newError("Shell width is "+t)}this.boxWidth=(t!=""&&t!="auto"&&t.indexOf("%")==-1)?parseInt(t):this.shell.clientWidth;this.applyCorners=function(){if(this.backgroundObject){var A=function(ao,an,am){if(ao===0){return 0}var al;if(ao==="right"||ao==="bottom"){return am-an}if(ao==="center"){return(am-an)/2}if(ao.indexOf("%")>0){return(am-an)*100/parseInt(ao)}return h(ao)};this.backgroundPosX=A(m,this.backgroundObject.width,i);this.backgroundPosY=A(o,this.backgroundObject.height,y)}else{if(this.backgroundImage){this.backgroundPosX=h(m);this.backgroundPosY=h(o)}}if(w){C=document.createElement("div");C.style.width=this.boxWidth+"px";C.style.fontSize="1px";C.style.overflow="hidden";C.style.position="absolute";C.style.paddingLeft=this.borderWidth+"px";C.style.paddingRight=this.borderWidth+"px";C.style.height=w+"px";C.style.top=-w+"px";C.style.left=-this.borderWidthL+"px";this.topContainer=this.shell.appendChild(C)}if(r){var C=document.createElement("div");C.style.width=this.boxWidth+"px";C.style.fontSize="1px";C.style.overflow="hidden";C.style.position="absolute";C.style.paddingLeft=this.borderWidthB+"px";C.style.paddingRight=this.borderWidthB+"px";C.style.height=r+"px";C.style.bottom=-r+"px";C.style.left=-this.borderWidthL+"px";this.bottomContainer=this.shell.appendChild(C)}var M=this.spec.cornerNames();for(var F in M){if(!isNaN(F)){var V=M[F];var S=this.spec[V+"R"];var Q,K,Y,P;if(V=="tr"||V=="tl"){Q=this.borderWidth;K=this.borderColour;P=this.borderWidth}else{Q=this.borderWidthB;K=this.borderColourB;P=this.borderWidthB}Y=S-P;var E=document.createElement("div");E.style.height=this.spec.get(V+"Ru");E.style.width=this.spec.get(V+"Ru");E.style.position="absolute";E.style.fontSize="1px";E.style.overflow="hidden";var J,L,N;var R=filter?parseInt(/alpha\(opacity.(\d+)\)/.exec(filter)[1]):100;for(J=0;J<S;++J){var T=(J+1>=Y)?-1:Math.floor(Math.sqrt(Math.pow(Y,2)-Math.pow(J+1,2)))-1;if(Y!=S){var Z=(J>=Y)?-1:Math.ceil(Math.sqrt(Math.pow(Y,2)-Math.pow(J,2)));var aj=(J+1>=S)?-1:Math.floor(Math.sqrt(Math.pow(S,2)-Math.pow((J+1),2)))-1}var ak=(J>=S)?-1:Math.ceil(Math.sqrt(Math.pow(S,2)-Math.pow(J,2)));if(T>-1){this.drawPixel(J,0,this.boxColour,R,(T+1),E,true,S)}if(Y!=S){if(this.spec.antiAlias){for(L=T+1;L<Z;++L){if(this.backgroundImage!=""){var ai=curvyObject.pixelFraction(J,L,Y)*100;this.drawPixel(J,L,K,R,1,E,ai>=30,S)}else{if(this.boxColour!=="transparent"){var W=curvyObject.BlendColour(this.boxColour,K,curvyObject.pixelFraction(J,L,Y));this.drawPixel(J,L,W,R,1,E,false,S)}else{this.drawPixel(J,L,K,R>>1,1,E,false,S)}}}if(aj>=Z){if(Z==-1){Z=0}this.drawPixel(J,Z,K,R,(aj-Z+1),E,false,0)}N=K;L=aj}else{if(aj>T){this.drawPixel(J,(T+1),K,R,(aj-T),E,false,0)}}}else{N=this.boxColour;L=T}if(this.spec.antiAlias){while(++L<ak){this.drawPixel(J,L,N,(curvyObject.pixelFraction(J,L,S)*R),1,E,P<=0,S)}}}for(var a=0,H=E.childNodes.length;a<H;++a){var G=E.childNodes[a];var I=parseInt(G.style.top);var B=parseInt(G.style.left);var c=parseInt(G.style.height);if(V=="tl"||V=="bl"){G.style.left=(S-B-1)+"px"}if(V=="tr"||V=="tl"){G.style.top=(S-c-I)+"px"}G.style.backgroundRepeat=this.backgroundRepeat;if(this.backgroundImage){switch(V){case"tr":G.style.backgroundPosition=(this.backgroundPosX-this.borderWidthL+S-i-B)+"px "+(this.backgroundPosY+c+I+this.borderWidth-S)+"px";break;case"tl":G.style.backgroundPosition=(this.backgroundPosX-S+B+this.borderWidthL)+"px "+(this.backgroundPosY-S+c+I+this.borderWidth)+"px";break;case"bl":G.style.backgroundPosition=(this.backgroundPosX-S+B+1+this.borderWidthL)+"px "+(this.backgroundPosY-y-this.borderWidth+(curvyBrowser.quirksMode?I:-I)+S)+"px";break;case"br":if(curvyBrowser.quirksMode){G.style.backgroundPosition=(this.backgroundPosX+this.borderWidthL-i+S-B)+"px "+(this.backgroundPosY-y-this.borderWidth+I+S)+"px"}else{G.style.backgroundPosition=(this.backgroundPosX-this.borderWidthL-i+S-B)+"px "+(this.backgroundPosY-y-this.borderWidth+S-I)+"px"}}}}switch(V){case"tl":E.style.top=E.style.left="0";this.topContainer.appendChild(E);break;case"tr":E.style.top=E.style.right="0";this.topContainer.appendChild(E);break;case"bl":E.style.bottom=E.style.left="0";this.bottomContainer.appendChild(E);break;case"br":E.style.bottom=E.style.right="0";this.bottomContainer.appendChild(E)}}}var b={t:this.spec.radiusdiff("t"),b:this.spec.radiusdiff("b")};for(z in b){if(typeof z==="function"){continue}if(!this.spec.get(z+"R")){continue}if(b[z]){if(this.backgroundImage&&this.spec.radiusSum(z)!==b[z]){curvyCorners.alert(this.errmsg("Not supported: unequal non-zero top/bottom radii with background image"))}var D=(this.spec[z+"lR"]<this.spec[z+"rR"])?z+"l":z+"r";var U=document.createElement("div");U.style.height=b[z]+"px";U.style.width=this.spec.get(D+"Ru");U.style.position="absolute";U.style.fontSize="1px";U.style.overflow="hidden";U.style.backgroundColor=this.boxColour;switch(D){case"tl":U.style.bottom=U.style.left="0";U.style.borderLeft=this.borderString;this.topContainer.appendChild(U);break;case"tr":U.style.bottom=U.style.right="0";U.style.borderRight=this.borderString;this.topContainer.appendChild(U);break;case"bl":U.style.top=U.style.left="0";U.style.borderLeft=this.borderStringB;this.bottomContainer.appendChild(U);break;case"br":U.style.top=U.style.right="0";U.style.borderRight=this.borderStringB;this.bottomContainer.appendChild(U)}}var O=document.createElement("div");if(filter){O.style.filter=filter}O.style.position="relative";O.style.fontSize="1px";O.style.overflow="hidden";O.style.width=this.fillerWidth(z);O.style.backgroundColor=this.boxColour;O.style.backgroundImage=this.backgroundImage;O.style.backgroundRepeat=this.backgroundRepeat;switch(z){case"t":if(this.topContainer){if(curvyBrowser.quirksMode){O.style.height=100+w+"px"}else{O.style.height=100+w-this.borderWidth+"px"}O.style.marginLeft=this.spec.tlR?(this.spec.tlR-this.borderWidthL)+"px":"0";O.style.borderTop=this.borderString;if(this.backgroundImage){var X=this.spec.tlR?(this.backgroundPosX-(w-this.borderWidthL))+"px ":"0 ";O.style.backgroundPosition=X+this.backgroundPosY+"px";this.shell.style.backgroundPosition=this.backgroundPosX+"px "+(this.backgroundPosY-w+this.borderWidthL)+"px"}this.topContainer.appendChild(O)}break;case"b":if(this.bottomContainer){if(curvyBrowser.quirksMode){O.style.height=r+"px"}else{O.style.height=r-this.borderWidthB+"px"}O.style.marginLeft=this.spec.blR?(this.spec.blR-this.borderWidthL)+"px":"0";O.style.borderBottom=this.borderStringB;if(this.backgroundImage){var X=this.spec.blR?(this.backgroundPosX+this.borderWidthL-r)+"px ":this.backgroundPosX+"px ";O.style.backgroundPosition=X+(this.backgroundPosY-y-this.borderWidth+r)+"px"}this.bottomContainer.appendChild(O)}}}this.contentContainer.style.position="absolute";this.contentContainer.className="autoPadDiv";this.contentContainer.style.left=this.borderWidthL+"px";this.contentContainer.style.paddingTop=this.topPadding+"px";this.contentContainer.style.top=this.borderWidth+"px";this.contentContainer.style.paddingLeft=this.leftPadding+"px";this.contentContainer.style.paddingRight=this.rightPadding+"px";z=i;if(!curvyBrowser.quirksMode){z-=this.leftPadding+this.rightPadding}this.contentContainer.style.width=z+"px";this.contentContainer.style.textAlign=curvyBrowser.get_style(this.box,"textAlign");this.box.style.textAlign="left";this.box.appendChild(this.contentContainer);if(j){j.style.display="none"}};if(this.backgroundImage){m=this.backgroundCheck(m);o=this.backgroundCheck(o);if(this.backgroundObject){this.backgroundObject.holdingElement=this;this.dispatch=this.applyCorners;this.applyCorners=function(){if(this.backgroundObject.complete){this.dispatch()}else{this.backgroundObject.onload=new Function("curvyObject.dispatch(this.holdingElement);")}}}}}curvyObject.prototype.backgroundCheck=function(b){if(b==="top"||b==="left"||parseInt(b)===0){return 0}if(!(/^[-\d.]+px$/.test(b))&&!this.backgroundObject){this.backgroundObject=new Image;var a=function(c){var d=/url\("?([^'"]+)"?\)/.exec(c);return(d?d[1]:c)};this.backgroundObject.src=a(this.backgroundImage)}return b};curvyObject.dispatch=function(a){if("dispatch" in a){a.dispatch()}else{throw a.newError("No dispatch function")}};curvyObject.prototype.drawPixel=function(f,i,d,j,h,g,b,k){var c=document.createElement("div");c.style.height=h+"px";c.style.width="1px";c.style.position="absolute";c.style.fontSize="1px";c.style.overflow="hidden";var a=this.spec.get("tR");c.style.backgroundColor=d;if(b&&this.backgroundImage!=""){c.style.backgroundImage=this.backgroundImage;c.style.backgroundPosition="-"+(this.boxWidth-(k-f)+this.borderWidth)+"px -"+((this.boxHeight+a+i)-this.borderWidth)+"px"}if(j!=100){curvyObject.setOpacity(c,j)}c.style.top=i+"px";c.style.left=f+"px";g.appendChild(c)};curvyObject.prototype.fillerWidth=function(a){var b=curvyBrowser.quirksMode?0:this.spec.radiusCount(a)*this.borderWidthL;return(this.boxWidth-this.spec.radiusSum(a)+b)+"px"};curvyObject.prototype.errmsg=function(c,b){var d="\ntag: "+this.box.tagName;if(this.box.id){d+="\nid: "+this.box.id}if(this.box.className){d+="\nclass: "+this.box.className}var a;if((a=this.box.parentNode)===null){d+="\n(box has no parent)"}else{d+="\nParent tag: "+a.tagName;if(a.id){d+="\nParent ID: "+a.id}if(a.className){d+="\nParent class: "+a.className}}if(b===undefined){b="warning"}return"curvyObject "+b+":\n"+c+d};curvyObject.prototype.newError=function(a){return new Error(this.errmsg(a,"exception"))};curvyObject.IntToHex=function(b){var a=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];return a[b>>>4]+""+a[b&15]};curvyObject.BlendColour=function(f,h,k){if(f==="transparent"||h==="transparent"){throw this.newError("Cannot blend with transparent")}if(f.charAt(0)!=="#"){f=curvyObject.format_colour(f)}if(h.charAt(0)!=="#"){h=curvyObject.format_colour(h)}var a=parseInt(f.substr(1,2),16);var g=parseInt(f.substr(3,2),16);var l=parseInt(f.substr(5,2),16);var b=parseInt(h.substr(1,2),16);var i=parseInt(h.substr(3,2),16);var m=parseInt(h.substr(5,2),16);if(k>1||k<0){k=1}var j=Math.round((a*k)+(b*(1-k)));if(j>255){j=255}if(j<0){j=0}var c=Math.round((g*k)+(i*(1-k)));if(c>255){c=255}if(c<0){c=0}var d=Math.round((l*k)+(m*(1-k)));if(d>255){d=255}if(d<0){d=0}return"#"+curvyObject.IntToHex(j)+curvyObject.IntToHex(c)+curvyObject.IntToHex(d)};curvyObject.pixelFraction=function(h,i,d){var f;var k=d*d;var c=new Array(2);var j=new Array(2);var g=0;var b="";var a=Math.sqrt(k-Math.pow(h,2));if(a>=i&&a<(i+1)){b="Left";c[g]=0;j[g]=a-i;++g}a=Math.sqrt(k-Math.pow(i+1,2));if(a>=h&&a<(h+1)){b+="Top";c[g]=a-h;j[g]=1;++g}a=Math.sqrt(k-Math.pow(h+1,2));if(a>=i&&a<(i+1)){b+="Right";c[g]=1;j[g]=a-i;++g}a=Math.sqrt(k-Math.pow(i,2));if(a>=h&&a<(h+1)){b+="Bottom";c[g]=a-h;j[g]=0}switch(b){case"LeftRight":f=Math.min(j[0],j[1])+((Math.max(j[0],j[1])-Math.min(j[0],j[1]))/2);break;case"TopRight":f=1-(((1-c[0])*(1-j[1]))/2);break;case"TopBottom":f=Math.min(c[0],c[1])+((Math.max(c[0],c[1])-Math.min(c[0],c[1]))/2);break;case"LeftBottom":f=j[0]*c[1]/2;break;default:f=1}return f};curvyObject.rgb2Array=function(a){var b=a.substring(4,a.indexOf(")"));return b.split(", ")};curvyObject.rgb2Hex=function(i){try{var h=curvyObject.rgb2Array(i);var c=parseInt(h[0]);var f=parseInt(h[1]);var a=parseInt(h[2]);var g="#"+curvyObject.IntToHex(c)+curvyObject.IntToHex(f)+curvyObject.IntToHex(a)}catch(d){var b="getMessage" in d?d.getMessage():d.message;throw new Error("Error ("+b+") converting RGB value to Hex in rgb2Hex")}return g};curvyObject.setOpacity=function(b,f){f=(f==100)?99.999:f;if(curvyBrowser.isSafari&&b.tagName!="IFRAME"){var g=curvyObject.rgb2Array(b.style.backgroundColor);var c=parseInt(g[0]);var d=parseInt(g[1]);var a=parseInt(g[2]);b.style.backgroundColor="rgba("+c+", "+d+", "+a+", "+f/100+")"}else{if(typeof b.style.opacity!=="undefined"){b.style.opacity=f/100}else{if(typeof b.style.MozOpacity!=="undefined"){b.style.MozOpacity=f/100}else{if(typeof b.style.filter!="undefined"){b.style.filter="alpha(opacity="+f+")"}else{if(typeof b.style.KHTMLOpacity!="undefined"){b.style.KHTMLOpacity=f/100}}}}}};function addEvent(b,c,d,a){if(b.addEventListener){b.addEventListener(c,d,a);return true}if(b.attachEvent){return b.attachEvent("on"+c,d)}b["on"+c]=d;return false}curvyObject.getComputedColour=function(c){var b=document.createElement("DIV");b.style.backgroundColor=c;document.body.appendChild(b);if(window.getComputedStyle){var d=document.defaultView.getComputedStyle(b,null).getPropertyValue("background-color");b.parentNode.removeChild(b);if(d.substr(0,3)==="rgb"){d=curvyObject.rgb2Hex(d)}return d}else{var a=document.body.createTextRange();a.moveToElementText(b);a.execCommand("ForeColor",false,c);var g=a.queryCommandValue("ForeColor");var f="rgb("+(g&255)+", "+((g&65280)>>8)+", "+((g&16711680)>>16)+")";b.parentNode.removeChild(b);a=null;return curvyObject.rgb2Hex(f)}};curvyObject.format_colour=function(a){if(a!=""&&a!="transparent"){if(a.substr(0,3)==="rgb"){a=curvyObject.rgb2Hex(a)}else{if(a.charAt(0)!=="#"){a=curvyObject.getComputedColour(a)}else{if(a.length===4){a="#"+a.charAt(1)+a.charAt(1)+a.charAt(2)+a.charAt(2)+a.charAt(3)+a.charAt(3)}}}}return a};curvyCorners.getElementsByClass=function(b,d){var f=new Array;if(d===undefined){d=document}b=b.split(".");var a="*";if(b.length===1){a=b[0];b=false}else{if(b[0]){a=b[0]}b=b[1]}var g,h,i;if(a.charAt(0)==="#"){h=document.getElementById(a.substr(1));if(h){f.push(h)}}else{h=d.getElementsByTagName(a);i=h.length;if(b){var c=new RegExp("(^|\\s)"+b+"(\\s|$)");for(g=0;g<i;++g){if(c.test(h[g].className)){f.push(h[g])}}}else{for(g=0;g<i;++g){f.push(h[g])}}}return f};if(curvyBrowser.isMoz||curvyBrowser.isWebKit){var curvyCornersNoAutoScan=true}else{curvyCorners.scanStyles=function(){function f(h){var g=/^[\d.]+(\w+)$/.exec(h);return g[1]}var b,c,d;if(curvyBrowser.isIE){function a(g){var i=g.style;if(curvyBrowser.ieVer>6){var k=i["-webkit-border-radius"]||0;var h=i["-webkit-border-top-right-radius"]||0;var m=i["-webkit-border-top-left-radius"]||0;var l=i["-webkit-border-bottom-right-radius"]||0;var n=i["-webkit-border-bottom-left-radius"]||0}else{var k=i["webkit-border-radius"]||0;var h=i["webkit-border-top-right-radius"]||0;var m=i["webkit-border-top-left-radius"]||0;var l=i["webkit-border-bottom-right-radius"]||0;var n=i["webkit-border-bottom-left-radius"]||0}if(k||m||h||l||n){var j=new curvyCnrSpec(g.selectorText);if(k){j.setcorner(null,null,parseInt(k),f(k))}else{if(h){j.setcorner("t","r",parseInt(h),f(h))}if(m){j.setcorner("t","l",parseInt(m),f(m))}if(n){j.setcorner("b","l",parseInt(n),f(n))}if(l){j.setcorner("b","r",parseInt(l),f(l))}}curvyCorners(j)}}for(b=0;b<document.styleSheets.length;++b){if(document.styleSheets[b].imports){for(c=0;c<document.styleSheets[b].imports.length;++c){for(d=0;d<document.styleSheets[b].imports[c].rules.length;++d){a(document.styleSheets[b].imports[c].rules[d])}}}for(c=0;c<document.styleSheets[b].rules.length;++c){a(document.styleSheets[b].rules[c])}}}else{if(curvyBrowser.isOp){for(b=0;b<document.styleSheets.length;++b){if(operasheet.contains_border_radius(b)){d=new operasheet(b);for(c in d.rules){if(!isNaN(c)){curvyCorners(d.rules[c])}}}}}else{curvyCorners.alert("Scanstyles does nothing in Webkit/Firefox")}}};curvyCorners.init=function(){if(arguments.callee.done){return}arguments.callee.done=true;if(curvyBrowser.isWebKit&&curvyCorners.init.timer){clearInterval(curvyCorners.init.timer);curvyCorners.init.timer=null}curvyCorners.scanStyles()}}if(typeof curvyCornersNoAutoScan==="undefined"||curvyCornersNoAutoScan===false){if(curvyBrowser.isOp){document.addEventListener("DOMContentLoaded",curvyCorners.init,false)}else{addEvent(window,"load",curvyCorners.init,false)}};YAHOO.namespace("omnibus");YAHOO.omnibus.TabViewManager=function(d,a,c,b){this.tabView=new YAHOO.widget.TabView(d);this.tabRotas=this.tabView.getTab(0);this.tabLinhas=this.tabView.getTab(1);this.tabParadas=this.tabView.getTab(2);this.activeIndex=0;this.BusRoute=a;this.BusLine=c;this.BusStopRadius=b;this.setActiveTabByUrl(location.href);this.tabView.on("beforeActiveTabChange",this.beforeActivateCallback.bind(this));this.tabView.on("activeTabChange",this.onChangeTabsCallback.bind(this))};YAHOO.omnibus.TabViewManager.prototype.tabView=null;YAHOO.omnibus.TabViewManager.prototype.activeIndex=0;YAHOO.omnibus.TabViewManager.prototype.tabRotas=null;YAHOO.omnibus.TabViewManager.prototype.tabLinhas=null;YAHOO.omnibus.TabViewManager.prototype.tabParadas=null;YAHOO.omnibus.TabViewManager.prototype.BusRoute=null;YAHOO.omnibus.TabViewManager.prototype.BusLine=null;YAHOO.omnibus.TabViewManager.prototype.BusStopRadius=null;YAHOO.omnibus.TabViewManager.prototype.setActiveTabByUrl=function(a){var b=this;if(a.search("linhas")>=0){this.beforeActivateCallback();b.tabView.set("activeTab",b.tabView.getTab(1));b.activeIndex=1;b.loadLinesByUrl()}else{if(a.search("paradas")>=0){this.beforeActivateCallback();b.tabView.set("activeTab",b.tabView.getTab(2));b.activeIndex=2;b.loadStopsByUrl(a)}else{this.beforeActivateCallback();b.tabView.set("activeTab",b.tabView.getTab(0));b.activeIndex=0;b.tabView.getTab(b.activeIndex).set("title","");b.loadRouteByUrl()}}};YAHOO.omnibus.TabViewManager.prototype.loadRouteByUrl=function(){this.BusRoute.onActivate()};YAHOO.omnibus.TabViewManager.prototype.loadStopsByUrl=function(c){var d=this;d.BusStopRadius.onActivate();loadQueryString();var f=QueryString("uGP");var e=QueryString("addr");var b=QueryString("radius");if(f){var a={Latitude:QueryString("lat"),Longitude:QueryString("lng")};d.BusStopRadius.getBusStops(a,b);$get("selectRadius").value=b;return}if((typeof(e)!=="undefined")&&(typeof(b)!=="undefined")&&(e!="")){$get("txtEndereco").value=e;if(b>=250&&b<=1000){$get("selectRadius").value=b}d.BusStopRadius.getBusStops()}};YAHOO.omnibus.TabViewManager.prototype.openTab=function(a){this.tabView.set("activeTab",this.tabView.getTab(a))};YAHOO.omnibus.TabViewManager.prototype.loadLinesByUrl=function(){var a=this;a.BusLine.onActivate();loadQueryString();if(typeof(QueryString("lineCode"))!="undefined"){var b=QueryString("lineCode");a.BusLine.setLineCode(b);a.BusLine.searchBusLine(b)}};YAHOO.omnibus.TabViewManager.prototype.onChangeTabsCallback=function(){var a=this;if(a.tabView.get("activeIndex")!=a.activeIndex){WaitDialog.hideLoading();hideAdvOptions();roundedCorners();a.activeIndex=a.tabView.get("activeIndex");a.tabView.getTab(a.activeIndex).set("title","");YAHOO.omnibus.GeoAdvertisement.setLoadFromTempOn();if(window.name!="speclOFF"){YAHOO.omnibus.SpecificLocation.setLoadFromTempOn()}map.clear();clearElement($get("content"));if(a.activeIndex==0){a.BusRoute.onActivate()}else{if(a.activeIndex==1){a.BusLine.onActivate()}else{if(a.activeIndex==2){a.BusStopRadius.onActivate()}}}}};YAHOO.omnibus.TabViewManager.prototype.beforeActivateCallback=function(){var a=this;if(a.activeIndex==0){a.BusRoute.onDeactivate()}else{if(a.activeIndex==1){a.BusLine.onDeactivate()}else{if(a.activeIndex==2){a.BusStopRadius.onDeactivate()}}}};YAHOO.namespace("omnibus");YAHOO.omnibus.Adv=function(){this.fullBar=document.getElementById("fullBar");this.fullBarBack=document.getElementById("fullBarBack");var a=document.createElement("div");a.setAttribute("id","closeFullBar");a.setAttribute("class","spt spt-fullbanner_fechar");this.fullBar.appendChild(a);YAHOO.util.Event.addListener(a,"click",this.closeFullBar,this,true);YAHOO.lang.later(20000,this,function(){this.closeFullBar()});if(ActivateFullBar=="true"){this.showFullBar()}};YAHOO.omnibus.Adv.prototype.fullBar=null;YAHOO.omnibus.Adv.prototype.fullBarBack=null;YAHOO.omnibus.Adv.prototype.closeFullBar=function(){var c=new YAHOO.util.Anim("fullBar",{opacity:{to:0}},1,YAHOO.util.Easing.easeOut);var a=this;c.onComplete.subscribe(function(){a.fullBar.style.display="none";a.fullBarBack.style.display="none"});c.animate();var b=new YAHOO.util.Anim("fullBarBack",{opacity:{to:0},display:{to:"none"}},1,YAHOO.util.Easing.easeOut);b.animate()};YAHOO.omnibus.Adv.prototype.showFullBar=function(){this.fullBar.style.display="block";this.fullBarBack.style.display="block";var b=new YAHOO.util.Anim("fullBar",{opacity:{to:1}},1,YAHOO.util.Easing.easeOut);b.animate();var a=new YAHOO.util.Anim("fullBarBack",{opacity:{to:0.7}},1,YAHOO.util.Easing.easeOut);a.animate()};