

/*
    Viva Mambo, Inc. JavaScriptライブラリ
    Ver.0.01
    http://www.viva-mambo.co.jp/
    作成日：2006年7月05日
    更新日：2006年7月05日
    Copyright 2006 Viva Mambo, Inc. All Rights Reserved.
*/


/*--------------------------------------------------------------------
	onsubmitでsubmitボタンをdisableにする
--------------------------------------------------------------------*/

var DisableSubmit = {
   set: function(elements) {
      var _that = this;
      for (var i = 0; i < document.forms.length; ++i) {
         if(document.forms[i].onsubmit) continue;
         document.forms[i].onsubmit = function() {
            _that.setDisable(this.elements);
         };
      }
   },

   setDisable: function(elms) {
      for (var i = 0; i < elms.length; i++) {
         var elm = elms[i];
         if (elm.type == 'submit') {
            Set(elm);
            unSet(elm);
         }
      }

      function Set(button) {
         window.setTimeout(function() { button.disabled = true; }, 1);
      }
      function unSet(button) {
         window.setTimeout(function() { button.disabled = false; }, 1000);
      }
   }
}

window.onload = function() {
   DisableSubmit.set();
}


/*--------------------------------------------------------------------
	テキストボックスのvalueを空にする
--------------------------------------------------------------------*/

function initSearchWord() {
	if (document.form1.searchWord.value == '検索キーワード') {
		document.form1.searchWord.value = "";
	}
}


/*--------------------------------------------------------------------
	テキストボックスのvalueを評価する
--------------------------------------------------------------------*/

function checkSearchWord() {
	if (document.form1.searchWord.value == '検索キーワード'){
		alert('検索したいキーワードを入力してください');
		return false;
	} else {
		return true;
	}
}