// JavaScript Document



<!--

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];}

}



function MM_openBrWindow(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features);

}

//-->



//////////////////////////////////////////

//------------ PARA EL MENU ----->>>>>--//

//////////////////////////////////////////



function showms(foo) {

		document.getElementById(foo).style.visibility='visible';

		}

function hidems(foo) {

			document.getElementById(foo).style.visibility='hidden';

			var submenu = document.getElementById(foo);

			

			var divs = submenu.getElementsByTagName("div");

			for(i=1;i<divs.length;i++){

					var nombre = divs[i].id;

					var arDiv = nombre.split("_");

					if(arDiv[0]=="sub"){

					divs[i].style.visibility="hidden";

					}

				}

}

var timerID1 = null;

var timerOn1 = false;

var timecount1= 700;

var check1 = false;

function toggle(foo) {

  if( document.getElementById(foo).style.visibility =="hidden") {

    showms(foo);

  } else {

  	if( document.getElementById(foo).style.visibility =="visible") {

	    hidems(foo);

	} else {

	    showms(foo);

	}

  }

}

function startTime1(foo) {

		

  if (timerOn1 == false) {

		timerID1=setTimeout( "hidems('"+foo+"')" , timecount1);

        timerOn1 = true;

  }

}

function stopTime1(foo) {

	  clearTimeout(timerID1);

        timerID1 = null;

        timerOn1 = false;

}



function cambiarMenuOn(foo,foosub,ids,tipo){

	 if(document.getElementById(foo)) {

			var menu = document.getElementById(foo);

			var submenu = document.getElementById(foosub);

			var divs = submenu.getElementsByTagName("div");

			if(tipo==1){

				menu.style.background="#dfdfdf";

			}

			for(i=1;i<divs.length;i++){

					var nombre = divs[i].id;

					var arDiv = nombre.split("_");

					if(arDiv[0]=="sub"){

						var ly = document.getElementById(nombre);

						if(ids!=arDiv[1]){

							if(ly.style.visibility=="visible"){

								ly.style.visibility="hidden";

							}

						}else{

							ly.style.visibility="visible";

						}

					}

				}

	 }

}

function cambiarSubMenuOn(foo){

	var menu = document.getElementById(foo);

	menu.style.background="#969595";

	menu.style.color="#ffffff";

}

function cambiarSubMenuOff(foo){

	var menu = document.getElementById(foo);

	menu.style.background="#ffffff";

	menu.style.color="#666666";

}

function cambiarMenuOff(foo){

	 if(document.getElementById(foo)) {

			document.getElementById(foo).style.background="#FDFFFB";

	 }

}

//////////////////////////////////////////

//--<<<<<----- PARA EL MENU ------------//

//////////////////////////////////////////



function mostrarFoto(img,ancho,alto,formato,titulo){

	var imagen = document.getElementById("imagen");

	var html="";

	if(formato == ".jpg" || formato==".gif" || formato==".png"){

	

			html+="<img src='"+img+"' whidth='"+ancho+"' height='"+alto+"'/>";

	

	}else{

		

		html+="<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"";

		html+="codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" whidth='"+ancho+"' height='"+alto+"'>";

		html+="<param name=\"movie\" value=\""+img+"\">";

		html+="<param name=\"quality\" value=\"high\">";

	    html+="<embed src=\""+img+"\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\"";

		html+=" whidth='"+ancho+"' height='"+alto+"'></embed></object>";

	}

	if(titulo!=""){

		html+="<br><br><div style='text-align:left;margin-left:8px;'>"+titulo+"</div>";	

	}

	imagen.innerHTML=html;

}



/*AMIGO*/



function enviarAmigo(){

	var Nombre = document.amigo.Nombre.value;

	var NombreAmigo = document.amigo.NombreAmigo.value;

	var Email = document.amigo.Email.value;

	var EmailAmigo = document.amigo.EmailAmigo.value;

	var strError = "";

	if(Nombre==""){

		strError+= "- Ingrese su Nombre\n";

	}

	

	if(Email==""){

		strError+= "- Ingrese su Email\n";

	}else{

		var p = Email.indexOf("@");

		if(p<1){

			strError+= "- El Email debe ser una dirección de correo.\n";

		}

	}

	if(NombreAmigo==""){

		strError+= "- Ingrese el Nombre de su Amigo\n";

	}

	if(EmailAmigo==""){

		strError+= "- Ingrese el Email de su Amigo\n";

	}else{

		var p = EmailAmigo.indexOf("@");

		if(p<1){

			strError+= "- El Email de su Amigo debe ser una dirección de correo.\n";

		}

	}

	if(strError!=""){

		alert(strError);

	}else{

		document.amigo.submit();	

	}

}

// Contacto

function enviarContacto(){

	var Nombre = document.contacto.Nombre.value;

	var Email = document.contacto.Email.value;

	var Telefono = document.contacto.Telefono.value;

	var Mensaje = document.contacto.Mensaje.value;

	var strError = "";

	if(Nombre==""){

		strError+= "- Ingrese su Nombre y Apellido\n";

	}

	if(Telefono==""){

		strError+= "- Ingrese su Teléfono\n";

	}

	if(Email==""){

		strError+= "- Ingrese su E-mail\n";

	}else{

		var p = Email.indexOf("@");

		if(p<1){

			strError+= "- El E-mail debe ser una dirección de correo.\n";

		}

	}

	if(Mensaje==""){

		strError+= "- Ingrese los Comentarios\n";

	}

	if(strError!=""){

		alert(strError);

	}else{

		document.contacto.submit();	

	}

}

/* Mostrar Ocultar Elemento */

function mostrarOcultar(id,estado){ // estado ver u ocultar

var elemento=document.getElementById(id);
var valor=document.getElementById(id).style.display;

if (estado=='ver'){elemento.style.display='block';}
if (estado=='ocultar'){elemento.style.display='none';}

}

function verOcultar(id){ // estado ver u ocultar

var sufijo='sub_';
var sufijo2='menu_1_';
var elemento=document.getElementById(sufijo+id);
var valor=document.getElementById(sufijo+id).style.display;
var superior=document.getElementById(sufijo2+id);

if (valor=='block'){elemento.style.display='none'; superior.style.backgroundImage="url(../img/icono_flecha.gif)";}
if (valor=='none'){elemento.style.display='block'; superior.style.backgroundImage="url(../img/icono_flecha_a.gif)";}


}

/* validar busqueda*/

function buscarArticulo(){
var palabra=document.getElementById('palabra').value;
if (palabra==''){alert ("Por favor ingrese una palabra o frase para comenzar la búsqueda");}
else {document.buscar.submit();}
	
}
