
function LinkManager()
{var isSingleLocation=false;var singeLocationName=null;this.checkLeftNavPane=function(page)
{var windowStyleLinks='height=410, width=425,resizable=yes,scrollbars=no,menubar=yes,toolbar=yes';var windowStyleEmail='height=610, width=425,resizable=yes,scrollbars=no,menubar=yes,toolbar=yes';var windowStyle=null;if(page=="MapLink.aspx")
{windowStyle=windowStyleLinks;}
else if(page=="MapEmail.aspx")
{windowStyle=windowStyleEmail;}
var activePois='';for(var i=0;i<17;i++){activePois+=(ClientCache.Retrieve('poi_'+i)=='active')?i+'|':'';}
activePois=activePois.substr(0,activePois.length-1);var paneNumber=ClientCache.Retrieve('selected_pane_num');if(paneNumber!=null){if(document.getElementById('header'+paneNumber).getAttribute('class')=='nestedAccordionHeaderSelected'){var searchType=ClientCache.Retrieve('pane_'+paneNumber+'_type');if(searchType=='dd'){window.open(page+"?"+queryLang+"&stype=dd"+"&waypoints="+waypointsArray.join("|")+"&pois="+activePois+"&zoom="+mapManager.Map.GetZoomLevel()+"&style="+mapManager.Map.GetMapStyle()+"&traffic="+trafficEnabled,'_blank',windowStyle);}
else if(searchType=='fm'){window.open(page+"?"+queryLang+"&stype=fm"+"&findinput="+ClientCache.Retrieve('pane_'+paneNumber+'_FindInput')+"&pois="+activePois+"&zoom="+mapManager.Map.GetZoomLevel()+"&style="+mapManager.Map.GetMapStyle()+"&traffic="+trafficEnabled,'_blank',windowStyle);}
else if(searchType=='bus'){window.open(page+"?"+queryLang+"&stype=bus"+"&location="+(ClientCache.Retrieve('pane_'+paneNumber+'_location'))+"&keyword="+(ClientCache.Retrieve('pane_'+paneNumber+'_keyword'))+"&pois="+activePois+"&zoom="+mapManager.Map.GetZoomLevel()+"&style="+mapManager.Map.GetMapStyle()+"&traffic="+trafficEnabled,'_blank',windowStyle);}
else{window.open(page+"?"+queryLang+"&stype=per"+"&location="+(ClientCache.Retrieve('pane_'+paneNumber+'_location'))+"&keyword="+(ClientCache.Retrieve('pane_'+paneNumber+'_keyword'))+"&pois="+activePois+"&zoom="+mapManager.Map.GetZoomLevel()+"&style="+mapManager.Map.GetMapStyle()+"&traffic="+trafficEnabled,'_blank',windowStyle);}}
else{window.open(page+"?"+queryLang+"&pois="+activePois+"&zoom="+mapManager.Map.GetZoomLevel()+"&style="+mapManager.Map.GetMapStyle()+"&traffic="+trafficEnabled+"&lat="+mapManager.Map.GetCenter().Latitude+"&lon="+mapManager.Map.GetCenter().Longitude,'_blank',windowStyle);}}
else{window.open(page+"?"+queryLang+"&pois="+activePois+"&zoom="+mapManager.Map.GetZoomLevel()+"&style="+mapManager.Map.GetMapStyle()+"&traffic="+trafficEnabled+"&lat="+mapManager.Map.GetCenter().Latitude+"&lon="+mapManager.Map.GetCenter().Longitude,'_blank',windowStyle);}}
this.parseQuerystringParameters=function()
{var paramStr=window.location.search;if(paramStr=='')return;var params=window.location.search.replace('?','').split('&');for(var i=0;i<params.length;i++)
{var vals=params[i].split('=');var name=vals[0];var value=vals[1];switch(name.toLowerCase())
{case'st':switch(value)
{case'loc':this.setLocationSearch(params);return;case'bus':this.setBusinessSearch(params);return;case'drn':this.setDirectionSearch(params);return;}}}}
this.setLocationSearch=function(params)
{for(var i=0;i<params.length;i++)
{var vals=params[i].split('=');var name=vals[0];var value=vals[1];switch(name.toLowerCase())
{case'loc':var location=decodeURI(value);var txtFind=document.getElementById('txtFind');if(txtFind==null)return;txtFind.value=location;mapManager.FindLookup();TopNav('FindMap');break;}}}
this.setBusinessSearch=function(params)
{for(var i=0;i<params.length;i++)
{var vals=params[i].split('=');var name=vals[0];var value=vals[1];switch(name.toLowerCase())
{case'kw':var keyword=decodeURI(value);var txtBusName=document.getElementById('txtBusName');if(txtBusName==null)return;txtBusName.value=keyword;break;case'lcn':var location=decodeURI(value);var txtBusLocation=document.getElementById('txtBusLocation');if(txtBusLocation==null)return;txtBusLocation.value=location;break;}
mapManager.FindBusiness();TopNav('FindBusiness');}}
this.setDirectionSearch=function(params)
{for(var i=0;i<params.length;i++)
{var vals=params[i].split('=');var name=vals[0];var value=vals[1];switch(name.toLowerCase())
{case'org':var origin=decodeURI(value);var txtFrom=document.getElementById('txtFrom');if(txtFrom==null)return;txtFrom.value=origin;break;case'dest':var destination=decodeURI(value);var txtTo=document.getElementById('txtTo');if(txtTo==null)return;txtTo.value=destination;break;}}
mapManager.GetNewDirections();TopNav('DrivingDirections');}}