/******************************************************************************
函數名稱 : Clipboard()
函數說明 : 剪貼簿物件
傳入參數 : void
傳 回 值 : [Object] Clipboard 物件
撰寫日期 : 2005/1/1
備    註 : 
*******************************************************************************/
function Clipboard(id)
{
  //private property
  this.clipboard = window.clipboardData;

  //public property

  //private method

  //public method
  this.clearData = clearClipboardData;
  this.setData = setClipboardData;
  this.getData = getClipboardData;

  return this;
}

/******************************************************************************
函數名稱 : clearClipboardData()
函數說明 : 清除剪貼簿物件資料
傳入參數 : void
傳 回 值 : void
撰寫日期 : 2005/1/1
備    註 : 
*******************************************************************************/
function clearClipboardData()
{
  this.clipboard.clearData();
  return;
}

/******************************************************************************
函數名稱 : setClipboardData(format, data)
函數說明 : 設定剪貼簿物件資料
傳入參數 : format-----資料格式
           data-------資料內容
傳 回 值 : [Boolean] true:成功 false:失敗
撰寫日期 : 2005/1/1
備    註 : 
*******************************************************************************/
function setClipboardData(format, data)
{
  return this.clipboard.setData(format, data);
}

/******************************************************************************
函數名稱 : getClipboardData(format)
函數說明 : 取得剪貼簿物件資料
傳入參數 : format-----資料格式
傳 回 值 : [String] 資料內容
撰寫日期 : 2005/1/1
備    註 : 
*******************************************************************************/
function getClipboardData(format)
{
  return this.clipboard.getData(format);
}

//=================================================================================================

/******************************************************************************
函數名稱 : ElementObject(id)
函數說明 : 依 HTML id 屬性取得元素相關物件
傳入參數 : id [String] HTML id 屬性
傳 回 值 : [Object] ElementObject 物件
撰寫日期 : 2005/1/1
備    註 : 
*******************************************************************************/
function ElementObject(id)
{
  //private property

  //public property
  this.id = id;
  this.object = null;
  this.style = null;

  //private method

  //public method
  this.getInnerHTML = getInnerHTML;
  this.getOuterHTML = getOuterHTML;

  return this;
}

/******************************************************************************
函數名稱 : getInnerHTML()
函數說明 : 取得物件標籤內的 HTML 原始碼
傳入參數 : void
傳 回 值 : [String] HTML 原始碼
撰寫日期 : 2005/1/1
備    註 : 
*******************************************************************************/
function getInnerHTML()
{
  var i;
  var len;
  var html = "";
  var childNodes;
  var childNode;

  if (this.object != null)
  {
    if (this.object.innerHTML)
      html += this.object.innerHTML.toLowerCase();
    else
    {
      childNodes = this.object.childNodes;
      len = childNodes.length;

      for (i = 0; i < len; i++)
      {
        childNode = childNodes.item(i);
        html += gDOMSerializer.serialize(childNode, "");
      }
    }
  }

  return html;
}

/******************************************************************************
函數名稱 : getOuterHTML()
函數說明 : 取得物件標籤內的 HTML 原始碼 (含物件本身的標籤)
傳入參數 : void
傳 回 值 : [String] HTML 原始碼
撰寫日期 : 2005/1/1
備    註 : 
*******************************************************************************/
function getOuterHTML()
{
  var html = "";

  if (this.object != null)
  {
    if (this.object.outerHTML)
      html += this.object.outerHTML.toLowerCase();
    else
      html += gDOMSerializer.serialize(this.object, "");
  }

  return html;
}

//=================================================================================================

/******************************************************************************
函數名稱 : getObjectById(id)
函數說明 : 依 HTML id 屬性取得物件
傳入參數 : id [String] HTML id 屬性
傳 回 值 : [Object] ElementObject 物件
撰寫日期 : 2005/1/1
備    註 : 
*******************************************************************************/
function getObjectById(id)
{
  var element = new ElementObject(id);

  if (window.document.getElementById)
  {
    if (window.document.getElementById(id) != null)
    {
        element.object = window.document.getElementById(id);
      element.style = window.document.getElementById(id).style;
    }
  }
  else if (window.document.all)
  {
    if (window.document.all[id] != null)
    {
      element.object = window.document.all[id];
      element.style = window.document.all[id].style;
    }
  }
  else if (window.document.layers)
  {
    if (window.document.layers[id] != null)
    {
         element.object = window.document.layers[id];
         element.style = window.document.layers[id];
    }
  }

  return element;
}


