


var divMouseOverClass = Class.create();

divMouseOverClass.prototype = {

	initialize: function(class_out, class_over) {
		
		this.class_over = class_over;
		this.class_out = class_out;

		lbActions = document.getElementsByClassName(class_out);
		for(i = 0; i < lbActions.length; i++) {
			Event.observe(lbActions[i], 'mouseover', this.over.bindAsEventListener(this), false);
			Event.observe(lbActions[i], 'mouseout', this.out.bindAsEventListener(this), false);
		}

	},
	
	over: function(event) {
		elt = Event.findElement(event, 'DIV');
		$(elt).className = this.class_over;
	}
	,
	out: function(event) {
		elt = Event.findElement(event, 'DIV');
		$(elt).className = this.class_out;
	}	

}


// podmiana input gdy pusty na podany tekst
// 
var inputEmptyText = Class.create();
inputEmptyText.prototype = {

	initialize: function(id, options) {
		
		this.textboxchanged = false;
		this.text = options['text'];
		this.elem = $(id);
		Event.observe(this.elem, 'focus', this.focus.bindAsEventListener(this), false);
		Event.observe(this.elem, 'blur', this.blur.bindAsEventListener(this), false);
		
		this.blur();
	},
	
	focus: function() {
		if (!this.textboxchanged) {
			this.textboxchanged = true;
			this.elem.value = "";
		}
	}
	,
	blur: function() {
		if (this.elem.value == "") {
			this.textboxchanged = false;
			this.elem.value = this.text;
		}
	}	

}
