zonble.jumpmenu=function(targ,selObj,restore){
   if(!selObj.options[selObj.selectedIndex].value){
      return false;
   }
   eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
   if (restore)
      selObj.selectedIndex=0;
}

zonble.border_add=function(object) {
   object.style.border = '1px solid #000';
}

zonble.border_del=function(object) {
   object.style.border = '1px solid #999';
}


// 在確定有迴響內容的時候，才能夠使用「送出」按鈕
function checkcomment(){
   if(document.getElementById('author').value.length < 2 || document.getElementById('text').value.length < 2){
      document.getElementById('submit').disabled = true;
   } else {
      document.getElementById('submit').disabled = false;
   }
   if(document.getElementById('author').value.length < 2){
      document.getElementById('author_star').style.display = "inline";
      document.getElementById('author_star').style.color = "red";
   } else {
      document.getElementById('author_star').style.display = "none";
   }
   if(document.getElementById('text').value.length < 2){
      document.getElementById('text_star').style.display = "inline";
      document.getElementById('text_star').style.color = "red";
   } else {
      document.getElementById('text_star').style.display = "none";
   }	
}

//檢查是否重複送出留言
var commentcount = 0;
function submitcheck(form) {
   if (commentcount==0) {
      commentcount++;
      return true;
   } else {
      alert("雖然系統的回應有點慢，但是您的留言已經送出了，請不要繼續重複送出。\n不然，同一篇留言出現好幾次，是會造成別人困擾的。");
      return false;
   }
}

// 單篇文章 Javascript 初始化
var HOST = 'zonble.twbbs.org';

// Cookie 相關
// Copyright (c) 1996-1997 Athenia Associates.
// http://www.webreference.com/js/
// License is granted if and only if this entire
// copyright notice is included. By Tomer Shiran.

zonble.cookie = new Object;
zonble.cookie.setCookie = function (name, value, expires, path, domain, secure) {
   var curCookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "");
   document.cookie = curCookie;
}

zonble.cookie.getCookie = function (name) {
   var prefix = name + '=';
   var c = document.cookie;
   var nullstring = '';
   var cookieStartIndex = c.indexOf(prefix);
   if (cookieStartIndex == -1)
      return nullstring;
   var cookieEndIndex = c.indexOf(";", cookieStartIndex + prefix.length);
   if (cookieEndIndex == -1)
      cookieEndIndex = c.length;
   return unescape(c.substring(cookieStartIndex + prefix.length, cookieEndIndex));
}

   zonble.cookie.deleteCookie = function (name, path, domain) {
      if (getCookie(name))
	 document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
   }

zonble.cookie.fixDate = function (date) {
   var base = new Date(0);
   var skew = base.getTime();
   if (skew > 0)
      date.setTime(date.getTime() - skew);
   return date;
}

zonble.cookie.rememberMe = function (f) {
   var now = new Date();
   zonble.cookie.fixDate(now);
   now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
   zonble.cookie.setCookie('mtcmtauth', f.author.value, now, '', HOST, '');
   zonble.cookie.setCookie('mtcmtmail', f.email.value, now, '', HOST, '');
   zonble.cookie.setCookie('mtcmthome', f.url.value, now, '', HOST, '');
}

zonble.cookie.forgetMe = function (f) {
   zonble.cookie.deleteCookie('mtcmtmail', '', HOST);
   zonble.cookie.deleteCookie('mtcmthome', '', HOST);
   zonble.cookie.deleteCookie('mtcmtauth', '', HOST);
   f.email.value = '';
   f.author.value = '';
   f.url.value = '';
}