function get_select_form_bound_object(src_id, des_id, default_id)
{
  var object;
  var value;

  object = getObjectById(src_id).object;
  value = object.value;
  object = getObjectById(des_id + value).object;
  if (object == null) { object = getObjectById(default_id).object; }
  return object;
}

//=================================================================================================

/******************************************************************************
函數名稱 : getEventObject(event)
函數說明 : 取得事件物件
傳入參數 : event [Object] Event 物件
傳 回 值 : [Object] Event 物件
撰寫日期 : 2005/1/1
備    註 : 
*******************************************************************************/
function getEventObject(event)
{
  var e;
  if (typeof(event) == "object") { e = event; }
  else { e = window.event; }
  return e;
}

//=================================================================================================

/******************************************************************************
函數名稱 : Property(key, value)
函數說明 : 記錄物件屬性 (名值對)
傳入參數 : key [Object] 索引鍵
           value [Object] 屬性值
傳 回 值 : [Object] Property 物件
撰寫日期 : 2005/1/1
備    註 : 
*******************************************************************************/
function Property(key, value)
{
  //private property

  //public property
  this.key = key;  //索引鍵
  this.value = value;  //屬性值

  //private method

  //public method

  return this;
}

//=================================================================================================

/******************************************************************************
函數名稱 : Dictionary()
函數說明 : 字典物件
傳入參數 : void
傳 回 值 : [Object] Dictionary 物件
撰寫日期 : 2005/1/1
備    註 : 
*******************************************************************************/
function Dictionary()
{
  //private property
  this.propertys = new Array();

  //public property

  //private method

  //public method
  this.add = dictionaryAdd;
  this.remove = dictionaryRemove;
  this.removeAll = dictionaryRemoveAll;
  this.exists = dictionaryExists;
  this.size = dictionarySize;
  this.isEmpty = dictionaryIsEmpty;
  this.keys = dictionaryKeys;
  this.values = dictionaryValues;
  this.getValue = dictionaryGetValue;

  return this;
}

/******************************************************************************
函數名稱 : dictionaryAdd(key, value)
函數說明 : 在 Dictionary 物件中增加一個索引鍵和項目對
傳入參數 : key [Object] 索引鍵
           value [Object] 屬性值
傳 回 值 : void
撰寫日期 : 2005/1/1
備    註 : 1.若 key 已存在即覆寫 value
*******************************************************************************/
function dictionaryAdd(key, value)
{
  this.propertys[key] = value;
  return;
}

/******************************************************************************
函數名稱 : dictionaryRemove(key)
函數說明 : 從 Dictionary> 物件中移除一組索引鍵、項目對
傳入參數 : key [Object] 索引鍵
傳 回 值 : void
撰寫日期 : 2005/1/1
備    註 : 
*******************************************************************************/
function dictionaryRemove(key)
{
  var value = this.propertys[key];
  delete this.propertys[key];
  return value;
}

/******************************************************************************
函數名稱 : dictionaryRemoveAll()
函數說明 : 從 Dictionary> 物件中移除所有的索引鍵、項目對
傳入參數 : key [Object] 索引鍵
傳 回 值 : void
撰寫日期 : 2005/1/1
備    註 : 
*******************************************************************************/
function dictionaryRemoveAll()
{
  this.propertys = new Array();
  return;
}

/******************************************************************************
函數名稱 : dictionaryExists(key)
函數說明 : 如果索引鍵存在於 Dictionary 物件中，傳回 true，否則傳回 false
傳入參數 : key [Object] 索引鍵
傳 回 值 : [Boolean] true 索引鍵存在
                     false 索引鍵不存在
撰寫日期 : 2005/1/1
備    註 : 
*******************************************************************************/
function dictionaryExists(key)
{
  if (typeof(this.propertys[key]) != "undefined")
    return true;
  return false;
}

/******************************************************************************
函數名稱 : dictionarySize()
函數說明 : Dictionary 物件中儲存的名值對數量
傳入參數 : void
傳 回 值 : [Integer] 名值對數量
撰寫日期 : 2005/1/1
備    註 : 
*******************************************************************************/
function dictionarySize() { return this.propertys.length }

