//copyright David Bruce 2005. //Do not reuse without permission //email david@compositiontoday.com for more info var temp2=0 var kObj var isdrag=false; function play(soundUrl) { //soundUrl='/sound_bank/'+soundUrl+'.mp3' soundUrl='http://88.198.78.90/ct/files/mp3/'+soundUrl+'.mp3' //alert(soundUrl) carryon=true if (document.all){ document.all.bgs.src = soundUrl; } else { var IFrameObj = document.getElementById("soundFrame"); IFrameObj.src = "about:blank"; IFrameObj.src = soundUrl; setTimeout("endPlay()", 10000); } } function endPlay() { var IFrameObj = document.getElementById("soundFrame"); IFrameObj.src = "about:blank"; } function stop() { carryon=false if (document.all){ if (document.all) document.all.bgs.src = '/images/sp.gif'; } else {var IFrameObj = document.getElementById("soundFrame"); IFrameObj.src = "about:blank"; } } function CheckIsIE() { if (navigator.appName.toUpperCase() == 'MICROSOFT INTERNET EXPLORER') { return true;} else { return false; } } var sPosition; var showPerc=100; document.onmousedown=dragLayer; function doup(){ isdrag = false; dragMe=false document.getElementById("caption").src='/sound_bank/loading.gif'; play(mm); setTimeout('remove()',3000); } function remove(){ document.getElementById("caption").src='/sound_bank/empty.gif' } var Color= new Array(); Color[0] = "a0"; Color[1] = "bb0"; Color[2] = "b0"; Color[3] = "c1"; Color[4] = "db1"; Color[5] = "d1"; Color[6] = "eb1"; Color[7] = "e1"; Color[8] = "f1"; Color[9] = "gb1"; Color[10] = "g1"; Color[11] = "ab1"; Color[12] = "a1"; Color[13] = "bb1"; Color[14] = "b1"; Color[15] = "c2"; Color[16] = "db2"; Color[17] = "d2"; Color[18] = "eb2"; Color[19] = "e2"; Color[20] = "f2"; Color[21] = "gb2"; Color[22] = "g2"; Color[23] = "ab2"; Color[24] = "a2"; Color[25] = "bb2"; Color[26] = "b2"; Color[27] = "c3"; Color[28] = "db3"; Color[29] = "d3"; Color[30] = "eb3"; Color[31] = "e3"; Color[32] = "f3"; Color[33] = "gb3"; Color[34] = "g3"; Color[35] = "ab3"; Color[36] = "a3"; Color[37] = "bb3"; Color[38] = "b3"; Color[39] = "c4"; Color[40] = "db4"; Color[41] = "d4"; Color[42] = "eb4"; Color[43] = "e4"; Color[44] = "f4"; Color[45] = "gb4"; Color[46] = "g4"; Color[47] = "ab4"; Color[48] = "a4"; Color[49] = "bb4"; Color[50] = "b4"; Color[51] = "c5"; Color[52] = "db5"; Color[53] = "d5"; Color[54] = "eb5"; Color[55] = "e5"; Color[56] = "f5"; Color[57] = "gb5"; Color[58] = "g5"; Color[59] = "ab5"; Color[60] = "a5"; Color[61] = "bb5"; Color[62] = "b5"; Color[63] = "c6"; Color[64] = "db6"; Color[65] = "d6"; Color[66] = "eb6"; Color[67] = "e6"; Color[68] = "f6"; Color[69] = "gb6"; Color[70] = "g6"; Color[71] = "ab6"; Color[72] = "a6"; Color[73] = "bb6"; Color[74] = "b6"; Color[75] = "c7"; Color[76] = "db7"; Color[77] = "d7"; Color[78] = "eb7"; Color[79] = "e7"; Color[80] = "f7"; Color[81] = "gb7"; Color[82] = "g7"; Color[83] = "ab7"; Color[84] = "a7"; Color[85] = "bb7"; Color[86] = "b7"; Color[87] = "c8"; // Demofunction to change bg-color by moving slider var rVal,gVal,bVal, cCol,mm function moveLayer(e) { e=(e)?e:event; if ( isdrag) { var fobj = (!document.all)? e.target : e.srcElement; oldY = parseInt(kObj.style.pixelTop); var kk=(!document.all)?e.clientY:e.clientY; kObj.style.top=temp2+kk-yPos+'px'; //alert( temp2+'--- '+kk+'------ '+yPos) //need to change line above to ff // Limit movement of knob to stay inside layer if (parseInt(kObj.style.top) > oldY) direction="dn"; else direction="up"; if (parseInt(kObj.style.top)< -83+(100-maxnote) && direction=="up") { kObj.style.top= -83+(100-maxnote)+'px'; direction="dn";} if (parseInt(kObj.style.top)> 216-minnote && direction=="dn") {kObj.style.top=216-minnote+'px' ; direction="up";} ind = Math.round(83-parseInt(kObj.style.top)); if (ind < minnote) ind = minnote; if (ind > maxnote) ind=maxnote; if (kObj.id =="knobImg") document.note.src='http://88.198.78.90/ct/files/mp3/notes/'+Color[ind]+'.gif'; var nn=Color[ind]; mm=getmp(Color[ind]); return false; } } function dragLayer(e) { e=(e)?e:event; var fobj = (!document.all)? e.target : e.srcElement; var topelement = (!document.all) ? "HTML" : "BODY"; while (fobj.tagName != topelement && fobj.className != "drag") { fobj = (!document.all) ? fobj.parentNode : fobj.parentElement; } if (fobj.className=="drag") {dragMe=true; isdrag = true;kObj=fobj; temp2=parseInt(kObj.style.top); yPos= e.clientY; document.onmousemove=moveLayer; return false} } document.onmousedown=dragLayer; document.onmouseup=doup;