
var board = "piano";

function toAnimals() {
	board = "animals";
}

function toPiano() {
	board = "piano";
}

var sc = new Howl({urls: ['snd/dirka-c.ogg']}),
	sd = new Howl({urls: ['snd/dirka-d.ogg']}),
	se = new Howl({urls: ['snd/dirka-e.ogg']}),
	sf = new Howl({urls: ['snd/dirka-f.ogg']}),
	sg = new Howl({urls: ['snd/dirka-g.ogg']}),
	sa = new Howl({urls: ['snd/dirka-a.ogg']}),
	sh = new Howl({urls: ['snd/dirka-h.ogg']}),
	sc2 = new Howl({urls: ['snd/c2.ogg']}),
	sd2 = new Howl({urls: ['snd/d2.ogg']}),
	se2 = new Howl({urls: ['snd/e2.ogg']}),
	
	scis = new Howl({urls: ['snd/crna-cis.ogg']}),
	sdis = new Howl({urls: ['snd/crna-dis.ogg']}),
	sfis = new Howl({urls: ['snd/crna-fis.ogg']}),
	sgis = new Howl({urls: ['snd/crna-gis.ogg']}),
	sais = new Howl({urls: ['snd/crna-ais.ogg']}),
	scis2 = new Howl({urls: ['snd/cis2.ogg']}),
	sdis2 = new Howl({urls: ['snd/dis2.ogg']}),
	sfis2 = new Howl({urls: ['snd/fis2.ogg']}),
	
	maca = new Howl({urls: ['snd/maca.ogg']}),
	ovca = new Howl({urls: ['snd/ovca.ogg']}),
	kravica = new Howl({urls: ['snd/kravica.ogg']}),
	ker = new Howl({urls: ['snd/ker.ogg']}),
	konj = new Howl({urls: ['snd/konj.ogg']});

//bele dirke
function c() {	
	if (board == "piano") {
		sc.play();
	} else if (board == "animals") {
		maca.play();
	}
}
function d() {	
	if (board == "piano") {
		sd.play();
	} else if (board == "animals") {
		kravica.play();
	}
}
function e() {	
	if (board == "piano") {
		se.play();
	} else if (board == "animals") {
		ker.play();
	}
}
function f() {	
	if (board == "piano") {
		sf.play();
	} else if (board == "animals") {
		konj.play();
	}
}
function g() {	
	if (board == "piano") {
		sg.play();
	} else if (board == "animals") {
		ovca.play();
	}
}
function a() {	
	if (board == "piano") {
		sa.play();
	} else if (board == "animals") {
		maca.play();
	}
}
function h() {	
	if (board == "piano") {
		sh.play();
	} else if (board == "animals") {
		kravica.play();
	}
}
function c2() {	
	if (board == "piano") {
		sc2.play();
	} else if (board == "animals") {
		ker.play();
	}
}
function d2() {	
	if (board == "piano") {
		sd2.play();
	} else if (board == "animals") {
		konj.play();
	}
}
function e2() {	
	if (board == "piano") {
		se2.play();
	} else if (board == "animals") {
		ovca.play();
	}
}

//crne dirke
function cis() {	
	if (board == "piano") {
		scis.play();
	} else if (board == "animals") {
		ker.play();
	}
}
function dis() {	
	if (board == "piano") {
		sdis.play();
	} else if (board == "animals") {
		konj.play();
	}
}
function fis() {	
	if (board == "piano") {
		sfis.play();
	} else if (board == "animals") {
		ovca.play();
	}
}
function gis() {	
	if (board == "piano") {
		sgis.play();
	} else if (board == "animals") {
		maca.play();
	}
}
function ais() {	
	if (board == "piano") {
		sais.play();
	} else if (board == "animals") {
		kravica.play();
	}
}
function cis2() {	
	if (board == "piano") {
		scis2.play();
	} else if (board == "animals") {
		ker.play();
	}
}
function dis2() {	
	if (board == "piano") {
		sdis2.play();
	} else if (board == "animals") {
		konj.play();
	}
}
function fis2() {	
	if (board == "piano") {
		sfis2.play();
	} else if (board == "animals") {
		ovca.play();
	}
}

//kada se prodrma
function shaken() {
	vibrate();
}

//vibriraj
function vibrate() {
	if('vibrate' in navigator) {
		navigator.vibrate(100);
	}
}
