function setFileModeQuality(idx) { document.getElementById("a"+idx).style.backgroundColor = "#ddd"; document.cookie ="filequality="+idx+";expires=Thu, 22-Apr-2038 00:00:00 GMT"; document.getElementById("selected").style.backgroundColor = "#fff"; setTimeout(function() { loadBody("top.html"); }, 200); } function setTVModeQuality(idx) { document.getElementById("a"+idx).style.backgroundColor = "#ddd"; document.cookie ="tvquality="+idx+";expires=Thu, 22-Apr-2038 00:00:00 GMT"; document.getElementById("selected").style.backgroundColor = "#fff"; setTimeout(function() { loadBody("top.html"); }, 200); } function setBonDriver(idx) { document.getElementById("a"+idx).style.backgroundColor = "#ddd"; document.cookie ="bondriver="+idx+";expires=Thu, 22-Apr-2038 00:00:00 GMT"; document.getElementById("selected").style.backgroundColor = "#fff"; setTimeout(function() { loadBody("top.html"); }, 200); } function selectChannel(idx) { document.getElementById("a"+idx).style.backgroundColor = "#ddd"; setTimeout(function() { loadBody("playtv.html?channel="+idx+"&width="+screen.width); }, 200); } function selectFile(idx) { document.getElementById("a"+idx).style.backgroundColor = "#ddd"; setTimeout(function() { loadBody("playfile.html?file="+idx+"&width="+screen.width); }, 200); } function selectDir(idx) { document.getElementById("a"+idx).style.backgroundColor = "#ddd"; setTimeout(function() { loadBody("filelist.html?dir="+idx); }, 200); } function loadBody(page) { document.body.innerHTML = "
Now Loading
"; httpObj = new XMLHttpRequest(); httpObj.onload = pageUpdate; httpObj.open("GET", page, true); httpObj.setRequestHeader('Cache-Control', 'no-cache'); httpObj.setRequestHeader("If-Modified-Since", "Thu, 01 Jun 1970 00:00:00 GMT"); httpObj.send(null); } function loadBody2(id, page) { document.getElementById("a0").style.backgroundColor = "#fff"; document.getElementById(id).style.backgroundColor = "#ddd"; setTimeout(function() { loadBody(page); }, 200); } function loadPage(id, page) { document.getElementById("a0").style.backgroundColor = "#fff"; document.getElementById("a1").style.backgroundColor = "#fff"; document.getElementById(id).style.backgroundColor = "#ddd"; setTimeout(function() { document.location = page; }, 200); } function pageUpdate() { var html = httpObj.responseText; if(/iPad|Macintosh/.test(navigator.userAgent)){ html = html.replace(/(width=\")[0-9]+(\")/g, "$1" + "1024" + "$2"); html = html.replace(/(height=\")[0-9]+(\")/g, "$1" + "576" + "$2"); //html = html.replace(/(video)/g, "$1" + " id=\"video\""); if(html.indexOf("Back") == -1 && html.indexOf("Exit") == -1){ html = html.replace(/(