// *********************************
// Francisco Javier Martínez
// francisco_javier_martinez@hotmail.com
// www.javiscript.com
   
// *********************************

// Class LIB Util
function LIB_util_object ()
{
	// Función para cambiar el estado de un checkbox (Imagen)
	 this.changeChecbox = function (checkboxId)
	 {
	 	var actualImageCheckbox = document.getElementById(checkboxId.toLowerCase() + "_img");
	 	if (actualImageCheckbox)
		{
			var actualCheckbox_obj = document.getElementById("checkbox_" + checkboxId)
			if (actualCheckbox_obj == null)
			{
				actualCheckbox_obj = document.getElementById("checkbox_" + checkboxId)
			}
			if (actualCheckbox_obj)
			{
				if (actualCheckbox_obj.checked)
				{
					actualImageCheckbox.style.backgroundImage = "url(img/modulo_login/checkbox_off.gif)";
				}
				else
				{
					actualImageCheckbox.style.backgroundImage = "url(img/modulo_login/checkbox_on.gif)";
				}
			}
		}
	 }
	 
	 // Función para controlar el VALUE de campos preiniciados
	 this.focusMe = function (objReferer, theEvent, initValue)
	 {
	 	switch (theEvent.type.toLowerCase())
		{
			case "blur":
				if (objReferer.value == "")
				{
					objReferer.value = initValue;
				}
			break;
			
			case "focus":
				if (objReferer.value == initValue)
				{
					objReferer.value = "";
				}
			break;
		}
	 }
}

var LIB_UTIL = new LIB_util_object();