var Form = function(jqElem){

	var jqElem       = jqElem;
	var interval     = 1;
	var befClassName = (jqElem.attr('class') == '') ? '' : jqElem.attr('class');

	this.focus = function(){
		jqElem.focus();
	}

	this.val = function(){
		return jqElem.val();
	}

	this.trim = function(){
		return $.trim(jqElem.val());
	}

	this.startNotice = function(noticeClassName, noticeCount, noticeIntervalTime, focusFlag, initValue){

		if(focusFlag){
			jqElem.focus();
		}

		if(initValue != null){
			jqElem.val(initValue);
		}

		var count        = 1;
		var aftClassName = (befClassName == '') ? noticeClassName : befClassName + ' ' + noticeClassName;

		jqElem.attr('class', aftClassName);

		if(interval > 1){
			clearInterval(interval);
		}

		interval = setInterval(function(){

			if(jqElem.attr('class') == aftClassName){

				jqElem.attr('class', befClassName);

				if(count < noticeCount){
					count++;
				}else{

					clearInterval(interval);

					if(befClassName == ''){
						jqElem.removeAttr('class');
					}

				}

			}else{
				jqElem.attr('class', aftClassName);
			}

		}, noticeIntervalTime);

		return false;

	}

	this.stopNotice = function(){

		clearInterval(interval);

		if(befClassName == ''){
			jqElem.removeAttr('class');
		}else{
			jqElem.attr('class', befClassName);
		}

	}

	jqElem.focus(function(){

		clearInterval(interval);

		if(befClassName == ''){
			jqElem.removeAttr('class');
		}else{
			jqElem.attr('class', befClassName);
		}

	});

}
