var locals=new Array(3);locals['homeLocal']=new Array(4);locals['workLocal']=new Array(4);locals['otherLocal']=new Array(4);locals['homeLocal']['street']="";locals['homeLocal']['city']="";locals['homeLocal']['province']="";locals['homeLocal']['postalCode']="";locals['workLocal']['street']="";locals['workLocal']['city']="";locals['workLocal']['province']="";locals['workLocal']['postalCode']="";locals['otherLocal']['street']="";locals['otherLocal']['city']="";locals['otherLocal']['province']="";locals['otherLocal']['postalCode']="";function changeLocation(local,formName)
{if(local.value!='')
{var selectedLocal=local.value+'Local';document.forms[formName]['St'].value=locals[selectedLocal]['street'];document.forms[formName]['Ci'].value=locals[selectedLocal]['city'];document.forms[formName]['Pc'].value=locals[selectedLocal]['postalCode'];for(var i=0;i<document.forms[formName]['Pv'].length;i++)
{if(document.forms[formName]['Pv'][i].value==locals[selectedLocal]['province'])
{document.forms[formName]['Pv'].selectedIndex=i;}}
return false;}
else
{document.forms[formName]['St'].value='';document.forms[formName]['Ci'].value='';document.forms[formName]['Pc'].value='';document.forms[formName]['Pv'].selectedIndex=0;return false;}}
function ddFormSwitch(formAction)
{if(formAction=="closeBy")
{document.getElementById('ddForm').style.display="none";document.getElementById('cbForm').style.display="inline";}
else
{document.getElementById('cbForm').style.display="none";document.getElementById('ddForm').style.display="inline";}}
function changeDirections(formObj,fromtext,totext)
{var direction=formObj.value;if(direction=="to")
{var otherDirection="from";document.getElementById("directionText").innerHTML=fromtext;}
else
{var otherDirection="to";document.getElementById("directionText").innerHTML=totext;}
document.forms['DrivingDirections'][direction+'BusinessName'].value=document.forms['DrivingDirections'][otherDirection+'BusinessName'].value;document.forms['DrivingDirections'][direction+'St'].value=document.forms['DrivingDirections'][otherDirection+'St'].value;document.forms['DrivingDirections'][direction+'Ci'].value=document.forms['DrivingDirections'][otherDirection+'Ci'].value;document.forms['DrivingDirections'][direction+'Pc'].value=document.forms['DrivingDirections'][otherDirection+'Pc'].value;document.forms['DrivingDirections'][direction+'Pv'].value=document.forms['DrivingDirections'][otherDirection+'Pv'].value;document.forms['DrivingDirections'][direction+'Lon'].value=document.forms['DrivingDirections'][otherDirection+'Lon'].value;document.forms['DrivingDirections'][direction+'Lat'].value=document.forms['DrivingDirections'][otherDirection+'Lat'].value;document.forms['DrivingDirections'][otherDirection+'BusinessName'].value="";document.forms['DrivingDirections'][otherDirection+'St'].value=document.forms['DrivingDirections']['St'].value;document.forms['DrivingDirections'][otherDirection+'Ci'].value=document.forms['DrivingDirections']['Ci'].value;document.forms['DrivingDirections'][otherDirection+'Pc'].value=document.forms['DrivingDirections']['Pc'].value;document.forms['DrivingDirections'][otherDirection+'Lon'].value="";document.forms['DrivingDirections'][otherDirection+'Lat'].value="";var selectedProv=document.forms['DrivingDirections']['Pv'].selectedIndex;var provValue=document.forms['DrivingDirections']['Pv'][selectedProv].value;document.forms['DrivingDirections'][otherDirection+'Pv'].value=provValue;return false;}
function AddressSubmition(formObj)
{if(formObj['selectedDirection'][0].checked==true)
{var otherDirection="from";}
else
{var otherDirection="to";}
var selectedProv=formObj["Pv"].selectedIndex;var objValue=formObj["Pv"][selectedProv].value;formObj[otherDirection+"St"].value=formObj["St"].value;formObj[otherDirection+"Ci"].value=formObj["Ci"].value;formObj[otherDirection+"Pv"].value=objValue;formObj[otherDirection+"Pc"].value=formObj["Pc"].value;return true;}