function flotante(idmensaje, sdiv) {

var oDiv = document.getElementById(sdiv);
var aMensajes = Array();
	aMensajes[0]='<h5>Productor/a</h5><p class="p1">Persona jurídica o física que se encarga de la producción del contenido audiovisual y que es el propietario de la obra final.<br />Con este perfil podrás incluir nuevos proyectos en el sistema y gestionar su evolución.</p>';
	aMensajes[1]='<h5>Profesional</h5><p class="p1">Te informaremos de los proyectos que hay en marcha en tu lugar de residencia y que precisen de personas con tu perfil. Tendrás acceso a oportunidades de trabajo y colaboración en modo cooperativo.</p>';
	aMensajes[2]='<h5>Empresa</h5><p class="p1">Te informaremos de los proyectos que hay en marcha en tu área de operación. Tendrás oportunidades de negocio y colaboración en modo cooperativo.</p>';
	aMensajes[3]='<h5>Espectador</h5><p class="p1">Eres parte esencial del sistema, de ti depende que los proyectos prosperen y consigan el interes de los anunciantes para financiar la producción.</p>';
	aMensajes[4]='<table><tr><td style="font-size: x-small;">Correo electrónico:</td><td><input style="font-size:x-small" type="text" name="email" size="30" maxlength="100" /></td></tr><tr><td style="font-size: x-small;">Password:</td><td><input style="font-size:x-small" type="password" name="pwd" size="12" maxlength="12" /></td></tr><tr><td></td><td><input type="submit" value="Entrar" /></td></tr></table>';
	aMensajes[5]='<h5>Versión beta</h5><p style="color:red" class="p1">¡Muy pronto podrás registrarte!</p>';

	oDiv.style.opacity = 0;
	oDiv.style.filter = "Alpha(opacity=0)";
	
	try {
		oDiv.style.top = window.event.layerY + 10 + "px";
		oDiv.style.left = window.event.layerX+"px";

		if (window.event.layerX + 350 > 890) {
			oDiv.style.left = "540px";
		} 
	} catch (oException) {
		oDiv.style.top = window.event.y + 10 + "px";
		oDiv.style.left = window.event.x+"px";

		if (window.event.x + 350 > 890) {
			oDiv.style.left = "540px";
		} 
	}

	oDiv.innerHTML = "<a href='javascript:void(0);' target='_self' onclick='document.getElementById(&quot;"+sdiv+"&quot;).style.display=&quot;none&quot;'>cerrar</a>"+aMensajes[idmensaje];

	oDiv.style.zIndex=900;
	oDiv.style.display="block";
	oDiv.style.opacity = 1;
	oDiv.style.filter = "Alpha(opacity=100)";
}

function identificarse (sUrl) {
	$('div#dlgidentificar').dialog({
		autoOpen: false,
		title: 'Identificación',
		width: 400,
		modal: true,
		close: function() {
			$("div#dlgidentificar input").val("");
			$("div#msgerr").html("").hide();
		}
	});
	$('a#identificar')[0].onclick=function(event){
		$('div#dlgidentificar').dialog("open");
		$('div#dlgidentificar table').show();
	};
	$("a#enviar").button()[0].onclick=function(event){
		$.getJSON(
			sUrl+'autentificar',
			$("div#dlgidentificar input").serialize(),
			function(obj) {
				if (obj.err) {
					$("div#msgerr").html(obj.errmsg).show();
				} else {
					$('div#cabecera a#identificar').hide();
					$('div#cabecera a#registro').hide();
					$('div#cabecera a#colaborador').text(obj.nombre).show();
					$('div#cabecera a#salir').show();
					$('div#dlgidentificar').dialog("close");
				}
			}
		);
	};
	$("a#salir")[0].onclick=function(event){
		$.getJSON(
			sUrl+'autentificar',
			'destroy=si',
			function(obj) {
				$('div#cabecera a#colaborador').text("").hide();
				$('div#cabecera a#salir').hide();
				$('div#cabecera a#identificar').show();
				$('div#cabecera a#registro').show();
				$("div#dlgidentificar input").val("");
				$("div#msgerr").html("").hide();
			}
		);
	};
}

