// JavaScript Document
var mostrarMensaje;

function CambiarImagen()
{
	//Cambiar por el numero de imagenes existentes para cambiar.
	var total = 6;
	
	//Numero de estilos de fondo.
	var indice = Math.floor(Math.random()* total);
	
	if(document.getElementById('imagenEncabezado') != null)
		document.getElementById('imagenEncabezado').src='imagenes/imagen_encabezado' + indice + '.png';
	
	if (document.getElementById('imagenLateral') != null)
		document.getElementById('imagenLateral').src='imagenes/imagen_lateral' + indice + '.jpg';
}

function CambiarImagen1()
{
	//Cambiar por el numero de imagenes existentes para cambiar.
	var total = 6;
	
	//Numero de estilos de fondo.
	var indice = Math.floor(Math.random()* total);
	
	if(document.getElementById('imagenEncabezado') != null)
		document.getElementById('imagenEncabezado').src='../imagenes/imagen_encabezado' + indice + '.png';
		
	/*if (document.getElementById('imagenLateral'))
		//document.getElementById('imagenLateral').src='../imagenes/imagen_lateral' + indice + '.jpg';
		alert(document.getElementById('imagenLateral'));*/
			
}

function CambiarTexto(obj, texto, texto1)
{	
	if(mostrarMensaje)
	{
		if(obj.value == texto)
			obj.value = texto1;
			
	}
	
	if(texto == '' && obj.value == texto1)
	{
		obj.style.color = '#FF9900';
	}
	else
	{
		obj.style.color = 'black';
	}
}

function ValidarFormularioContacto()
{
	mostrarMensaje = true;

	if(document.getElementById("nombre").value == "" || document.getElementById("nombre").value == "*Dato Requerido")
	{
		document.getElementById("nombre").value = "*Dato Requerido";
		document.getElementById("nombre").style.color= '#FF9900';
		
		return;
	}
	
	if(document.getElementById("telefono").value == "" || document.getElementById("telefono").value == "*Dato Requerido")
	{
		document.getElementById("telefono").value = "*Dato Requerido";
		document.getElementById("telefono").style.color= '#FF9900';
		
		return;
	}	
	
	/*if(document.getElementById("celular").value == "" || document.getElementById("celular").value == "*Dato Requerido")
	{
		document.getElementById("celular").value = "*Dato Requerido";
		document.getElementById("celular").style.color= '#FF9900';
		
		return;
	}*/
	
	if(document.getElementById("email").value == "" || document.getElementById("email").value == "*Dato Requerido")
	{
		document.getElementById("email").value = "*Dato Requerido";
		document.getElementById("email").style.color= '#FF9900';
		
		return;
	}
	
	if(document.getElementById("asunto").value == "" || document.getElementById("asunto").value == "*Dato Requerido")
	{
		document.getElementById("asunto").value = "*Dato Requerido";
		document.getElementById("asunto").style.color= '#FF9900';
		
		return;
	}
	
	if(document.getElementById("mensaje").value == "" || document.getElementById("mensaje").value == "*Dato Requerido")
	{
		document.getElementById("mensaje").value = "*Dato Requerido";
		document.getElementById("mensaje").style.color= '#FF9900';
		
		return;
	}
	
	var select = document.forms.form1.elements.dependencia;
	
	var w = document.form1.dependencia.selectedIndex;
	var selected_text = document.form1.dependencia.options[w].text;


	document.getElementById("nombreDependencia").value = selected_text;
		
	/*switch (document.getElementById("dependencia").value)
	{
		case "0":
			document.getElementById("destino").value = "comunicaciones@botanicomedellin.org";
			break;
		case "1":
			document.getElementById("destino").value = "pilar.velilla@botanicomedellin.org";
			break;
		case "2":
			document.getElementById("destino").value = "isabel.eusse@botanicomedellin.org";
			break;
		case "3":
			document.getElementById("destino").value = "andrea.diaz@botanicomedellin.org";
			break;
		case "4":
			document.getElementById("destino").value = "biblioteca@botanicomedellin.org";
			break;
		case "5":
			document.getElementById("destino").value = "comunicaciones@botanicomedellin.org";
			break;
		case "6":
			document.getElementById("destino").value = "doris.benitez@botanicomedellin.org ";
			break;
		case "7":
			document.getElementById("destino").value = "rubiela.jimenez@botanicomedellin.org";
			break;
		case "8":
			document.getElementById("destino").value = "fernando.giraldo@botanicomedellin.org";
			break;
		case "9":
			document.getElementById("destino").value = "cristina.colorado@botanicomedellin.org";
			break;
		case "10":
			document.getElementById("destino").value = "juandavid.fernandez@botanicomedellin.org";
			break;
		case "11":
			document.getElementById("destino").value = "manuela.mejia@botanicomedellin.org";
			break;
		case "12":
			document.getElementById("destino").value = "mario.rios@botanicomedellin.org";
			break;
		case "13":
			document.getElementById("destino").value = "yadis.alvarez@botanicomedellin.org";
			break;
		case "14":
			document.getElementById("destino").value = "gustavo.acosta@botanicomedellin.org";
			break;
		case "15":
			document.getElementById("destino").value = "oscar.gonima@botanicomedellin.org";
			break;
		case "16":
			document.getElementById("destino").value = "leidy.ardila@botanicomedellin.org";
			break;
		case "17":
			document.getElementById("destino").value = "latiendadeljardin@botanicomedellin.org";
			break;
		case "18":
			document.getElementById("destino").value = "luzmary.arango@botanicomedellin.org";
			break;
		
	}*/
	
	document.getElementById("destino").value = "comunicaciones@botanicomedellin.org";
	
	
	document.form1.submit();
}

