
function he(form, event)
{
var vError ='';
var vState ='return';

	if (event == 'SelectStartType')
	{		
		form.FormState.value = event;
		form.Start.value = '';
		vState = 'submit';
	}

	if (event == 'SelectEndType')
	{		
		form.FormState.value = event;
		form.End.value = '';
		vState = 'submit';
	}

	if (event == 'SelectStart')
	{		
	/*	form.Start.value = form.SelectStart[form.SelectStart.selectedIndex].text;
		form.StartGeo.value = form.SelectStart[form.SelectStart.selectedIndex].value;
		vState = 'return';
	*/
		var StartValue = form.SelectStart[form.SelectStart.selectedIndex].text;
		form.Start.value = StartValue; 
		form.StartGeo.value = form.SelectStart[form.SelectStart.selectedIndex].value;
		
		var indexBrackBegin = form.Start.value.search(/\(/);
		var indexBrackEnd = form.Start.value.search(/\)/);
		
		if( indexBrackBegin >=0 && indexBrackEnd >=0)
		{
		 
		  form.Start.value = StartValue.substring(indexBrackBegin+1, indexBrackEnd);
		
		  if(form.Start.value == '' || form.Start.value == ' ')
			form.Start.value = StartValue.substring(0, indexBrackBegin-1);
		
		}
		else
		  form.Start.value = StartValue;
		vState = 'return';
	}

	if (event == 'SelectEnd')
	{		
	/*	form.End.value = form.SelectEnd[form.SelectEnd.selectedIndex].text;
		form.EndGeo.value = form.SelectEnd[form.SelectEnd.selectedIndex].value;
		vState = 'return'; */

		var EndValue = form.SelectEnd[form.SelectEnd.selectedIndex].text;
		form.End.value = EndValue; 
		form.EndGeo.value = form.SelectEnd[form.SelectEnd.selectedIndex].value;
		
		var indexBrackBegin = form.End.value.search(/\(/);
		var indexBrackEnd = form.End.value.search(/\)/);
		
		if( indexBrackBegin >=0 && indexBrackEnd >=0)
		{
		 
		  form.End.value = EndValue.substring(indexBrackBegin+1, indexBrackEnd);
		
		  if(form.End.value == '' || form.End.value == ' ')
			form.End.value = EndValue.substring(0, indexBrackBegin-1);
		
		}
		else
		  form.End.value = EndValue;
		vState = 'return';
	}

	if (event == 'MatchOrigin')
	{		
		form.Start.value = form.MatchOrigin[form.MatchOrigin.selectedIndex].text;
		form.StartGeo.value = form.MatchOrigin[form.MatchOrigin.selectedIndex].value;
	}

	if (event == 'MatchDestination')
	{		
		form.End.value = form.MatchDestination[form.MatchDestination.selectedIndex].text;
		form.EndGeo.value = form.MatchDestination[form.MatchDestination.selectedIndex].value;
	}
	
	if (event == 'SetLocation')
	{		
		form.FormState.value = event;
		vState = 'submit';
	}

	if (event == 'SetMorningTimes')
	{		
	 	form.FromTime.value = '5:00';
		form.FromMeridian[0].checked = true;
		form.ToTime.value = '12:00';
		form.ToMeridian[1].checked = true;
	}

	if (event == 'SetAfternoonTimes')
	{		
	 	form.FromTime.value = '12:00';
		form.FromMeridian[1].checked = true;
		form.ToTime.value = '6:00';
		form.ToMeridian[1].checked = true;
	}

	if (event == 'SetEveningTimes')
	{		
	 	form.FromTime.value = '6:00';
		form.FromMeridian[1].checked = true;
		form.ToTime.value = '5:00';
		form.ToMeridian[0].checked = true;
	}

	if (event == 'SetDayTimes')
	{		
	 	form.FromTime.value = '5:00';
		form.FromMeridian[0].checked = true;
		form.ToTime.value = '4:59';
		form.ToMeridian[0].checked = true;
	}

	if (event == 'SetStops')
	{		
		form.StopCategory[2].checked = true;
	}

	if (event == 'ScheduleLookupSearch')
	{
 		if (form.LineName.value=='')
		{
		 vError += 'Please enter a Route or pick from the list';
		}
  }
  
	if (event == 'HeadwaySheet')
  {
 		if (form.LineName.value=='')
		{
	  	 vError += 'Please enter a Route or pick from the list';
		}
		form.FormState.value = event;
  }
	
	if (event == 'TripPlanningSched')
  {
 		if (form.LineName.value=='')
		{
  		 vError += 'Please enter a Route';
		}
  }

 if (event == 'iLocationLookup')
 {
 		if (form.Start.value=='')
		{
		 vError += 'Please enter a location';
		}

 }
 
 if (event == 'iStopLookup')
 {
 		if (form.StopNumber.value=='')
		{
		 vError += 'Please enter a stop number';
		}

 }

 if (event == 'iNextBusFind' || event == 'iNextBus' )
 {
 		if (form.StopNumber.value=='')
		{
		 vError += 'Please enter a stop number, or use the location form below to find your closest stop';
		}

 }

 if (event == 'TripPlan')
	{
	if (form.End.value=='') 
	{
		vError += 'Please enter a destination\n';
	}
		
	if (form.Start.value=='')
	{
		vError += 'Please enter an origin\n';
	}

	if (form.End.value==form.Start.value) 
	{
		vError += 'The locations are the same\n';
	}

	if (vError == '')
	{
	 form.FormState.value = 'Valid';
	}

	}
	
	if (vState == 'submit' && vError == '')
	{
	 form.submit();
	 return true;
	}
 	else if (vState == 'return' && vError == '')
	{ 
		return true;
	}
	else
	{
	 alert(vError);
	 return false;
	}
	
}

