// JavaScript Document


// Función para mostrar correos (con enlaces)
	function writeMail(eml,dom) {
		document.write("<a href='mailto:"+eml+"@"+dom+"'>"+eml+"@"+dom+"</a>")
		}

// Función para ocultar Datos
	function hideInfo(){
		document.getElementById("datos").style.display='none';
		}
		
// Función para ocultar Datos
	function hideInfoEx(){
		document.getElementById("datosEx").style.display='none';
		}		
		
// Función para mostrar Datos
	function showInfo(obj,cal, dir, pai, tel, eml, dom, eml_alt, dom_alt) {
		setDiv(obj,"datos",5,18)		
		document.getElementById("datos").style.display='block';			
		document.getElementById("datos").style.position='absolute';
		if (cal != "") {
			document.getElementById("cal").innerHTML =cal;
			document.getElementById("cal").style.display ='block';
			}
			else {document.getElementById("cal").style.display ='none';}					
		if (dir != "") {
			document.getElementById("dir").innerHTML =dir;
			document.getElementById("dir").style.display ='block';
			}
			else {document.getElementById("dir").style.display ='none';}					
		if (pai != "") {
			document.getElementById("pai").innerHTML =pai;
			document.getElementById("pai").style.display ='block';
			}
			else {document.getElementById("pai").style.display ='none';}
		if (tel != "") {
			document.getElementById("tel").innerHTML ='Tel: ' + tel;
			document.getElementById("tel").style.display ='block';
			}
			else {document.getElementById("eml").style.display ='none';}		
		if (eml != "" && dom != "") {
			document.getElementById("eml").innerHTML ='Eml: ' + eml + '@' + dom;
			document.getElementById("eml").style.display ='block';
			}
			else {document.getElementById("eml").style.display ='none';}
		if (eml_alt != "" && dom_alt != "") {
			document.getElementById("eml_alt").innerHTML ='Eml: ' + eml_alt + '@' + dom_alt;
			document.getElementById("eml_alt").style.display ='block';
			}
			else {document.getElementById("eml_alt").style.display ='none';}
		}
		
		
// Función para mostrar Datos Expositores
	function showInfoEx(obj, pai, eml, dom) {
		setDiv(obj,"datosEx",5,18)		
		document.getElementById("datosEx").style.display='block';			
		document.getElementById("datosEx").style.position='absolute';
		if (pai != "") {
			document.getElementById("pai").innerHTML =pai;
			document.getElementById("pai").style.display ='block';
			}
			else {document.getElementById("pai").style.display ='none';}
		if (eml != "" && dom != "") {
			document.getElementById("eml").innerHTML ='Eml: ' + eml + '@' + dom;
			document.getElementById("eml").style.display ='block';
			}
			else {document.getElementById("eml").style.display ='none';}
		}		
		
// Función para ocultar Datos
	function hideThemes(){
		document.getElementById("eje").style.display='none';
		}		
		
// Función para mostrar Ejes Temáticos
	function showThemes() {
		setDiv("convocatoria","eje",50,32)		
		document.getElementById("eje").style.display='block';			
		document.getElementById("eje").style.position='absolute';
		}		

// Función para posicionar Divs Flotantes
	function setDiv(obj,lyr,posX,posY) {
		var newX = findPosX(document.getElementById(obj));
		var newY = findPosY(document.getElementById(obj));
		var x = document.getElementById(lyr);
		x.style.left = newX + posX + 'px';
		x.style.top = newY + posY + 'px';		
		}

// Función para encontrar posición X de un objeto
	function findPosX(obj) {
		var curleft = 0;
		if (obj.offsetParent) {
			while (obj.offsetParent) {
				curleft += obj.offsetLeft
				obj = obj.offsetParent;
				}
			}
		else if (obj.x)
			curleft += obj.x;
		return curleft;
		}
	
// Función para encontrar posición Y de un objeto
	function findPosY(obj) {
		var curtop = 0;
		var printstring = '';
		if (obj.offsetParent) {
			while (obj.offsetParent) {
				printstring += ' element ' + obj.tagName + ' has ' + obj.offsetTop;
				curtop += obj.offsetTop
				obj = obj.offsetParent;
				}
			}
		else if (obj.y)
			curtop += obj.y;
		return curtop;
		}

// Función para recoger variables del URL
	function getUrlVars(){
		var vars = [], hash;
		var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
		for (var i = 0; i < hashes.length; i++) {
			hash = hashes[i].split('=');
			vars.push(hash[0]);
			vars[hash[0]] = hash[1];
			}
		return vars;
		}		
		
