function abrirVentana(URL,nombreVentana,opciones) { //v2.0
  window.open(URL,nombreVentana,opciones);
}

function abrePagina(URL) { //v2.0
  window.open(URL);
}

function abreSeccion(idSeccion) { //v2.0
	f = window.document.formularioPasar;
	f.action = "secciones.php";
	f.seccion.value = idSeccion;
	f.submit();
}

function abreDocumento(idDocumento) { //v2.0
	f = window.document.formularioPasar;
	f.action = "documentos.php";
	f.documento.value = idDocumento;
	f.submit();
}
function scroll_top(){

	if(window.pageYOffset){
		return window.pageYOffset;
	 }
	 else {
		return  Math.max(document.body.scrollTop,document.documentElement.scrollTop);
	 }

}

function verTrabajo(sec, nom){
   var margenTop = -278 + scroll_top();
     
   document.getElementById("informacionTrabajo").style.display = 'block';
   document.getElementById("informacionNoticia").style.display = 'none';		      
   document.getElementById("informacionVideo").style.display = 'none';		      
   document.getElementById("capaPopup").style.display = 'block';		   
   document.getElementById("capaPopup").style.marginTop = margenTop+'px';	
   document.getElementById("capaOculta").style.display = 'block';
   document.getElementById("capaOculta").style.top = scroll_top()+'px';	   	   
   document.getElementById("myBody").style.overflow = 'hidden';
   window.frames["iframeInformacionTrabajo"].location.href = 'http://www.orfebreriaandaluza.com/includes/productos.inc.php?sec=' + sec + '&nom='+nom;
   }  

function verNoticia(not){
   var margenTop = -278 + scroll_top();
     
   document.getElementById("informacionTrabajo").style.display = 'none';
   document.getElementById("informacionNoticia").style.display = 'block';		      
   document.getElementById("informacionVideo").style.display = 'none';		      
   document.getElementById("capaPopup").style.display = 'block';		   
   document.getElementById("capaPopup").style.marginTop = margenTop+'px';	
   document.getElementById("capaOculta").style.display = 'block';
   document.getElementById("capaOculta").style.top = scroll_top()+'px';	   	   
   document.getElementById("myBody").style.overflow = 'hidden';
   window.frames["iframeInformacionNoticia"].location.href = 'includes/noticias.inc.php?not=' + not;
   }
   
function verVideo(vid){
   var margenTop = -278 + scroll_top();
     
   document.getElementById("informacionTrabajo").style.display = 'none';
   document.getElementById("informacionNoticia").style.display = 'none';		      
   document.getElementById("informacionVideo").style.display = 'block';		      
   document.getElementById("capaPopup").style.display = 'block';		   
   document.getElementById("capaPopup").style.marginTop = margenTop+'px';	
   document.getElementById("capaOculta").style.display = 'block';
   document.getElementById("capaOculta").style.top = scroll_top()+'px';	   	   
   document.getElementById("myBody").style.overflow = 'hidden';
   window.frames["iframeInformacionVideo"].location.href = 'includes/videos.inc.php?vid=' + vid;
	//window.frames["iframeinformacionVideo"].location.reload();        
   }
   
function cerrar(){
	window.frames["iframeInformacionNoticia"].location.reload();    
   document.getElementById("capaOculta").style.display = 'none';
   document.getElementById("capaPopup").style.display = 'none';		   
   document.getElementById("informacionNoticia").style.display = 'none';		      
   document.getElementById("informacionTrabajo").style.display = 'none';		      
   document.getElementById("informacionVideo").style.display = 'none';		      
   document.getElementById("myBody").style.overflow = 'auto';	   
   window.frames["iframeInformacionVideo"].location.href = 'includes/videos.inc.php';
   window.frames["iframeInformacionNoticia"].location.href = 'includes/noticias.inc.php';   
   window.frames["iframeInformacionTrabajo"].location.href = 'includes/productos.inc.php';   
   }
function mostrarCargando(){
	
   var margenTop = -70 + scroll_top();
   document.getElementById("capaCargando").style.marginTop = margenTop+'px';
   document.getElementById("capaOculta").style.top = scroll_top()+'px';	   	
   document.getElementById("capaCargando").style.display = 'block';		   
   document.getElementById("capaOculta").style.display = 'block';
   document.getElementById("myBody").style.overflow = 'hidden';
   
   }   
function ocultarCargando(){
   document.getElementById("capaCargando").style.display = 'none';		   
   document.getElementById("capaOculta").style.display = 'none';
   document.getElementById("myBody").style.overflow = 'auto';
   }      
