// JavaScript Document
$(document).ready(function(){					   
	$("#btnGo").click(function(){		
		$("#txttxtUsername").attr("readonly", true);
		$("#txttxtPassword").attr("readonly", true);		
		
		var msj = "";
		
		msj += (Validar.EsVacio($("#txttxtUsername").val()))? "- User name is required.\n" : "";
		msj += (Validar.EsVacio($("#txttxtPassword").val()))? "- Password is required.\n" : "";		
				
		if(msj == ""){	
			$("#txtAction").val("Login");			
			$("#frmLogin").submit();				
			//openWindow("https://webportal.aafcs.org/Login/Login.aspx?ReturnPage=http://www.aafcs.org/technology2.html",'SignUp' );
		//	__doPostBack('btnGo','');
			return true;
		}else{	
			alert(msj);
			$("#txttxtUsername").attr("readonly", false);
			$("#txttxtPassword").attr("readonly", false);	
			return false;
		}
		
	});	
});

function openWindow(theURL,winName) {
window.open(theURL,winName,"toolbar=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600,top=0,left=0");
}

function __doPostBack(eventTarget, eventArgument) {
		var theform;
		if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
			theform = document.frmLogin;
		}
		else {
			theform = document.forms["frmLogin"];
		}
		theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
		theform.__EVENTARGUMENT.value = eventArgument;
		theform.submit();
}