// Función para cambiar el tamańo de letra
	function docFormat(){
		var hash = getUrlVars();
		var tipo = hash['tipo'];
		var ver = hash['ver'];
		var size = hash['fs'];
		if (typeof size != 'undefined') {
			if (size == 15) {
				document.write("<link rel='stylesheet' type='text/css' href='recursos/css/estilo_15.css' />")
				}
			document.write('<style>body * {font-size:'+size+'px}</style>');
			}
		if (typeof tipo != 'undefined') {		
			for (var i = 0; i < document.getElementById("form").elements.length; i++) {
				if (document.getElementById(formulario).elements[i].type == 'input') {
					document.getElementById(formulario).elements[i].disabled = true;
					}
				if (document.getElementById(formulario).elements[i].type == 'checkbox') {
					document.getElementById(formulario).elements[i].disabled = true;
					}
				if (document.getElementById(formulario).elements[i].type == 'radio') {
					document.getElementById(formulario).elements[i].disabled = true;
					}
				}			
			if (tipo == 'print') {
				if (ver == 'en') {
					var titulo = 'Registry for the XXIV World Conference of Therapeutic Communities';
					var datos = 'Personal Data';
					var estudiantes = 'Only for Students';
					var comunidad = 'Therapeutic Community';
					var asistencia = 'Additional Assistance';
					var compania = 'Companion';
					var seleccion = 'Program Selection';
					var inscripcion = 'Inscription Fee';
					var pago = 'Payment Type';
					var envio = 'Send Regitry';
					var matricula = '<span>Registry #</span>:<input type="text" name="matricula" id="matricula" />';
					}
				else {
					var titulo = 'Inscripcion para la XXIV Conferencia Mundial de Comunidades Terapeuticas';
					var datos = 'Datos Personales';
					var estudiantes = 'Solo para Estudiantes';
					var comunidad = 'Comunidad Terapeutica';
					var asistencia = 'Asistencia Adicional';
					var compania = 'Acompa'+String.fromCharCode(209)+'antes';
					var seleccion = 'Seleccion del Programa';
					var inscripcion = 'Costo de Inscripcion';
					var pago = 'Forma de Pago';
					var envio = 'Envio de Inscripcion';
					var matricula = '<span>Matricula #</span>:<input type="text" name="matricula" id="matricula" />';					
					}
				document.getElementById("titulo").innerHTML = '<h1>'+titulo+'</h1>';
				document.getElementById("subtitulo_datos").innerHTML = '<h2>'+datos+'</h2>';
				document.getElementById("in_sexo").innerHTML = '<span>Sexo</span>:<input type="text" name="sexo" id="sexo" />';				
				document.getElementById("subtitulo_estudiantes").innerHTML = '<h2>'+estudiantes+'</h2>';
				document.getElementById("in_matricula").innerHTML = matricula;
				document.getElementById("subtitulo_comunidad").innerHTML = '<h2>'+comunidad+'</h2>';
				document.getElementById("subtitulo_asistencia").innerHTML = '<h2>'+asistencia+'</h2>';
				document.getElementById("subtitulo_acompa").innerHTML = '<h2>'+compania+'</h2>';
				document.getElementById("subtitulo_seleccion").innerHTML = '<h2>'+seleccion+'</h2>';
				document.getElementById("subtitulo_inscripcion").innerHTML = '<h2>'+inscripcion+'</h2>';
				document.getElementById("subtitulo_pago").innerHTML = '<h2>'+pago+'</h2>';
				document.getElementById("subtitulo_envio").innerHTML = '<h2>'+envio+'</h2>';
				document.write("<link rel='stylesheet' type='text/css' href='recursos/css/estilo_print.css' />")
				}
			}
		}

// Función para mostrar el video
	function writeVideo(){
		var hash = getUrlVars();
		var ver = hash['ver'];
		var tipo = hash['tipo'];
		if (tipo == "2") {
			var so = new SWFObject('recursos/swf/video_prom.swf', 'video_flv', '400', '350', '9', '#000000');
			}
		else {
			var so = new SWFObject('recursos/swf/video.swf', 'video_flv', '400', '350', '9', '#000000');			
			}
		if (typeof ver == 'undefined') {
			ver = 'es';	
			}
		so.addVariable('ver',ver);			
		so.write('video');
		}
		

