window.onload = prepareButton;
 
function prepareButton()
{
$("ir_menu").onclick=function(){
		window.location.href="../../menu.html";
}
$("cuento_aleatorio").onclick=function(){
		var num_aleatorio=aleatorioInt (1,10);
		switch (num_aleatorio){
		case 1: 
			window.location.href="los_3_cerditos.html";
			break;
		case 2:
			window.location.href="caperucita_roja.html";
			break;
		case 3:
			window.location.href="patito_feo.html";
			break;
		case 4:
			window.location.href="los_7_cabritillos.html";
			break;
		case 5:
			window.location.href="blancanieves.html";
			break;
		case 6: 
			window.location.href="alibaba.html";
			break;
		case 7: 
			window.location.href="hansel_y_gretel.html";
			break;
		case 8: 
			window.location.href="pulgarcita.html";
			break;
		case 9: 
			window.location.href="bella_durmiente.html";
			break;
		case 10: 
			window.location.href="ratoncito_perez.html";
			break;
	}
}
$("aumentaLetra").onclick=function() {
			resizeText(1,'texto_cuento');
			//resizeText(1,'texto_cuento2');
		}
$("reduceLetra").onclick=function() {
			resizeText(-1,'texto_cuento');
			//resizeText(-1,'texto_cuento2');
		}
$("ir_que_recuerdas").onclick=function(){
		var cuento=$('codigocuento').value;
		var url='../../juegos/recuerdas.html?cuento=' + cuento;
		window.location.href=url;
}
$("ir_mates").onclick=function(){
		window.location.href="../../juegos/sumas.html";
}		
}
function resizeText(multiplier,id_class) {
	var elements = document.getElementsByClassName(id_class);
	for (var i = 0; i < elements.length; i++) {
		if (elements[i].style.fontSize == "") {
				elements[i].style.fontSize = "14px";
		}		
		elements[i].style.fontSize = parseFloat(elements[i].style.fontSize) + (multiplier * 1) + "px";
	}
}



