	var navegador = navigator.appName;
 	if (navegador.search("Microsoft Internet Explorer")!=-1)
 	{	
		document.write('<link rel="stylesheet" type="text/css" href="dialogBox/ie.css" />');
	}
	else
	{
		document.write('<link rel="stylesheet" type="text/css" href="dialogBox/no_ie.css" />');
	}


function getXmlHttp(){
	try{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e){
		// Internet Explorer
		try{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP.3.0"); //IE 7
		}
		catch (e){
			try {
				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); //IE 6
			}
			catch (e) {
				try {
					xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); //otros IE
				}
				catch (e) {
					alert("Su navegador no soporta AJAX.");
					return false;
				}
			}
		}
	}
	return xmlHttp;
}

function agranda(id)
{
	var cont=document.createElement('div');
	var i=document.createElement('img');
	i.src="galeria/fotos/"+id+".jpg";
	var d=document.createElement('div');
	d.className="licencia_foto";
	d.align="center";
	d.appendChild(document.createTextNode('Todas las obras estan protegidas por una licencia Creative Commons (BY-NC-SA).'));
	d.appendChild(document.createElement('br'));
	d.appendChild(document.createTextNode('Si deseas descargarte alguna con alta resolución puedes solicitarlo en la página de contacto.'));
	cont.appendChild(i);
	cont.appendChild(d);
	showDialog('Foto '+id,cont,'foto');
}

function condiciones()
{
	var d=document.createElement('div');
	d.appendChild(document.createTextNode("La composición de música personalizada y gratuita para un proyecto de interés, exige las siguientes condiciones:"));
	var ol=	document.createElement('ol');	
	var li1 = document.createElement('li');
	var li2 = document.createElement('li');
	var li3 = document.createElement('li');
	var li4 = document.createElement('li');
	var li5 = document.createElement('li');
	var li6 = document.createElement('li');
	
	li1.appendChild(document.createTextNode("Se debe respetar mi autoría como compositor de la música."));
	li2.appendChild(document.createTextNode("La acreditación debe mostrarse en algún sitio visible para el espectador."));
	li3.appendChild(document.createTextNode("Si se emplea en un medio online y es factible, debe agregar un enlace a mi página personal."));
	li4.appendChild(document.createTextNode("La obra final no debe tener caracter lucrativo. En caso contrario, se negociaría un precio simbólico."));
	li5.appendChild(document.createTextNode("La obra final debe dirigirse a un público relativamente amplio."));
	li6.appendChild(document.createTextNode("No puede reutilizarse la música en otro contexto sin autorización previa del autor."));										

	ol.appendChild(li1);
	ol.appendChild(li2);
	ol.appendChild(li3);
	ol.appendChild(li4);
	ol.appendChild(li5);
	ol.appendChild(li6);
	d.appendChild(ol);
	return d;
}

function elder()
{
	var d=document.createElement('div');
	d.appendChild(document.createTextNode("El museo Elder de la Ciencia y Tecnología es probablemente el más importante de Canarias, siendo de visita obligada para turistas y residentes."));
	d.appendChild(document.createElement('br'));
	d.appendChild(document.createElement('br'));
	d.appendChild(document.createTextNode("El proyecto que desarrollé fué una aplicación interactiva en Flash que se instaló en cuatro pantallas táctiles conectadas en red y repartidas por todo el museo."));
	d.appendChild(document.createElement('br'));
	d.appendChild(document.createElement('br'));
	d.appendChild(document.createTextNode("El programa contaba con cuatro secciones: una galería de vídeos e imagenes, un libro de visitas virtual, un juego de conocimiento y una librería para ampliar información sobre la exposición."));
	d.appendChild(document.createTextNode("Cada pantalla estaba especializada en un área concreta, pero todas se comunicaban entre sí y eran controladas remotamente por un administrador."));
	d.appendChild(document.createElement('br'));
	d.appendChild(document.createElement('br'));
	d.appendChild(document.createTextNode("Actualmente están siendo usadas por cientos de visitantes diarios."));
	return d;
}	

