function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

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_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_timelinePlay(tmLnName, myID) { //v1.2
  //Copyright 1997 Macromedia, Inc. All rights reserved.
  var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,propNum,theObj,firstTime=false;
  if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
  tmLn = document.MM_Time[tmLnName];
  if (myID == null) { myID = ++tmLn.ID; firstTime=true;}//if new call, incr ID
  if (myID == tmLn.ID) { //if Im newest
    setTimeout('MM_timelinePlay("'+tmLnName+'",'+myID+')',tmLn.delay);
    fNew = ++tmLn.curFrame;
    for (i=0; i<tmLn.length; i++) {
      sprite = tmLn[i];
      if (sprite.charAt(0) == 's') {
        if (sprite.obj) {
          numKeyFr = sprite.keyFrames.length; firstKeyFr = sprite.keyFrames[0];
          if (fNew >= firstKeyFr && fNew <= sprite.keyFrames[numKeyFr-1]) {//in range
            keyFrm=1;
            for (j=0; j<sprite.values.length; j++) {
              props = sprite.values[j];
              if (numKeyFr != props.length) {
                if (props.prop2 == null) sprite.obj[props.prop] = props[fNew-firstKeyFr];
                else        sprite.obj[props.prop2][props.prop] = props[fNew-firstKeyFr];
              } else {
                while (keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]) keyFrm++;
                if (firstTime || fNew==sprite.keyFrames[keyFrm-1]) {
                  if (props.prop2 == null) sprite.obj[props.prop] = props[keyFrm-1];
                  else        sprite.obj[props.prop2][props.prop] = props[keyFrm-1];
        } } } } }
      } else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
      if (fNew > tmLn.lastFrame) tmLn.ID = 0;
  } }
}

function MM_timelineGoto(tmLnName, fNew, numGotos) { //v2.0
  //Copyright 1997 Macromedia, Inc. All rights reserved.
  var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,lastKeyFr,propNum,theObj;
  if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
  tmLn = document.MM_Time[tmLnName];
  if (numGotos != null)
    if (tmLn.gotoCount == null) tmLn.gotoCount = 1;
    else if (tmLn.gotoCount++ >= numGotos) {tmLn.gotoCount=0; return}
  jmpFwd = (fNew > tmLn.curFrame);
  for (i = 0; i < tmLn.length; i++) {
    sprite = (jmpFwd)? tmLn[i] : tmLn[(tmLn.length-1)-i]; //count bkwds if jumping back
    if (sprite.charAt(0) == "s") {
      numKeyFr = sprite.keyFrames.length;
      firstKeyFr = sprite.keyFrames[0];
      lastKeyFr = sprite.keyFrames[numKeyFr - 1];
      if ((jmpFwd && fNew<firstKeyFr) || (!jmpFwd && lastKeyFr<fNew)) continue; //skip if untouchd
      for (keyFrm=1; keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]; keyFrm++);
      for (j=0; j<sprite.values.length; j++) {
        props = sprite.values[j];
        if (numKeyFr == props.length) propNum = keyFrm-1 //keyframes only
        else propNum = Math.min(Math.max(0,fNew-firstKeyFr),props.length-1); //or keep in legal range
        if (sprite.obj != null) {
          if (props.prop2 == null) sprite.obj[props.prop] = props[propNum];
          else        sprite.obj[props.prop2][props.prop] = props[propNum];
      } }
    } else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
  }
  tmLn.curFrame = fNew;
  if (tmLn.ID == 0) eval('MM_timelinePlay(tmLnName)');
}

