function show(idObj) {
	 document.getElementById(idObj).style.visibility = "visible";
}
function hide(idObj) {
	 document.getElementById(idObj).style.visibility = "hidden";
}

function intro(menu){
var texto="";
var seccionObj=document.getElementById("seccion");
switch (menu){
	case "bienvenida": texto="Descubre Tinkle. Nuestra visión, misión, valores, metodología y organización.";
			break;
	case "accion": texto="Las capacidades de Tinkle. Nuestros servicios, equipo, referencias, actividades y oportunidades.";
			break;
	case "gestion": texto="Tinkle 'en directo'. Nuestros proyectos, el histórico, evaluación e intercambio.";
			break;
	}
seccionObj.innerHTML=texto;
}

function popup1(pop){
document.getElementById(pop).style.display="block";
}
function popup(pop){
for (i=1;i<22;i++){
	var popId="pop"+i;
	if (document.getElementById(popId)){
		var popLink="pop"+i+"Link";
		document.getElementById(popId).style.display="none";
		document.getElementById(popLink).style.fontWeight="normal";
		document.getElementById(popLink).style.color="#999";
	}
}
document.getElementById(pop).style.display="block";
var linkSelect=pop+"Link";
var linkSelectObj=document.getElementById(linkSelect);
linkSelectObj.style.fontWeight="bold";
linkSelectObj.style.color="#68CD33";
}

function cerrar1(pop){
document.getElementById(pop).style.display="none";
}

function cerrar(pop){
document.getElementById(pop).style.display="none";
var popLink=pop+"Link";
var popLinkObj=document.getElementById(popLink);
popLinkObj.style.fontWeight="normal";
popLinkObj.style.color="#999";
}

function abrir(desti){
  var ampla = 300;
  var altura = 110;
  strURL = desti;
  poshoritz = (screen.width) ? (screen.width-ampla)/2 : 0;
  posvert = (screen.height) ? (screen.height-altura)/2 : 0;
  strW = 'toolbar=0,directories=0,location=0,status=no,menubar=0,resizable=1,copyhistory=0,scrollbars=0,width='+ ampla + ',height='+ altura + ',top='+ posvert + ',left='+ poshoritz;
  eval("window.open('" + strURL + "','','" + strW + "')");
}
function getURL(val){
   location = val;
   return false;
}

		function PopupDatos (pagina) {
var opciones="toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=775, height=600, top=20, left=20";
window.open(pagina,"datos",opciones);
}


function init_xmas(){
	$("#xmas").fadeIn(2000);

	$(".seguent a").click(function(){
		$("#xmas .marc").hide();
		$(this).parents('.marc').next().fadeIn();
	});
	$("div.anterior a").click(function(){
		$("#xmas .marc").hide();
		$(this).parents('.marc').prev().fadeIn();
	});

	$(".close").click(function(){
		$("#xmas").fadeOut(750);
	});
	$("#xmas h2").click(function(){
		$("#xmas .marc").hide();
		$("#xmas2009-1").fadeIn();
	});

	$("#tcLinks a.a").click(function(){
		var idReg="reg"+this.id
		$("#regalsAnt .regal div").hide();
		$("#reg"+this.id).fadeIn();
		$("#tcLinks a").removeClass("on");
		$(this).addClass("on");
	});
	$(".linkAnt").click(function(){
		$("#xmas .marc").hide();
		$("#regalsAnt").fadeIn();
	});
	$("#tcActual").click(function(){
		$("#xmas .marc").hide();
		$("#xmas2009-1").fadeIn();
	});
	$("a.linkInici").click(function(){
		$("#xmas .marc").hide();
		$("#xmas2009-1").fadeIn();
	});
	$("#linkMas").click(function(){
		$("#xmas .marc").hide();
		$("#xmas2009-2").fadeIn();
	});


	$("a.anterior2").click(function(){
		$("#xmas .marc").hide();
		$("#xmas2009-1").fadeIn();
	});


	$("a.verVideo").click(function(){
		$("#xmas .marc").hide();
		$("#xmas2009").fadeIn();
	});


	$("#linkEjercicios").click(function(){
		$("#xmas .marc").hide();
		$("#xmas2009-3").fadeIn();
	});



}


function viewData(city){
	var links = document.getElementById('list').getElementsByTagName("a");
	for (var i = 0; i < links.length; i++)  {
   	 	links[i].className="";
   	};
	document.getElementById(city).className="on";
	var ofic = document.getElementById('oficinas_mundo').getElementsByTagName("div");
	for (var i = 0; i < links.length; i++)  {
   	 	ofic[i].style.display="none";
   	};
	document.getElementById(city +'Ofic').style.display="block";
	var mapa = document.getElementById('estilo_mapa').getElementsByTagName("div");
	for (var i = 0; i < links.length; i++)  {
   	 	mapa[i].className="";
   	};
	document.getElementById(city +'Map').className="on";
}

function init_popup(popup){
	var popup=$(popup);
	popup.fadeIn(2000);
	$(".close").click(function(){
		popup.fadeOut(750);
	});
}