window.addEvent('domready', function() {

	Lightbox.init.bind(Lightbox);

});

function validateForm() {
	count = document.editor.elements.length;
	
	valid = true;
	
    for (i=0; i < count; i++) {
    	if(document.editor.elements[i].value == "" && document.editor.elements[i].type == "text") {
    		valid = false;
    	}
	}	

	if($("confirmpass") != null && $("pass") != null) {
		if(document.editor.confirmpass.value != document.editor.pass.value) {
    		valid = false;
    	}
    }

	if(valid) {
		document.editor.submit.disabled=false;
	} else {
		document.editor.submit.disabled=true;
	}
}

function checkLength(textarea,counter,maxlength) {
if (textarea.value.length > maxlength)
	textarea.value = textarea.value.substring(0, maxlength);
else
	counter.value = maxlength - textarea.value.length;
}