function datos_empresa(booleano){
		if (document.getElementById('empresas')){
			if (booleano==true){
				document.getElementById('empresas').style.display='';
			}
			else{
				document.getElementById('empresas').style.display='none';
				if (document.forms['frmDatos']){
					var formo=document.forms['frmDatos'];
					for (i=0;i<formo.elements.length;i++){
						if (formo.elements[i].name.split('_')[0]=='empresa'){
							if (formo.elements[i].type=='text'){formo.elements[i].value='';}
						}
					}
				}
			}
		}
	}

function desplegar(menu){
	//funcin que gestiona el abrir y cerrar de los menus
	if(document.getElementById(menu).style.visibility=="visible"){
		document.getElementById(menu).style.visibility="hidden";
		document.getElementById(menu).style.display="none";		
	}else{
		document.getElementById(menu).style.display="block";
		document.getElementById(menu).style.visibility="visible";
	}
}

function plegar(objeto,inicio,fin){
	//pliega todas menos la que se le manada por el parametro "menu"
			//alert(inicio+","+fin)
			for (i=inicio; i<=fin; i++) {
				if (document.getElementById("fechaFranjas"+i)){
					document.getElementById("fechaFranjas"+i).style.visibility = "hidden";	
					document.getElementById("fechaFranjas"+i).style.display="none";
				}
				if (document.getElementById("pestana"+i)){
					document.getElementById("pestana"+i).className="pestana1";	
				}

			}
			if (document.getElementById(objeto)){
					document.getElementById(objeto).className="pestanaON"
			}


}

function SoloNum(){
	//Prop&oacute;sito:	Evitar que se escriban letras en los campos num&eacute;ricos.
	//Efectos:		Si se pulsa una tecla de texto no ocurrir&aacute; nada.
		if (event.keyCode!=13&&(event.keyCode<48||event.keyCode>57))
			event.keyCode=0;
	}

function SoloNota(){
//Propsito:	Evitar que se escriban letras en los campos de telfonos.
//Efectos:		Si se pulsa una tecla de texto que no sea alguno de estos caracteres ( ) . ' - +  no ocurrira nada
	//alert(event.keyCode)
	if (event.keyCode!=13&&event.keyCode!=46&&(event.keyCode<48||event.keyCode>57)){
		
			event.keyCode=0;
	}
}

function CambiaComilla(){
//Propsito:	Substuir la comilla simple por el acento.
//Efectos:		Si se pulsa la comilla['] se reemplazar por el acento[].
	if (event.keyCode==39){
		event.keyCode=180;
	}
}

