var stage1="";
var stage2="";
var stage3="";
var aciertosDaily=0;
var aciertosTime=0;

function playBgMusic(){
    createjs.Sound.play("fondumusica0", {loop:-1});
}
function playDialog(dialog){
	stopAllAudio();
	switch (dialog){
        case "dialogo1_b1":
            avanceDaily();
            playSound("d1_b1");
            break;
        case "dialogo1_b2":
            avanceDaily();
            playSound("d1_b2");
            break;
        case "dialogo1_b3":
            avanceDaily();
            playSound("d1_b3");
            break;
        case "dialogo2_b1":
            avanceDaily();
            playSound("d2_b1");
            break;
        case "dialogo2_b2":
            avanceDaily();
            playSound("d2_b2");
            break;
        case "dialogo2_b3":
            avanceDaily();
            playSound("d2_b3");
            break;
        case "dialogo2_b4":
            avanceDaily();
            playSound("d2_b4");
            break;
        case "dialogo2_b4":
            avanceDaily();
            playSound("d2_b4");
            break;
        case "dialogo2_b5":
            avanceDaily();
            playSound("d2_b5");
            break;
        case "dialogo2_b6":
            avanceDaily();
            playSound("d2_b6");
            break;
        case "dialogo2_b7":
            avanceDaily();
            playSound("d2_b7");
            break;
        case "dialogo2_b8":
            avanceDaily();
            playSound("d2_b8");
            break;
		case "dialogo3_b1":
            avanceDaily();
            playSound("d3_b1");
            break;
        case "dialogo3_b2":
            avanceDaily();
            playSound("d3_b2");
            break;
        case "dialogo3_b3":
            avanceDaily();
            playSound("d3_b3");
            break;
		case "dialogo4_b1":
            avanceDaily();
            playSound("d4_b1");
            break;
        case "dialogo4_b2":
            avanceDaily();
            playSound("d4_b2");
            break;
        case "dialogo4_b3":
            avanceDaily();
            playSound("d4_b3");
            break;
		case "dialogo4_b4":
            avanceDaily();
            playSound("d4_b4");
            break;
		case "dialogo4_b5":
            avanceDaily();
            playSound("d4_b5");
            break;
		case "dialogo5_b1":
            avanceDaily();
            playSound("d5_b1");
            break;
		case "dialogo5_b2":
            avanceDaily();
            playSound("d5_b2");
            break;
		case "dialogo6_b1":
            avanceDaily();
            playSound("d6_b1");
            break;
		case "dialogo6_b2":
            avanceDaily();
            playSound("d6_b2");
            break;
		case "dialogo6_b3":
            avanceDaily();
            playSound("d6_b3");
            break;
        case "dialogo7_b1":
            avanceDaily();
            playSound("d7_b1");
            break;
        case "dialogo8_b1":
            avanceDaily();
            playSound("d8_b1");
            break;
        case "dialogo8_b2":
            avanceDaily();
            playSound("d8_b2");
            break;
        case "dialogo8_b3":
            avanceDaily();
            playSound("d8_b3");
            break;
        case "dialogo8_b4":
            avanceDaily();
            playSound("d8_b4");
            break;
        case "dialogo9_b1":
            avanceDaily();
            playSound("d9_b1");
            //------ Termina Daily
            break;



        case "dialogo11_b1":
            avanceTime();
            playSound("d11_b1");
            break;
        case "dialogo11_b2":
            avanceTime();
            playSound("d11_b2");
            break;
        case "dialogo12_b1":
            avanceTime();
            playSound("d12_b1");
            break;
        case "dialogo13_b1":
            avanceTime();
            playSound("d13_b1");
            break;
        case "dialogo14_b1":
            avanceTime();
            playSound("d14_b1");
            break;
        case "dialogo14_b2":
            avanceTime();
            playSound("d14_b2");
            break;
        case "dialogo14_b3":
            avanceTime();
            playSound("d14_b3");
            break;
        case "dialogo14_b4":
            avanceTime();
            playSound("d14_b4");
            break;
        case "dialogo14_b5":
            avanceTime();
            playSound("d14_b5");
            break;
        case "dialogo15_b1":
            avanceTime();
            playSound("d15_b1");
            break;
        default: 
			playSound("d1_b1");   
    }
}

function stopAllAudio(){
	createjs.Sound.stop("d1_b1");
}

function avanceDaily(){
    aciertosDaily++;
    if(aciertosDaily<=33){
        //document.getElementById("counterDaily").innerHTML = aciertosDaily+"/33";
    }else if(aciertosDaily>32){
        //document.getElementById("counterDaily").innerHTML = "Listo! ya puedes ver el examen";
    }
}

function avanceTime(){
    aciertosTime++;
    if(aciertosTime<=11){
        //document.getElementById("counterTime").innerHTML = aciertosTime+"/11";
    }else if(aciertosTime>10){
        //document.getElementById("counterTime").innerHTML = "Listo! ya puedes ver el examen";
    }
}

