/**
 * 
 *
 * @package 
 * @version   $Id: $
 * @copyright 
 */
xmix = new Object();
xmix.common = new Object();
xmix.common.form = function(){
	this.disabler = function(name){
		jQuery(name).bind("submit", function () {
			 var buttons = jQuery( this ).find(":image, :submit, :select");
			 setTimeout(function () {
				 buttons.attr("disabled", true);
				 setTimeout(function () {
					 buttons.attr("disabled", false);
				 }, 3000);
			 }, 1);
		}).find(":image, :submit, :select").attr("disabled", false);
	}
	this.zen2han = function(value){
		var char1 = new Array("１","２","３","４","５","６","７","８","９","０");
		var char2 = new Array(1,2,3,4,5,6,7,8,9,0);
		var count;

		while(value.match(/[０-９]/)){
			for(count = 0; count < char1.length; count++){
				//入力データを全角数字から半角数字に置換する
				value = value.replace(char1[count], char2[count]);
			}
		}
		return value;
	}
	this.submit = function(mode,form,action){

		if(mode != ''){
			$("#mode").val(mode);
		}

		if(form == ''){
			form = 'form';
		}

		if(action != ''){
			$("#" + form).attr("action",action);	
		}

		this.disabler(form);
		$("#" + form).submit();
	}
}
var xcf = new xmix.common.form();

