function saveContact(pAction, idioma)
{
	if(trim(document.getElementById('name').value)=='')
	{
		if (idioma=='1')
		{
			window.alert('Ingrese su Nombre');
		}
		else
		{
			window.alert('Enter your name');			
		}
		
		document.getElementById('name').focus();
		return;
	}

	if(trim(document.getElementById('job').value)=='')
	{
		if (idioma=='1')
		{
		window.alert('Ingrese su Cargo');
		}
		else
		{
			window.alert('Enter your position');			
		}
		
		document.getElementById('job').focus();
		return;
	}
	
	if(trim(document.getElementById('ocupation').value)=='')
	{
		if (idioma=='1')
		{
		window.alert('Ingrese su Compaņia');
		}
		else
		{
			window.alert('Enter your company');			
		}
		
		document.getElementById('ocupation').focus();
		return;
	}

	if(trim(document.getElementById('telephone').value)=='')
	{
		if (idioma=='1')
		{
			window.alert('Ingrese su Telefono');
		}
		else
		{
			window.alert('Enter your telephone');			
		}
		
		document.getElementById('telephone').focus();
		return;
	}

	if(trim(document.getElementById('email').value)=='')
	{
		if (idioma=='1')
		{
			window.alert('Ingrese su E-mail');
		}
		else
		{
			window.alert('Enter your email');			
		}
		
		document.getElementById('email').focus();
		return;
	}
	else
	{
		if(!checkEmail(trim(document.getElementById('email').value)))
		{
			if (idioma=='1')
			{
			window.alert('Ingrese un E-mail valido');
			}
			else
			{
				window.alert('Enter a valid email');			
			}
			document.getElementById('email').focus();
			return;
		}
	}
	
	if(trim(document.getElementById('comment').value)=='')
	{
		if (idioma=='1')
		{
			window.alert('Ingrese su Comentario');
		}else
			{
				window.alert('Enter your comment');			
			}
		document.getElementById('comment').focus();
		return;
	}	

	document.getElementById('general').action = pAction;
	document.getElementById('general').submit();
}


function saveContactEn(pAction)
{
	if(trim(document.getElementById('name').value)=='')
	{
		window.alert('Enter Name');
		document.getElementById('name').focus();
		return;
	}
	
	if(trim(document.getElementById('job').value)=='')
	{
		window.alert('Enter Position');
		document.getElementById('job').focus();
		return;
	}
	
	if(trim(document.getElementById('ocupation').value)=='')
	{
		window.alert('Enter Company');
		document.getElementById('ocupation').focus();
		return;
	}
	
	if(trim(document.getElementById('telephone').value)=='')
	{
		window.alert('Enter Phone');
		document.getElementById('telephone').focus();
		return;
	}
		
	if(trim(document.getElementById('email').value)=='')
	{
		window.alert('Enter Email');
		document.getElementById('email').focus();
		return;
	}
	else
	{
		if(!checkEmail(trim(document.getElementById('email').value)))
		{
			window.alert('Incorrect Email');
			document.getElementById('email').focus();
			return;
		}
	}

	if(trim(document.getElementById('comment').value)=='')
	{
		window.alert('Enter Comment');
		document.getElementById('comment').focus();
		return;
	}	

	document.getElementById('general').action = pAction;
	document.getElementById('general').submit();
}

function cleanContact()
{
	document.getElementById('name').value='';
	document.getElementById('ocupation').value='';
	document.getElementById('job').value='';
	document.getElementById('email').value='';
	document.getElementById('comment').value='';
	document.getElementById('name').focus();	
}
