var stage1="";
var stage2="";
var stage3="";

function playBgMusic(){
    createjs.Sound.play("fondumusica0", {loop:-1});
}
function playDialog(dialog){
	stopAllAudio();
	switch (dialog){
        case "dialogo1_b1":
            playSound("d1_b1");
            break;
        case "dialogo1_b2":
            playSound("d1_b2");
            break;
        case "dialogo2_b1":
            playSound("d2_b1");
            break;
        case "dialogo2_b2":
            playSound("d2_b2");
            break;
        case "dialogo2_b3":
            playSound("d2_b3");
            break;
        case "dialogo2_b4":
            playSound("d2_b4");
            break;
        case "dialogo2_b5":
            playSound("d2_b5");
            break;
        case "dialogo3_b1":
            playSound("d3_b1");
            break;
		case "dialogo3_b1a":
            playSound("d3_b1a");
            break;
		case "dialogo3_b2":
            playSound("d3_b2");
            break;
		case "dialogo3_b3":
            playSound("d3_b3");
            break;
		case "dialogo3_b3":
            playSound("d3_b3");
            break;
		case "dialogo3_b4":
            playSound("d3_b4");
            break;
		case "dialogo3_b5":
            playSound("d3_b5");
            break;
		case "dialogo3_b6":
            playSound("d3_b6");
            break;
		case "dialogo3_b7":
            playSound("d3_b7");
            break;
		case "dialogo3_b8":
            playSound("d3_b8");
            break;
		case "dialogo3_b9":
            playSound("d3_b9");
            break;
		case "dialogo3_b10":
            playSound("d3_b10");
            break;
        case "dialogo4_b1":
            playSound("d4_b1");
            break;
		case "dialogo4_b2":
            playSound("d4_b2");
            break;
		case "dialogo4_b3":
            playSound("d4_b3");
            break;
		case "dialogo4_b3":
            playSound("d4_b3");
            break;
		case "dialogo4_b4":
            playSound("d4_b4");
            break;
		case "dialogo4_b5":
            playSound("d4_b5");
            break;
		case "dialogo4_b6":
            playSound("d4_b6");
            break;
		case "dialogo4_b7":
            playSound("d4_b7");
            break;
		case "dialogo4_b8":
            playSound("d4_b8");
            break;
		case "dialogo4_b9":
            playSound("d4_b9");
            break;
		case "dialogo4_b10":
            playSound("d4_b10");
            break;
        case "dialogo4_b11":
            playSound("d4_b11");
            break;
        case "dialogo5_b1":
            playSound("d5_b1");
            break;
        case "dialogo5_b2":
            playSound("d5_b2");
            break;
        case "dialogo5_b3":
            playSound("d5_b3");
            break;
        case "dialogo5_b4":
            playSound("d5_b4");
            break;
        case "dialogo5_b5":
            playSound("d5_b5");
            break;
        case "dialogo5_b6":
            playSound("d5_b6");
            break;
        case "dialogo5_b7":
            playSound("d5_b7");
            break;
        case "dialogo5_b8":
            playSound("d5_b8");
            break;
        case "dialogo5_b9":
            playSound("d5_b9");
            break;
        case "dialogo5_b10":
            playSound("d5_b10");
            break;
        case "dialogo5_b11":
            playSound("d5_b11");
            break;
        case "dialogo5_b12":
            playSound("d5_b12");
            break;
        case "dialogo5_b13":
            playSound("d5_b13");
            break;
        case "dialogo5_b14":
            playSound("d5_b14");
            break;
        case "dialogo5_b15":
            playSound("d5_b15");
            break;
        case "dialogo5_b16":
            playSound("d5_b16");
            break;
        case "dialogo5_b17":
            playSound("d5_b17");
            break;
        case "dialogo5_b18":
            playSound("d5_b18");
            break;
        case "dialogo5_b19":
            playSound("d5_b19");
            break;
        case "dialogo5_b21":
            playSound("d5_b21");
            break;
        case "dialogo5_b22":
            playSound("d5_b22");
            break;
        case "dialogo5_b23":
            playSound("d5_b23");
            break;
        case "dialogo5_b24":
            playSound("d5_b24");
            break;
        case "dialogo5_b25":
            playSound("d5_b25");
            break;
        case "dialogo5_b26":
            playSound("d5_b26");
            break;
        case "dialogo5_b27":
            playSound("d5_b27");
            break;
        case "dialogo5_b28":
            playSound("d5_b28");
            break;
        case "dialogo5_b29":
            playSound("d5_b29");
            break;
        case "dialogo5_b30":
            playSound("d5_b30");
            break;
        case "dialogo5_b31":
            playSound("d5_b31");
            break;
        case "dialogo5_b32":
            playSound("d5_b32");
            break;
        case "dialogo5_b33":
            playSound("d5_b33");
            break;
        case "dialogo6_b1":
            playSound("d6_b1");
            break;
        case "dialogo6_b2":
            playSound("d6_b2");
            break;
        case "dialogo6_b3":
            playSound("d6_b3");
            break;
        case "dialogo6_b4":
            playSound("d6_b4");
            break;
        case "dialogo7_b1":
            playSound("d7_b1");
            break;
        case "dialogo8_b1":
            playSound("d8_b1");
            break;
        case "dialogo8_b2":
            playSound("d8_b2");
            break;
        case "dialogo8_b3":
            playSound("d8_b3");
            break;
        case "dialogo9_b1":
            playSound("d9_b1");
            break;
        case "dialogo9_b2":
            playSound("d9_b2");
            break;
        case "dialogo9_b3":
            playSound("d9_b3");
            break;
        case "dialogo9_b4":
            playSound("d9_b4");
            break;
        case "dialogo10_b1":
            playSound("d10_b1");
            break;
        case "dialogo10_b2":
            playSound("d10_b2");
            break;
        case "dialogo10_b3":
            playSound("d10_b3");
            break;
        case "dialogo10_b3":
            playSound("d10_b3");
            break;
        case "dialogo10_b4":
            playSound("d10_b4");
            break;
        case "dialogo10_b5":
            playSound("d10_b5");
            break;
        case "dialogo10_b6":
            playSound("d10_b6");
            break;
        case "dialogo10_b7":
            playSound("d10_b7");
            break;
        case "dialogo10_b8":
            playSound("d10_b8");
            break;
        case "dialogo10_b9":
            playSound("d10_b9");
            break;
        case "dialogo10_b10":
            playSound("d10_b10");
            break;
        case "dialogo10_b11":
            playSound("d10_b11");
            break;
        case "dialogo10_b12":
            playSound("d10_b12");
            break;
        case "dialogo10_b13":
            playSound("d10_b13");
            break;
        case "dialogo10_b14":
            playSound("d10_b14");
            break;
        case "dialogo10_b15":
            playSound("d10_b15");
            break;
        case "dialogo10_b16":
            playSound("d10_b16");
            break;
        case "dialogo10_b17":
            playSound("d10_b17");
            break;
        default: 
			playSound("d1_b1");   
    }
}