function CambiaComillaPegado(NombreForm){
	//Propsito:	Substuir la comilla simple por el acento cuando pegan en todos los campos del formulario.
	//Efectos:		Si se pega la comilla['] se reemplazar por el acento[].
	
		var iNumCampos = document.forms[NombreForm].length-1
		for (i=0;i<=iNumCampos;i++)
		{
			if (document.forms[NombreForm].elements[i].type!="select-multiple"){
				sTexto=document.forms[NombreForm].elements[i].value;
				while (sTexto.search("'") != -1){
					sTexto=sTexto.replace("'", "");
					}
				while (sTexto.search('"') != -1){
					sTexto=sTexto.replace('"', '');
					}
				//alert(document.forms[formulario].elements[i].name)
				document.forms[NombreForm].elements[i].value=sTexto;
			}
			
		}
	
}
function ValidoAcceso(NombreForm,TxtEmail) {
	CambiaComillaPegado(NombreForm);
	var i;
	var sFormulario=document.forms[NombreForm];
	var validado = true;
	for (i=0; i<= sFormulario.length-1; i++){
	  if (sFormulario.elements[i].attributes["validationmsg"]){
		if (sFormulario.elements[i].attributes["validationmsg"].value != "" && sFormulario.elements[i].style.visibility != "hidden"){
			switch (sFormulario.elements[i].type) {  
				case "select-multiple" :  
					if (sFormulario.elements[i].options.length =="0"){
						alert(sFormulario.elements[i].attributes["validationmsg"].value);
						sFormulario.elements[i].focus();
						return false;
					}
					break;
				case "textarea" :  
					if (sFormulario.elements[i].value.length > sFormulario.elements[i].maxlength){validado=false;}
					if (sFormulario.elements[i].value.length == "0" ){validado=false;}
					if (validado==false){
						alert(sFormulario.elements[i].attributes["validationmsg"].value);
						return false;
					}
					break;
				default :  
					if (sFormulario.elements[i].type !="image" && sFormulario.elements[i].type !="select-multiple" &&
					 sFormulario.elements[i].type !="textarea" && sFormulario.elements[i].type !="checkbox" && 
					 sFormulario.elements[i].type !="radio" && sFormulario.elements[i].attributes["validationmsg"].value != "0" && 
					 sFormulario.elements[i].attributes["validationmsg"] != "undefined" && sFormulario.elements[i].disabled == false && 
					 (sFormulario.elements[i].value =="" || sFormulario.elements[i].value =="0" )){
						alert(sFormulario.elements[i].attributes["validationmsg"].value);
						sFormulario.elements[i].focus();
						return false;
					}
					break;
			}  
			if (sFormulario.elements[i].minlength){
				if (sFormulario.elements[i].value.length < sFormulario.elements[i].minlength){validado=false;}
			}
			if (validado==false){
				alert(sFormulario.elements[i].attributes["validationmsg"].value);
				sFormulario.elements[i].focus();
				return false;
			}
		 }
	  }
	}
	if (TxtEmail!=""){
		/* Verificar si el email tiene el formato user@dominio. */
		var emailPat=/^(.+)@(.+)$/
	
		var emailStr = document.getElementById(TxtEmail).value
		
		if (!emailStr.match(emailPat)) {
			alert("El campo Email parece incorrecto (compruebe @ y .'s)")
			document.getElementById(TxtEmail).focus();
			return false
		}
	}

	return true
}
function ValidoBuscador(){
	if (document.forms["frmBuscar"].elements["buscar"].value.length<2){
		alert("Debe introducir al menos 2 caracteres de bsqueda.");
		document.forms["frmBuscar"].elements["buscar"].focus();
		return false;
	}
	if (document.forms["frmBuscar"].elements["buscar"].value=="Buscar en la web") {
			alert("Debe escribir el parmetro de bsqueda.");
			document.forms["frmBuscar"].elements["buscar"].focus();
			return false;
		}
	else
		return true;
}
function ValidoPuntuacion(NombreForm,aviso){
	CambiaComillaPegado(NombreForm);
	var sFormulario=document.forms[NombreForm];
	if (sFormulario.elements["Puntuacion"].value.length==0){
		alert(aviso);
		sFormulario.elements["Puntuacion"].focus();
		return false;
	}
	else
		return true;
}

function BorrarBuscador(){
	document.forms["frmBuscar"].elements["buscar"].value="";
}

window.defaultStatus="Bienvenidos al Congreso";

function FJSfechaLarga(){
	var mydate=new Date();
	var year=mydate.getYear();
	
	if (year < 1000){year+=1900;}
	
	var day=mydate.getDay();
	var month=mydate.getMonth();
	var daym=mydate.getDate();

	if (daym<10){daym = "0" + daym ;}
	
	var dayarray=new Array("Domingo","Lunes","Martes","Mircoles","Jueves","Viernes","Sbado");
	var montharray=new Array("enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre");
	var fecha =  dayarray[day]+" "+daym+" de "+montharray[month]+" del "+year;
	
	return fecha;
}

function MostrarMenu(menuId){
	
		
			if ( document.getElementById(menuId).style.visibility=="hidden" )
			{
				document.getElementById(menuId).style.display="Inline";
				document.getElementById(menuId).style.visibility="visible";
				document.getElementById("flecha"+menuId).src="graficos/flecha2a.gif"
			}
			else
			{
				document.getElementById(menuId).style.visibility="hidden";
				document.getElementById(menuId).style.display="none";
				document.getElementById("flecha"+menuId).src="graficos/flecha1a.gif"
			}

}