// Función para reporducir el video
	function showVideo(){
		var newX = findPosX(document.getElementById('contenido'));
		var newY = findPosY(document.getElementById('contenido'));
		var x = document.getElementById('container');
		x.style.left = newX + 50 + 'px';
		x.style.top = newY + 70 + 'px';
		document.getElementById('container').style.overflown='hidden';
		document.getElementById('container').style.display='block';			
		document.getElementById('container').style.position='absolute';		
		}
		
// Función para reporducir el video
	function showVideoProm(){
		var newX = findPosX(document.getElementById('contenido'));
		var newY = findPosY(document.getElementById('contenido'));
		var x = document.getElementById('container');
		x.style.left = newX + 50 + 'px';
		x.style.top = newY + 400 + 'px';
		document.getElementById('container').style.overflown='hidden';
		document.getElementById('container').style.display='block';			
		document.getElementById('container').style.position='absolute';		
		}
		
// Función para reporducir el video
	function hideVideo(){
		window.open('about:blank','loadvideo')
		window.parent.document.getElementById("container").style.display='none';	
		}
		
// Función para mostrar cabecera (flash)
	function showHeader(idioma,act) {
		pes = new Array()
		pes[1] = "presentacion.htm";
		pes[2] = "peru.htm";
		pes[3] = "conferencia.htm";
		pes[4] = "contenido.htm";
		pes[5] = "ponencias.htm";
		pes[6] = "fotos.htm";
		pes[7] = "auspiciadores.htm";
		pen = new Array()
		pen[1] = "introduction.htm";
		pen[2] = "about-peru.htm";
		pen[3] = "conference.htm";
		pen[4] = "content.htm";
		pen[5] = "expositions.htm";
		pen[6] = "photos.htm";
		pen[7] = "sponsors.htm";
		if (idioma == 'en') {
			var actual = pen[act]; var url = pes[act];
			}
		else {
			var actual = pes[act]; var url = pen[act];
			}
		var so = new SWFObject('recursos/swf/cabecera.swf', 'cabecera_flash', '750', '160', '9', '#000000');
		var hash = getUrlVars();
		var size = hash['fs']; //font size
		so.addVariable('ver',idioma);
		so.addVariable('act',act);
		so.addVariable('fs',size);		
		so.addVariable('verCur',actual);
		so.addVariable('verUrl',url);
		so.addParam('wmode','transparent');
		so.write('cabecera');
		}
		
// Función para mostrar flash
	function showFlash(swf,div,w,h,idioma) {
		var so = new SWFObject('recursos/swf/'+swf+'.swf', swf+'_flash', w, h, '9', '#000000');
		so.addParam('wmode','transparent');
		so.addVariable('ver',idioma);
		so.write(div);
		}

// Función para mostrar creditos
	function showCredits(idioma) {
		var so = new SWFObject('recursos/swf/ahmeto.swf', 'ahmeto_flash', '144', '30', '9', '#000000');
		so.addParam('wmode','transparent');
		so.addVariable('ver',idioma);
		so.write('ahmeto');
		}

// Función para mostrar imagenes secundarias
	function showImages(num1,num2,num3,num4,creditxt,crediurl) {
		var so = new SWFObject('recursos/swf/imagen.swf', 'imagen_a_flash', '147', '147', '9', '#000000');
		so.addParam('wmode','transparent');
		so.addVariable('creditxt',creditxt);
		so.addVariable('crediurl',crediurl);
		so.addVariable('im1',num1);
		so.addVariable('im2',num2);
		so.write('imagen_a');
		var so = new SWFObject('recursos/swf/imagen.swf', 'imagen_b_flash', '147', '147', '9', '#000000');
		so.addParam('wmode','transparent');
		so.addVariable('creditxt',creditxt);
		so.addVariable('crediurl',crediurl);		
		so.addVariable('im1',num3);
		so.addVariable('im2',num4);
		so.write('imagen_b');		
		}		

