function productStart() {
	
	var pestanas = document.getElementById('pestanas');
	pestanaNum=0;
	
	// Comprobamos si se desea entrar directamente en alguna pestaņa
	pestanaActual = getPestanaActual();
	if (!document.getElementById(pestanaActual))	{
		pestanaActual = "p1";
	}
	
	for(jj=0;jj<pestanas.childNodes.length;jj++){
		if (pestanas.childNodes[jj].nodeName == "LI") {
			if (pestanas.childNodes[jj].getAttribute("id")== "p" + pestanaActual) {
				pestanas.childNodes[jj].firstChild.className= "active";
			}
			pestanas.childNodes[jj].onclick = function(){
				//alert(this.childNodes[0].hash);
				showPestana(this.childNodes[0].hash.substring(1,this.childNodes[0].hash.length));
				for(xx=0;xx<pestanas.childNodes.length;xx++){
					if (pestanas.childNodes[xx].nodeName == "LI") {
						//alert(pestanas.childNodes[xx]);
						if (pestanas.childNodes[xx].getAttribute("id") == this.getAttribute("id")) {
							pestanas.childNodes[xx].firstChild.className= "active";
						} else {
							pestanas.childNodes[xx].firstChild.className= "noActive";
						}
					}
				}
			}
		}
	}	
	
	//abrimos directamente la pestaņa que nos interesa
	switch (pestanaActual){
		case "p2":
			showPestana("p2");
			break;
		case "p3":
			showPestana("p3");
			break;
		case "p4":
			showPestana("p4");
			break;
		case "p5":
			showPestana("p5");
			break;
		default : 
			showPestana("p1");
	}
}

function showPestana(x) {
	var arrayPestanas=new Array();
	
	for(i=0;i<5;i++){
		num=i+1;
		if(document.getElementById('p'+num)){ arrayPestanas[i]=document.getElementById('p'+num);}
	}	
	
	for(i=0;i<arrayPestanas.length;i++){
		arrayPestanas[i].style.display="none";
	}
	
	for(ii=0;ii<5;ii++){
		num=i+1;
		if(document.getElementById('p'+num)){ arrayPestanas[i]=document.getElementById('p'+num);}
	}	
	
	for(i=0;i<arrayPestanas.length;i++){
		arrayPestanas[i].style.display="none";
	}
	
	document.getElementById(x).style.display ="block";
}

function getPestanaActual() {
	aa = document.location.toString();
	return_value = '';
	posAlmoadilla = aa.indexOf('#');
	return_value = aa.substr(posAlmoadilla +1,aa.length);
	return return_value;
}

