var SubmitButton = {};
SubmitButton.holder;

SubmitButton.init=function(obj){
	SubmitButton.holder = obj;
	SubmitButton.chkSubmitEnable(false);	
	SubmitButton.unbindEvents();
	SubmitButton.holder.on("click",function(){
		//trace(SubmitButton.holder.find("input").hasClass("disabled"))
		if(SubmitButton.holder.find("input").hasClass("disabled"))
			return;
		$(SubmitButton).trigger({
			type:"submitClicked",
			value:"none"
		});
		SubmitButton.chkSubmitEnable(false);
	});
}

SubmitButton.chkSubmitEnable=function(flag){
	if(!flag) {
		SubmitButton.holder.eq(0).addClass('disabled');
	}
	else {
		SubmitButton.holder.eq(0).removeClass('disabled');
	}
};

SubmitButton.unbindEvents=function(){
	if(SubmitButton.holder)
		SubmitButton.holder.unbind();
}