function wizard_Player35_3() { return document.wizard_mediaplayer35_3; } function wizard_PlayerIsRecent() { var player = wizard_Player35_3(); if (player.versionInfo) { return 0; } else { return 0; } } function wizard_PlayerPlay35_3(productid) { if (document.wizard_playingproductid35_3 == productid) { wizard_PlayerStop35_3(); wizard_ChangePlayButton35_3(productid, 0) } else { document.wizard_playingproductid35_3 = productid; if (player = wizard_Player35_3()) { try { if (wizard_PlayerIsRecent()) { player.URL = 'http://www.mobilemoney.com/interfaces/previews/asx.asp?productid=' + productid; wizard_StopAllMediaPlayers35_3("wizard_mediaplayer35_3") } else { wizard_StopAllMediaPlayers35_3("wizard_mediaplayer35_3") wizard_PlayerResetAll35_3(productid); var el = document.getElementById('wizard_embed35_3'); el.innerHTML = "" //alert(el.innerHTML) } return true; } catch (ex) { } } } return false; } function wizard_PlayerStop35_3() { if (player = wizard_Player35_3()) { if (wizard_PlayerIsRecent()) { if (player.URL != 'http://www.surf2music.nl/nothing.wma' && player.URL != '') { player.URL = 'http://www.surf2music.nl/nothing.wma'; } } else { var el = document.getElementById('wizard_embed35_3'); el.innerHTML = "" wizard_PlayerResetAll35_3(-1); } } document.wizard_playingproductid35_3 = 0; } // Stop all mediaplayers, except one function wizard_StopAllMediaPlayers35_3(except) { var objects; var i; var id; objects = document.getElementsByTagName("object"); for (i = 0; i < objects.length; i++) { id = objects[i].id; if ((left(id, 18) == "wizard_mediaplayer") && (id != except)) { eval("wizard_PlayerStop" + right(id, id.length-18) + "();") } } objects = document.getElementsByTagName("embed"); for (i = 0; i < objects.length; i++) { id = objects[i].id; if ((left(id, 18) == "wizard_mediaplayer") && (id != except)) { eval("wizard_PlayerStop" + right(id, id.length-18) + "();") } } } function left(str, n){ if (n <= 0) return ""; else if (n > String(str).length) return str; else return String(str).substring(0,n); } function right(str, n){ if (n <= 0) return ""; else if (n > String(str).length) return str; else { var iLen = String(str).length; return String(str).substring(iLen, iLen - n); } } function wizard_PlayerResetAll35_3(turnonID){ var id; var spans; spans = document.getElementsByTagName('span'); for (i = 0; i < spans.length; i++) { id = spans[i].id; if (left(id, 8) == "speaker_") { id = right(id, id.length-8) tmpend = id.indexOf("_") if (tmpend >= 0) { id = left(id, tmpend) } if (id == turnonID) { wizard_ChangePlayButton35_3(id, 1); } else { wizard_ChangePlayButton35_3(id, 0); } } } } function asc(c) { var i; c = c.charAt(0); for (i = 0; i < 256; ++ i) { var h = i.toString(16); if (h.length == 1) { h = "0" + h; } h = unescape("%" + h); if (h == c) { break; } } return i; } function r(string,text,by) { var strLength = string.length, txtLength = text.length; if ((strLength == 0) || (txtLength == 0)) { return string; }; var i = string.indexOf(text); if ((!i) && (text != string.substring(0,txtLength))) { return string; }; if (i == -1) { return string; }; var newstr = string.substring(0,i) + by; if (i+txtLength < strLength) { newstr += r(string.substring(i+txtLength,strLength),text,by); }; return newstr; } function wizard_charsum(txt) { var chsum = 0; for (i = 0; i < txt.length; i++) { chsum = chsum + asc(String(txt).substring(i, i+1)); } return chsum; } function wizard_ChangePlayButton35_3(productid, playing) { if (typeof(productid) == 'undefined') { return; } //try { var el = document.getElementById('speaker_' + productid); var old_innerHTML = el.innerHTML.toLowerCase(); old_innerHTML = old_innerHTML.replace("'", '"'); var stopbutton = mm_wizard_speaker_stopbutton.toLowerCase(); stopbutton = r(stopbutton, "'", '"'); var playbutton = mm_wizard_speaker_playbutton.toLowerCase(); playbutton = r(playbutton,"'",'"'); if (playing == 1) { //alert("playing:" + productid); if (wizard_charsum(old_innerHTML) != wizard_charsum(stopbutton)) { el.innerHTML = mm_wizard_speaker_stopbutton; //alert(wizard_charsum(old_innerHTML)); } } else { //if (old_innerHTML != startbutton) { //if (wizard_charsum(old_innerHTML) != wizard_charsum(playbutton)) { //alert(old_innerHTML + '\r' + playbutton); el.innerHTML = mm_wizard_speaker_playbutton; //} } //} catch(e) {} } function wizard_PlayerStateChange35_3(NewState, debug) { try { switch(NewState) { case 1: //Stopped case 2: //Paused case 8: //MediaEnded case 10: //Ready wizard_PlayerResetAll35_3(-1); break; case 3: //Playing wizard_PlayerResetAll35_3(document.wizard_playingproductid35_3); break; case 6: //Buffering case 9: //Transitioning wizard_PlayerResetAll35_3(document.wizard_playingproductid35_3); break; case 11: //Reconnecting break; } } catch(ex) {} }