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
   location.href="http://help1.yam.com/pmwiki/index.php?n=Seednet.Q2-1";
}
//活動專區
function MM_membereven() { //v2.0
   location.href="/pay_moon.asp?ichannel=membereven&PageUrl=membereven&moon=5&id=4&type=open";
}


//常見問題
function MM_faq() { //v2.0
    location.href="/pay_moon.asp?ichannel=topfaq&PageUrl=topfaq";
}

//e金幣--->seednet 自家購點
function MM_openecoinWindow() { //v2.0
  window.open('https://service.seed.net.tw/register-cgi/chargedial_reg?FUNC=OnLineApplyPortal&ServiceID=CT000001','ecoin','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
}



//準備中訊息視窗
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')
}

// 浮水印JavaScript Document
function setVariables() {
if (navigator.appName == "Netscape") {
v=".top=";
dS="document.";
sD="";
y="window.pageYOffset";
}
else {
v=".pixelTop=";
dS="";
sD=".style";
y="document.body.scrollTop";
}
}
function checkLocation() {
object="object1";
yy=eval(y);
eval(dS+object+sD+v+yy);
setTimeout("checkLocation()",10);
}
//浮水印結束

// 浮水印選單Start
float_init        = 1;
function DHTML_Init(FloatObject) {
if (navigator.userAgent.match(/Mozilla\/5\../) && float_init) {
SetObjectOffsetTop(FloatObject, undefined);
} }
function All (ID) {
if (document.all)        {  return document.all[ID];   }
else if (document.documentElement){
return document.getElementById (ID); }
else if (document.layers)        { return document.layers[ID]; }}
function GetWindowOffsetTop() {
if (window.innerHeight)        { return window.pageYOffset; }
else if (document.body)        { return document.body.scrollTop; }}
function GetWindowHeight() {
if (window.innerHeight)        { return window.innerHeight; }
else if (document.body)        { return document.body.clientHeight; }}
function GetObjectHeight(FloatObject) {
DHTML_Init(FloatObject);
if (document.all || document.documentElement)        {
Clip = FloatObject.style.clip;
if (! Clip) { return FloatObject.offsetHeight; }
else        { return GetClipElement (Clip, 'Bottom'); }}
else if (document.layers)        { return FloatObject.clip.height; }}
function GetClipElement (Clip, Element) {
Clip = Clip.substr(Clip.indexOf('(') + 1);
Clip = Clip.substr(0, Clip.length - 1);
Clippers = Clip.split (" ");
for (i = 0; i < Clippers.length; i++) {
if (Clippers[i] != 'auto')
{ Clippers[i] = Clippers[i].replace (/D/g, ""); }}
ClipTop = Number(Clippers[0]);
ClipRight = Number(Clippers[1]);
ClipBottom = Number(Clippers[2]);
ClipLeft = Number(Clippers[3]);
if (Element == 'Top')                { return ClipTop; }
else if (Element == 'Right')        { return ClipRight; }
else if (Element == 'Bottom')        { return ClipBottom; }
else if (Element == 'Left')        { return ClipLeft; }
else                                { return undefined; }}
function GetObjectOffsetTop(FloatObject) {
DHTML_Init(FloatObject);
if (FloatObject.offsetTop)        { return FloatObject.offsetTop; }
else if (document.layers)        { return FloatObject.top; }}
function SetObjectOffsetTop(FloatObject, Offset) {
if (FloatObject.style)        { FloatObject.style.top = Offset; }
else if (FloatObject.top)        { FloatObject.top = Offset; }}
CenterMenu = 1;
MenuBorder = 100;
TimeCheck  = 250;
TimeUpdate = 15;
DivUpdate  = 15;
Minimum    = 50;
AddHeight  = -4;
function ScrollMenu() {
Menu                = All('persistMenu');
WinTop        = GetWindowOffsetTop();
WinHeight        = GetWindowHeight() + AddHeight;
MenuTop        = GetObjectOffsetTop(Menu);
MenuHeight = GetObjectHeight (Menu);
MenuNew        = (CenterMenu) ? Math.round (WinTop + (WinHeight - MenuHeight) / 3) : WinTop + MenuBorder;
if (MenuNew < Minimum)
{ MenuNew = Minimum; }
if (MenuTop != MenuNew) {
if ( (MenuTop + MenuHeight) < WinTop || MenuTop > (WinTop + WinHeight) ) {
SetObjectOffsetTop (Menu, (MenuTop < MenuNew) ? (WinTop - MenuHeight) : (WinTop + WinHeight));
} else {
Add = (MenuTop < MenuNew) ? 1 : -1;
SetObjectOffsetTop (Menu, MenuTop + Math.round((MenuNew - MenuTop) / DivUpdate) + Add);
}
}
window.setTimeout('ScrollMenu()', (GetObjectOffsetTop(Menu) == MenuNew) ? TimeCheck : TimeUpdate);
}
//浮水印選單End

//時間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?websname=seednet";
}

//免費頻道
function MM_FreeChannel() { //v2.0
  location.href="/pay_moon.asp?ichannel=free&PageUrl=free&moon=5&c=1&s=1";
}

//月費頻道
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=31";
}

//社群頻道
function MM_GroupChannel() { //v2.0
  //location.href="/group/group_index.asp?type=member_title";
  //location.href="http://blog.webs-tv.net/index_apol.php";
  location.href="/url/blog01.asp"; //先導引至導覽頁
}

//紅利頻道
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";
}

//信箱頻道
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_MemIDchg() { //v2.0
  window.open('/member/modifyform.asp?ProcType=chkidchange','payall','width=320,height=300');
  // alert("抱歉！此功能暫不開放！");
}

//播放元件下載
function MM_MPSDKdownload() { //v2.0
  window.open('http://help.webs-tv.net/?id=tv2:tv2-1&r=seednettv:seednettvright&tn=seednet&type=1','MPSDKdownload','width=500,height=400,toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
}