/* Funciones para flash */
function insertar_flash(nombre, w, h, variables, bgcolor)
{
    
       document.write(" <object style='z-index:0' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' width='" + w + "' height='" + h + "' id='" + nombre + "' align='middle' VIEWASTEXT>");
       document.write(" <param name='allowScriptAccess' value='sameDomain' />");
       document.write("<param name='movie' value='../flash/" + nombre + ".swf" + variables + "' />");
       document.write("<param name='quality' value='high' />");
       document.write("<embed src='../flash/" + nombre + ".swf" + variables + "' quality='high' bgcolor='" + bgcolor + "' width='" + w + "' height='" + h + "' name='" + nombre + "' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
       document.write("</object>");
}
function flash_transparente(cual, width, height, variables)
{
       document.write("<object style='z-index:0' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' width='" + width + "' height='" + height + "' id='" + cual + "' align='middle' VIEWASTEXT>");
       document.write("<param name='allowScriptAccess' value='sameDomain' />");
       document.write("<param name='movie' value='../flash/" + cual + ".swf" + variables + "' />");
       document.write("<param name='quality' value='high' />");
       document.write("<param name='wmode' value='transparent'>");
       document.write("<embed wmode='transparent'  src='../flash/" + cual + ".swf" + variables + "' quality='high' width='" + width + "' height='" + height + "' name='" + cual + "' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
       document.write("</object>");
}

/* Obtener QueryString */
function querySt(ji) {
hu = window.location.search.substring(1);
gy = hu.split("&");
for (i=0;i<gy.length;i++) {
ft = gy[i].split("=");
if (ft[0] == ji) {
return ft[1];
}
}
}

/* Pre cargar imagenes */
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function precargar()
{
	MM_preloadImages('');
}
function validar(idioma)
{
	var textos = arregloContacto(idioma);
	var al = 0;
	if(!validarVacio("txt_1", textos[al]))
		return false;
	al++;
	document.form1.submit(); 
}
function validarContacto(idioma)
{
	var textos = arregloContacto(idioma);
	var al = 0;
	if(!validarVacio("txt_0", textos[al]))
		return;
	al++;
	if(!validarVacio("txt_1", textos[al]))
		return;
	al++;
	if(!validarVacio("txt_2", textos[al]))
			return;
	al++;
	document.form1.submit(); 
}

/* Film Strip */
function fsd(id,tipo)
{
	id = id.substr(3);
	document.getElementById("fsd_" + id).className = "filmStrip_detail" + tipo;
}


/* PARTICIPA */
var currPart;
function part(tipo,cual)
{
	if (cual != currPart)
	{
		document.getElementById(cual + "_i").className = "participa_div" + tipo;
	}
}
function setCurrPart(cual)
{
	currPart = "part_" + cual;
	if (document.getElementById(currPart))
	{
		document.getElementById(currPart + "_i").className = "participa_div";
	}
}

/* Otros proyectos */
var currOtros = 0;
function cambiarOtros(cual)
{
	document.getElementById("tbl_" + currOtros).style.display = "none";
	document.getElementById("num_" + currOtros).className = "bola t_Gri_12_r";
	currOtros = cual;
	document.getElementById("tbl_" + currOtros).style.display = "";
	document.getElementById("num_" + currOtros).className = "bola_on t_Bla_12_r";
}
/* Otros proyectos */
var currPra = 0;
function cambiarPra(cual)
{
	document.getElementById("tbl_" + currPra).style.display = "none";
	document.getElementById("num_" + currPra).className = "pra_bola t_Bla_12_r";
	currPra = cual;
	document.getElementById("tbl_" + currPra).style.display = "";
	document.getElementById("num_" + currPra).className = "pra_bola_on t_Bla_12_r";
}

/* ARTISTAS */
var currArtista;
function cambArtista(cual, tipo)
{
	cual = cual.substr(4);
	if (cual != currArtista)
	{
		document.getElementById("fle_" + cual).className = "art_flecha" + tipo;
		document.getElementById("nom_" + cual).className = "art_nombre" + tipo;
	}
}
function setCurrArtista(cual)
{
	if (document.getElementById("fle_" + cual)) { 
	currArtista = cual;
	document.getElementById("fle_" + cual).className = "art_flecha";
		document.getElementById("nom_" + cual).className = "art_nombre";
	}
}

/* PROYECTOS */
var currfoto = 0;
function cambiarFoto(cual)
{
	document.getElementById("tbl_" + currfoto).style.display = "none";
	document.getElementById("num_" + currfoto).className = "pra_bola t_Bla_12_r";
	currfoto = cual;
	document.getElementById("tbl_" + currfoto).style.display = "";
	document.getElementById("num_" + currfoto).className = "pra_bola_on t_Bla_12_r";
}

/* DETALLE PRACTICAS */
var currfoto2 = 0;
function cambiarFoto2(cual)
{
	document.getElementById("tbl_" + currfoto2).style.display = "none";
	document.getElementById("num_" + currfoto2).className = "bola t_Bla_12_r";
	currfoto2 = cual;
	document.getElementById("tbl_" + currfoto2).style.display = "";
	document.getElementById("num_" + currfoto2).className = "bola_on t_Bla_12_r";
}

/* Visor de documentos */
var currDocumento;
function antDocumentacion()
{
	document.getElementById("img_" + currDocumento).style.display = "none";
	if (document.getElementById("txt_" + currDocumento))
		document.getElementById("txt_" + currDocumento).style.display = "none";
	currDocumento--;
	document.getElementById("img_" + currDocumento).style.display = "";
	if (document.getElementById("txt_" + currDocumento))
		document.getElementById("txt_" + currDocumento).style.display = "";
	setCurrDocumentacion(currDocumento);
	scrollArriba_v();
	}
function sigDocumentacion()
{
	document.getElementById("img_" + currDocumento).style.display = "none";
	if (document.getElementById("txt_" + currDocumento))
		document.getElementById("txt_" + currDocumento).style.display = "none";
	currDocumento++;
	document.getElementById("img_" + currDocumento).style.display = "";
	if (document.getElementById("txt_" + currDocumento))
		document.getElementById("txt_" + currDocumento).style.display = "";
	setCurrDocumentacion(currDocumento);
	scrollArriba_v();
}
function setCurrDocumentacion(cual)
{
	var cant = parseInt(document.getElementById("cantidad").value);
	currDocumento = cual;
	document.getElementById("ant").style.visibility = "visible";
	document.getElementById("sig").style.visibility = "visible";
	if (currDocumento == 0)
		document.getElementById("ant").style.visibility = "hidden";
	if ((currDocumento +1) >= cant)
		document.getElementById("sig").style.visibility = "hidden";
		if (document.getElementById("anch_" + cual))
		{
			var x = 465;
			var ancho = parseInt(document.getElementById("anch_" + cual).value);
			var w = (465 - ancho)/2;
			ancho = w + ancho - 30;
	document.getElementById("flechas3").style.left = ancho + "px";
		}
	scrollArriba_v();
}