function ValidarFormularioRegistro()
{
	mostrarMensaje = true;

	if(document.getElementById("nombres").value == "" || document.getElementById("nombres").value == "*Dato Requerido")
	{
		document.getElementById("nombres").value = "*Dato Requerido";
		document.getElementById("nombres").style.color= '#FF9900';
		
		return;
	}
	
	if(document.getElementById("apellidos").value == "" || document.getElementById("apellidos").value == "*Dato Requerido")
	{
		document.getElementById("apellidos").value = "*Dato Requerido";
		document.getElementById("apellidos").style.color= '#FF9900';
		
		return;
	}
	
	if(document.getElementById("telefono").value == "" || document.getElementById("telefono").value == "*Dato Requerido")
	{
		document.getElementById("telefono").value = "*Dato Requerido";
		document.getElementById("telefono").style.color= '#FF9900';
		
		return;
	}	
	
	/*if(document.getElementById("celular").value == "" || document.getElementById("celular").value == "*Dato Requerido")
	{
		document.getElementById("celular").value = "*Dato Requerido";
		document.getElementById("celular").style.color= '#FF9900';
		
		return;
	}*/
	
	if(document.getElementById("email").value == "" || document.getElementById("email").value == "*Dato Requerido")
	{
		document.getElementById("email").value = "*Dato Requerido";
		document.getElementById("email").style.color= '#FF9900';
		
		return;
	}
	
	if(document.getElementById("ciudad").value == "" || document.getElementById("ciudad").value == "*Dato Requerido")
	{
		document.getElementById("ciudad").value = "*Dato Requerido";
		document.getElementById("ciudad").style.color= '#FF9900';
		
		return;
	}
	
	RegistrarPersona();
	
	//document.form1.submit();
}

