/*
MultiLogin by Timmy
Amononado por Felipe Brahm :-) - http://www.felipebrahm.com
http://www.cai.cl
*/

function login(uN, pN, fA) {

	var f = document.getElementById("multiLoginForm");
	var u = document.getElementById("multiLoginForm_user");
	var p = document.getElementById("multiLoginForm_password");
	
	if(u.value == "" && p.value == "") {
		alert("Debes llenar los campos de USUARIO y CLAVE.");
		return;
	} else if(u.value == "") {
		alert("Debes llenar el campo de USUARIO.");
		return;
	} else if(p.value == "") {
		alert("Debes llenar el campo de CLAVE.");
		return;
	}
	
	f.action = fA;
	u.name = uN;
	p.name = pN;
	f.submit();

}

/*
function setBlankValue(input, defaultValue, currentValue) {

	if(defaultValue == currentValue)
		input.value = "";

}
*/

/*
No lo pude usar porque IE no pesca bien el focus()

function setInputAsPassword(divId, inputName) {

	var nuevoInput = '<input name="'+ inputName +'" type="password" id="'+ inputName +'" size="16" class="multiLogin_input" />';
	document.getElementById(divId).innerHTML = nuevoInput;
	
	var inputElement = document.getElementById(inputName);
	inputElement.focus();

}*/