$(document).ready(function() {

	var lineNumber = getParameterByName('ln');
	var titleEl = document.getElementById('stationtitle');
	
	document.getElementById('subcommand').innerHTML = "<button onclick=\"location.href='mapLineaM.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 '4':
				lineNeeded = Linea4;
				break;
			case '5':
				lineNeeded = Linea5;
				break;
			case '6':
				lineNeeded = Linea6;
				break;
			case '7':
				lineNeeded = Linea7;
				break;
			case '8':
				lineNeeded = Linea8;
				break;
			case '9':
				lineNeeded = Linea9;
				break;
			case 'A':
				lineNeeded = LineaA;
				break;
			case 'B':
				lineNeeded = LineaB;
				break;
			case "12":
				lineNeeded = Linea12;
				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=\"estacionMetro.html?from=estacionesMetro.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;
});