// Función SWFObject
	/*
	* SWFObject v1.4.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
	*
	* SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
	* http://www.opensource.org/licenses/mit-license.php
	*
	* **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
	*   legal reasons.
	*/
	if(typeof deconcept=="undefined"){var deconcept=new Object();}
	if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
	if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
	deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){if(!document.getElementById){return;}
	this.DETECT_KEY=_b?_b:"detectflash";
	this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
	this.params=new Object();
	this.variables=new Object();
	this.attributes=new Array();
	if(_1){this.setAttribute("swf",_1);}
	if(id){this.setAttribute("id",id);}
	if(w){this.setAttribute("width",w);}
	if(h){this.setAttribute("height",h);}
	if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
	this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();
	if(c){this.addParam("bgcolor",c);}
	var q=_8?_8:"high";
	this.addParam("quality",q);
	this.setAttribute("useExpressInstall",_7);
	this.setAttribute("doExpressInstall",false);
	var _d=(_9)?_9:window.location;
	this.setAttribute("xiRedirectUrl",_d);
	this.setAttribute("redirectUrl","");
	if(_a){this.setAttribute("redirectUrl",_a);}};
	deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
	this.attributes[_e]=_f;
	},getAttribute:function(_10){
	return this.attributes[_10];
	},addParam:function(_11,_12){
	this.params[_11]=_12;
	},getParams:function(){
	return this.params;
	},addVariable:function(_13,_14){
	this.variables[_13]=_14;
	},getVariable:function(_15){
	return this.variables[_15];
	},getVariables:function(){
	return this.variables;
	},getVariablePairs:function(){
	var _16=new Array();
	var key;
	var _18=this.getVariables();
	for(key in _18){_16.push(key+"="+_18[key]);}
	return _16;},getSWFHTML:function(){var _19="";
	if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
	if(this.getAttribute("doExpressInstall")){
	this.addVariable("MMplayerType","PlugIn");}
	_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
	_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
	var _1a=this.getParams();
	for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}
	var _1c=this.getVariablePairs().join("&");
	if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";
	}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
	_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
	_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
	var _1d=this.getParams();
	for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
	var _1f=this.getVariablePairs().join("&");
	if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}
	return _19;
	},write:function(_20){
	if(this.getAttribute("useExpressInstall")){
	var _21=new deconcept.PlayerVersion([6,0,65]);
	if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
	this.setAttribute("doExpressInstall",true);
	this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
	document.title=document.title.slice(0,47)+" - Flash Player Installation";
	this.addVariable("MMdoctitle",document.title);}}
	if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
	var n=(typeof _20=="string")?document.getElementById(_20):_20;
	n.innerHTML=this.getSWFHTML();return true;
	}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}
	return false;}};
	deconcept.SWFObjectUtil.getPlayerVersion=function(){
	var _23=new deconcept.PlayerVersion([0,0,0]);
	if(navigator.plugins&&navigator.mimeTypes.length){
	var x=navigator.plugins["Shockwave Flash"];
	if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
	}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}
	catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
	_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}
	catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}
	catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}
	return _23;};
	deconcept.PlayerVersion=function(_27){
	this.major=_27[0]!=null?parseInt(_27[0]):0;
	this.minor=_27[1]!=null?parseInt(_27[1]):0;
	this.rev=_27[2]!=null?parseInt(_27[2]):0;
	};
	deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
	if(this.major<fv.major){return false;}
	if(this.major>fv.major){return true;}
	if(this.minor<fv.minor){return false;}
	if(this.minor>fv.minor){return true;}
	if(this.rev<fv.rev){
	return false;
	}return true;};
	deconcept.util={getRequestParameter:function(_29){
	var q=document.location.search||document.location.hash;
	if(q){var _2b=q.substring(1).split("&");
	for(var i=0;i<_2b.length;i++){
	if(_2b[i].substring(0,_2b[i].indexOf("="))==_29){
	return _2b[i].substring((_2b[i].indexOf("=")+1));}}}
	return "";}};
	deconcept.SWFObjectUtil.cleanupSWFs=function(){if(window.opera||!document.all){return;}
	var _2d=document.getElementsByTagName("OBJECT");
	for(var i=0;i<_2d.length;i++){_2d[i].style.display="none";for(var x in _2d[i]){
	if(typeof _2d[i][x]=="function"){_2d[i][x]=function(){};}}}};
	deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};
	__flash_savedUnloadHandler=function(){};
	if(typeof window.onunload=="function"){
	var _30=window.onunload;
	window.onunload=function(){
	deconcept.SWFObjectUtil.cleanupSWFs();_30();};
	}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}};
	if(typeof window.onbeforeunload=="function"){
	var oldBeforeUnload=window.onbeforeunload;
	window.onbeforeunload=function(){
	deconcept.SWFObjectUtil.prepUnload();
	oldBeforeUnload();};
	}else{window.onbeforeunload=deconcept.SWFObjectUtil.prepUnload;}
	if(Array.prototype.push==null){
	Array.prototype.push=function(_31){
	this[this.length]=_31;
	return this.length;};}
	var getQueryParamValue=deconcept.util.getRequestParameter;
	var FlashObject=deconcept.SWFObject;
	var SWFObject=deconcept.SWFObject;