function comprobar()
{
	var d=document.createElement('div');
	if (document.getElementById('nombre').value=="")
	{
		d.appendChild(document.createTextNode("• No ha indicado su nombre."));
		d.appendChild(document.createElement('br'));
						} 
	if (document.getElementById('email').value=="")
	{
		d.appendChild(document.createTextNode("• No ha indicado un email al que pueda responderle."));
		d.appendChild(document.createElement('br'));
	} 
	else
	{
		email=document.getElementById('email').value;
		var p1=email.split('@');
		if(p1.length < 2)
		{
			d.appendChild(document.createTextNode("• El email que ha escrito no existe."));
			d.appendChild(document.createElement('br'));
		}
		else
		{
			if(p1[0].length < 3||  p1[1].length < 6)
			{	
				d.appendChild(document.createTextNode("• El email que ha escrito no existe."));
				d.appendChild(document.createElement('br'));
			}
			else
			{
				p2=p1[1].split('.');
				if(p2.length < 2 || p2[0].length < 2 || p2[1].length < 2)
				{
					d.appendChild(document.createTextNode("• El email que ha escrito no existe."));
					d.appendChild(document.createElement('br'));
				}
			}
			
		}
	}
	if (document.getElementById('mensaje').value=="")
	{
		d.appendChild(document.createTextNode("• No puede enviar un email vacío."));
		d.appendChild(document.createElement('br'));
	}
	
	if(d.innerHTML == "") return true;
	else
	{
		showDialog('Datos incorrectos',d,'error');
		return false;
	} 
	

}

function enviar()
{
	if(comprobar())
	{
		var RSSRequestObject=getXmlHttp();
		var datos = "enviomail.php?nombre="+document.getElementById('nombre').value;
		datos += '&asunto='+document.getElementById('asunto').value;
		datos += "&email="+document.getElementById('email').value;
		datos += "&mensaje="+escape(document.getElementById('mensaje').value);
		
		RSSRequestObject.open("GET", datos , false); 
		RSSRequestObject.send(null); 
		if(RSSRequestObject.responseText=="ok") showDialog('Mensaje enviado',document.createTextNode('Su mensaje ha sido enviado correctamente. Recibirá una respuesta lo antes posible'),'success');
		else showDialog('Error',document.createTextNode('No se ha podido enviar su mensaje por problemas en la conexión. Pruebe en unos minutos y si persiste, envíe su correo directamente a albertoeh@gmail.com'),'error');

	}
}

function cr()
{
	document.write("albertoeh");
	document.write("&#6");
	document.write("4gm");
	document.write("ail.");
	document.write("co");
	document.write("m");
}

function reproductor(estado)
{
	if (estado=="on")
	{
		document.getElementById('reproductor').innerHTML='<object style="z-index:-200px" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="720" height="290" id="mp3player" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="wmode" value="transparent" /></param><param name="allowFullScreen" value="false" /><param name="movie" value="reproductor/mp3player.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />	<embed src="reproductor/mp3player.swf" quality="high" wmode="transparent" bgcolor="#ffffff" width="720" height="290" name="mp3player" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
	}
	else
	{
		document.getElementById('reproductor').innerHTML="";
	}
}
		
function muestra(id){
	document.getElementById("programador").style.display="none";
	document.getElementById("profesor").style.display="none";
	document.getElementById("posicionamiento").style.display="none";
	document.getElementById("otros").style.display="none";
	
	document.getElementById("tit_1").className="tit_off margin_right_60";
	document.getElementById("tit_2").className="tit_off margin_right_60";
	document.getElementById("tit_3").className="tit_off margin_right_60";
	document.getElementById("tit_4").className="tit_off";
	
	document.getElementById("tit_1").onmouseover =function(){this.className='tit_over margin_right_60'};
	document.getElementById("tit_1").onmouseout =function(){this.className='tit_off margin_right_60'};
	document.getElementById("tit_2").onmouseover =function(){this.className='tit_over margin_right_60'};
	document.getElementById("tit_2").onmouseout =function(){this.className='tit_off margin_right_60'};
	document.getElementById("tit_3").onmouseover =function(){this.className='tit_over margin_right_60'};
	document.getElementById("tit_3").onmouseout =function(){this.className='tit_off margin_right_60'};
	document.getElementById("tit_4").onmouseover =function(){this.className='tit_over'};
	document.getElementById("tit_4").onmouseout =function(){this.className='tit_off'};
	switch (id)
	{
		case 1: 
			document.getElementById("programador").style.display="inline";
			document.getElementById("tit_1").className="tit_on margin_right_60";
			document.getElementById("tit_1").onmouseover =function(){};
			document.getElementById("tit_1").onmouseout =function(){};
			break;
		case 2: document.getElementById("profesor").style.display="inline";
			document.getElementById("tit_2").className="tit_on margin_right_60";
			document.getElementById("tit_2").onmouseover =function(){};
			document.getElementById("tit_2").onmouseout =function(){};
			break;
		case 3: document.getElementById("posicionamiento").style.display="inline";
			document.getElementById("tit_3").className="tit_on margin_right_60";
			document.getElementById("tit_3").onmouseover =function(){};
			document.getElementById("tit_3").onmouseout =function(){};
			break;
		case 4: document.getElementById("otros").style.display="inline";
			document.getElementById("tit_4").className="tit_on";
			document.getElementById("tit_4").onmouseover =function(){};
			document.getElementById("tit_4").onmouseout =function(){};
			break;
	}
}