/*
==================================
 人脈網 - 自定JS物件函數

 設計者: Yamaka
 2009/03/08, 2009/03/18

 myjss.js
==================================
*/

// 檢查欄位內容, 並去除 前後空白, tag, script
fieldIsEmpty = function(field) {
  var value = field.value.strip().stripScripts().stripTags();
  field.value = value;
  return (field.value == null || field.value == "");
}


// string trim()
String.prototype.trim = function() {  
  return this.strip();
  //return this.replace(/(^\s*)|(\s*$)/g, "");
}

String.prototype.isEmpty = function() {
  return (this.trim() == null || this.trim() == "");
}

String.prototype.checkEmail = function() {
  var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
  return (filter.test(this));
}

Position.GetWindowSize = function(w) {
  w = w ? w : window;
  var width = document.body.offsetWidth;
  var height = document.body.offsetHeight;
  return {w:width, h:height};
}

Position.GetWindowSize2 = function(w) {
  w = w ? w : window;
  var width = w.innerWidth || (w.document.documentElement.clientWidth || w.document.body.clientWidth);
  var height = w.innerHeight || (w.document.documentElement.clientHeight || w.document.body.clientHeight);
  return [width, height];
}

var currentWin = "TeamLogin";
function cover0() {
  if (Windows.getWindow("cover0") != null) return;
  var win = new Window({id: "cover0", className: "alphacube", width:200, height:150, closable: false, draggable: false, 
                          maximizable: false, minimizable: false, resizable: false, opacity: 0.7, showEffectOptions: {duration: 0.0}, hideEffectOptions: {duration: 0.0}});
  //win.maximize();
  win.setZIndex(450);
  win.getContent().onclick = function (){
    Windows.getWindow(currentWin).toFront();
  }
}

Prototype.Browser.IE6 = navigator.userAgent.indexOf("MSIE 6.0;") > -1;
