﻿function ReplaceAll(a, b, c) { var d = a; var e = d.indexOf(b); while (e != -1) { d = d.replace(b, c); e = d.indexOf(b) } return d } function runScript(a) { if (a.keyCode == 13) { Searchsong(); return false } } function Searchsong() { if (document.getElementById("Search").value.length < 2) { alert("กรุณากรอกอย่างน้อย 2 ตัวอักษรค่ะ") } else { var a = document.getElementById("Search"); var b = document.getElementById("Type"); window.location.href("Search.aspx?kw=" + a.value + "&type=" + b.options[b.selectedIndex].value + "&PI=1&PS=20") } } function Radiourl() { var a = document.getElementById("StationId"); if (a.options[a.selectedIndex].value == 0) { alert("กรุณาเลือกสถานีที่ต้องการฟังด้วยค่ะ") } else { OpenBlankPage("OnlineStation.aspx?Station=" + a.options[a.selectedIndex].value) } } function getUrlVars() { var a = [], b; var c = window.location.href.slice(window.location.href.indexOf("?") + 1).split("&"); for (var d = 0; d < c.length; d++) { b = c[d].split("="); a.push(b[0]); a[b[0]] = b[1] } return a } function writeObject(a, b) { if (document.getElementById) { x = document.getElementById(b); x.innerHTML = a } else if (document.all) { x = document.all[b]; x.innerHTML = a } else if (document.layers) { x = document.layers[b]; x.document.open(); x.document.write(a); x.document.close() } } function stoplist() { if (navigator.appName == "Microsoft Internet Explorer") { var a = document.getElementById("windowmediaplayer"); a.stop() } else { var b = document.getElementById("windowmediaplayer"); b.style.display = "none" } } function playlist() { writeObject("", "premusic"); if (navigator.appName == "Microsoft Internet Explorer") { var a = document.getElementById("windowmediaplayer"); a.play() } else { var b = document.getElementById("windowmediaplayer"); b.style.display = "block" } } function stopSound() { writeObject("", "premusic") } function playSound(a) { var b = "http://alice.toplinedigital.co.th/DataFiles/Song/Preview/"; if (navigator.appName == "Microsoft Internet Explorer") { writeObject('<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" Name="MediaPlayer" src="' + b + a + '" AutoStart="true" ShowStatusBar="0" ShowControls="0" ShowDisplay="0" volume="1" HEIGHT="1" WIDTH="1" loop="false">', "premusic") } else { writeObject('<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" Name="MediaPlayer" src="' + b + a + '" AutoStart="true" ShowStatusBar="0" ShowControls="0" ShowDisplay="0" volume="1" HEIGHT="1" WIDTH="1" loop="false">', "premusic") } } function unloadSoundPreview(a) { playSound() } function soundPreviewIndex(a) { if (a != "") { playSound(a) } stoplist() } function soundPreview(a) { if (a != "") { playSound(a) } } function OpenBlankPage(a) { document.location.href = a } function openNewWindowInside(a, b, c) { window.open(a, "popup", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,modal=yes,width=" + b + ",height=570"); var d = a.split("."); if (d[0] == "PopupDownload") { stopSound() } } function opennewwindowScroll(a, b) { window.open(a, "popup", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,modal=yes,width=" + b + ",height=570"); var c = a.split("."); if (c[0] == "PopupDownload") { stoplist(); stopSound() } } function opennewwindow(a, b) { window.open(a, "popup", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,modal=yes,width=" + b + ",height=570"); var c = a.split("."); if (c[0] == "PopupDownload") { stoplist(); stopSound() } } $.extend({ getUrlVars: function() { var a = [], b; var c = window.location.href.slice(window.location.href.indexOf("?") + 1).split("&"); for (var d = 0; d < c.length; d++) { b = c[d].split("="); a.push(b[0]); a[b[0]] = b[1] } return a }, getUrlVar: function(a) { return $.getUrlVars()[a] } })