function ValidarFormularioRecomendacion()
{
	mostrarMensaje = true;

	if(document.getElementById("nombre").value == "" || document.getElementById("nombre").value == "*Dato Requerido")
	{
		document.getElementById("nombre").value = "*Dato Requerido";
		document.getElementById("nombre").style.color= '#FF9900';
		
		return;
	}
	
	if(document.getElementById("email").value == "" || document.getElementById("email").value == "*Dato Requerido")
	{
		document.getElementById("email").value = "*Dato Requerido";
		document.getElementById("email").style.color= '#FF9900';
		
		return;
	}
	
	if(document.getElementById("nombreAmigo").value == "" || document.getElementById("nombreAmigo").value == "*Dato Requerido")
	{
		document.getElementById("nombreAmigo").value = "*Dato Requerido";
		document.getElementById("nombreAmigo").style.color= '#FF9900';
		
		return;
	}	
	
	if(document.getElementById("emailAmigo").value == "" || document.getElementById("emailAmigo").value == "*Dato Requerido")
	{
		document.getElementById("emailAmigo").value = "*Dato Requerido";
		document.getElementById("emailAmigo").style.color= '#FF9900';
		
		return;
	}
	
	if(document.getElementById("mensaje").value == "" || document.getElementById("mensaje").value == "*Dato Requerido")
	{
		document.getElementById("mensaje").value = "*Dato Requerido";
		document.getElementById("mensaje").style.color= '#FF9900';
		
		return;
	}
	
	document.form1.submit();
}

function CambiarEstiloRegistreseInterno()
{
	document.getElementById('divTextoRegistrese').style.color = "#377976";
	document.getElementById('imgRegistrese').src='imagenes/int_tonregistro2.png';
}

function CambiarEstiloRegistreseInterno1()
{
	document.getElementById('divTextoRegistrese').style.color = "#49452C";
	document.getElementById('imgRegistrese').src='imagenes/int_tonregistro.png';
}

function CambiarEstiloRecomendacionInterno()
{
	document.getElementById('divTextoRecomendacion').style.color = "#377976";
	document.getElementById('imgRecomendacion').src='imagenes/int_tonrecomiende2.png';
}

function CambiarEstiloRecomendacionInterno1()
{
	document.getElementById('divTextoRecomendacion').style.color = "#49452C";
	document.getElementById('imgRecomendacion').src='imagenes/int_tonrecomiende.png';
}

function CambiarEstiloRegistrese()
{
	document.getElementById('divTextoRegistrese').style.color = "#377976";
	document.getElementById('imgRegistrese').src='imagenes/regis_botonreg2.jpg';
}

function CambiarEstiloRegistrese2()
{
	document.getElementById('divTextoRegistrese').style.color = "#49452C";
	document.getElementById('imgRegistrese').src='imagenes/regis_botonreg.jpg';
}

function CambiarEstiloRecomendacion()
{
	document.getElementById('divTextoRecomendacion').style.color = "#377976";
	document.getElementById('imgRecomendacion').src='imagenes/regis_botonrecom2.jpg';
}

function CambiarEstiloRecomendacion2()
{
	document.getElementById('divTextoRecomendacion').style.color = "#49452C";
	document.getElementById('imgRecomendacion').src='imagenes/regis_botonrecom.jpg';
}

/*Interior*/
function CambiarEstiloRegistrese1()
{
	document.getElementById('divTextoRegistrese').style.color = "#377976";
	document.getElementById('imgRegistrese').src='../imagenes/int_tonregistro2.png';
}

function CambiarEstiloRegistrese11()
{
	document.getElementById('divTextoRegistrese').style.color = "#49452C";
	document.getElementById('imgRegistrese').src='../imagenes/int_tonregistro.png';
}

function CambiarEstiloRecomendacion1()
{
	document.getElementById('divTextoRecomendacion').style.color = "#377976";
	document.getElementById('imgRecomendacion').src='../imagenes/int_tonrecomiende2.png';
}

function CambiarEstiloRecomendacion11()
{
	document.getElementById('divTextoRecomendacion').style.color = "#49452C";
	document.getElementById('imgRecomendacion').src='../imagenes/int_tonrecomiende.png';
}