function FJSmenu(menuId){
	for (var i = 1; i <= 50; i++ )
	{
		if (document.getElementById("menu" + i) && document.getElementById("submenu" + i)){
		
			if ( (menuId==("menu"+i)) && (document.getElementById("submenu" + i).style.visibility=="hidden") )
			{
				document.getElementById(menuId).className="menu3";
				document.getElementById("submenu" + i).style.display="Inline";
				document.getElementById("submenu" + i).style.visibility="visible";
				document.getElementById("submenu" + i).style.height="100%";
			}
			else
			{
				document.getElementById("menu"+ i).className="menu1";
				document.getElementById("submenu" + i).style.visibility="hidden";
				document.getElementById("submenu" + i).style.height="0";
				document.getElementById("submenu" + i).style.display="none";	
			}
		
		}
		
	}
}

function ValidoBusca(){
	if (document.forms["frmRegistro"].elements["usuario"].value.length<3 || document.forms["frmRegistro"].elements["clave"].value.length<3){
		alert("Debe introducir al menos 3 caracteres para el Nombre de usuario y Contrasena.");
		document.forms["frmRegistro"].elements["usuario"].focus();
		return false;
	}
	if (document.forms["frmRegistro"].elements["usuario"].value=="Usuario") {
			alert("Debe escribir su Nombre de usuario y su contrasea.");
			document.forms["frmRegistro"].elements["usuario"].focus();
			return false;
		}
	else
		return true;
}

function Borrar(campo){
	document.forms["frmRegistro"].elements[campo].value="";
}
	
function ValidoBoletin(){
	if (document.forms["frmBoletines"].elements["email"].value.length < 6 || document.forms["frmBoletines"].elements["email"].value=="Email"){
		alert("El Email debe ser correcto.");
		document.forms["frmBoletines"].elements["email"].focus();
		return false;
	}
	/* Verificar si el email tiene el formato user@dominio. */
	var emailPat=/^(.+)@(.+)$/
	var emailStr = document.getElementById("email").value
	if (!emailStr.match(emailPat)) {
		alert("El campo Email parece incorrecto (compruebe @ y .'s)")
		document.getElementById("email").focus();
		return false
	}
	if (document.forms["frmBoletines"].elements["nombre"].value=="Nombre" ||  document.forms["frmBoletines"].elements["nombre"].value.length<3) {
			alert("El Nombre debe tener al menos 3 caracteres.");
			document.forms["frmBoletines"].elements["nombre"].focus();
			return false;
	}
	if (!document.forms["frmBoletines"].elements["lopd"].checked) {
			alert("Es necesario aceptar las Condiciones de Uso y la Poltica de Privacidad.");
			document.forms["frmBoletines"].elements["lopd"].focus();
			return false;
	}
	else
		return true;
}

function BorrarBoletin(campo){
	document.forms["frmBoletines"].elements[campo].value="";
}

function Ffavoritos(iIdioma) {
	var shtml ="" ;
	if (navigator.appVersion >= 4 || navigator.appName=="Microsoft Internet Explorer") {
		if (iIdioma==3){
			var shtml = "<a href='javascript:window.external.AddFavorite(\"http://www.seorl.net\",\"SEORL\");' class='texto'>Bookmarks</a>";
		}
		else{
			var shtml = "<a href='javascript:window.external.AddFavorite(\"http://www.seorl.net\",\"SEORL\");' class='texto'>Favoritos</a>";
		}
		
	}
	document.write(shtml);
}
function Zoom(identificador,identificador2,urlBase){
	var win= null;
	var w=760;
	var h=550;
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=auto,fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=auto,resizable=no'
	win=window.open(urlBase+"plantillas2010/includes/galeriaImagenes.asp?id="+identificador+"&id2="+identificador2,"imagenes",settings)
}

