function LTrim(a){return a.replace(/^\s*/,"")}function RTrim(a){return a.replace(/\s*$/,"")}function trim(a){return RTrim(LTrim(a))}function MM_preloadImages(){var f=document;if(f.images){if(!f.MM_p){f.MM_p=new Array()}var e,c=f.MM_p.length,b=MM_preloadImages.arguments;for(e=0;e<b.length;e++){if(b[e].indexOf("#")!=0){f.MM_p[c]=new Image;f.MM_p[c++].src=b[e]}}}}function checkMobileNumber(b){b=b+"";var c="+0123456789";var a;for(i=0;i<b.length;i++){a=b.charAt(i);if(c.indexOf(a)==-1){return false}}return true}function MM_openBrWindow(c,a,b){window.open(c,a,b)}function showHide(b,a){if(a==1){document.getElementById(b).style.display="block"}else{document.getElementById(b).style.display="none"}}function enableSection(a,b,c){if(a.checked){document.getElementById(b).style.display="";document.getElementById(c).style.display="none"}}function enableSectionFix(){try{if(document.forms[0].endLocationType&&eval(document.forms[0].endLocationType)){var value1=getRadioValue(document.forms[0].endLocationType);var value2=getRadioValue(document.forms[0].startLocationType);if(value1=="poi"){document.getElementById("endpoint_poi").style.display="";document.getElementById("endpoint_address").style.display="none"}else{document.getElementById("endpoint_poi").style.display="none";document.getElementById("endpoint_address").style.display=""}if(value2=="poi"){document.getElementById("startpoint_poi").style.display="";document.getElementById("startpoint_address").style.display="none"}else{document.getElementById("startpoint_poi").style.display="none";document.getElementById("startpoint_address").style.display=""}}}catch(e){}}function enableSection2(b,a,c){document.getElementById(b).style.display="";document.getElementById(a).style.display="none";if(c&&c!=null&&document.getElementById(c)!=null){document.getElementById(c).style.display="none"}if(b=="quicktable"){document.getElementById("lmdLink").style.display="none"}else{document.getElementById("lmdLink").style.display=""}document.getElementById(b).focus()}function enableSection3(b,a,d,c){document.getElementById(b).style.display="";document.getElementById(a).style.display="none";if(d&&d!=null&&document.getElementById(d)!=null){document.getElementById(d).style.display="none"}if(c&&c!=null&&document.getElementById(c)!=null){document.getElementById(c).style.display="none"}}function mouseOverImage(a){a.src=a.src.replace("_normal","_over")}function originalImage(a){a.src=a.src.replace("_over","_normal")}function getDropdownValue(c){if(c){if(c.length){var a=c.length;for(i=0;i<a;++i){if(c.options[i].selected){var b=c.options[i].value;if(b=="0"||b=="-1"){return""}else{return trim(b)}}}}else{return""}}else{return""}}function setDropdownValue(c,b){if(c){if(c.length){var a=c.length;for(i=0;i<a;++i){if(c.options[i].value==b){c.options[i].selected=true;return}}}}}function getRadioValue(b){if(b.length!=null){if(b&&b.length){var a=b.length;for(i=0;i<a;++i){if(b[i].checked){return b[i].value}}}}else{if(b.checked){return b.value}}return""}function submitMailForm(h){var c=trim(document.forms[0].to.value);var g=trim(document.forms[0].friendsEmail.value);var f=trim(document.forms[0].message.value);var b=trim(document.forms[0].name.value);var e="Following information is required:\n";var a=true;var d=0;if(b==""){e+=(++d)+". Name\n";a=false}if(c==""||!CheckEmail(c)||c.indexOf(";")>0||c.indexOf(",")>0){e+=(++d)+". A Valid Email Address\n";a=false}if(f==""){e+=(++d)+". Message\n";a=false}if(g!=""&&g.indexOf(";")>0){e+=(++d)+". Valid Friend(s)' Email Address(es)\n";a=false}if(!a){alert(e);return false}return startBgProcess2(h)}function CheckEmail(a){AtPos=a.indexOf("@");StopPos=a.lastIndexOf(".");Message="";if(a==""){return false}if(AtPos==-1||StopPos==-1){return false}if(StopPos<AtPos){return false}if(StopPos-AtPos==1){return false}return true}function startBgProcess2(b){var a=b.src.toLowerCase().indexOf("/images/");contextPath=b.src.substring(0,a);document.getElementById("contentTableMail").style.display="none";document.getElementById("processingTableMail").style.display="";document.getElementById("processImageIdMail").src=contextPath+"/images/new_wait.gif";return true}function newWindow(a){try{var g=640;var c=480;if(document.layers){g=window.outerWidth,c=window.outerHeight}else{g=screen.width,c=screen.height}}catch(d){}var b=(g-680)/2,f=(c-550)/2;return window.open(a,"formwindows","top=50,left=50,bottom=50,right=50,toolbar=no,location=no,directories=no,menubar=no,resizable=yes,scrollbars=yes,height=550,width=680,screenX="+b+",screenY="+f+",top="+f+",left="+b+"")}function newWindow1(a){try{var g=400;var c=300;if(document.layers){g=window.outerWidth,c=window.outerHeight}else{g=screen.width,c=screen.height}}catch(d){}var b=(g-440)/2,f=(c-370)/2;return window.open(a,"formwindows","top=50,left=50,bottom=50,right=50,toolbar=no,location=no,directories=no,menubar=no,resizable=yes,scrollbars=yes,height=370,width=440,screenX="+b+",screenY="+f+",top="+f+",left="+b+"")}function sendMail(b,a,d){try{var j=800;var f=600;if(document.layers){j=window.outerWidth,f=window.outerHeight}else{j=screen.width,f=screen.height}}catch(g){}var c=(j-d)/2,h=(f-a)/2;window.open(b,"formwindows","top=50,left=50,bottom=50,right=50,toolbar=no,location=no,directories=no,menubar=no,resizable=yes,scrollbars=yes,height="+a+",width="+d+",screenX="+c+",screenY="+h+",top="+h+",left="+c+"")}function sendSMS(){try{var b=trim(document.forms[0].mobileNo.value);var d="Following information is required / invalid:\n";var a=true;var c=0;if(b==""||!checkMobileNumber(b)||b.length>13||b.length<10){d+=(++c)+". Mobile Number\n";a=false}if(!a){alert(d);return false}newWindow1("common/blank.jsp");document.forms[0].target="formwindows";return true}catch(f){}return false}function sendMessage(h){try{var c=trim(document.forms[0].mobileNo.value);var b=trim(document.forms[0].email.value);var f="Following information is required / invalid:\n";var a=true;var d=0;if(c==""&&b==""){f+=(++d)+". Mobile Number or Email Address\n";a=false}if(c!=""&&(!checkMobileNumber(c)||c.length>13||c.length<10)){f+=(++d)+". Invalid Mobile Number\n";a=false}if(b!=""&&(!CheckEmail(b)||b.indexOf(";")>0||b.indexOf(",")>0)){f+=(++d)+". Invalid Email Address\n";a=false}if(!a){alert(f);return false}return startBgProcess(h)}catch(g){}}function gotoURL(a){var b=newWindow("common/blank.jsp");document.forms[0].target="formwindows";document.forms[0].onSubmit=setTimeout("aNewWindow.location.href = '"+a+"'",300);return true}function getDirections(a){document.forms[0].target="";document.forms[0].onsubmit="";return startBgProcess(a)}function reverseRoute(a){document.forms[0].target="";document.forms[0].onsubmit="";return startBgProcess(a)}function newSource(a){if(confirm("Are you sure you want to search again?\nYour current results will be discarded.")){document.forms[0].target="";document.forms[0].onsubmit="";return startBgProcess(a)}return false}function setCityBasedForm(){var b=getDropdownValue(document.forms[0].selectedCity);var a=GetCookie("futureRouteGuruLaunch");if(b>1&&(a!=b||a=="")){var c=newWindow("common/blank.jsp");c.location.href="futurelaunch/notification.jsp?city="+b;setDropdownValue(document.forms[0].selectedCity,"1")}}function GetCookie(d){if(document.cookie){var b=document.cookie.indexOf(d);if(b!=-1){var c=(document.cookie.indexOf(d+"=",b)+1);var a=document.cookie.indexOf(";",b);if(a==-1){a=document.cookie.length}return document.cookie.substring(c+d.length,a)}}return""}function submitNotificationForm(h){var e="Following information is required / invalid:\n";var c=trim(document.forms[0].email.value);var b=trim(document.forms[0].name.value);var g=trim(document.forms[0].cityId.value);var a=true;var d=0;if(b==""){e+=(++d)+". "+document.forms[0].nameDisplayLabel.value+"\n";a=false}if(c==""||!CheckEmail(c)){e+=(++d)+". "+document.forms[0].emailDisplayLabel.value+"\n";a=false}if(!a){alert(e);return false}var f=new Date();f.setTime(f.getTime()+(7*24*60*10*1000));document.cookie="futureRouteGuruLaunch="+g+";expires="+f.toGMTString();return startBgProcess2(h)}function submitToServer(j){var g=getRadioValue(document.forms[0].startLocationType);var k="Following information is required:\n";var a=true;var d=0;if(g=="poi"){var b=trim(document.forms[0].startPOIName.value);if(b==""){k+=(++d)+". "+document.forms[0].poiNameDisplayLabel.value+"\n";a=false}}else{var c=getDropdownValue(document.forms[0].startAddSelectedTown);if(c==""){k+=(++d)+". "+document.forms[0].selectedTownDisplayLabel.value+"\n";a=false}var e=trim(document.forms[0].startAddSelectedLocalityName.value);var h=trim(document.forms[0].startAddSelectedSubLocalityName.value);var f=trim(document.forms[0].startAddName.value);if(e==""&&f==""&&h==""){k+=(++d)+". Atleast one of '"+document.forms[0].selectedLocalityDisplayLabel.value+"', or ";k+="'"+document.forms[0].selectedSubLocalityDisplayLabel.value+"', or ";k+="'"+document.forms[0].selectedNameDisplayLabel.value+"'\n";a=false}}if(!a){alert(k);return false}return startBgProcess(j)}function submitFlow(l){var k=getDropdownValue(document.forms[0].selectedCity);var h=getRadioValue(document.forms[0].startLocationType);var d=getRadioValue(document.forms[0].endLocationType);var q="Following information is required:\n";var a=true;var f=0;if(k==""){q+=(++f)+". "+document.forms[0].selectedCityDisplayLabel.value+"\n";a=false}if(h=="poi"){var b=trim(document.forms[0].startPOIName.value);if(b==""){q+=(++f)+". Start > "+document.forms[0].poiNameDisplayLabel.value+"\n";a=false}}else{var c=getDropdownValue(document.forms[0].startAddSelectedTown);if(c==""){q+=(++f)+". Start > "+document.forms[0].selectedTownDisplayLabel.value+"\n";a=false}var e=trim(document.forms[0].startAddSelectedLocalityName.value);var j=trim(document.forms[0].startAddSelectedSubLocalityName.value);var g=trim(document.forms[0].startAddName.value);if(e==""&&g==""&&j==""){q+=(++f)+". Start > Atleast one of '"+document.forms[0].selectedLocalityDisplayLabel.value+"', or ";q+="'"+document.forms[0].selectedSubLocalityDisplayLabel.value+"', or ";q+="'"+document.forms[0].selectedNameDisplayLabel.value+"'\n";a=false}}if(d=="poi"){var b=trim(document.forms[0].endPOIName.value);if(b==""){q+=(++f)+". Destination > "+document.forms[0].poiNameDisplayLabel.value+"\n";a=false}}else{var p=getDropdownValue(document.forms[0].endAddSelectedTown);if(p==""){q+=(++f)+". Destination > "+document.forms[0].selectedTownDisplayLabel.value+"\n";a=false}var o=trim(document.forms[0].endAddSelectedLocalityName.value);var n=trim(document.forms[0].endAddSelectedSubLocalityName.value);var m=trim(document.forms[0].endAddName.value);if(o==""&&m==""&&n==""){q+=(++f)+". Destination > Atleast one of '"+document.forms[0].selectedLocalityDisplayLabel.value+"', or ";q+="'"+document.forms[0].selectedSubLocalityDisplayLabel.value+"', or ";q+="'"+document.forms[0].selectedNameDisplayLabel.value+"'\n";a=false}}if(!a){alert(q);return false}return startBgProcess(l)}function loadimageagain(c,e,a){if(document.getElementById(a)){var b=document.getElementById(a).src.toLowerCase().indexOf("/image.jsp");path=document.getElementById(a).src.substring(0,b);var d=new Date().getTime();document.getElementById(a).src=path+"/images/wait.gif";document.getElementById(a).src=path+"/image.jsp?id="+d+"&pageTypeMap="+c+"&newid="+e}}function startBgProcess(b){var a=b.src.toLowerCase().indexOf("/images/");contextPath=b.src.substring(0,a);document.getElementById("contentTable").style.display="none";document.getElementById("processingTable").style.display="";document.getElementById("processImageId").src=contextPath+"/images/new_wait.gif";return true}function startBgProcessMobile(b){var a=b.src.toLowerCase().indexOf("/images/");contextPath=b.src.substring(0,a);document.getElementById("contentTable").style.display="none";document.getElementById("processingTable").style.display="";document.getElementById("processImageId").src=contextPath+"/images/wait.gif";return true}function startBgProcessFeeder(b){var a=b.src.toLowerCase().indexOf("/images/");contextPath=b.src.substring(0,a);document.getElementById("inputTable").style.display="none";document.getElementById("waitTable").style.display="none";document.getElementById("processImageId").src=contextPath+"/images/wait.gif";return true}function submitFeeder(d){var b="Following information is required:\n";var a=trim(document.forms[0].startPOIName.value);if(a==""){b+=" Start > "+document.forms[0].poiNameDisplayLabel.value+"\n";completeform=false}var c=trim(document.forms[0].endPOIName.value);if(c==""){b+=" Destination > "+document.forms[0].poiNameDisplayLabel.value+"\n";completeform=false}if(!completeform){alert(b);return false}return startBgProcess(d)}function submitFromFeeder(d){var c="Following information is required:\n";var b=true;var a=trim(document.forms[0].startPOIName.value);if(a==""){c+=" Start > "+document.forms[0].poiNameDisplayLabel.value+"\n";b=false}if(!b){alert(c);return false}return startBgProcess(d)}function makeBlank(a){a.value="";a.onclick=""}function getPrint(b,a,d){try{var j=640;var f=480;if(document.layers){j=window.outerWidth,f=window.outerHeight}else{j=screen.width,f=screen.height}}catch(g){}var c=(j-d)/2,h=(f-a)/2;window.open(b,"printpopup","top=5,left=5,bottom=5,right=5,toolbar=no,location=no,directories=no,menubar=no,resizable=yes,scrollbars=yes,height="+a+",width="+d+",screenX="+c+",screenY="+h+",top="+h+",left="+c+"")}var ns4=document.layers;var ie4=document.all;var ns6=document.getElementById&&!document.all;var dragswitch=0;var nsx;var nsy;var nstemp;function drag_dropns(name){if(!ns4){return}temp=eval(name);temp.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);temp.onmousedown=gons;temp.onmousemove=dragns;temp.onmouseup=stopns}function gons(a){temp.captureEvents(Event.MOUSEMOVE);nsx=a.x;nsy=a.y}function dragns(a){if(dragswitch==1){temp.moveBy(a.x-nsx,a.y-nsy);return false}}function stopns(){temp.releaseEvents(Event.MOUSEMOVE)}function drag_drop(a){if(ie4&&dragapproved){crossobj.style.left=tempx+event.clientX-offsetx;crossobj.style.top=tempy+event.clientY-offsety;return false}else{if(ns6&&dragapproved){crossobj.style.left=tempx+a.clientX-offsetx+"px";crossobj.style.top=tempy+a.clientY-offsety+"px";return false}}}function initializedrag(b){crossobj=ns6?document.getElementById("showimage"):document.all.showimage;var c=ns6?b.target:event.srcElement;var a=ns6?"html":document.compatMode&&document.compatMode!="BackCompat"?"documentElement":"body";while(c.tagName!=a.toUpperCase()&&c.id!="dragbar"){c=ns6?c.parentNode:c.parentElement}if(c.id=="dragbar"){offsetx=ie4?event.clientX:b.clientX;offsety=ie4?event.clientY:b.clientY;tempx=parseInt(crossobj.style.left);tempy=parseInt(crossobj.style.top);dragapproved=true;document.onmousemove=drag_drop}}document.onmouseup=new Function("dragapproved=false");function hidebox(){crossobj=ns6?document.getElementById("showimage"):document.all.showimage;if(ie4||ns6){crossobj.style.visibility="hidden"}else{if(ns4){document.showimage.visibility="hide"}}};