function stopAllAudio(){
	createjs.Sound.stop("d1_b1");
    createjs.Sound.stop("d1_b2");
    createjs.Sound.stop("d2_b1");
    createjs.Sound.stop("d2_b2");
    createjs.Sound.stop("d2_b3");
    createjs.Sound.stop("d2_b4");
    createjs.Sound.stop("d2_b5");
    createjs.Sound.stop("d3_b1");
    createjs.Sound.stop("d3_b2");
    createjs.Sound.stop("d3_b3");
    createjs.Sound.stop("d3_b4");
    createjs.Sound.stop("d3_b5");
    createjs.Sound.stop("d3_b6");
    createjs.Sound.stop("d3_b7");
    createjs.Sound.stop("d3_b8");
    createjs.Sound.stop("d3_b9");
    createjs.Sound.stop("d3_b10");
    createjs.Sound.stop("d4_b1");
    createjs.Sound.stop("d4_b2");
    createjs.Sound.stop("d4_b3");
    createjs.Sound.stop("d4_b4");
    createjs.Sound.stop("d4_b5");
    createjs.Sound.stop("d4_b6");
    createjs.Sound.stop("d4_b7");
    createjs.Sound.stop("d4_b8");
    createjs.Sound.stop("d4_b9");
    createjs.Sound.stop("d4_b10");
    createjs.Sound.stop("d4_b11");
    createjs.Sound.stop("d5_b1");
    createjs.Sound.stop("d5_b2");
    createjs.Sound.stop("d5_b3");
    createjs.Sound.stop("d5_b4");
    createjs.Sound.stop("d5_b5");
    createjs.Sound.stop("d5_b6");
    createjs.Sound.stop("d5_b6");
    createjs.Sound.stop("d5_b7");
    createjs.Sound.stop("d5_b8");
    createjs.Sound.stop("d5_b9");
    createjs.Sound.stop("d5_b10");
    createjs.Sound.stop("d5_b11");
    createjs.Sound.stop("d5_b12");
    createjs.Sound.stop("d5_b13");
    createjs.Sound.stop("d5_b14");
    createjs.Sound.stop("d5_b15");
    createjs.Sound.stop("d5_b16");
    createjs.Sound.stop("d5_b17");
    createjs.Sound.stop("d5_b18");
    createjs.Sound.stop("d5_b19");
    createjs.Sound.stop("d5_b20");
    createjs.Sound.stop("d5_b21");
    createjs.Sound.stop("d5_b22");
    createjs.Sound.stop("d5_b23");
    createjs.Sound.stop("d5_b24");
    createjs.Sound.stop("d5_b25");
    createjs.Sound.stop("d5_b26");
    createjs.Sound.stop("d5_b27");
    createjs.Sound.stop("d5_b28");
    createjs.Sound.stop("d5_b29");
    createjs.Sound.stop("d5_b30");
    createjs.Sound.stop("d5_b30");
    createjs.Sound.stop("d5_b31");
    createjs.Sound.stop("d5_b32");
    createjs.Sound.stop("d5_b33");
    createjs.Sound.stop("d6_b1");
    createjs.Sound.stop("d6_b2");
    createjs.Sound.stop("d6_b3");
    createjs.Sound.stop("d6_b4");
    createjs.Sound.stop("d7_b1");
    createjs.Sound.stop("d8_b1");
    createjs.Sound.stop("d8_b2");
    createjs.Sound.stop("d8_b3");
    createjs.Sound.stop("d9_b1");
    createjs.Sound.stop("d9_b2");
    createjs.Sound.stop("d9_b3");
    createjs.Sound.stop("d9_b4");
    createjs.Sound.stop("d10_b1");
    createjs.Sound.stop("d10_b2");
    createjs.Sound.stop("d10_b3");
    createjs.Sound.stop("d10_b4");
    createjs.Sound.stop("d10_b5");
    createjs.Sound.stop("d10_b6");
    createjs.Sound.stop("d10_b7");
    createjs.Sound.stop("d10_b8");
    createjs.Sound.stop("d10_b9");
    createjs.Sound.stop("d10_b10");
    createjs.Sound.stop("d10_b11");
    createjs.Sound.stop("d10_b12");
    createjs.Sound.stop("d10_b13");
    createjs.Sound.stop("d10_b14");
    createjs.Sound.stop("d10_b15");
    createjs.Sound.stop("d10_b16");
    createjs.Sound.stop("d10_b17");
}


