<!--
function s() { if (parent != self) top.location = self.location;  return true;}

function openNew(address)
{
    win_ref = window.open(address,
                          'main',
                          'toolbar=1,resizable=1,menubar=1,location=1,'+
                          'status=1,scrollbars=1,width=710,height=370,'+
                          'screenX=35,screenY=15');

    win_ref.focus();
    return false;
}

function init()
{
    intrinsicHeight = document.getElementById("content").offsetHeight;
}

function load(offset, bottom)
{
    document.search_form.keywords.focus();
    init();
    position(offset, bottom);
}

function position(offset, bottom)
{
   var height = 0;
   if (bottom) {
      height = 
         Math.max(document.getElementById("w").clientHeight - 20 -
                  document.getElementById("topLink").offsetHeight -
                  document.getElementById("botLink").offsetHeight - offset, 
                  200);
   }
   else {
      height =
         Math.min(intrinsicHeight, 
                  Math.max(200,
                           document.getElementById("w").clientHeight - 20 -
                           document.getElementById("topLink").offsetHeight -
                           document.getElementById("botLink").offsetHeight - offset));
   
   }
   if (typeof(window.innerHeight) == 'number') {
      height = window.innerHeight -
               document.getElementById("topLink").offsetHeight - 50 -
               document.getElementById("botLink").offsetHeight - offset;
   }
   document.getElementById("content").style.height = height;
}

function subscribe(group) {
      var user = document.sub_form.user.value;
      if (user == null) {
         return;
      }
      user = user.trim();
      if (user.length == 0) {
         return;
      }
      var index = 0;
      if (group == null) {
         group = "bcbsr";
      } else if ((index = group.indexOf("-GB")) > 0){
         var array = user.split("@");
         if (array.length > 1) {
            host = array[1].toLowerCase();2
            if (host.indexOf("yahoo") >= 0 ||
                host.match(/\d+.com/g)) {
                group = "bcbsr-gb";
            }
         }
      } else if ((index = group.indexOf("-Big5")) > 0) {
         array = user.split("@");
         if (array.length > 1) {
            host = array[1].toLowerCase();
            if (host.indexOf("yahoo") >= 0 ||
                host.match(/\d+.com/g)) {
                group = "bcbsr-big5";
            }
         }
      }
      var url="http://groups.yahoo.com/subscribe/" + group + "?user=" + user;
      return openNew(url);
   }

   String.prototype.trim = function() {
      return this.replace(/^\s+|\s+$/g,'');
   }
 
   String.prototype.ltrim = function() {
      return this.replace(/^\s+/g,'');
   }

   String.prototype.rtrim = function() {
      return this.replace(/\s+$/g,'');
   }
//-->
