/* 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_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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 MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


/* 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('../img/back.png',
					 '../img/m_0_on.png','../img/m_1_on.png',
					 '../img/m_2_on.png','../img/m_3_on.png','../img/m_5_on.png'
					 );
}
function validar(idioma)
{
	var textos = arregloContacto(idioma);
	var al = 0;
	if(!validarVacio("txt_1", textos[al]))
		return false;
	al++;
	document.form1.submit();
}

var currFoto = 0;
function fotoAnterior()
{
	document.getElementById("img_" + currFoto).style.display = "none";
	currFoto--;
	apagar();
	document.getElementById("img_" + currFoto).style.display = "";
}
function fotoSiguiente()
{
	document.getElementById("img_" + currFoto).style.display = "none";
	currFoto++;
	apagar();
	document.getElementById("img_" + currFoto).style.display = "";
}
function apagar()
{
	var cant = document.getElementById("cantidad").value;
	var prev = document.getElementById("prev");
	var sig = document.getElementById("sig");
	prev.style.visibility="visible";
	sig.style.visibility="visible";
	if (currFoto == 0)
		prev.style.visibility = "hidden";
	if (currFoto >= (cant-1))
		sig.style.visibility = "hidden";
}
