/* PAINT MENU BACKGROUND */
function PaintLi(n,cor) {
	var mylist = document.getElementById(n);
	mylist.style.backgroundColor = cor;
}
function PaintWhite(n,oid,isParent) {
	if(isParent == "1") {
		return;
	}
	if(n != oid) {
		var mylist = document.getElementById(n);
		mylist.style.backgroundColor = '#fff';
	}
}

/* CLEAR TEXTBOX */
function clearDefault(el) {
	if (el.defaultValue==el.value) el.value = ""
}
function restoreDefault(el) {
	if (el.value == "") el.value = el.defaultValue
}

/* EXPAND SELECT */
function expandSELECT(element) {
	element.getParent().style.height = element.getParent().scrollHeight;
	element.style.width = 'auto';
	element.style.position = 'absolute';
}
function contractSELECT(element) {
	element.style.width = '';
	element.style.position = 'relative';
}

window.addEvent('domready', function(){
	$$('input.cleardefault').each(function(el, i){
		el.addEvent("focus",function(event){
			clearDefault(el);
		});
		el.addEvent("blur",function(event){
			restoreDefault(el);
		});
	});
	
	if (window.ie) {
		$$('select.expandable').each(function(el, i){
			el.addEvent('mouseover', function(e){
				el.focus();
				expandSELECT(el);
			});
			el.addEvent('blur', function(e){
				contractSELECT(el);
			});
		});
	}
	
    if (typeof(Lightbox) != 'undefined' ) {
		Lightbox.init({showControls: true});
	}
});