﻿function killAllErrors() {
  return true;
}
window.onerror = killAllErrors;
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")
        {
        document.getElementById('friendly_send_div_01').innerText=mal_wd01+" : ";
        document.getElementById('friendly_send_div_02').innerText=mal_wd02+" : ";
        document.getElementById('friendly_send_div_03').innerText=mal_wd03+" : ";
        document.getElementById('friendly_send_div_04').innerText=mal_wd04+" : ";
        document.getElementById('friendly_send_div_send').innerText=mbr_wd16;
        document.getElementById('friendly_send_div_reset').innerText=mbr_wd05;
        document.getElementById('friendly_send_div').style.display="block";
        document.getElementById('friendly_send_div').style.visibility="visible";
        location.href="#DotWeb_BM_TO_BOTTOM";
        return;
        }
    else
        {
        document.getElementById('friendly_send_div').style.visibility="hidden";
        document.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 loading_data()
    {
    if(document.site_search_txt.search_text.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;
            }
        document.site_search_txt.submit();
        }
    else
        {
        alert(sch_wd01);
        }
    return;
    }
function stoploading()
    {
    loadingMSG.innerHTML = "";
    return;
    }

//new add
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);
        document.getElementById(mod1PopMenuId).style.visibility='visible';
        if(site_style=="top")
            {
            if(mod1PopOffsetTop==-99999)
                { 
                mod1PopOffsetTop=(document.getElementById(mod1PopMenuId).offsetTop+15);
                }
            document.getElementById(mod1PopMenuId).style.top=mod1PopOffsetTop;
            }
        else
        	  {
        	  document.getElementById(mod1PopMenuId).style.top=document.getElementById(mod1PopMenuId).offsetTop;	
        	  }
        
        if(site_style==4)
            {
            if(mod1PopOffsetTop==-99999)
                { 
                mod1PopOffsetTop=(document.getElementById(mod1PopMenuId).offsetTop+14);
                }
            document.getElementById(mod1PopMenuId).style.top=mod1PopOffsetTop;
            }
        else
        	  {
        	  document.getElementById(mod1PopMenuId).style.top=document.getElementById(mod1PopMenuId).offsetTop;	
        	  }
        	  
        if(site_style==6||site_style==3)	
            {
            if(mod1PopOffsetLeft==-99999)
                {
                mod1PopOffsetLeft=(document.getElementById(mod1PopMenuId).offsetLeft-180-60);	
                
                }    
            document.getElementById(mod1PopMenuId).style.left=mod1PopOffsetLeft;    
            }
        else
        	  {
            document.getElementById(mod1PopMenuId).style.left=document.getElementById(mod1PopMenuId).offsetLeft;
            }
        }
    if(this_event=="mout")
        {
        mod1PopMenuTimer=setTimeout("mod1HideMenu()",300);
        }    
    }

// uer functions
var ns4 = (document.layers) ? true : false;
var ie4 = (document.all && !document.getElementById) ? true : false;
var ie5 = (document.all && document.getElementById) ? true : false;
var ns6 = (!document.all && document.getElementById) ? true : false;

function showdiv(sw,obj) {
	// show/hide the divisions
	if (sw && (ie4 || ie5) ) document.all[obj].style.visibility = 'visible';
	if (!sw && (ie4 || ie5) ) document.all[obj].style.visibility = 'hidden';
	if (sw && ns4) document.layers[obj].visibility = 'visible';
	if (!sw && ns4) document.layers[obj].visibility = 'hidden';
}
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.01
  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 && d.getElementById) x=d.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_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 swapFrame(ImageName){
	var href=ImageName;
	window.top.frames[1].location.pathname="/"+href+".htm"
}

// End -->
/* ================================= */
/* Original Information Co.,LTD.     */
/* http://www.original.com.tw        */
/* email:service@original.com.tw     */
/* ================================= */