/******************************************************************************
函數名稱 : dictionaryIsEmpty()
函數說明 : Dictionary 物件中儲存的名值對是否為空
傳入參數 : void
傳 回 值 : [Boolean] true 名值對為空
                     false 名值對不為空
撰寫日期 : 2005/1/1
備    註 : 
*******************************************************************************/
function dictionaryIsEmpty() { return this.propertys.length <= 0; }

/******************************************************************************
函數名稱 : dictionaryKeys()
函數說明 : 傳回一個陣列，其中包含 Dictionary 物件中現存的所有索引鍵
傳入參數 : void
傳 回 值 : [Array] 索引鍵陣列
撰寫日期 : 2005/1/1
備    註 : 
*******************************************************************************/
function dictionaryKeys()
{
  var keys = new Array();
  for(var key in this.propertys)
    keys[keys.length] = key;
  return keys;
}

/******************************************************************************
函數名稱 : dictionaryValues()
函數說明 : 傳回一個陣列，其中包含 Dictionary 物件中的所有項目值
傳入參數 : void
傳 回 值 : [Array] 項目值陣列
撰寫日期 : 2005/1/1
備    註 : 
*******************************************************************************/
function dictionaryValues()
{
  var values = new Array();
  for(var key in this.propertys)
    values[values.length] = this.propertys[key];
  return values;
}

/******************************************************************************
函數名稱 : dictionaryGetValue(key)
函數說明 : 在 Dictionary 物件傳回指定索引鍵的一個項目值
傳入參數 : key [Object] 索引鍵
傳 回 值 : [Object] 項目值
撰寫日期 : 2005/1/1
備    註 : 1.若項目值不存在於 Dictionary 物件則傳回 null
*******************************************************************************/
function dictionaryGetValue(key)
{
  return this.propertys[key];
}

//=================================================================================================

/******************************************************************************
函數名稱 : Navigator()
函數說明 : 瀏覽器物件
傳入參數 : void
傳 回 值 : [Object] Navigator 物件
撰寫日期 : 2005/1/1
備    註 : 
*******************************************************************************/
function Navigator()
{
  //private property
  this.name = window.navigator.appName;

  //public property
  this.MICROSOFT_INTERNET_EXPLORER = 1;
  this.NETSCAPE = 2;

  //private method

  //public method

  //----- 記錄瀏覽器資訊至字典物件 -----
  var key;
  var value;

  key = "navigator.name";
  if (this.name == "Microsoft Internet Explorer") { value = this.MICROSOFT_INTERNET_EXPLORER; }
  else if (this.name == "Netscape") { value = this.NETSCAPE; }
  gDictionary.add(key, value);

  return this;
}

/******************************************************************************
函數名稱 : addBookmark(url, name)
函數說明 : 加入我的最愛
傳入參數 : url [Object] URL
           name [Object] 名稱
傳 回 值 : void
撰寫日期 : 2005/1/1
備    註 : 
*******************************************************************************/
function addBookmark(url, name)
{
  window.external.AddFavorite(url, name);
}

//=================================================================================================

/**************************************************************************************************
*
* 表單操作函式區
*
**************************************************************************************************/

function city_address_synchronization(dictionary_key, src_id, des_id, property_name)
{
  var i;
  var len;
  var re;

  var object;
  var value;

  var option;
  var options;

  var old_city_name;
  var city_name;

  object = getObjectById(src_id).object;
  value = object.value;
  if (value == "0") { return; }

  options = object.options;
  len = options.length;
  city_name = "";

  for (i = 0; i < len; i++)
  {
    option = options[i];

    if (option.value == value)
    {
      eval('city_name = option.' + property_name);
      break;
    }
  }

  if (city_name == "") { return; }
  old_city_name = gDictionary.getValue(dictionary_key);
  if (old_city_name == null) { old_city_name = ""; }

  object = getObjectById(des_id).object;
  value = object.value;

  if (value == '')
    value = city_name;
  else if (old_city_name != "")
  {
    re = new RegExp(old_city_name, "ig");
    value = value.replace(re, city_name);
  }

  object.value = value;
  gDictionary.add(dictionary_key, city_name);

  return;
}

