var audio = document.getElementsByTagName('audio');
if (audio.length > 0) {
    audio = audio[0];
    audio.addEventListener('ended', function() {
        window.location.href = 'cmd://tiku/playEnded';
    }, false);
}

function playAudio() {
    if (audio.length > 0) {
        audio = audio[0];
        audio.play();
    }
}

(function() {
	var imgs = document.getElementsByTagName('img');
	for(var i = 0, l = imgs.length; i < l; i++) {
        imgs[i].addEventListener('click', function() {
                          window.location.href = 'cmd://tiku/image/'+ this.getAttribute('src');
                          }, false);
	}
 })();