$(document).ready(function() {

	var lineNumber = getParameterByName('ln');
	var titleEl = document.getElementById('stationtitle');
	
	document.getElementById('subcommand').innerHTML = "<button onclick=\"location.href='mapLineaMB.html?ln="+lineNumber+"'\"><span class=\"icon icon-mapa\">ruta</span></button>";
	
		titleEl.innerHTML = titleEl.innerHTML + 
		"<h1 data-l10n-id=\"line-number\" data-l10n-args='{ \"number\": \""+lineNumber+"\" }'></h1>"
		
		var lineNeeded = null;
		
		switch(lineNumber) {
			case '1':
				lineNeeded = Linea1;
				break;
			case '2':
				lineNeeded = Linea2;
				break;
			case '3':
				lineNeeded = Linea3;
				break;
			case '4N':
				lineNeeded = Linea4N;
				break;
			case '4S':
				lineNeeded = Linea4S;
				break;
			case '5':
				lineNeeded = Linea5;
				break;
			
		}
		
		//console.log(lineNeeded.nombre);
		
		var stationsList = "";
		
		for (var i = 0; i < lineNeeded.estaciones.length; i++) {
			 
			 var cur = lineNeeded.estaciones[i];
			 
			 stationsList += "<li>" +
								"<a class=\"acontainer\" href=\"estacionMetrobus.html?from=estacionesMetrobus.html&nombre="+cur.nombre+"&imagen="+cur.image+"&lt="+cur.lt+"&ll="+cur.ll+"&descripcion="+cur.descripcion+"&ln="+lineNumber+"\">&nbsp;</a>" +
								"<aside class=\"pack-end\">" +
								"  <img alt=\"placeholder\" src=\"."+cur.image+"\">" +
								"</aside>" +
								"<a href=\"#\" >" +
								"  <p class=\"bl\">"+cur.nombre+"</p>" +
								"</a>" +
							  "</li>";
		}
		
		document.getElementById('loadLinesHere').innerHTML = stationsList;
});