function setScheduleFormState(form,state)
{
	form.FormState.value = state;
	if (state == 'iHeadwaySheet')
	{
		form.OnlyStops.value = '0';
	}
	else
	{
		form.OnlyStops.value = '1';
	}
}

function setNextStop(id,lonlat)
{
 document.RF.SN.value = id;
 document.RF.GEO.value = lonlat;
 document.RF.submit();
	if (event == "SetNextStop")
	{		
		form.StopId.value = id;
		form.StopGeo.value = lonlat;
		document.RF.submit();
	}
}


function showDate() 
{

var d=new Date()
var weekday=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var monthname=new Array("Jan.","Feb.","Mar.","Apr.","May","Jun.","Jul.","Aug.","Sep.","Oct.","Nov.","Dec.")

document.write(weekday[d.getDay()] + " - ")
document.write(monthname[d.getMonth()])
document.write(" " + d.getDate() + ", ")
document.write(d.getFullYear())
}

function printPage()
{
	if (navigator.appName == "Netscape") 
	{
       	window.print();
	}
	else
	{
	 if (confirm("Print this page?")) window.print();
	}
}
function popup(mylink, windowname, param)
{	
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, param);
return false;
}
function printHandle(form,route)
{
	
	//var url= "http://www.yorkregiontransit.com/" + route + ".pdf";
	var url= "http://www.yrt.ca/maps/navigators/" + route + ".pdf";

	if(form.PLayout[2].checked == true)
	{		
		window.open(url);
		return false;
	}
	return true;
}