function MM_initTimelines() { //v4.0
    //MM_initTimelines() Copyright 1997 Macromedia, Inc. All rights reserved.
    var ns = navigator.appName == "Netscape";
    var ns4 = (ns && parseInt(navigator.appVersion) == 4);
    var ns5 = (ns && parseInt(navigator.appVersion) > 4);
    document.MM_Time = new Array(1);
    document.MM_Time[0] = new Array(1);
    document.MM_Time["Timeline1"] = document.MM_Time[0];
    document.MM_Time[0].MM_Name = "Timeline1";
    document.MM_Time[0].fps = 6;
    document.MM_Time[0][0] = new String("behavior");
    document.MM_Time[0][0].frame = 61;
    document.MM_Time[0][0].value = "MM_timelineGoto('Timeline1','1')";
    document.MM_Time[0].lastFrame = 61;
    for (i=0; i<document.MM_Time.length; i++) {
        document.MM_Time[i].ID = null;
        document.MM_Time[i].curFrame = 0;
        document.MM_Time[i].delay = 1000/document.MM_Time[i].fps;
    }
}

function message(){
      //var message='敬告各顧客:\n今天(2001/04/17)下午3:30至4:00系統維修中,資料庫將關閉,敬請稍後再上站,謝謝!!如有不便,敬請原諒!!';
      var message='敬告各顧客:\n\n目前現上刷卡機制維護中,\n暫時無法使用線上刷卡付款。\n造成不便,敬請原諒!!';
      alert(message); 
    }
    

    
function CreateFreeWindow( txturl){
    msgWindow = window.open(txturl,"displayWindow",
            "toolbar=yes,width=800,height=600,location=0,directories=no,status=no,scrollbars=yes,resizable=no,menubar=yes");
    msgWindow.focus();
    }
    
function MemberOnlyWindow(){
    //flag=confirm('此為會員專區!\n必須登入才能參觀或是用免費參觀區參觀~\n是否進入免費參觀區??');
    //if(flag){
    // window.location.replace('guest.php');
    //alert('你已經進入會員參觀區!!離開請點選"會員登出"離開~');
    // }else window.location.replace('index.php');
    var message='此為會員專屬權益，請先登入會員!!';
    alert(message);
}

function isCorrect(frm){
    if (frm.mail.value.length == 0){
      alert('請輸入帳號及密碼 !!'); 
      frm.mail.focus();      
      return false; 
    }else if (frm.pwd.value.length < 4 || frm.pwd.value.length > 8) {
      alert('密碼長度不正確 !!'); 
      frm.pwd.focus();      
      return false; 
    }	
}

function GoNext(frm) {
    frm.submit();
}

function GoNext1(item) {    
    if(item==2){
        form2.action = '/unit001/free00016/today_index.php'; // 今日運勢            
       } 
    if(item==1){
        form2.action = '/unit001/free00021/fs1_index.php'; // 吉時吉色            
        }       
    if(item==3){
        form2.action = '/unit001/free00017/auspicious.php'; // 吉時吉色        
        }         
        form2.submit();
}
    
function Renew(frm) {
    oWin = window.open("rn_entermail.htm","LogonWin","width=400,height=100,scrollbars=no,resizable=no");
    if (oWin.opener == null) oWin.opener = window;
    oWin.focus()
}
    
function CreateWindow( txturl){
    msgWindow = window.open(txturl,"displayWindow","toolbar=no,width=610,height=365,location=0,directories=no,status=no,scrollbars=no,resizable=no,menubar=no,top=0,left=0");
    msgWindow.focus();
}
      
function AlertMessages(){
    alert("本網頁為保有會員之隱私權, 即日起不再刊登會員\n\n樂透選號之中獎名單, 唯樂透對獎活動仍然有效, \n\n中獎者仍將公佈在樂透中獎公告網頁中, 請隨時參考.\n\n");
}

function AlertMessages2(){
    alert("甜甜圈之友,您好：\n\n關於甜甜圈之友定盤將於1/14下午3點鐘上線，\n敬請期待！謝謝！\n");
}

function CreateNewWindow( txturl){
    msgWindow = window.open(txturl,"displayWindow","toolbar=no,width=610,height=365,location=0,directories=no,status=no,scrollbars=no,resizable=no,menubar=no,top=0,left=0");
    msgWindow.focus();
}