function area_address_synchronization(dictionary_key, src_id, des_id, property_name)
{
  var i;
  var len;
  var re;

  var object;
  var value;

  var option;
  var options;

  var old_area_name;
  var area_name;

  object = getObjectById(src_id).object;
  value = object.value;
  if (value == "0") { return; }

  options = object.options;
  len = options.length;
  area_name = "";

  for (i = 0; i < len; i++)
  {
    option = options[i];

    if (option.value == value)
    {
      eval('area_name = option.' + property_name);
      break;
    }
  }

  if (area_name == "") { return; }
  old_area_name = gDictionary.getValue(dictionary_key);
  if (old_area_name == null) { old_area_name = ""; }

  object = getObjectById(des_id).object;
  value = object.value;

  re = new RegExp(area_name, "ig");
  if (value.search(re) != -1) { area_name = ""; }

  if (value == '' || old_area_name == "")
    value += area_name;
  else 
  {
    re = new RegExp(old_area_name, "ig");
    value = value.replace(re, area_name);
  }

  object.value = value;
  gDictionary.add(dictionary_key, area_name);

  return;
}

function get_area_zip_code(id, property_name)
{
  var i;
  var len;

  var object;
  var value;

  var option;
  var options;

  var zip_code;

  zip_code = "";
  object = getObjectById(id).object;
  value = object.value;
  if (value == "0") { return zip_code; }

  options = object.options;
  len = options.length;

  for (i = 0; i < len; i++)
  {
    option = options[i];

    if (option.value == value)
    {
      eval('zip_code = option.' + property_name);
      break;
    }
  }

  return zip_code;
}

function select_form_bound_select_form(src_id, des_id, default_id)
{
  var i;
  var len;

  var style;
  var object;
  var options;
  var value;

  object = getObjectById(src_id).object;
  value = object.value;
  options = object.options;
  len = options.length;

  for (i = 0; i < len; i++)
  {
    option = options[i];
    style = getObjectById(des_id + option.value).style;
    if (style == null) { continue; }
    style.display = "none";
    style.position = "absolute";
  }

  style = getObjectById(default_id).style;
  if (style != null)
  {
    style.display = "none";
    style.position = "absolute";
  }

  style = getObjectById(des_id + value).style;
  if (style == null) { style = getObjectById(default_id).style; }
  style.position = "static";
  style.display = "inline";
}

function write_information(id, value)
{
  var object;

  object = getObjectById(id).object;
  object.value = value;

  return true;
}

function change_form_action(id, action)
{
  var object;

  object = getObjectById(id).object;
  object.action = action;

  return true;
}

function submit_form(id)
{
  var object;

  object = getObjectById(id).object;
  object.submit();

  return true;
}

function reset_form(id)
{
  var object;

  object = getObjectById(id).object;
  object.reset();

  return true;
}

//=================================================================================================

/**************************************************************************************************
*
* 表單驗證函式區
*
**************************************************************************************************/

function is_empty(value)
{
  if (value == "")
    return true;
  else
    return false;
}

function is_equal(value1, value2)
{
  if (value1 == value2)
    return true;
  else
    return false;
}

function is_oct_number_format(value)
{
  var re = new RegExp("[^0-7]");

  if (value.search(re) == -1)
    return true;
  else
    return false;
}

function is_dec_number_format(value)
{
  var re = new RegExp("[^0-9]");

  if (value.search(re) == -1)
    return true;
  else
    return false;
}

function is_hex_number_format(value)
{
  var re = new RegExp("[^0-9a-fA-F]");

  if (value.search(re) == -1)
    return true;
  else
    return false;
}

function is_dec_float_format(value)
{
  var re = new RegExp("[^0-9\.]");

  if (value.search(re) == -1)
    return true;
  else
    return false;
}

function is_rgb_color_format(value)
{
  var re = new RegExp("^#[0-9a-fA-F]{6}");

  if (value.search(re) == 0)
    return true;
  else
    return false;
}

function is_email_format(value)
{
  var re = new RegExp("(.+)@(.+[.].+)");

  if (value.search(re) == 0)
    return true;
  else
    return false;
}

function is_mobile_phone_format(value)
{
  return is_dec_number_format(value);
}

function is_phone_code_format(value)
{
  return is_dec_number_format(value);
}

function is_phone_format(value)
{
  var re = new RegExp("[^0-9#]");

  if (value.search(re) == -1)
    return true;
  else
    return false;
}

function is_valid_date(year, month, day)
{
  var year = parseInt(year, 10);
  var month = parseInt(month, 10) - 1;
  var day = parseInt(day, 10);
  var date = new Date(year, month, day);

  if (isNaN(date) == false && year == date.getFullYear() && month == date.getMonth() && day == date.getDate())
    return true;
  else
    return false;
}

