function ver_mas()
{
	document.getElementById("intro").style.display="none";
	document.getElementById("ver_mas").style.display="block";
}
function enviar()
{
	var nombre=document.contacto.nombre.value;
	var email=document.contacto.email.value;
	var valido=1;
	if(nombre=="")
	{
		alert("Por favor ingrese su nombre para poder enviar el correo de contácto");
		valido=0;
	}
	if(email=="")
	{	
		alert("Por favor ingrese su dirección de correo para poder enviar el correo de contácto");
		valido=0;	
	}else
	{
		if(email.indexOf("@")==-1 || email.indexOf(".")==-1){alert("Su dirección de correo de electrónico no es una dirección válida.");valido=0;}
	}
	if(valido==1)
	{
		document.contacto.submit();
	}
	
}

function toggle(obj)
{
	$('#'+obj).slideToggle('500');
}

function enviar()
{
	document.getElementById('error').style.display="none";
	var error=false;
	var msg="";
	var first="";
	if(document.getElementById('empresa').value=="")
	{
		error=true;
		msg="-Nombre de la Empresa<br />";
		first="empresa";
	}
	if(document.getElementById('representante').value=="")
	{
		error=true;
		msg+="-Representante legal<br />";		
		if(first==""){first="representante" ;}
	}
	if(document.getElementById('contacto').value=="")
	{
		error=true;
		msg+="-Contacto de la Empresa<br />";	
		if(first==""){first="contacto" ;}		
	}
	if(document.getElementById('direccion').value=="")
	{
		error=true;
		msg+="-Dirección de la Empresa<br />";
		if(first==""){first="direccion" ;}
	}
	if(document.getElementById('tel1').value=="")
	{
		error=true;
		msg+="-Un teléfono de la Empresa<br />";	
		if(first==""){first="tel1" ;}
	}
	if(document.getElementById('email').value=="")
	{
		error=true;
		msg+="-Correo electrónico de la Empresa<br />";		
		if(first==""){first="email" ;}
	}else
	{	
		var mail=document.getElementById("email").value;
		if(mail.indexOf("@")==-1 || mail.indexOf(".")==-1)
		{
			error=true;
			msg+="-Correo electrónico de la Empresa no es válido<br />";		
			if(first==""){first="email" ;}
		} 
	}
	
	if(  ($('input[@name=actividad]:checked').size())==0	)
	{
		error=true;
		msg+="-Una actividad empresarial <br />";		
	}
	if($('#otros').is(':checked')  && document.getElementById('otro_texto').value=="" )
	{
		error=true;
		msg+="-Asegurese de especificar en que consiste la otra actividad comercial de la empresa<br />";	
	}
	if (document.frueda.portafolio.value=="" )
	{
		error=true;
		msg+="-Adjunte el Portafolio de Servicios de su empresa<br />";
		
	}	
	
	if (error)
	{
		document.location.href="#frueda";		
		document.location.href="#frueda";	//es necesario 2 veces 	
		$('#error').html('Para poder enviar la información asegurese de ingresar la siguiente información:<br />'+msg);
		$('#error').slideToggle(1000,function(){$("#"+first).focus();} );		
	}else
	{
		var actividad="";
		$('input[@name=actividad]:checked').each(function(){
				actividad+=$(this).attr('id')+',';			
			}  );		
	
		$('#actividades').attr('value',actividad);
		$('#frueda').submit();
	}
}
$(document).ready(function(){
	
	/*Links de #Menu*/
	$('div#index').click(function(){window.location.href="index.php";});
	$('div#mision').click(function(){window.location.href="mision.php";});
	$('div#vision').click(function(){window.location.href="vision.php";});
	$('div#objetivos').click(function(){window.location.href="objetivos.php";});
	$('div#proyectos').click(function(){window.location.href="proyectos.php";});
	$('div#rueda').click(function(){window.location.href="rueda.php";});
	$('div#servicios').click(function(){window.location.href="servicios.php";});
	$('div#contactenos').click(function(){window.location.href="contactenos.php";});
	
	
	/*Links de #Enlaces */
	$('li#colombiamining').click(function(){window.location.href="http://www.colombiamining.com/";} );
	$('li#gemma').click(function(){window.location.href="http://www.unalmed.edu.co/gemma/";});
	$('li#minas').click(function(){window.location.href="http://www.minas.medellin.unal.edu.co/";});
	$('li#blog').click(function(){window.location.href="http://www.colombiamining.com/blog/";});
	$('li#enlace-ingenieria').click(function(){window.location.href="http://www.enlaceingenieria.com/";});
	
	
	
});



