/* funciones para cotizaciones */ function hideElement (elementId) { var element; if (document.getElementById(elementId)) { element = document.getElementById(elementId); element.style.display = "none"; } } function showElement(elementId) { var element; if (document.getElementById(elementId)) { element = document.getElementById(elementId); element.style.display = "block"; } } function mostrarcot (elemente) { hideElement("cotisoja"); hideElement("cotimaiz"); hideElement("cotimoneda"); hideElement("cotitrigo"); showElement(elemente); } /* funciones para cotizaciones */ /* para el buscador INICIO */ function buscar(nomObjetoBuscador) { location.href = "inicio.php?p=buscar&palabras="+document.getElementById(nomObjetoBuscador).value; } function seleccionar(oThis) { oThis.value=""; } /* para el buscador FIN */ /* multimedia INICIO */ function claseGaleria(objImagen, objBotonera, objSpanTitulo, objSpanDesc, IarregloFotos, IarregloTitulo, IarregloDescripcion) { this.oImagen = objImagen; this.oBotonera = objBotonera; this.oSpanTitulo = objSpanTitulo; this.oSpanDesc = objSpanDesc; this.aElementos = IarregloFotos; this.aTitulos = IarregloTitulo; this.aDescripcion = IarregloDescripcion; this.actual = 0; this.cantObjetos = IarregloFotos.length; this.mostrarElemento = function() { this.oImagen.src=this.aElementos[this.actual]; this.oBotonera.innerHTML=(1+this.actual)+' de '+this.cantObjetos+''; this.oSpanTitulo.innerHTML = this.aTitulos[this.actual]; this.oSpanDesc.innerHTML = this.aDescripcion[this.actual]; } this.proximo = function() { if(this.actual<(this.cantObjetos-1)) { this.actual++; this.mostrarElemento() } } this.anterior = function() { if(this.actual>0) { this.actual--; this.mostrarElemento() } } this.mostrarElemento();//inicio el objeto, muestrando el primer elemento } /* multimedia FIN */ /* para las herramientas INICIO */ function enviar_por_email(notas_id) { window.open("enviar-mail_.php?notas_id="+notas_id,"pop_enviar_por_email","width=490,height=565"); }; function aumentarTamanio(nomParrafo) { var p = document.getElementById(nomParrafo); if(p.style.fontSize == "18px") { p.style.fontSize = "13px"; p.style.lineHeight = "17px"; } else { p.style.fontSize = "18px"; p.style.lineHeight = "22px"; } } /* para las herramientas FIN */ /* para el popup del audio INICIO */ function PopAudio(archiv) { window.open("audio/index.php?archiv="+archiv,"audiopopup","width=325,height=130,status=no,menubar=no,scrollbars=no,toolbar=no,location=no,directories=no,resizable=no,top=10,left=10"); } /* para el popup del audio FIN */ /* para la fehce y la hora INICIO */ // Array de los mesesvar monthNames = new makeArray(12);monthNames[0] = "Enero";monthNames[1] = "Febrero";monthNames[2] = "Marzo";monthNames[3] = "Abril";monthNames[4] = "Mayo";monthNames[5] = "Junio";monthNames[6] = "Julio";monthNames[7] = "Agosto";monthNames[8] = "Septiembre";monthNames[9] = "Octubre";monthNames[10] = "Noviembre";monthNames[11] = "Diciembre"; // Array de los días var dayNames = new makeArray(7);dayNames[0] = "Domingo";dayNames[1] = "Lunes";dayNames[2] = "Martes";dayNames[3] = "Miércoles";dayNames[4] = "Jueves";dayNames[5] = "Viernes";dayNames[6] = "Sábado";var now = new Date();var year = now.getYear();if (year < 2000) year = year + 1900;function makeArray(len){ for (var i = 0; i < len; i++) this[i] = null; this.length = len;}function mostrarFecha(){ var strFecha = dayNames[now.getDay()] + " " + now.getDate() +" de " + monthNames[now.getMonth()] + " de " + year; return strFecha;} /* para la fecha y hora FIN */ /* para el reproductor de Flash con Publicidad utiliza la clase swfObject, ubicada en el js */ var publicidad_vista = 0; function updateHTML(elmId, value) { document.getElementById(elmId).innerHTML = value; } function onYouTubePlayerReady(playerId) { ytplayer = document.getElementById("myytplayer"); ytplayer.addEventListener("onStateChange", "onytplayerStateChange"); } function onytplayerStateChange(newState) { if(newState==0 && publicidad_vista==0) { codVideo = document.getElementById("video_principal").value; loadNewVideo(codVideo, 0); publicidad_vista += 1; } if(newState==0 && publicidad_vista==2) stop(); } // funciones para la API function loadNewVideo(id, startSeconds) { if (ytplayer) ytplayer.loadVideoById(id, parseInt(startSeconds)); } function cueNewVideo(id, startSeconds) { if (ytplayer) ytplayer.cueVideoById(id, startSeconds); } function stop() { if (ytplayer) ytplayer.stopVideo(); } function play() { if (ytplayer) ytplayer.playVideo(); } function clearVideo() { if (ytplayer) ytplayer.clearVideo(); } function reproducirVideos() { //cambio el thumbnail de la imagen, por el primer video if(document.getElementById("contVideo").style.display=="none") { document.getElementById("imgThumb").style.display="none"; document.getElementById("contVideo").style.display="block"; } if(publicidad_vista>0 || document.getElementById("video_publicidad").value=="") { if(document.getElementById("video_publicidad").value=="") setTimeout("loadNewVideo(document.getElementById('video_principal').value, 0);play()",2000); else loadNewVideo(document.getElementById("video_principal").value, 0); } else { setTimeout("loadNewVideo(document.getElementById('video_publicidad').value, 0);play()",2000); } } /* FIN del reproductor Flash con Publicidad */ /* funciones Inicio */ function cambia_clase(oThis, nomClase) { oThis.className = nomClase; } function cambiaPestania(divMostrar, codIdentificacion, oThis) { if(document.getElementById('tdFoto_'+codIdentificacion)) { document.getElementById('divFoto_'+codIdentificacion).style.display='none'; document.getElementById('tdFoto_'+codIdentificacion).className = 'tdMenu'; } if(document.getElementById('tdAudio_'+codIdentificacion)) { document.getElementById('divAudio_'+codIdentificacion).style.display='none'; document.getElementById('tdAudio_'+codIdentificacion).className = 'tdMenu'; } if(document.getElementById('tdVideo_'+codIdentificacion)) { document.getElementById('divVideo_'+codIdentificacion).style.display='none'; document.getElementById('tdVideo_'+codIdentificacion).className = 'tdMenu'; } if(document.getElementById(divMostrar+'_'+codIdentificacion)) document.getElementById(divMostrar+'_'+codIdentificacion).style.display='block'; oThis.className = 'tdBlanco'; } /* funciones Fin */