if(!window.Term){
	Processing.addIgnoredURL("/term/show.action");
	window.Term = {
			
		LBTerm: null,
		
		options: {
			acceptByAjax: true
		},

		init: function(options){
			this.options = Object.extend(this.options, options || {});
			Event.observe(window, "load", function(){
				Consulte.copyModuleName();
			});
		},

		accept:function(){
			var url = window.contextPath + "/term/accept.action";
			if(this.options.acceptByAjax){
				new Ajax.Updater("content", url, {
					parameters:Form.serialize(document.termForm)
				});
			}else{
				document.termForm.method = "POST";
				document.termForm.action = url;
				document.termForm.submit();
			}
		},
		decline:function(termType){
			if(Consulte.showConfirmMessage(Bundle.getMessage("message.decline.term", "txt.term.name."+termType))){
				var termForm = $(document.termForm);
				termForm.method = "POST";
				termForm.action = window.contextPath + "/term/decline.action";
				termForm.submit();
			}
		},
		
		alertTerm:function(typeTerm, hasBanner){
			new Ajax.Request(contextPath+"/term/show.action", {
				parameters: { 
					typeTerm: typeTerm, 
					presentationType: 'I',
					banner: hasBanner
				},
				onComplete: function(response){
					this.LBTerm = new LightBox(response.responseText.strip(), {justContent:1});
					this.LBTerm.show();
				}.bind(this)
			});
		},
		
		closeAlertTerm:function(){
			this.LBTerm.close();
		}
	};
}