function is_date_format(value)
{
  var re = new RegExp("[0-9]{4}-[0-9]{2}-[0-9]{2}");

  if (value.search(re) == 0)
    return true;
  else
    return false;
}

function is_number_code_format(value) {
  var re;
  var flag = false;

  //經紀商會員
  if (!flag) {
    re = new RegExp("5[0-9]{6}");

    if (value.length == 7) {
      if (value.search(re) == 0)
        flag = true;
      else
        flag = false;
    }
  }

  //站長會員
  if (!flag) {
    re = new RegExp("[bB][nN][0-9]{9}");

    if (value.length == 11) {
      if (value.search(re) == 0)
        flag = true;
      else
        flag = false;
    }
  }

  //集點會員
  if (!flag) {
    re = new RegExp("[aA][fF][0-9]{9}");

    if (value.length == 11) {
      if (value.search(re) == 0)
        flag = true;
      else
        flag = false;
    }
  }

  return flag;
}

function is_identity_format(value)
{
  var i;
  var alphabet = "ABCDEFGHJKLMNPQRSTUVXYWZIO";
  var firstLetter;
  var TempInt;
  var CheckSum;

  if(value.length != 10)
    return false;
  else
  {
    firstLetter = value.substring(0, 1);
    TempInt = alphabet.indexOf(firstLetter.toUpperCase());

    if(TempInt != -1)
    {
      CheckSum = parseInt(TempInt / 10) + TempInt % 10 * 9 + 1;

      for(i = 1; i < 9; i++)
        CheckSum += parseInt(value.substring(i, i + 1)) * (9 - i);

        CheckSum = (10 - (CheckSum % 10)) % 10;

        if( CheckSum != parseInt(value.substring(9, 10)))
        return false;
    }
    else
      return false;
  }

  return true;
}

function is_unification_format(value)
{
  return true;
}

function is_site_name_format(value)
{
  var i;
  var len = value.length;

  if((value.charAt(0) < 'a' || value.charAt(0) > 'z'))
    return false;

  for(i = 0; i < len; i++)
  {
    if((value.charAt(i) < 'a' || value.charAt(i) > 'z') && (value.charAt(i) < '0' || value.charAt(i) > '9'))
      return false;
  }

  return true;
}



function make_date(year, month, day, separator)
{
  return year + separator + month + separator + day;
}

function make_time(hour, minute, second, separator)
{
  return hour + separator + minute + separator + second;
}



function add_query_string(url, query_string)
{
  var re = new RegExp("\\?");

  if (url.search(re) == -1)
    url += "?" + query_string;
  else
    url += "&" + query_string;

  return url;
}



function run_memo_separator(id)
{
  object = getObjectById(id).object;
  object.value = getMemoSeparatorFormat() + object.value;

  return true;
}

function run_select_all(id) 
{
  object = getObjectById(id).object;
  object.select();

  return true;
}



//=================================================================================================

/**************************************************************************************************
函數名稱 : new_window(url, name, replace, left, top, width, height, toolbar, menubar, status, scrollbars, resizable, location, directories)
函數說明 : 開新視窗
傳入參數 : url-------------欲載入網址
           name------------視窗名稱
           replace---------是否取代原本網址記錄位置
           left------------視窗位置
           top-------------視窗位置
           width-----------視窗寬度
           height----------視窗高度
           toolbar---------開新視窗時是否顯示工具列 yes:顯示 no:隱藏
           menubar---------開新視窗時是否顯示選單列 yes:顯示 no:隱藏
           status----------開新視窗時是否顯示狀態列 yes:顯示 no:隱藏
           scrollbars------開新視窗時是否顯示卷軸列 yes:顯示 no:隱藏
           resizable-------開新視窗時是否可改變視窗大小 yes:是 no:否
           location--------開新視窗時是否顯示網址列 yes:顯示 no:隱藏
           directories-----
傳 回 值 : handle----------視窗 handle
撰寫日期 : 2005/6/1
備    註 : 
**************************************************************************************************/
function new_window(url, name, replace, left, top, width, height, toolbar, menubar, status, scrollbars, resizable, location, directories)
{
  var handle = null;
  var features = "";

  if (typeof(left) != "undefined") { features += "left=" + left + ","; }
  if (typeof(top) != "undefined") { features += "top=" + top + ","; }
  if (typeof(width) != "undefined") { features += "width=" + width + ","; }
  if (typeof(height) != "undefined") { features += "height=" + height + ","; }
  if (typeof(toolbar) != "undefined") { features += "toolbar=" + toolbar + ","; }
  if (typeof(menubar) != "undefined") { features += "menubar=" + menubar + ","; }
  if (typeof(status) != "undefined") { features += "status=" + status + ","; }
  if (typeof(scrollbars) != "undefined") { features += "scrollbars=" + scrollbars + ","; }
  if (typeof(resizable) != "undefined") { features += "resizable=" + resizable + ","; }
  if (typeof(location) != "undefined") { features += "location=" + location + ","; }
  if (typeof(directories) != "undefined") { features += "directories=" + directories + ","; }

  if (features != '') { features = features.substr(0, features.length - 1); }

  handle = window.open(url, name, features, replace);
  handle.focus();

  return handle;
}

