function ow(theURL,winName,features){ window.open(theURL,winName,features);}isParams = false;function showParams(){ d = document.getElementById("itiParams"); if (d.style.visibility == "visible") { d.style.visibility = "hidden"; isParams = false; } else { d.style.top = parseInt(document.getElementById("posParams").offsetTop); d.style.left = parseInt(document.getElementById("posParams").offsetLeft); d.style.visibility = "visible"; isParams = true; }}imIti = "../../img/iti/";shim = "../../img/cmn/s.gif";wbg = "class=wbg";bbg = "class=bbg";lbbg = "class=lbbg";bbbg = "class=bbbg";busy = false;firstV = true;isOnHW = false;line = true;maxTime = 0;maxDist = 0;fdrW = 0;lastWays = "";itiTotalTime = 0;var arriveeRid;function FDRWay(isHW,dis,ways,dir,ang,isPieton,x,y,coord) { this.type = "V"; this.isHW = isHW; this.dis = dis; this.ways = ways; this.dir = dir; this.ang = ang; this.isPieton = isPieton; this.x = x; this.y = y; this.coord = coord;}function FDRMessage(lab,ic,code) { this.type = "M"; this.ic = ic; this.lab = lab; this.code = code;}function FDRFrontier(cc,lab,id){ this.type = "f"; this.cc = cc; this.lab = lab; this.id = id;}function FDRRoadMapToll(pDis, pTime, cost1, cost2, cost3, cc, lab){ this.type = "p"; this.pDis = pDis; this.pTime = pTime; this.cost = new Array(); this.cost["MOTO"] = cost1; this.cost["CAR"] = cost2; this.cost["CARAVAN"] = cost3; this.cc = cc; this.lab = lab;}function FDRRoundAbout(dir){ this.type = "R"; this.dir = dir;}function FDRDirection(lab,coord){ this.type = "I"; this.lab = lab; this.coord = coord;}function FDRCity(isDep,isArr,lDis,tDis,tTime,lab){ this.type = "D"; this.lDis = lDis; this.tDis = tDis; this.tTime = tTime; this.lab = lab; this.isDep = isDep; this.isArr = isArr;}function FDRPlace(isNear,camp,hot,res,tur,lab,rId,coord,imp,x,y){ this.isNear = isNear; this.camp = camp; this.hot = hot; this.res = res; this.tur = tur; this.lab = lab; this.rId = rId; this.coord = coord; this.imp = imp; this.x = x; this.y = y;}function FDRPoi(isDep,isArr,nom,ad,id,icon,rId,d,t){ this.type = "POI"; this.isDep = isDep; this.isArr = isArr; this.nom = nom; this.ad = ad; this.id = id; this.icon = icon; this.rId = rId; this.d = d; this.t = t;}function mkBlock(t,d,p,c,bool){ if (p == "") p = mkIm(shim,1,1,"","",""); if (t == "") t = mkIm(shim,1,1,"","",""); if (d == "") d = mkIm(shim,1,1,"","",""); return "<tr" + ( (bool != "no") ? " class=blockLine" : "") + "><td width=35 "+bbg+((t!=mkIm(shim,1,1,"","",""))?"bordered":"")+" valign=top align=center>"+t+"</td><td width=2 "+wbg+">"+mkIm(shim,1,2,"","")+"</td><td width=56 "+bbg+((d!=mkIm(shim,1,1,"","",""))?"bordered":"")+" align=right valign=top><nobr>"+d+"</nobr></td><td width=2 "+wbg+">"+mkIm(shim,1,2,"","")+"</td><td width=30 align=center "+((line)?" background='"+imIti+((isOnHW)?"fdr_bgHW.gif":"fdr_bg.gif")+"'":"")+" valign=top class=leftbg>"+p+"</td><td class=rightbg width="+(fdrW-125)+">"+c+"</td></tr>";}function mkMapBlock(c,j,k){ return "<tr><td width=35 "+bbg+" valign=top align=center>"+mkIm(shim,1,1,"","","")+"</td><td width=2 "+wbg+">"+mkIm(shim,1,2,"","")+"</td><td width=56 "+bbg+" align=right valign=top>"+mkIm(shim,1,1,"","","")+"</td><td width=2 "+wbg+">"+mkIm(shim,1,2,"","")+"</td><td width=30 align=center "+((line)?" background='"+imIti+((isOnHW)?"fdr_bgHW.gif":"fdr_bg.gif")+"'":"")+" class=leftbg>"+mkIm(shim,1,1,"","","")+"</td><td class=rightbg width="+(fdrW-125)+">"+"<table cellpadding=0 cellspacing=0 id=mapZoomInt"+j+""+k+" style='display:none;margin-right:5px' align=right><tr><td rowspan=3><img src='../../img/iti/mini_zoom.gif' usemap=#m_mini_zoom"+j+""+k+" class=noprint></td><td></td><td align=center valign=bottom height=15><img src='../../img/map/mini_north.gif' onmouseover=\"this.src='../../img/map/mini_northON.gif'\" onmouseout=\"this.src='../../img/map/mini_north.gif'\" class=noprint style='position:relative;cursor:hand;top:6px;z-index:100' onclick='ViaM_doFDRCalc(mapsID[\"mapInt"+j+""+k+"\"],\"?direction=2\",\""+j+""+k+"\")'></td><td></td></tr><tr><td align=right width=12><img src='../../img/map/mini_west.gif' onmouseover=\"this.src='../../img/map/mini_westON.gif'\" onmouseout=\"this.src='../../img/map/mini_west.gif'\" class=noprint style='position:relative;cursor:hand;left:6px;z-index:100' onclick='ViaM_doFDRCalc(mapsID[\"mapInt"+j+""+k+"\"],\"?direction=4\",\""+j+""+k+"\")'></td><td width=250><img src='"+((mapsUrl["mapInt"+j+""+k]!=null) ? mapsUrl["mapInt"+j+""+k] : shim)+"' width='250' height='200' style='border:1px solid #006;"+((fmaps["mapInt"+j+""+k]=="ok") ? "" : "display:none")+";' id=mapInt"+j+""+k+"></td><td align=left width=12><img src='../../img/map/mini_east.gif' onmouseover=\"this.src='../../img/map/mini_eastON.gif'\" onmouseout=\"this.src='../../img/map/mini_east.gif'\" class=noprint style='position:relative;cursor:hand;left:-6px;z-index:100' onclick='ViaM_doFDRCalc(mapsID[\"mapInt"+j+""+k+"\"],\"?direction=0\",\""+j+""+k+"\")'></td></tr><tr><td></td><td valign=top align=center><img src='../../img/map/mini_south.gif' onmouseover=\"this.src='../../img/map/mini_southON.gif'\" onmouseout=\"this.src='../../img/map/mini_south.gif'\" class=noprint style='position:relative;cursor:hand;top:-6px;z-index:100' onclick='ViaM_doFDRCalc(mapsID[\"mapInt"+j+""+k+"\"],\"?direction=6\",\""+j+""+k+"\")'></td><td></td></tr></table><map name='m_mini_zoom"+j+""+k+"'><area shape='rect' coords='13,156,33,174' href='javascript:ViaM_doFDRCalc(mapsID[\"mapInt"+j+""+k+"\"],\"?action=mapNavigation&typeZoom=In\",\""+j+""+k+"\")'><area shape='rect' coords='14,45,32,64' href='javascript:ViaM_doFDRCalc(mapsID[\"mapInt"+j+""+k+"\"],\"?action=mapNavigation&typeZoom=Out\",\""+j+""+k+"\")'></map>"+"</td></tr>";}function mkMsgBlock(t,d,p,c,bool){ if (p == "") p = mkIm(shim,1,1,"","",""); if (t == "") t = mkIm(shim,1,1,"","",""); if (d == "") d = mkIm(shim,1,1,"","",""); return "<tr" + ( (bool != "no") ? " class=blockLine" : "") + "><td width=35 "+bbg+((t!=mkIm(shim,1,1,"","",""))?"bordered":"")+" valign=top align=center>"+t+"</td><td width=2 "+wbg+">"+mkIm(shim,1,2,"","")+"</td><td width=56 "+bbg+((d!=mkIm(shim,1,1,"","",""))?"bordered":"")+" align=right valign=top><nobr>"+d+"</nobr></td><td width=2 "+wbg+" style='background-repeat:no-repeat'>"+mkIm(shim,1,2,"","")+"</td><td width=30 align=center "+((line)?" background='"+imIti+((isOnHW)?"fdr_bgHW.gif":"fdr_bg.gif")+"'":"")+" valign=top class=leftbg>"+p+"</td><td width="+(fdrW-125)+" class=rightbg style='border-top:1px dashed #000066;border-bottom:1px dashed #000066;padding-top:3px;padding-bottom:3px'>"+c+"</td></tr>";}function mkSep(){ return "<tr class=sepLine><td height='5' "+bbg+">"+mkIm(shim,1,1,"","")+"</td><td width=2 "+wbg+">"+mkIm(shim,1,2,"","")+"</td><td height='5' align=right "+bbg+">"+mkIm(shim,1,1,"","")+"</td><td width=2 "+wbg+">"+mkIm(shim,1,2,"","")+"</td><td "+((line)?" background='"+imIti+((isOnHW)?"fdr_bgHW.gif":"fdr_bg.gif")+"'":"")+">"+mkIm(shim,1,1,"","")+"</td><td height='5' background='"+imIti+"bgSep.gif'>"+mkIm(shim,1,1,"","")+"</td></tr>";}function mkSepPrint(){ return "<tr class=sepLinePrintBefore><td height='5' "+bbg+">"+mkIm(shim,10,1,"","")+"</td><td width=2 "+wbg+">"+mkIm(shim,1,2,"","")+"</td><td height='10' align=right "+bbg+">"+mkIm(shim,1,1,"","")+"</td><td width=2 "+wbg+">"+mkIm(shim,10,2,"","")+"</td><td "+((line)?" background='"+imIti+((isOnHW)?"fdr_bgHW.gif":"fdr_bg.gif")+"'":"")+" class=printbg>"+mkIm(shim,10,1,"","")+"</td><td height='5' class=printbg>"+mkIm(shim,1,1,"","")+"</td></tr>" + "<tr class=sepLinePrintAfter><td height='10' "+bbg+">"+mkIm(shim,10,1,"","")+"</td><td width=2 "+wbg+">"+mkIm(shim,1,2,"","")+"</td><td height='10' align=right "+bbg+">"+mkIm(shim,1,1,"","")+"</td><td width=2 "+wbg+">"+mkIm(shim,10,2,"","")+"</td><td "+((line)?" background='"+imIti+((isOnHW)?"fdr_bgHW.gif":"fdr_bg.gif")+"'":"")+" class=printbg>"+mkIm(shim,10,1,"","")+"</td><td height='5' class=printbg>"+mkIm(shim,1,1,"","")+"</td></tr>";}function mkFirstSep(){ return "<tr class=sepLineFirstPrint><td height='10' "+bbg+">"+mkIm(shim,10,1,"","")+"</td><td width=2 "+wbg+">"+mkIm(shim,1,2,"","")+"</td><td height='10' align=right "+bbg+">"+mkIm(shim,1,1,"","")+"</td><td width=2 "+wbg+">"+mkIm(shim,10,2,"","")+"</td><td "+((line)?" background='"+imIti+((isOnHW)?"fdr_bgHW.gif":"fdr_bg.gif")+"'":"")+" class=printbg>"+mkIm(shim,10,1,"","")+"</td><td height='5' class=printbg>"+mkIm(shim,1,1,"","")+"</td></tr>";}function mkLastSep(){ return "<tr class=sepLineLastPrint><td height='10' "+bbg+">"+mkIm(shim,10,1,"","")+"</td><td width=2 "+wbg+">"+mkIm(shim,1,2,"","")+"</td><td height='10' align=right "+bbg+">"+mkIm(shim,1,1,"","")+"</td><td width=2 "+wbg+">"+mkIm(shim,10,2,"","")+"</td><td "+((line)?" background='"+imIti+((isOnHW)?"fdr_bgHW.gif":"fdr_bg.gif")+"'":"")+" class=printbg>"+mkIm(shim,10,1,"","")+"</td><td height='5' class=printbg>"+mkIm(shim,1,1,"","")+"</td></tr>";}function mkIm(s,h,w,c,e,cl,alt,id){ return "<img src='"+s+"' "+((h!="")?"height="+h+" ":"")+((w!="")?"width="+w+" ":"")+((c!="")?"style='"+c+"' ":"")+((e!="")?"onclick='"+e+"'":"")+" align=absmiddle "+(((cl!="")&&(typeof(cl)!="undefined"))?"class="+cl:"")+" " + (((alt!="")&&(typeof(alt)!="undefined"))?"alt='"+alt+"'":"")+(((id!="")&&(typeof(id)!="undefined"))?" id='"+id+"'":"")+">";}function showFDR(el,unit,vh,width){ if (busy == false) { maps = new Array(); isComputingMap = false; busy = true; fdrW = width; el.style.visibility = "visible"; firstV = true; isOnHW = false; iHTML = "<table id=fdrTab cellpadding=0 cellspacing=0 width="+width+" class=fdr><tr class=noprint><td width=35 "+bbg+">"+mkIm(shim,1,35,"","")+"</td><td width=2 "+wbg+">"+mkIm(shim,1,2,"","")+"</td><td width=56 "+bbg+">"+mkIm(shim,1,56,"","")+"</td><td width=2 "+wbg+">"+mkIm(shim,1,2,"","")+"</td><td width=30>"+mkIm(shim,1,30,"","")+"</td><td width=="+(width-125)+">"+mkIm(shim,1,407,"","")+"</td></tr>"; iHTML += mkFirstSep(); j = 0; while (j < FB.length) { if (FB[j].type == "POI") { d=""; c = "<table cellpadding=2 cellspacing=0 width="+(width-125)+"><tr><td "+lbbg+" class=big><img src='"+FB[j].icon+"' align=left><b>"+FB[j].nom+"</b>, "+FB[j].ad+"</td>"; c += "</tr></table><div align=right>" + mkIm(imIti+"voir_la_carte"+((fmaps["mapInt"+j+"0"]=="ok") ? "OFF" : "")+".gif","","","cursor:hand;","showMap2(\"" + FB[j].rId + "\",this,\""+j+"0\",\""+((FB[j].isDep) ? "start" : ((FB[j].isArr) ? "dest" : ""))+"\")","noprint","","zoomMap"+j) + "</div>"; if (FB[j].isArr) iHTML += mkSepPrint(); iHTML += mkBlock(mkHour(FB[j].t),"&nbsp;"+mkDist(FB[j].d,unit)+"&nbsp;",((FB[j].isDep) ? mkIm(imIti+"fdr_start.gif",23,20,"","") : ((FB[j].isArr) ? mkIm(imIti+"fdr_dest.gif",23,20,"","") : mkIm(shim,1,1,"",""))),c); iHTML += mkMapBlock(d,j,0); strfinal = "<div align=right style='margin-top:15px'>" + mkIm(imIti+"plus_details.gif","","","cursor:hand;","location.href=\"mapPerformPage?pim=true&"+strArrivee+"\"","noprint","","") + "</div>"; if (FB[j].isArr) iHTML += mkBlock("","","",strfinal); maxTime = FB[j].t; maxDist = FB[j].d; if (FB[j].isDep) line=true; if (FB[j].isArr) arriveeRid = FB[j].rId; } if (FB[j].type == "M") { if ((FB[j].code == 0)||(FB[j].code == "")||(FB[j].code == "null")) { im=((FB[j].ic!="")?mkIm(imIti+"liais"+FB[j].ic+".gif",21,19,"",""):""); c = mkIm(imIti+"msg_alert.gif",13,13,"","")+" "+FB[j].lab; iHTML += mkMsgBlock("","",im,c); } else iHTML += mkMsgBlock("","",mkIm(imIti+"msg"+FB[j].code+".gif",21,21,"",""),FB[j].lab); } if (FB[j].type == "p") { c = ((FB[j].lab!="") ? FB[j].lab + "<br>" : "") + "Peaje: " + FB[j].cost[vh]/100+" "+FB[j].cc; iHTML += mkMsgBlock(mkHour(FB[j].pTime),"&nbsp;"+mkDist(FB[j].pDis,unit)+"&nbsp;",mkIm(imIti+"fdr_picto_peage.gif",9,19,"",""),c); } if (FB[j].type == "V") { dirLab = ""; picto = true; if ((FB[j-1].type != "I")||(isOnHW && !FB[j].isHW)) { if (FB[j].dir == 0) { dirLab = "continuar " + mkWay(j,"por : "); picto = false; } if (FB[j].dir == -18 || FB[j].dir == 18) { dirLab = "dar media vuelta "+ mkWay(j,": "); } if (FB[j].dir > 0 && FB[j].dir <= 17) { dirLab = "tomar la derecha "+ mkWay(j,": "); } if (FB[j].dir >= -17 && FB[j].dir < 0) { dirLab = "tomar la izquierda "+ mkWay(j,": "); } if (FB[j].isHW) dirLab = "coger "+ mkWay(j,": "); if (isOnHW && !FB[j].isHW) dirLab = "coger "+ mkWay(j,": "); if (firstV) dirLab = "Coger "+ mkWay(j,": "); hwStart = (FB[j].isHW)&&(!isOnHW); hwEnd = (!FB[j].isHW)&&(isOnHW); tmponHW = !isOnHW; if ((FB[j].isHW)&&(!isOnHW)) isOnHW = true; if ((!FB[j].isHW)&&(isOnHW)) isOnHW = false; if (lastWays == getWayList(j)) dirLab = "continuar " + mkWay(j,"por : "); c = dirLab + "<b>" + getWayList(j) + "</b> " + ((FB[j].dis != 0) ? (" durante " + mkDist(FB[j].dis,unit)) : ""); iHTML += mkBlock("","",((hwStart) ? mkIm(imIti+"fdr_picto_hwStart.gif",17,19,"","") : ((hwEnd) ? mkIm(imIti+"fdr_picto_hwEnd.gif",17,19,"","") : ((tmponHW) ? ((FB[j].isPieton) ? mkIm(imIti+"fdr_pieton.gif",20,14,"","") : (((!firstV)&&(picto)) ? mkIm(imIti+"angle" + FB[j].dir + ".gif",17,19,"","") : "")) : ""))),c); } lastWays = getWayList(j); if (firstV) firstV = false; } if (FB[j].type == "I") { exit = false; if (isOnHW) { t = j; while ((FB[t].type != "V")&&(t<FB.length-1)) t++; if ((t==FB.length-1)||(FB[t].isHW == false)) exit = true; } c = "<table cellpadding=0 cellspacing=0 width=100%><tr>"; c += "<td width=10 style='padding:2px' valign=top><nobr>" + ((isOnHW) ? ((exit) ? "Salir hacia : " : "Seguir : ") : "Seguir : ") + "</nobr></td>"; if ((FB[j+1].type == "V")&&((!isOnHW || FB[j+1].isHW))) c += "<td style='padding:2px;border-bottom:0px none' valign=top "+bbbg+"><b>" + FB[j].lab + "</b>" + "</td></tr>"; else c += "<td style='padding:2px;' valign=top "+bbbg+"><b>" + FB[j].lab + "</b>" + "</td></tr>"; if ((FB[j+1].type == "V")&&((!isOnHW || FB[j+1].isHW))) c += "<tr><td style='padding:2px;'>"+mkWay(j+1,"por : ")+"</td><td style='padding:2px;border-top:0px none' "+bbbg+"><b>" + getWayList(j+1) + "</b> " + "</td></tr>"; c += "</table><div align=right>" + mkIm(imIti+"voir_la_carte"+((fmaps["mapInt"+j+"0"]=="ok") ? "OFF" : "")+".gif","","","cursor:hand;","showMap2(\"" + FB[j].coord + "\",this,\""+j+"0\",\""+"\")","noprint","","zoomMap"+j) + "</div>"; if (j > 0) iHTML += mkSepPrint(); iHTML += mkBlock("","",((isOnHW) ? ((exit) ? mkIm(imIti+"HWout.gif",17,19,"","") : mkIm(imIti+"directionHW.gif",17,19,"","")) : ""),c); iHTML += mkMapBlock(d,j,0); if ((FB[j+1].type == "V")&&((!isOnHW || FB[j+1].isHW))) { hwStart = (FB[j+1].isHW)&&(!isOnHW); hwEnd = (!FB[j+1].isHW)&&(isOnHW); tmponHW = !isOnHW; if ((FB[j+1].isHW)&&(!isOnHW)) isOnHW = true; if ((!FB[j+1].isHW)&&(isOnHW)) isOnHW = false; iHTML += mkBlock("","",((hwStart) ? mkIm(imIti+"fdr_picto_hwStart.gif",17,19,"","") : ((hwEnd) ? mkIm(imIti+"fdr_picto_hwEnd.gif",17,19,"","") : ((tmponHW) ? ((FB[j+1].isPieton) ? mkIm(imIti+"fdr_pieton.gif",20,14,"","") : (((!firstV)&&(picto)) ? "" : "")) : ""))),"continuar " + mkWay(j+1,"por : ") + "<b>" + getWayList(j+1) + "</b> " + ((FB[j+1].dis != 0) ? (" durante " + mkDist(FB[j+1].dis,unit)) : "")); } } if (FB[j].type == "D") { k = 0; while (k < FB[j].lab.length) { if ((FB[j].isArr)&&(FB[j].lDis > 100)) iHTML += mkBlock("","","","entrar en " + FB[j].lab[k].lab.substring(0,FB[j].lab[0].lab.indexOf(",")) + " ("+mkDist(FB[j].lDis,unit)+")"); if ((FB[j].lab[k] != "")&&(FB[j].lab[k].lab != "")) { if (k > 0) iHTML += mkBlock("","",mkIm(shim,5,1,"",""),mkIm(shim,5,1,"","")); c = "<table cellpadding=0 cellspacing=0 width=100%><tr>"; if ((FB[j].isDep)||(FB[j].isArr)) { c += "<td "+lbbg+" style='padding:2px'><b>" + FB[j].lab[k].lab + "</b></td><td align=right "+lbbg+">"; } else { c += "<td width=10 nowrap><nobr>" + ((FB[j].lab[k].isNear) ? "Cerca de :" : ((FB[j].lDis == 0) ? "En" : "Atravesar")) + "&nbsp;</nobr></td><td style='padding:2px' "+lbbg+"><b>" + FB[j].lab[k].lab + "</b>" + ((FB[j].lDis == 0) ? "" : " durante " + mkDist(FB[j].lDis,unit)) + "</td>"; } d=""; if ((FB[j].isDep)||(FB[j].isArr)) { c += "<td "+lbbg+" style='padding:2px;font-weight:bold' align=right></td>"; c += "</tr></table><div align=right>" + mkIm(imIti+"voir_la_carte"+((fmaps["mapInt"+j+""+k]=="ok") ? "OFF" : "")+".gif","","","cursor:hand;","showMap2(\"" + FB[j].lab[k].coord + "\",this,\""+j+""+k+"\",\""+((FB[j].isDep) ? "start" : ((FB[j].isArr) ? "dest" : ""))+"\")","noprint","","zoomMap"+j) + "</div>"; if (FB[j].isArr) arriveeRid = FB[j].lab[k].rId; } else { c += "</tr></table><div align=right>" + mkIm(imIti+"voir_la_carte"+((fmaps["mapInt"+j+""+k]=="ok") ? "OFF" : "")+".gif","","","cursor:hand;","showMap2(\"" + FB[j].lab[k].coord + "\",this,\""+j+""+k+"\",\""+((FB[j].isDep) ? "start" : ((FB[j].isArr) ? "dest" : ""))+"\")","noprint","","zoomMap"+j) + "</div>"; } if (!FB[j].isDep) iHTML += mkSepPrint(); if ((FB[j].isArr)&&(FB[j].lDis > 100)) FB[j].tDis = FB[j].lDis + FB[j].tDis; if (FB[j].isArr) FB[j].tTime = itiTotalTime; iHTML += mkBlock(mkHour(FB[j].tTime),"&nbsp;"+mkDist(FB[j].tDis,unit)+"&nbsp;",((FB[j].isDep) ? mkIm(imIti+"fdr_start.gif",23,20,"","") : ((FB[j].isArr) ? mkIm(imIti+"fdr_dest.gif",23,20,"","") : mkIm(shim,1,1,"",""))),c); iHTML += mkMapBlock(d,j,k); strfinal = "<div align=right style='margin-top:15px'>" + mkIm(imIti+"plus_details.gif","","","cursor:hand;","location.href=\"mapPerformPage?pim=true&"+strArrivee+"\"","noprint","","") + "</div>"; if (FB[j].isArr) iHTML += mkBlock("","","",strfinal); if ((FB[j].isDep)&&(FB[j].lDis > 100)) iHTML += mkBlock("","","","salir de " + FB[j].lab[k].lab.substring(0,FB[j].lab[0].lab.indexOf(",")) + " ("+mkDist(FB[j].lDis,unit)+")"); maxTime = FB[j].tTime; maxDist = FB[j].tDis; } k++; } if (FB[j].isDep) line=true; } if (FB[j].type == "f") { c = "<table cellpadding=0 cellspacing=0 width="+(width-125)+" height=22><tr><td "+lbbg+" style='padding:2px'>"+FB[j].lab+"</td><td "+lbbg+" width=27 background='../../img/iti/fdr_picto_flagbg.gif' style='background-repeat:no-repeat' align=center>"+mkIm(imIti+FB[j].cc+".gif",15,17,"cursor:hand","ow(\"CityToCityFrontierXML?msgId="+FB[j].id+"&lang="+lg+"&zone="+zn+"\",\"\",\"status=no,scrollbars=yes,width=375,height=400\")","hide")+"</td></tr></table>"; iHTML += mkMsgBlock("","","",c); } if (FB[j].type == "R") { c = "En la rotonda tomar la " + FB[j].dir + ((FB[j].dir==1) ? "" : ((FB[j].dir==2) ? "" : ((FB[j].dir==3) ? "" : ""))) + " a salida "; c += "<b>" + getWayList(j+1) + "</b>"; iHTML += mkBlock("","","",c); iHTML += mkBlock("","",mkIm(shim,5,1,"",""),mkIm(shim,5,1,"",""),"no"); j++; hwStart = (FB[j].isHW)&&(!isOnHW); hwEnd = (!FB[j].isHW)&&(isOnHW); tmponHW = !isOnHW; if ((FB[j].isHW)&&(!isOnHW)) isOnHW = true; if ((!FB[j].isHW)&&(isOnHW)) isOnHW = false; dirLab = "continuar " + mkWay(j,"por : "); c = dirLab + "<b>" + getWayList(j) + "</b> " + ((FB[j].dis != 0) ? (" durante " + mkDist(FB[j].dis,unit + "")) : ""); iHTML += mkBlock("","",((hwStart) ? mkIm(imIti+"fdr_picto_hwStart.gif",17,19,"","") : ((hwEnd) ? mkIm(imIti+"fdr_picto_hwEnd.gif",17,19,"","") : ((tmponHW) ? ((FB[j].isPieton) ? mkIm(imIti+"fdr_pieton.gif",20,14,"","") : (((!firstV)&&(picto)) ? mkIm(imIti+"angle" + FB[j].dir + ".gif",17,19,"","") : "")) : ""))),c); } j++; iHTML += mkBlock("","",mkIm(shim,5,1,"",""),mkIm(shim,5,1,"",""),"no"); } iHTML += mkLastSep(); el.innerHTML = iHTML; busy = false; }}function mkWay(idx,str){ return ((getWayList(idx)!="")?str:"");}function mkHour(i){ seconds = i; minutes = 0; hours = 0; while (seconds >= 60) { minutes +=1; seconds -= 60; } while (minutes >= 60) { hours += 1; minutes -= 60; } return (((hours<10) ? "0"+hours : hours) + "h" + ((minutes<10)?"0"+minutes:minutes));}function mkDist(i,u){ if (u == "mi") { yds = Math.round(i/0.9144); if (yds <= 800) { if (yds < 101) return (closer(yds,10) + " yds"); else return (closer(yds,50) + " yds"); } else { i = Math.round((i/1609)*1000); if (i < 2001) return (closer(i,100)/1000 + " mi"); else if ((i > 2000)&&(i<10001)) return (closer(i,500)/1000 + " mi"); else return (closer(i,1000)/1000 + " mi"); } } else { if (i < 101) return (closer(i,10) + " m"); if ((i > 100)&&(i < 501)) return (closer(i,50) + " m"); if ((i > 500)&&(i < 2001)) return ((Math.round(closer(i,100)/100)/10) + " km"); if ((i > 2000)&&(i < 10001)) return ((Math.round(closer(i,500)/100)/10) + " km"); if (i > 10000) return (Math.round(closer(i,1000)/1000) + " km"); }}function closer(n,d){ dNeg = 0; dPos = 0; while ((n-dNeg) % d != 0) dNeg++; while ((dPos+n) % d != 0) dPos++; return ((dPos <= dNeg) ? (dPos+n) : (n-dNeg));}function getWayList(idx){ w = 0; value = ""; while (w < FB[idx].ways.length) { if (FB[idx].ways[w] != "") { if (w > 0) value += "/"; value += FB[idx].ways[w]; } w++; } return value;}fmaps = new Array();mapsUrl = new Array();isComputingMap = false;function showMap(rId,o,idMap,str){ if (str==null) str=""; if (document.images["mapInt"+idMap].style.display == "none") { if ((fmaps["mapInt"+idMap] != "okHide")&&(fmaps["mapInt"+idMap] != "ok")&&(!isComputingMap)) { o.src = imIti+"fdr_picto_2map2on.gif"; o.alt = "Reducir"; calcMap(idMap,rId,str); document.images["mapInt"+idMap].style.display = ""; document.getElementById("mapZoomInt"+idMap).style.display = ""; } else if (fmaps["mapInt"+idMap] == "okHide") { o.src = imIti+"fdr_picto_2map2on.gif"; o.alt = "Reducir"; document.images["mapInt"+idMap].style.display = ""; document.getElementById("mapZoomInt"+idMap).style.display = ""; fmaps["mapInt"+idMap] = "ok"; } } else { o.src = imIti+"fdr_picto_2map2.gif"; o.alt = "Ver el mapa"; document.images["mapInt"+idMap].style.display = "none"; document.getElementById("mapZoomInt"+idMap).style.display = "none"; fmaps["mapInt"+idMap] = "okHide"; }}function showMap2(rId,o,idMap,str){ if (str==null) str=""; if (document.images["mapInt"+idMap].style.display == "none") { if ((fmaps["mapInt"+idMap] != "okHide")&&(fmaps["mapInt"+idMap] != "ok")&&(!isComputingMap)) { o.src = imIti+"voir_la_carteOFF.gif"; o.alt = "Reducir"; calcMap(idMap,rId,str); document.images["mapInt"+idMap].style.display = ""; document.getElementById("mapZoomInt"+idMap).style.display = ""; } else if (fmaps["mapInt"+idMap] == "okHide") { o.src = imIti+"voir_la_carteOFF.gif"; o.alt = "Reducir"; document.images["mapInt"+idMap].style.display = ""; document.getElementById("mapZoomInt"+idMap).style.display = ""; fmaps["mapInt"+idMap] = "ok"; } } else { o.src = imIti+"voir_la_carte.gif"; o.alt = "Ver el mapa"; document.images["mapInt"+idMap].style.display = "none"; document.getElementById("mapZoomInt"+idMap).style.display = "none"; fmaps["mapInt"+idMap] = "okHide"; }}