function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}
function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//新手上路
function MM_newway() { //v2.0
    window.open("http://help.webs-tv.net/?r=tv:tvright&id=tv:tv1-1&type=1");
}

//下載軟體
function MM_software() { //v2.0
    location.href="http://help.webs-tv.net/?id=tv2:tv2-1&r=tv:tvright&tn=&type=1";
}

//常見問題
function MM_faq() { //v2.0
    location.href="/pay_moon.asp?ichannel=faq&PageUrl=faq";
}

//e金幣
function MM_openecoinWindow() { //v2.0
  location.href="/pay_moon.asp?ichannel=memberarea&PageUrl=memberarea&type=buy";
}

//交易查詢
function MM_tradeWindow() { //v2.0
  location.href="/pay_moon.asp?ichannel=memberarea&PageUrl=memberarea&type=paylog";
}

//帳號開通
function MM_openIDWindow() { //v2.0
  location.href="/pay_moon.asp?ichannel=memberarea&PageUrl=memberarea";
}

//帳號查詢
function MM_IDsearch() { //v2.0
  location.href="/pay_moon.asp?ichannel=memberarea&PageUrl=memberarea&type=buy";
}

//密碼查詢
function MM_PWDsearch() { //v2.0
  location.href="/pay_moon.asp?ichannel=memberarea&PageUrl=memberarea&type=pwdsearch";
}

//資費異動
function MM_MemIDchg() { //v2.0
  location.href="/pay_moon.asp?ichannel=memberarea&PageUrl=memberarea&type=idchange";
}

//準備中訊息視窗
function avmail() {
 Window.alert("\n準備中~");
}

//公告訊息視窗
function Popup(sList,h,w){
window.open (sList,'newwindow','height='+h+',width='+w+',top=0,left=0,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no')
}

//時間Start
function showtime()
{
var now = new Date()
var hours = now.getHours()
var minutes = now.getMinutes()
var seconds = now.getSeconds()
var timeValue = ""
if(hours>=1 && hours <4)
{timeValue += ("凌晨")}
if(hours>=4 && hours<6)
{timeValue += ("清晨")}
if(hours>=6 && hours<9)
{timeValue += ("早上")}
if(hours>=9 && hours<12)
{timeValue += ("上午")}
if(hours>=12 && hours<13)
{timeValue += ("中午")}
if(hours>=13 && hours<18)
{timeValue += ("下午")}
if(hours>=18 && hours <19)
{timeValue += ("傍晚")}
if(hours>=19 && hours <24)
{timeValue += ("晚上")}
if(hours<1)
{timeValue += ("午夜")}
timeValue += ((hours > 12) ? hours - 12 : hours)
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
document.TimeClock.face.value = timeValue
timerID = setTimeout("showtime()",1000)
timerRunning = true
}
//時間End

//新聞頻道
function MM_NewsChannel() { //v2.0
  //location.href="http://news.webs-tv.net/index.php";
  window.open('http://news.webs-tv.net/index.php','ecoin','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
}

//免費頻道
function MM_FreeChannel() { //v2.0
  location.href="/pay_moon.asp?ichannel=free&PageUrl=free&moon=5";
}

//月費頻道
function MM_MoonChannel() { //v2.0
  location.href="/pay_moon.asp?ichannel=moon&PageUrl=index_moon&moon=3&titletype=subtitle";
}

//計次頻道
function MM_PayChannel() { //v2.0
  location.href="/pay_moon.asp?ichannel=pay&PageUrl=Pay&moon=1&c=3&s=30";
}

//社群頻道
function MM_GroupChannel() { //v2.0
  //location.href="/group/group_index.asp?type=member_title";
  top.location.href="http://blog.webs-tv.net/index_webs.php";
}

//紅利頻道
function MM_ProfitChannel() { //v2.0
  location.href="/pay_moon.asp?ichannel=profit&PageUrl=profit&evenid=index";
}

//活動頻道
function MM_EvenChannel() { //v2.0
  location.href="/pay_moon.asp?ichannel=membereven&PageUrl=membereven"; //美少女活動
  //location.href="/pay_moon.asp?ichannel=membereven&PageUrl=golden"; //金鐘獎
}

//ADSL頻道
function MM_AdslChannel() { //v2.0
  location.href="/ADSL/adslindex.asp";
}

//信箱頻道
function MM_MailChannel() { //v2.0
  window.open('/webmail/mail_index.asp?ichannel=login','ecoin','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
}

//會員頻道
function MM_MemChannel() { //v2.0
  location.href="/pay_moon.asp?ichannel=memberarea&PageUrl=memberarea";
}

//加入會員
function MM_AddMemChannel() { //v2.0
  location.href="/pay_moon.asp?ichannel=member&PageUrl=member";
}

//廣告導覽頁播放框
function MM_URLPLAYER(pgmid) { //v2.0
  window.open('/play/playwindow/urlplayer.asp?pid='+pgmid,'payall','width=320,height=300');
}

//播放元件下載
function MM_MPSDKdownload() { //v2.0
  window.open('http://help.webs-tv.net/?id=tv:tv3-6&r=tv:tvright&tn=&type=1','MPSDKdownload','width=500,height=400,toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
}

//首頁頁纖
function show(item, myvar){
	document.getElementById(item).style.display = myvar ? "block" : "none";
}

//首頁搜尋
function mySearch(fm){
	var strText = document.fm.Keys.value;
	var keyword = "";
	if(strText == ''){
			alert("您必須輸入關鍵文字!");
	}else{
		//alert(strText);//alert mytext.text data
		if(document.fm.Kind[0].checked == false && document.fm.Kind[1].checked == false && document.fm.Kind[2].checked == false&& document.fm.Kind[3].checked == false){
			alert("請選擇搜尋範圍!");
		}else{
			//document.fm.Keys.value = escape(strText);
			document.fm.submit();
		}
	}
}