function showPopup(id)
{
	


	var HTMLStr;

	var sizeX = 250;
	var sizeY = 250;	
	var locX =  20;
	var browser=navigator.appName
	if (browser=="Microsoft Internet Explorer")
		locY = window.event.y - 2;
	else 
		locY = 10;

   var part1  = "<table cellpadding=0 cellspacing=0 style='border-style:solid;border-color: #42B4E6;'><tr><td><table cellpadding=0 cellspacing=0 border=0 width=100%><tr bgcolor=#42B4E6><td width=10/><td valign=middle class=white>";	
	var part2  = "</td> <td valign=top width=35% class=whitebold align=right>";
	if (browser=="Microsoft Internet Explorer")
		part2 += "<img src='FILE/Apps/Info/images/closepop.jpg' align=top onclick='parent.oPopup.hide();'/>";
		part2 += "</td><td width=10/></tr></table><table bgcolor=#FFFFFF cellpadding=10 cellspacing=0 border=0 width=100%><tr><td>";
   var part3  = "<small>Send your comments to transitinfo@york.ca. We regularly record and review feedback, however we are not able to respond to every submission.</small><br/><br/></td></tr></table></td></tr></table>";

	if (id == "template1" )
	{
		HTMLStr = part1 + "--<b>TITLE</b>--Help" + part2 + "--BODY--" + part3;
      var sizeX = 250;
      var sizeY = 250;
	}	
   else if (id == "trip_from" )
	{
		HTMLStr =  part1 + "<b>From</b> Help" + part2 + "<p>Enter the <b>starting</b> address, intersection, bus stop number or landmark where your ride <b>begins</b>.  Your information can be entered like this:</p><p><table cellspacing=4><tbody><tr valign=top><td>Address:</td><td>" + "<img src='FILE/Apps/Info/images/From-address.gif'/><br/>" + "</td></tr><tr><td height=2/></tr><tr valign=top><td>Intersection:</td><td>" + "<img src='FILE/Apps/Info/images/From-intersection1.gif'/>" + "<br/><b>&nbsp;<i>or</i></b><br/> <img src='FILE/Apps/Info/images/From-intersection2.gif'/><br/></td></tr><tr><td height=2/></tr><tr valign=top><td>Landmark:</td><td><img src='FILE/Apps/Info/images/From-landmark.gif'/><br/></td></tr></tbody></table></p><p>If your address is similar to something else, you will be asked to confirm your choice from a list of possible matches.</p><p align=center><img src='FILE/Apps/Info/images/From-list.gif'/></p><p><b>Tip:</b> If you are having trouble matching your address or intersection, try it without  unit/suite numbers, street suffixes (i.e. St., Ave., Pl.) and/or directions (i.e. N, S, E, W).</p><p><b>Landmarks:</b> Use the landmark dropdown menu to search for landmarks by category, such as shopping, recreation and medical destinations.</p><p align=center><img src='FILE/Apps/Info/images/Landmark-dropdown.gif'/> </p><p><b>Bus Stop Numbers:</b> If you use bus stop numbers in the From or To fields, your results may include the use of other bus stops in the area.</p><p><b>Note:</b> Not ALL landmarks in York Region are in the drop-down menu. If you are having problems with a landmark, try entering its address. YRT/Viva services operate south of Steeles Avenue into the City of Toronto only at select locations. If you enter a Toronto address or location outside of the YRT/Viva service area, you will not be able to complete a ride Plan. Toronto to Toronto trips on YRT/Viva are not allowed. For Toronto local service please contact TTC at (416) 393-4636. </p>" + part3;
		locY = 60;		
      var sizeX = 470;
      var sizeY = 555;
	}		
	else if (id == "trip_to" )
	{
		HTMLStr = part1 + "<b>To</b> Help" + part2 + "<p>Enter the <b>destination</b> address, intersection, bus stop number or landmark where your ride <b>ends</b>.  Your information can be entered like this:</p><p><table cellspacing=4><tbody><tr valign=top><td>Address:</td><td><img src='FILE/Apps/Info/images/To-address.gif'/><br/></td></tr><tr><td height=2/></tr><tr valign=top><td>Intersection:</td><td><img src='FILE/Apps/Info/images/From-intersection1.gif'/><br/><b>&nbsp;<i>or</i></b><br/> <img src='FILE/Apps/Info/images/From-intersection2.gif'/><br/></td></tr><tr><td height=2/></tr><tr valign=top><td>Landmark:</td><td><img src='FILE/Apps/Info/images/To-landmark.gif'/><br/></td></tr></tbody></table></p><p>If your address is similar to something else, you will be asked to confirm your choice from a list of possible matches.<p align=center><img src='FILE/Apps/Info/images/From-list.gif'/></p></p><p><b>Tip:</b> If you are having trouble matching your address or intersection, try it without  unit/suite numbers, street suffixes (i.e. St., Ave., Pl.) and/or directions (i.e. N, S, E, W).</p><p><b>Landmarks:</b> Use the landmark dropdown menu to search for landmarks by category, such as shopping, recreation and medical destinations.</p><p align=center><img src='FILE/Apps/Info/images/Landmark-dropdown.gif'/> </p><p><b>Bus Stop Numbers:</b> If you use bus stop numbers in the From or To fields, your results may include the use of other bus stops in the area.</p><p><b>Note:</b>Not ALL landmarks in York Region are in the drop-down menu. If you are having problems with a landmark, try entering its address. YRT/Viva services operate south of Steeles Avenue into the City of Toronto only at select locations. If you enter a Toronto address or location outside of the YRT/Viva service area, you will not be able to complete a ride Plan. Toronto to Toronto trips on YRT/Viva are not allowed. For Toronto local service please contact TTC at (416) 393-4636. </p>" + part3;
      locY = 60;			
      var sizeX = 460;
      var sizeY = 555;
	}
	else if (id == "trip_when" )
	{
		HTMLStr = part1 + "<b>When</b> Help" + part2 + "<p>Enter the <b>time</b> and <b>date</b> for your ride. </p><p>Choose the <b>time</b> based on when you want to <b>LEAVE</b> or when you want to <b>ARRIVE</b>. The default selection is <b>LEAVE</b>.  You can change this by clicking the drop-down menu and choosing <b>ARRIVE</b>. The default time is a few minutes later than the current time.  If you need to change the time, use the drop-down clock and be sure to specify a.m. or p.m. <b>For travel times between 12 midnight and 3:55 a.m., please select ‘x’ from the drop-down menu.</b></p><p><b>Note: </b>The trip planner may search up to 30 minutes before and 1.5 hours after the time you have entered.  This means you may see some ride Plan results that start before your desired time. If you are planning a trip where routes may have longer than average service frequencies (most common in rural areas), your desired time may not produce a ride Plan. You may get a better result by adjusting your desired time plus or minus 30 minutes.</p><p>The default <b>date</b> is today. If you are planning a ride for a future date, click the calendar icon to choose your date. Date selection is important as YRT/Viva provides different levels of service on different days. A weekday ride may not be available on the weekend, or on a future weekday after a service change.  </p><p><b>Note:</b> You can complete ride Plans for up to one month into the future at most times of the year.  At other times, future schedules may not be available and rideQuest will be able to search two to four weeks into the future. </p>" + part3;
      locY = 60;			
      var sizeX = 450;
      var sizeY = 500;
	}		
	else if (id == "trip_sort" )
	{
		HTMLStr = part1 + "<b>Sort Results</b> Help" + part2 + "<p>You can sort your ride results by shortest total trip time, least amount of walking or least amount of transfers along the way. The default choice is Shortest Time. Click the button beside a different sort option to choose it.</p>" + part3;
      locY = 350;		
      var sizeX = 450;
      var sizeY = 150;
	}			
	else if (id == "trip_select" )
	{
		HTMLStr = part1 + "<b>Select One<b> Help" + part2 + "<p>This section determines the right service for you.  The default selection is <b>I am interested in YRT, Viva and TTC contracted services</b>, which will offer a wide variety of options.</p><p>If you are connecting to a GO Transit Train, selecting <b>I am travelling to/from a GO Train Station</b> will offer specialized YRT GO Shuttle options</p><p>If you are travelling to a high school, selecting <b>I am travelling to/from a high school</b> will offer High School Special options.</p><p>If you are interested in Express services, selecting <b>I am interested in Express services </b>will offer specialized Express options.</p>" + part3;
      locY = 220;	
      var sizeX = 450;
      var sizeY = 320;
	}			
	else if (id == "trip_results" )
	{
		HTMLStr = part1 + "<b>ride Results</b> Help" + part2 + "<p>The search information you entered into rideQuest is listed at the top of the page</p><p><ul><li>From: Where your ride begins</li><li>To:  Where your ride ends.</li><li>When:  The date and time of your ride</li><li>Effective: Whether your ride is valid for Weekday, Saturday or Sunday/Holiday service, and the time period for which schedules are currently available.</li><li>Sorted by:  Whether your results are sorted by time, transfers or walking distance.</li></ul></p><p><b>Note:</b> ride Results may vary from one day to the next and are subject to regular service changes. Weekday and weekend service levels may be different and ride Plans valid today, may not be valid another day.</p><p><b>ride Options:</b> Choose your final ride Plan from the list of options on this page. What you see is an overview of each option, outlining the route(s) used, start time, arrival time, total duration of the ride, number of transfers required, approximate walking distance and cash fare. For other discounted ticket and pass options, visit our <u>Fares</u> page.</p><p>To view a complete ride Plan, click the <b>Details</b> button to the left of the option.</p><p>To plan a different ride, click <b>NEW RIDE</b> to return to a new rideQuest start screen.</p>" + part3;
      locY = 100;			
      var sizeX = 450;
      var sizeY = 540;
	}		
	else if (id == "trip_details" )
	{
		HTMLStr = part1 + "<b>ride Plan<b> Help" + part2 + "<p>Your <b>ride Plan</b> provides all of the routes, transfers, departures and arrival times for your ride. A map displays the path from your starting point to your end point.</p><p>You can print this page by clicking the print button in the upper right hand corner. Click <b>Back</b> in your internet browser tool bar to see your ride Results options again.</p><p>To plan a return ride, click <b>Return Ride</b>. This will reverse your From and To points on a new rideQuest screen. Select a return time and click 'GO.'</p><P><B>Bus Stop Names:</B> You may see your bus stop names in a variety of formats.</P><P><B>YONGE / MULOCK SB</B> – This means Yonge St AT Mulock Ave.</P><P><B>JOHN BUTTON BLVD OP MELCHIOR</B> – This means John Button Blvd OPPOSITE Melchior Rd. There is an opposite street, but not an intersecting street at this location.</P><P><B>14TH AV STOP # 1603</B> – This means 14th Ave., bus stop number 1603. There are no intersecting or opposite streets at this location.</P><P><B>Stay-in-seat Transfers:</B> If the phrase (Stay on the same vehicle) appears anywhere in your ride Plan, it means that a ‘Stay-in-seat’ transfer occurs on your trip. Your bus may be changing into a different route, or going in a different direction. Although this is considered a type of transfer, you can stay on the same vehicle.</P><P><B>Printing:</B> You can print your ride Plan by clicking the print button at the top right of the page, or by choosing file and print from the top left of your internet browser tool bar. If your ride Plan does not fit inside the page, try adjusting your print margin settings.</P><P><B>50 Cents to GO:</B>  With a valid GO Train ticket or pass you can travel to or from the GO Train station for just 50 cents. Visit our GO Transit page for full details (http://www.yrt.ca/services/go-transit-in-york-region.asp).</P><p><b>Note:</b> Before using your ride Plan, review our Commuter Alerts page (http://www.yrt.ca/news/commuter-alerts.asp) for any detours or major delays that may affect your ride.</p>" + part3; 
		var sizeX = 550;
      var sizeY = 610;
	}		
	else if (id == "schedule_help" )
	{
		HTMLStr = part1 + "<b>Schedule Finder</b> Help" + part2 + "<p>Enter your route number or select a route from the YRT, Viva or TTC contracted routes in York Region drop down menu. </p><p>If you are entering a route number, enter the number only, not the route name. You cannot spell the number. Do enter not the route name or branch letters for that route. For Viva routes, please enter “Viva” followed by the colour. For example, “Viva blue,” not “blue.”</p><p>Click “GO” to continue.</p>" + part3;
		var sizeX = 450;
      var sizeY = 280;
	}
	else if (id == "schedule_help2a" )
	{
		HTMLStr = part1 + "<b>Schedule Finder</b> Help" + part2 + "<p>Select the <b>direction</b> of your travel. Keep in mind that this indicates the general direction of travel.  Most bus routes do not travel entirely east, west, north or south.</p><p>Enter the <b>date</b> of travel. The default date is today.  Click the calendar icon to select a future date. </p>" + part3;
		var sizeX = 450;
      var sizeY = 195;
	}	
	else if (id == "schedule_help2b" )
	{
		HTMLStr = part1 + "<b>Schedule Finder</b> Help" + part2 + "<p>Select your time of day.  The default choice is “All Day,” but you can also choose Morning, Afternoon or Evening by clicking the button to the left of the option. The      drop-down clocks will automatically fill in the correct times for your choice. If you have a very specific window of time, enter the start and end times in the start and end drop-down clocks. Be sure to specify a.m. or p.m.</p><p>Click “NEXT” to continue.</p>" + part3;
		var sizeX = 450;
      var sizeY = 225;
	}		
	else if (id == "schedule_help3" )
	{
		HTMLStr = part1 + "<b>Schedule Finder</b> Help" + part2 + "<p>The information you entered into Schedule Finder is listed at the top of the page. </p><p>Route: The route you have selected.<br/>Direction: The direction of schedule you are looking for.<br/>Time of Day: The time of day and date you have requested.</p><p>You can now choose to view all major stops along the route, or select specific stops from a list.  Times shown in bold are Major Stops.  Stops between these are estimated based on normal service conditions. Actual times may vary.</p><p>The default selection is “All major stops.” To select from the list instead, click the boxes next to the stops of your choice. To continue, click “GET SCHEDULE.”</p><p><b>Note:</b>Before using your schedule, please check our <u>Commuter Alerts</u> section for any major detours or delays that may affect your route.</p>" + part3; 
      locY = 150;		
		var sizeX = 450;
      var sizeY = 370;
	}		
	else if (id == "headway" )
	{
		HTMLStr = part1 + "<b>Schedule Finder</b> Help" + part2 + "<p>The information you entered into Schedule Finder is listed at the top of the page. </p><p>Route: The route you have selected.<br/>Direction: The direction of schedule you are looking for.<br/>Time of Day: The time of day and date you have requested.<br/>Effective: The current time period that this schedule is available.</p><p>Click “Choose new time” under the Time of Day section to search for a different time on the same day.  Enter a new time period and click “REFRESH” to see the new times.</p><p><b>Viewing and Scrolling</b></p><p>You may have to scroll up/down and left/right to view your complete schedule. If the detail at the top of the page is out of sight, you can mouse-over any times within the schedule for a pop-up of route, bus stop location and destination information. Any important schedule notes for this route will appear at the top of the schedule.</p><p><b>Printing</b></p><p>You can print a schedule by clicking the print button in the upper right hand corner of the page. If you have selected “All major stops,” you will be able to print a Route Navigator, which provides you with a map and a return schedule in the opposite direction. Try adjusting your print margin settings if your schedule is not fitting to the page.</p><p>If you have selected specific stops rather than all major stops, you can print a schedule with your chosen specific bus stop times, or print a Route Navigator. The Route Navigator shows major stops only, so stops selected from the all stops list may not appear. You need Adobe Acrobat Reader to open and read pdf files.  To download a free version, visit <a href='http://www.adobe.com'>www.adobe.com</a></p><P><B>Bus Stop Names:</B> You may see your bus stop names in a variety of formats.</P><P><B>YONGE / MULOCK SB</B> – This means Yonge St AT Mulock Ave.</P><P><B>JOHN BUTTON BLVD OP MELCHIOR</B> – This means John Button Blvd OPPOSITE Melchior Rd. There is an opposite street, but not an intersecting street at this location.</P><P><B>14TH AV STOP # 1603</B> – This means 14th Ave., bus stop number 1603. There are no intersecting or opposite streets at this location.</P><hr/><P><B>Note:</B> Before using your schedule, please check our <a href='http://www.yrt.ca/news/commuter-alerts.asp'>Commuter Alerts</a> section for any major detours or delays that may affect your route.</P>" + part3;
      locY = 10;	
		var sizeX = 680;
      var sizeY = 700;
	}		
	else if (id == "nextbus" )
	{
		HTMLStr = part1 + "<b>Next Bus</b> Help" + part2 + "<p>Next Bus provides the next five departure times for a specific bus stop.</p><p>You need a four-digit <b>bus stop number</b> to find Next Bus schedules. If you don’t know your bus stop number, click <b>find your stop.</b></p><p>If you have a bus stop number, enter the number and the date and time you want to travel. The default date is today.  If you plan to travel on a future date, click the calendar icon and choose the day. The default time is a few minutes from the current time. If you plan to travel at a different time, use the drop-down clock. Be sure to specify a.m. or p.m.</p><p><b>Tip:</b> Make note of your <b>bus stop number</b> to find Next Bus schedules quickly and easily each time you visit.</p>" + part3;
		var sizeX = 450;
      var sizeY = 350;
	}	
	else if (id == "nextbus2" )
	{
		HTMLStr = part1 + "<b>Next Bus</b> Help" + part2 + "<p>The bus stop number, bus stop location and date are at the top of the page.</p><P><B>Bus Stop Names:</B> You may see your bus stop names in a variety of formats.</P><P><B>YONGE / MULOCK SB</B> – This means Yonge St AT Mulock Ave.</P><P><B>JOHN BUTTON BLVD OP MELCHIOR</B> – This means John Button Blvd OPPOSITE Melchior Rd. There is an opposite street, but not an intersecting street at this location.</P><P><B>14TH AV STOP # 1603</B> – This means 14th Ave., bus stop number 1603. There are no intersecting or opposite streets at this location.</P><hr/><p>Up to five departure times are listed for your stop, along with the route number, route name and direction.</p><p>If other routes serve this stop, they will appear in an “All routes stopping at this location” list.  To see a schedule for these routes, click “Today’s Schedule” under in the “View Schedule” column.</p><p>The map shows where your stop is located.</p><p>To look for Next Bus times at a different stop, click “NEW SEARCH.”</p>" + part3;
		var sizeX = 450;
      var sizeY = 530;
	}	
	else if (id == "stoplookup" )
	{
		HTMLStr = part1 + "<b>Closest Stop</b> Help" + part2 + "<p>Closest Stop can locate the nearest YRT/Viva stops in or around a location. Enter an address, intersection, stop number or landmark. Your information can be entered like this:</p><p><table><tbody><tr><td>Address:</td><td>1 Bass Pro Mills</td></tr><tr><td>Intersection:</td><td>Jane and Rutherford <b>or</b> Jane @ Rutherford</td></tr><tr><td>Landmark:</td><td>Vaughan Mills Mall</td></tr></tbody></table></p><p><b>Tip:</b> If you are having trouble matching your address or intersection, try it without  unit/suite numbers, street suffixes (i.e. St., Ave., Pl.) and/or directions (i.e. N, S, E, W).</p><P><B>Bus Stop Names:</B> You may see your bus stop names in a variety of formats.</P><P><B>YONGE / MULOCK SB</B> – This means Yonge St AT Mulock Ave.</P><P><B>JOHN BUTTON BLVD OP MELCHIOR</B> – This means John Button Blvd OPPOSITE Melchior Rd. There is an opposite street, but not an intersecting street at this location.</P><P><B>14TH AV STOP # 1603</B> – This means 14th Ave., bus stop number 1603. There are no intersecting or opposite streets at this location.</P><hr/><p><b>Landmarks:</b> Use the landmark dropdown menu to search for landmarks by category, such as shopping, recreation and medical destinations.</p><p>Click “GO” to continue.</p><p><b>Note:</b> Not ALL landmarks in York Region are in the drop-down menu. If you are having problems with a landmark, try entering its address. YRT/Viva services operate south of Steeles Avenue into the City of Toronto only at select locations. If you enter a Toronto address or location outside of the YRT/Viva service area, you will not be able to complete a ride Plan. Toronto to Toronto trips on YRT/Viva are not allowed. For Toronto local service please contact TTC at (416) 393-4636. </p>" + part3;
		locY = 60;
		var sizeX = 550;
      		var sizeY = 655;
	}	
	
	
	if (browser!="Microsoft Internet Explorer")
	{ 
	   var windowHandle ;   
	   sizeY += 150;
	   sizeX += 10;
	   var parstr = "top=" + locY + ",left=" + locX + ",width=" + sizeX + ",height=" + sizeY + ",scrollbars=yes,resizable=yes,location=0,toolbar=no,menubar=no, status=no";
	
	
	   windowHandle = window.open('', 'help', parstr);	
	   windowHandle.document.title='YRT Help';
	   windowHandle.resizeTo(sizeX ,sizeY);	
	   windowHandle.document.close(); 
	   windowHandle.document.write(HTMLStr);
	   windowHandle.focus(); 
  
        }
	else
	{
	   var oPopupBody = oPopup.document.body;
	   oPopupBody.innerHTML = "<div style='overflow-x:auto; overflow-y:auto; height:550px'>" + HTMLStr + "</div>";
	   oPopup.show(locX, locY, sizeX, sizeY, document.body);
	}
}

function hidePopup()
{
	oPopup.hide();
}
