// JavaScript Document
var sel_opc='bienvenidos';
//var precio_plataforma=50;
//var precio_jornadas=0;
//var precio_cena=0;
//var precio=precio_plataforma+precio_jornadas+precio_cena;
//document.getElementById('precio_total').innerHTML=precio;
function sobre_opcion(origen) {
	document.getElementById(origen).style.cursor = 'pointer';
	if (sel_opc!=origen) {document.getElementById(origen).style.color="#663300";}
}


function sale_opcion(origen) {
	document.getElementById(origen).style.cursor = 'default';
	if (sel_opc!=origen) {document.getElementById(origen).style.color="#996633";}
}	

function sobre() {
	document.body.style.cursor = 'pointer';
}


function sale() {
document.body.style.cursor = 'default';
}


function cambia_ac(origen)
  {
	strHtml="";
	switch(origen){
		case "Login":
			strHtml="<iframe id='usuario' name='usuario' src='acceso.php' frameborder='0' width='750px' height='280px' scrolling='auto'></iframe>";
			document.getElementById('cuerpo_ac').style.height="280px";
		break;

		case "Ideas":
			strHtml="<iframe id='usuario' name='usuario' src='form_idea.php' frameborder='0' width='750px' height='280px' scrolling='auto'></iframe>";
			document.getElementById('cuerpo_ac').style.height="280px";
		break;

		case "Presenta":
		//	strHtml="<div class='logeado'><p>Aqu&iacute; podr&aacute;s subir los ficheros para la presentaci&oacute;n de tu idea en las jornadas</p></div>";
			strHtml="<iframe id='usuario' name='usuario' src='slides.php' frameborder='0' width='750px' height='280px' scrolling='auto'></iframe>";
			document.getElementById('cuerpo_ac').style.height="280px";
		break;
	}
	document.getElementById('cuerpo_ac').innerHTML=strHtml;
	cambia_fondo_ac(origen);
  }

function cambia_fondo_ac(celda){

	document.getElementById('Login').className="etiqueta_ac";
	document.getElementById('Ideas').className="etiqueta_ac";
	document.getElementById('Presenta').className="etiqueta_ac";

	document.getElementById(celda).className="etiqueta_sel_ac";

}


function elige(elegido){
	sel_opc=elegido;

switch (elegido) {

	case 'bienvenidos':
		pagina='bienvenidos.htm';
	break

	case 'participacion':
		pagina='participacion.htm';
	break

	case 'ceditorial':
		pagina='ceditorial.htm';
	break
	
	case 'comites':
		pagina='comites.htm';
	break
	
	case 'plataforma':
		pagina='plataforma.htm';
	break	

	case 'inscripcion':
		pagina='inscripcion.htm';
	break	

	case 'alojamiento':
		pagina='alojamiento.htm';
	break	

	case 'programa':
		pagina='programa.pdf';
	break
	
	case 'ciudad':
		pagina='ciudad.htm';
	break	

	case 'registro':
		pagina='registro.htm';
	break
	
	case 'patrocinadores':
		pagina='patrocinadores.htm';
	break	


	}
	
	document.getElementById('titulo').innerHTML=document.getElementById(elegido).title;
	strHtml = "<iframe src='"+pagina+"' id='ventana' name='ventana' frameborder='0' scrolling='auto' style='height:350px; width:800px;'>";
	strHtml=strHtml + "Si ves este texto es porque tu navegador no permite iframe.<a href='"+pagina+"' target='_blank'>Pincha aqu&iacute</a></iframe>";
	document.getElementById('centro').innerHTML=strHtml;
	document.getElementById('bienvenidos').style.color='#996633';
	document.getElementById('participacion').style.color='#996633';
	document.getElementById('ceditorial').style.color='#996633';
	document.getElementById('comites').style.color='#996633';
	document.getElementById('plataforma').style.color='#996633';
	document.getElementById('inscripcion').style.color='#996633';
	document.getElementById('alojamiento').style.color='#996633';
	document.getElementById('programa').style.color='#996633';
	document.getElementById('ciudad').style.color='#996633';
	document.getElementById('registro').style.color='#996633';
		document.getElementById('patrocinadores').style.color='#996633';
	document.getElementById(elegido).style.color='#663300';
	}

function calcula_jornadas(){
	precio_jornadas=0;
	if(document.getElementById('jueves').checked){precio_jornadas=precio_jornadas+100}
	if(document.getElementById('viernes').checked){precio_jornadas=precio_jornadas+100}
	document.getElementById('precio_jornadas').innerHTML=precio_jornadas;
	precio=precio_plataforma+precio_jornadas+precio_cena;
	document.getElementById('precio_total').innerHTML=precio;
	document.getElementById('precio').value=precio;
}

function calcula_cena(){
	if(document.getElementById('cena').checked){precio_cena=50}else{precio_cena=0}
	document.getElementById('precio_cena').innerHTML=precio_cena;
	precio=precio_plataforma+precio_jornadas+precio_cena;
	document.getElementById('precio_total').innerHTML=precio;
	document.getElementById('precio').value=precio;
}

function pon_fechas(verlas){
	if (verlas=="S") {
		document.getElementById('titulo').innerHTML="Fechas de inter&eacute;s";
		strHtml = "<iframe src='fechas.htm' id='ventana' name='ventana' frameborder='0' scrolling='auto' style='height:350px; width:800px;'>";
		strHtml=strHtml + "Si ves este texto es porque tu navegador no permite iframe.<a href='"+pagina+"' target='_blank'>Pincha aqu&iacute</a></iframe>";
		document.getElementById('fechas').style.cursor = 'pointer';
		document.getElementById('centro').innerHTML=strHtml;
	}else{
		elige(sel_opc);
		document.getElementById('fechas').style.cursor = 'default';
	}
}

function mayusculas(input){
	input.value = input.value.toUpperCase();
} 

function calcula_precio(precio) {
	if (document.getElementById('cena').checked){precio=precio+20}
	document.getElementById('total').innerHTML='Total cuota   '+String(precio)+' euros';
	document.getElementById('precio').value=precio;
}

function resize() {
  window.parent.document.getElementById("relacion_papers").height = window.document.getElementById("lista_papers").offsetHeight+20;
}

function c_status(fila,valor){
	var preg = window.confirm ("\u00bfQuiere cambiar el estado de la idea seleccionada?");
	if (preg){	
		document.getElementById("estado_id").value=fila;
		document.getElementById("estado_st").value=valor;	
		document.forms[1].submit();
	}else{
	parent.location.href="filtra_papers.php";
	}
}

function v_paper(fila,nombre){
	document.getElementById("papers_id").value=fila;
	document.getElementById("papers_n").value=nombre;
	window.open("blank.htm", fila , "width=500,height=300,scrollbars=yes") 
	document.forms[2].target=fila;
	document.forms[2].submit();
	parent.location.href="filtra_papers.php";
}

function v_changes(fila,nombre){
	document.getElementById("changes_id").value=fila;
	document.getElementById("changes_n").value=nombre;
	window.open("blank.htm", fila , "width=500,height=300,scrollbars=yes") 
	document.forms[3].target=fila;
	document.forms[3].submit();
	parent.location.href="filtra_papers.php";
}

function paperstoexcel(){
		document.getElementById("e_estado").value=document.forms['fpapers'].estado.value;
		document.getElementById("e_area").value=document.forms['fpapers'].area.value;
		document.getElementById("e_nivel").value=document.forms['fpapers'].nivel.value;
		document.getElementById("e_orden").value=document.forms['fpapers'].orden.value;
		document.forms['excel'].submit();
}



