var pop_up_note_mode = true; var note_id = 1; function id(name) { return document.getElementById(name); } function switchsound() { au = id('bgsound'); ai = id('sound_image'); if(au.paused) { au.play(); ai.src = "http://www.lessor.cn/Blessing/img/ext/music_note_big.png"; pop_up_note_mode = true; popup_note(); id("music_txt").innerHTML = "´ò¿ª"; id("music_txt").style.visibility = "visible"; setTimeout(function(){id("music_txt").style.visibility="hidden"}, 2500); } else { pop_up_note_mode = false; au.pause(); ai.src = "http://www.lessor.cn/Blessing/img/ext/music_note_big.png"; id("music_txt").innerHTML = "¹Ø±Õ"; id("music_txt").style.visibility = "visible"; setTimeout(function(){id("music_txt").style.visibility="hidden"}, 2500); } } function on_pop_note_end(event) { note = event.target; if(note.parentNode == id("note_box")) { id("note_box").removeChild(note); console.log("remove note id " + note.getAttribute("id")); } } function popup_note() { box = id("note_box"); note = document.createElement("span"); note.style.cssText = "visibility:visible;position:absolute;background-image:url('http://www.lessor.cn/Blessing/img/ext/music_note_small.png');width:15px;height:25px"; note.style.left = Math.random() * 20 + 20; note.style.top = "75px"; this_node = "music_note_" + note_id; note.setAttribute("ID", this_node); note_id += 1; scale = Math.random() * 0.4 + 0.4; note.style.webkitTransform = "rotate(" + Math.floor(360 * Math.random()) + "deg) scale(" + scale + "," + scale + ")"; note.style.webkitTransition = "top 2s ease-in, opacity 2s ease-in, left 2s ease-in"; note.addEventListener("webkitTransitionEnd", on_pop_note_end); box.appendChild(note); setTimeout("document.getElementById('" + this_node + "').style.left = '0px';", 100); setTimeout("document.getElementById('" + this_node + "').style.top = '0px';", 100); setTimeout("document.getElementById('" + this_node + "').style.opacity = '0';", 100); if(pop_up_note_mode) { setTimeout("popup_note()", 600); } } function playbksound() { var audiocontainer = id('audiocontainer'); if(audiocontainer != undefined) { audiocontainer.innerHTML = ''; } var audio = id('bgsound'); audio.play(); sound_div = document.createElement("div"); sound_div.setAttribute("ID", "cardsound"); sound_div.style.cssText = "position:fixed;left:440px;top:40px;z-index:5000;visibility:visible;"; box_htm = "
"; bg_htm = "