﻿/* ================================= */
/* Original Information Co.,LTD.     */
/* http://www.original.com.tw        */
/* email:service@original.com.tw     */
/* ================================= */

var dwPgDoc=document;
function dwDocPrint(a){
  dwPgDoc.write(a);
  return;
};
function dw_change_root(d){
  window.location.href=d;
};
function print_this_page(d){
  newwin=window.open(d,'_friendly_print','menubar=yes,status=no,scrollbars=yes,resizable=yes,toolbar=no,left=20,top=20,width=720,height=560');
  newwin.focus();
  return;
};
function send_this_page(){
  if(document.getElementById('friendly_send_div').style.display=="none")
      {
      dwPgDoc.getElementById('friendly_send_div_01').innerText=mal_wd01+" : ";
      dwPgDoc.getElementById('friendly_send_div_02').innerText=mal_wd02+" : ";
      dwPgDoc.getElementById('friendly_send_div_03').innerText=mal_wd03+" : ";
      dwPgDoc.getElementById('friendly_send_div_04').innerText=mal_wd04+" : ";
      dwPgDoc.getElementById('friendly_send_div_send').innerText=mbr_wd16;
      dwPgDoc.getElementById('friendly_send_div_reset').innerText=mbr_wd05;
      dwPgDoc.getElementById('friendly_send_div').style.display="block";
      dwPgDoc.getElementById('friendly_send_div').style.visibility="visible";
      location.href="#DotWeb_BM_TO_BOTTOM";
      return;
      }
  else
      {
      dwPgDoc.getElementById('friendly_send_div').style.visibility="hidden";
      dwPgDoc.getElementById('friendly_send_div').style.display="none";
      return;
      }
};
function re_old_fourm(webitem_no,webno){
  newwin=window.open('/forum/re_old_forum.jsp?id='+webitem_no+'&webno='+webno,'add_new_forum','menubar=no,status=no,scrollbars=no,resizable=yes,toolbar=no,left=100,top=100,width=460,height=450')
  newwin.focus();
  return;
};
function add_new_fourm(webno){
    newwin=window.open('/forum/add_new_forum.jsp?webno='+webno,'add_new_forum','menubar=no,status=no,scrollbars=no,resizable=yes,toolbar=no,left=100,top=100,width=460,height=450');
    newwin.focus();
    return;
};
function new_guestbook_message(webno){
    newwin=window.open('add_book.jsp?webno='+webno,'guestbook_add','menubar=no,status=no,scrollbars=no,resizable=yes,toolbar=no,left=200,top=100,width=440,height=340');
    newwin.focus();
    return;
};
function write_select(obname,array,num){
  document.write('<select class=cselect name='+obname+'>');
  for(i=0;i<array.length;i++)
      {
      if(num!="")
          {
          document.write('<option ');
          if(num==i)
          document.write(' selected ');
          document.write(' value='+i+'>'+array[i]+'<\/option>');
          }
      else
          document.write('<option value='+i+'>'+array[i]+'<\/option>');
      }
  document.write('<\/select>');
};
function re_select(obname,array,num){
   var re_selectStr='';
   re_selectStr+='<select class=cselect name='+obname+'>';
   for(i=0;i<array.length;i++)
       {
       if(num!="")
           {
           re_selectStr+='<option ';
           if(num==i)
           re_selectStr+=' selected ';
           re_selectStr+=' value='+i+'>'+array[i]+'<\/option>';
           }
       else
       re_selectStr+='<option value='+i+'>'+array[i]+'<\/option>';
       }
   re_selectStr+='<\/select>';
   return re_selectStr;
};
function write_option(array,num){
    for(i=0;i<array.length;i++)
        {
        if(num!="")
            {
            document.write('<option ');
                if(num==i)
                    document.write(' selected ');
                document.write(' value='+i+'>'+array[i]+'<\/option>');
            }
        else
        document.write('<option value='+i+'>'+array[i]+'<\/option>');
        }
};
function re_option(array,num){
    var re_optionStr='';
    for(i=0;i<array.length;i++)
        {
        if(num!="")
            {
            re_optionStr+='<option ';
                if(num==i)
                    re_optionStr+=' selected ';
                re_optionStr+=' value='+i+'>'+array[i]+'<\/option>';
            }
        else
        re_optionStr+='<option value='+i+'>'+array[i]+'<\/option>';
        }
    return re_optionStr;
};
function write_radio(obname,array,num){
    for(i=0;i<array.length;i++)
        {
        if(num!="")
            {
            document.write('<input name='+obname+' type=radio ');
                if(num==i)
                    document.write(' checked ');
                document.write(' value='+i+'>'+array[i]);
            }
        else
        document.write('<input name='+obname+' type=radio value='+i+'>'+array[i]);
        }
};
function re_radio(obname,array,num){
    var re_radioStr='';
    for(i=0;i<array.length;i++)
        {
        if(num!="")
            {
            re_radioStr+='<input name='+obname+' type=radio ';
                if(num==i)
                   re_radioStr+=' checked ';
                re_radioStr+=' value='+i+'>'+array[i];
            }
        else
        re_radioStr+='<input name='+obname+' type=radio value='+i+'>'+array[i];
        }
    return re_radioStr;
};
var error_picsrc="/adm-img/pic_not_fond.gif"
var menu_bnr_htm="";
var flot_bnr_htm="";
var mbr_login_chk="";
function send_from_to_mail(){
    window.location.href="#DotWeb_BM_BackToTop";
    loginText = "<TABLE SUMMARY='Progress Bar' BORDER='0' WIDTH='100%' ><TR><TD STYLE='padding:22px;' ALIGN='center' VALIGN='top' ><TABLE SUMMARY='Progress Bar' CELLSPACING='5' CELLPADDING='5'  BORDER='0'  BGCOLOR='ffffff'><TR><TD ALIGN='center'><MAR"+"QUEE CLASS='loadingmarquee' DIRECTION='right' SCROLLAMOUNT='8' SCROLLDELAY='100'><SPAN CLASS='progressBarHandle-0'></SPAN><SPAN CLASS='progressBarHandle-1'></SPAN><SPAN CLASS='progressBarHandle-2'></SPAN><SPAN CLASS='progressBarHandle-3'></SPAN><SPAN CLASS='progressBarHandle-4'></SPAN></MAR"+"QUEE><BR>Sending...<BR><TD></TR></TABLE><TD></TR></TABLE>";
    if (document.layers)
        {
        document.loadingMSG.document.write(loginText);
        document.loadingMSG.document.close();
        }
    else
        {
        loadingMSG.innerHTML = loginText;
        }
    document.onweb_jsp_f2m.target="banr_counter_hidn_win"
    document.onweb_jsp_f2m.action="/inc_file/form2mail_bean.jsp"
    document.onweb_jsp_f2m.method="get"
    document.onweb_jsp_f2m.submit();
    document.onweb_jsp_f2m.disabled=true;
};
function fisstcheck_search(){
	dwPgDoc.site_search_txt.search.disabled=true;
	var firstsch_msgTimer;
  window.clearTimeout(firstsch_msgTimer);
	firstsch_msgTimer=setTimeout("dwPgDoc.site_search_txt.search.disabled=false",1500);
}
function check_search(){
	  dwPgDoc.site_search_txt.search.disabled=true;
    var sch_msgTimer;
    window.clearTimeout(sch_msgTimer);
    sch_msgTimer=setTimeout("hidden_sch_msg()",5000);
};
function loading_data(){
  var s_obj=dwPgDoc.site_search_txt.search_text;
  if(s_obj.value=="Search")
      {
      s_obj.value=""
      setTimeout("s_obj.focus()",0);
      }
  if(s_obj.value.length>=2)
      {
      loginText = "<TABLE SUMMARY='Typesetting Table' BORDER='0' WIDTH='100%' ><TR><TD STYLE='PADDING:22px;' ALIGN='CENTER' VALIGN='TOP' ><TABLE SUMMARY='Loading Message' CELLSPACING='5' CELLPADDING='5'  BGCLOLR='ffffff'><TR><TD ALIGN='center'><MAR"+"QUEE CLASS='loadingmarquee' DIRECTION='right' SCROLLAMOUNT='8' SCROLLDELAY='100'><SPAN CLASS='progressBarHandle-0'></span><SPAN CLASS='progressBarHandle-1'></SPAN><SPAN CLASS='progressBarHandle-2'></SPAN><SPAN CLASS='progressBarHandle-3'></SPAN><SPAN CLASS='progressBarHandle-4'></SPAN></MAR"+"QUEE><BR>Loading...<BR><TD></TR></TABLE><TD></TR></TABLE>";
      if (document.layers)
          {
          document.loadingMSG.document.write(loginText);
          document.loadingMSG.document.close();
          }
      else
          {
          loadingMSG.innerHTML = loginText;
          }
      dwPgDoc.site_search_txt.submit();
      dwPgDoc.site_search_txt.search.disabled=true;
      }
  else
      {
      event.keyCode=9;
      var sch_msg_obj=dwPgDoc.getElementById('search_msg');
      if(sch_msg_obj)
          {
          sch_msg_obj.innerHTML=sch_wd01;
          sch_msg_obj.style.display="block";
          sch_msg_obj.style.filter="progid:DXImageTransform.Microsoft.Shadow(direction=135,color=#333333,strength=2)";
          }
      check_search();
      //alert(sch_wd01);

      }
  return;
};
function hidden_sch_msg(d){
	var sch_msg_obj=dwPgDoc.getElementById('search_msg');
	dwPgDoc.site_search_txt.search.disabled=false;
	dwPgDoc.site_search_txt.search_text.focus();
	sch_msg_obj.innerHTML="";
  sch_msg_obj.style.display="none";
};
function stoploading(){
    loadingMSG.innerHTML = "";
    return;
};
String.prototype.trim=trim;
function trim(){
   return this.replace(/^\s+|\s+$/g, "");
};
function validate_empty(field){
  ////check empty
  var kk=field.value;
  kk=kk.trim();
  if (kk == '')
    {
    alert('error!!');
    field.focus();
    }
};
function do_replace(str, replace_what, replace_with){
	var ndx = str.indexOf(replace_what);
	var delta = replace_with.length - replace_what.length;
	while (ndx >= 0)
	    {
	    str = str.substring(0,ndx) + replace_with + str.substring(ndx + replace_what.length);
	    ndx = str.indexOf(replace_what, ndx + delta + 1);
	    }
	return str;
};