/**************************************************************************************************
函數名稱 : open_window(url, name, replace, left, top, width, height, toolbar, menubar, status, scrollbars, resizable, location, directories)
函數說明 : 開啟舊視窗
傳入參數 : url-------------欲載入網址
           name------------視窗名稱
           replace---------是否取代原本網址記錄位置
           left------------視窗位置
           top-------------視窗位置
           width-----------視窗寬度
           height----------視窗高度
           toolbar---------開新視窗時是否顯示工具列 yes:顯示 no:隱藏
           menubar---------開新視窗時是否顯示選單列 yes:顯示 no:隱藏
           status----------開新視窗時是否顯示狀態列 yes:顯示 no:隱藏
           scrollbars------開新視窗時是否顯示卷軸列 yes:顯示 no:隱藏
           resizable-------開新視窗時是否可改變視窗大小 yes:是 no:否
           location--------開新視窗時是否顯示網址列 yes:顯示 no:隱藏
           directories-----
傳 回 值 : 無
撰寫日期 : 2005/6/1
備    註 : 
**************************************************************************************************/
function open_window(url, name, replace, left, top, width, height, toolbar, menubar, status, scrollbars, resizable, location, directories)
{
  close_window();
  handle = new_window(url, name, replace, left, top, width, height, toolbar, menubar, status, scrollbars, resizable, location, directories);
  gDictionary.add("window_handle", handle);
  return true;
}

/**************************************************************************************************
函數名稱 : close_window()
函數說明 : 關閉舊視窗
傳入參數 : 無
傳 回 值 : 無
撰寫日期 : 2005/6/1
備    註 : 
**************************************************************************************************/
function close_window()
{
  var handle = gDictionary.getValue("window_handle");

  if (handle != null && !handle.closed)
      handle.close();

  return true;
}

//=================================================================================================

/**************************************************************************************************
函數名稱 : getAllDay()
函數說明 : 取得 Date 物件當月全部天數
傳入參數 : 無
傳 回 值 : null-----不存在
           當月全部天數
撰寫日期 : 2003/9/1
備    註 : 
**************************************************************************************************/
function getAllDay()
{
  var year;
  var month;
  var allDay;

  year = this.getFullYear();
  month = this.getMonth();

  switch (month + 1)
  {
    case 1:
    case 3:
    case 5:
    case 7:
    case 8:
    case 10:
    case 12:
      allDay = 31;
      break;
    case 4:
    case 6:
    case 9:
    case 11:
      allDay = 30;
      break;
    case 2:
      if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))
        allDay = 29; 
      else
        allDay = 28;
      break;
    default:
      allDay = null;
      break;
  }

  return allDay;
}

Date.prototype.getAllDay = getAllDay;

/**************************************************************************************************
*
* 架構初始區
*
**************************************************************************************************/
window.gDictionary = new Dictionary();  //字典物件
window.gNavigator = new Navigator();  //瀏覽器物件
window.gClipboard = new Clipboard();  //剪貼簿物件

function run_oncontextmenu(event)
{
  return false;
}

function run_onkeydown(event)
{
  var object;
  var event = getEventObject(event);
  var keyCode = event.keyCode;
  if (keyCode == 13)
  {
    object = getObjectById("start_search").object;
    if (object != null) { object.click(); }
  }
}

//window.document.oncontextmenu = run_oncontextmenu;
window.document.onkeydown = run_onkeydown;



