function saveContact(pAction)
{
	if(trim(document.getElementById('REGV_Name').value)=='')
	{
		window.alert('Ingrese su Nombre');
		document.getElementById('REGV_Name').focus();
		return;
	}

	if(trim(document.getElementById('REGV_Lastname').value)=='')
	{
		window.alert('Ingrese su Apellido');
		document.getElementById('REGV_Lastname').focus();
		return;
	}

	if(trim(document.getElementById('REGV_Dni').value)=='')
	{
		window.alert('Ingrese su DNI');
		document.getElementById('REGV_Dni').focus();
		return;
	}

	if(trim(document.getElementById('REGV_Email').value)=='')
	{
		window.alert('Ingrese su E-mail');
		document.getElementById('REGV_Email').focus();
		return;
	}
	else
	{
		if(!checkEmail(trim(document.getElementById('REGV_Email').value)))
		{
			window.alert('Ingrese un E-mail valido');
			document.getElementById('REGV_Email').focus();
			return;
		}
	}
	
	if(document.getElementById('INAI_Id').selectedIndex==0)
	{
		window.alert('Ingrese su Area de Interes');
		document.getElementById('INAI_Id').focus();
		return;
	}

	if(trim(document.getElementById('REGT_Comment').value)=='')
	{
		window.alert('Ingrese su Mensaje');
		document.getElementById('REGT_Comment').focus();
		return;
	}

	document.getElementById('general').action = pAction;
	document.getElementById('general').submit();
}


function saveContactEn(pAction)
{
	if(trim(document.getElementById('REGV_Name').value)=='')
	{
		window.alert('Enter Name');
		document.getElementById('REGV_Name').focus();
		return;
	}
	/*
	if (mOlnlyAlnumhyphen(document.getElementById('REGV_Name')))
	{
		window.alert('haracters allowed are A-Z,a-z,0-9,- and _');
		document.getElementById('REGV_Name').focus();
		return;
	}
	*/
	if(trim(document.getElementById('REGV_Lastname').value)=='')
	{
		window.alert('Enter Lastname');
		document.getElementById('REGV_Lastname').focus();
		return;
	}
	/*
	if (mOlnlyAlnumhyphen(document.getElementById('REGV_Lastname')))
	{
		window.alert('haracters allowed are A-Z,a-z,0-9,- and _');
		document.getElementById('REGV_Lastname').focus();
		return;
	}
	*/
	if(trim(document.getElementById('REGV_Email').value)=='')
	{
		window.alert('Enter Email');
		document.getElementById('REGV_Email').focus();
		return;
	}
	else
	{
		if(!checkEmail(trim(document.getElementById('REGV_Email').value)))
		{
			window.alert('Incorrect Email');
			document.getElementById('REGV_Email').focus();
			return;
		}
	}
	
	if(trim(document.getElementById('REGT_Comment').value)=='')
	{
		window.alert('Enter Comment');
		document.getElementById('REGT_Comment').focus();
		return;
	}	

	document.getElementById('general').action = pAction;
	document.getElementById('general').submit();
}

function cleanContact()
{
	document.getElementById('REGV_Name').value='';
	document.getElementById('REGV_Lastname').value='';
	document.getElementById('REGV_Email').value='';
	document.getElementById('INAI_Id').selectedIndex=0;
	document.getElementById('REGT_Comment').value='';
	document.getElementById('REGV_Name').focus();	
}

function loginRegister(url)
{
	if(trim(document.getElementById('REGV_Email').value)=='')
	{
		window.alert('Ingrese su Usuario');
		document.getElementById('REGV_Email').focus();
		return;
	}

	if(trim(document.getElementById('REGV_Password').value)=='')
	{
		window.alert('Ingrese su Password');
		document.getElementById('REGV_Password').focus();
		return;
	}
	
	document.forms[0].action = url;
	document.forms[0].submit();
}

function jsClean(){
	document.forms[0].reset();
	document.getElementById('REGV_Email').focus();
}