function validate_email(){
    //ONKEYPRESS
    if ((event.keyCode < 48 || event.keyCode > 57)&&(event.keyCode < 65 || event.keyCode > 90)&&(event.keyCode < 97 || event.keyCode > 122)&&(event.keyCode < 95 || event.keyCode > 95)&&(event.keyCode < 46 || event.keyCode > 46)&&(event.keyCode < 64 || event.keyCode > 64)&&(event.keyCode < 45 || event.keyCode > 45) )
      event.returnValue = false;
};
function validate_id(){
    //ONKEYPRESS
    if ((event.keyCode < 48 || event.keyCode > 57)&&(event.keyCode < 65 || event.keyCode > 90)&&(event.keyCode < 97 || event.keyCode > 122)&&(event.keyCode < 95 || event.keyCode > 95)&&(event.keyCode < 45 || event.keyCode > 45) )
        event.returnValue = false;
};
function switchTab(tabpage,tabid){
    var oItem = document.getElementById(tabpage);
	  for(var i=0;i<oItem.children.length;i++)
	      {
		    var x = oItem.children(i);
		    x.className = "";
		    var y = x.getElementsByTagName('a');
		    y[0].style.color="#333333";
	      }
	  document.getElementById(tabid).className = "TB_Sel";
};
var mod1PopMenuTimer;
var mod1PopMenuId;
var mod1PopMenuOutId;
var mod1PopOffsetTop=-99999;
var mod1PopOffsetLeft=-99999;
function forceHideMenu(d){
    window.clearTimeout(mod1PopMenuTimer);
    mod1PopMenuId=d;
    mod1PopMenuOutId=d;
    //mod1PopMenuTimer=setTimeout("mod1HideMenu()",1000);
    //mod1PopMenuTimer=setTimeout("document.getElementById(mod1PopMenuId).style.visibility='hidden'",1000);
    document.getElementById(mod1PopMenuOutId).style.visibility='hidden';
};
function mod1HideMenu(){
    document.getElementById(mod1PopMenuId).style.visibility='hidden';
    window.clearTimeout(mod1PopMenuTimer);
};
function mod1PopMenu(single_id,this_event,site_style){
    //document.title=mod1PopOffsetTop;
    mod1PopMenuId=single_id;
    if(this_event=="mover")
        {
        window.clearTimeout(mod1PopMenuTimer);
        dwPgDoc.getElementById(mod1PopMenuId).style.visibility='visible';
        if(site_style=="top")
            {
            if(mod1PopOffsetTop==-99999)
                {
                mod1PopOffsetTop=(dwPgDoc.getElementById(mod1PopMenuId).offsetTop+15);
                }
            dwPgDoc.getElementById(mod1PopMenuId).style.top=mod1PopOffsetTop;
            }
        else
        	  {
        	  dwPgDoc.getElementById(mod1PopMenuId).style.top=dwPgDoc.getElementById(mod1PopMenuId).offsetTop;
        	  }

        if(site_style==4)
            {

            if(mod1PopOffsetTop==-99999)
                {
                mod1PopOffsetTop=(dwPgDoc.getElementById(mod1PopMenuId).offsetTop+14);
                }
            dwPgDoc.getElementById(mod1PopMenuId).style.top=mod1PopOffsetTop;
            }
        else
        	  {
        	  dwPgDoc.getElementById(mod1PopMenuId).style.top=dwPgDoc.getElementById(mod1PopMenuId).offsetTop;
        	  }

        if(site_style==6||site_style==3)
            {
            if(mod1PopOffsetLeft==-99999)
                {
                mod1PopOffsetLeft=(dwPgDoc.getElementById(mod1PopMenuId).offsetLeft-180-60);

                }
            dwPgDoc.getElementById(mod1PopMenuId).style.left=mod1PopOffsetLeft;
            }
        else
        	  {
            dwPgDoc.getElementById(mod1PopMenuId).style.left=dwPgDoc.getElementById(mod1PopMenuId).offsetLeft;
            }
        }
    if(this_event=="mout")
        {
        mod1PopMenuTimer=setTimeout("mod1HideMenu()",300);
        }
};
function loadsMar_quee(){
  var speed=55;
  dwPgDoc.getElementById('marq_ee2').innerHTML=dwPgDoc.getElementById('marq_ee1').innerHTML;
  var newsMarqu=setInterval(sMar_quee,speed);
  dwPgDoc.getElementById('marq_ee0').onmouseover=function() {clearInterval(newsMarqu)}
  dwPgDoc.getElementById('marq_ee0').onmouseout=function() {newsMarqu=setInterval(sMar_quee,speed)}
};
function sMar_quee(){
  if(dwPgDoc.getElementById('marq_ee2').offsetTop-dwPgDoc.getElementById('marq_ee0').scrollTop<=0)
    dwPgDoc.getElementById('marq_ee0').scrollTop-=dwPgDoc.getElementById('marq_ee1').offsetHeight;
  else
    dwPgDoc.getElementById('marq_ee0').scrollTop++;
};
function my_clender_module(){
  if(dwPgDoc.getElementById('my_clender_module'))
      {
      for(var i=0;i<=11;i++)
        {
        if(dwPgDoc.getElementById('clendermonth'+i))
            dwPgDoc.getElementById('clendermonth'+i).innerHTML=clendMomthArr[i];
        }
      for(var i=0;i<=6;i++)
        {
        if(dwPgDoc.getElementById('clenderweek'+i))
            dwPgDoc.getElementById('clenderweek'+i).innerHTML=clendWeekArr[i];
        }
      }
  if(dwPgDoc.getElementById('firstDayInMonth'))
	    {
	    var name2Value=dwPgDoc.getElementById('firstDayInMonth').name;
	    var month_name="";
	    var weekInYear="";
	    var wdx = name2Value.indexOf('week');
      month_name = name2Value.substring(5,wdx);
	    weekInYear = name2Value.substring(wdx+4,name2Value.length);
	    dwPgDoc.getElementById('firstDayInMonth').innerHTML=""+clendMomthArr[parseInt(month_name)]+"";
	    //dwPgDoc.getElementById('firstDayInMonth').title="第"+weekInYear+"週";
	    }
};
function killAllErrors() {
  return true;
};
window.onerror = killAllErrors;