function CambiaSala(prefijo,id){

	for (var i = 1; i <= 20; i++ )
	{
		if (document.getElementById(prefijo + i) ){
		
			if  (i==id )
			{
				document.getElementById("pestana" + prefijo + id).className="pestanaON";
				document.getElementById(prefijo + id).style.display="Inline";
				document.getElementById(prefijo + id).style.visibility="visible";
				document.getElementById(prefijo + id).style.height="100%";
			}
			else
			{
				document.getElementById("pestana" + prefijo + i).className="pestana1";
				document.getElementById(prefijo + i).style.visibility="hidden";
				document.getElementById(prefijo + i).style.height="0";
				document.getElementById(prefijo + i).style.display="none";	
			}
		
		}
		
	}
}
function CambiaDia(prefijo,id){

	for (var i = 1; i <= 10; i++ )
	{
		if (document.getElementById(prefijo + i) ){
		
			if  (i==id )
			{
				document.getElementById("pestana" + prefijo + id).className="pestanadiaON";
				document.getElementById(prefijo + id).style.display="Inline";
				document.getElementById(prefijo + id).style.visibility="visible";
				document.getElementById(prefijo + id).style.height="100%";
			}
			else
			{
				document.getElementById("pestana" + prefijo + i).className="pestanadia1";
				document.getElementById(prefijo + i).style.visibility="hidden";
				document.getElementById(prefijo + i).style.height="0";
				document.getElementById(prefijo + i).style.display="none";	
			}
		
		}
		
	}
}
function cambiarTamano(tam) {
	/*
		Cambiamos el tamaņo gradualmente en todos los navegadores menos en Opera
		que no es posible y asignamos un tamaņo fijo.
	*/
	 if(navigator.appName=="Opera"){
	 	if(tam==1){document.getElementById("textoContenido").style.fontSize = "15px";}
		if(tam==-1){document.getElementById("textoContenido").style.fontSize = "9px";}
	 }
	 else{
	 	if (document.all)
		    miRegla = document.styleSheets[0].rules;
		  else
		    miRegla = document.styleSheets[0].cssRules;
		  for (i=0; reg=miRegla[i]; i++) {
		    size = reg.style.fontSize;
		    if (size!='') {
		      size=parseFloat(size)+tam+'px';
		      reg.style.fontSize=size;
		    }
		  }
	 
	 }
  
}
/*Menus emergentes*/
function openIt(x,n,v) {
	var items = n;
	for (i=1; i<=items; i++) {
		if (document.getElementById("submenu"+i)){
				document.getElementById("submenu"+i).style.visibility = "hidden";	
				document.getElementById("submenu"+i).style.display="none";
				document.getElementById("contMenu"+i).style.backgroundImage="";
		}
	}
	if (x>0){
		if (v==1){
			document.getElementById("submenu"+x).style.visibility = "visible";
			document.getElementById("submenu"+x).style.display="Inline";
		}
		document.getElementById("contMenu"+x).style.backgroundImage="url(http://www.orlcongresos.com/congresos/plantillas2010/plantilla4/fondos/fondoSeccion.gif)";
		
	}
}


function AbrirVentanaCongreso(UrlMostrar){
	var win= null;
	var w=500;
	var h=600;
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=yes,fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=auto,resizable=yes'
	win=window.open(UrlMostrar,"Congreso",settings)
}

function di_AbrirVentanaCongreso(UrlMostrar, pwidth, pheight){
	var win= null;
	var w=pwidth;
	var h=pheight;
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=yes,fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=auto,resizable=yes'
	win=window.open(UrlMostrar,"Congreso",settings)
}

function di_AbrirVentanaCongresoOnlineRegForm(){
	di_AbrirVentanaCongreso('http://www.orlcongresos.com/di_includes/congresos/CEORLHNSBARCELONA2011/InstructionalCourses_OnlineRegForm.asp',800,600);
}

