
function externalLinks() { 
		if (!document.getElementsByTagName) return; 
		var anchors = document.getElementsByTagName("a"); 
		for (var i=0; i<anchors.length; i++) { 
			var anchor = anchors[i]; 
			if (anchor.getAttribute("href") && 	anchor.getAttribute("rel") == "External") 
				anchor.target = "_blank"; 
		 }
		 
		var forms = document.getElementsByTagName("form"); 
		for(var i = 0; i < forms.length; i++) 
		{ 
		   var form = forms[i]; 
		   if(form.getAttribute("action").substring(0, 4) == "http") 
		   { 
		      form.target = "_blank"; 
		   } 
		} 
		
		if (!document.getElementsByTagName) return; 
		var anchors = document.getElementsByTagName("a"); 
		for (var i=0; i<anchors.length; i++) { 
			var anchor = anchors[i]; 
			if (anchor.getAttribute("href") && 	anchor.getAttribute("rel") == "Parent") 
				anchor.target = "_parent"; 
		 }
}		 

window.onload = function() {
	JourneyPlannerInit();
	externalLinks();
	populateDeparture();
}







function submitform()
{
  document.getElementById('searchform').submit();
}

function populateDeparture()
{
	/*var depart = document.getElementById('depart');
	depart.length=0;
	for(var i=0;i<aStations.length;i++)
	{
	depart.options[i] = new Option(aStations[i][1], aStations[i][0]);
	}
	depart.selectedIndex=0;
	populateArrival();
	
	showDates(); */
}

function populateArrival()
{
	var arrival = document.getElementById('arrival');
	var depart = document.getElementById('depart');
	arrival.length=0;
	for(var i=0;i<aStations.length;i++)
	{
		if(depart.options[depart.options.selectedIndex].value!=aStations[i][0])
		{
			arrival.options[arrival.options.length] = new Option(aStations[i][1], aStations[i][0]);
		}
	}
	arrival.selectedIndex=arrival.options.length-1;
}

function updateSelects(Ym)
{
	var ymSelect = document.getElementById("monthselect");
	for(i=0;i<ymSelect.options.length;i++)
	{
		if(ymSelect.options[i].value == Ym) ymSelect.options.selectedIndex = i;
	}
	showDates();
	showDates2();
}


$(document).ready(
	function(){
		$("#return").click( function() {
			$("#ret").toggle(100);
		});
	});
	
	
	
	
	
	
	
	