//---------------------------------------------------------------------------
// Fichero: fun_comun.js
// Objeto: Funciones javascript comunes para las páginas de la aplicación.
// Autor: Doo2Web Solutions
// (c) Copyright 2005, Doo2Web Solutions, S.L. Todos los derechos reservados.
// Para cualquier duda, pueden dirigirse a soporte@doo2web.com
//---------------------------------------------------------------------------
var precapa;
var estilo;
var top;
var left;
//funciones de visibilidad de capas
if(document.getElementById){
        precapa='document.getElementById("'
		estilo='").style'
        top='.top'
        left='.left'
}else if(document.layers){
        precapa='document.'
        estilo=''
        top='.top'
        left='.left'
}else if(document.all){
        precapa=''
        estilo='.style'
        top='.pixelTop'
        left='.pixelLeft'
}
function mostrarcapa(capa){
	eval(precapa+capa+estilo+'.visibility="visible"');
	eval(precapa+capa+estilo+left+'='+((screen.width/2)-67));
}  
function ocultarcapa(capa){
	eval(precapa+capa+estilo+'.visibility="hidden"');
}
function activar (imgName) { 
	document.images[imgName].src = eval( imgName ); 
} 
function desactivar(imgName) { 
	document.images[imgName].src = eval( imgName + "2" ); 
} 

//-abrirv-//Esta función abre una nueva ventana
function abrirv(pagina,w,h){
	var opciones='';
	var scrol = '';
	var nombre = pagina;
	var top = (screen.height-h)/2;
	var left = (screen.width-w)/2;
	if (screen.height < h || screen.width < w) {
		scrol = 'yes';
			if (screen.height < h) {
					h = screen.height - 50;				
			} else {
				h = h + 20;
			}
			if (screen.width < w) {
					w = screen.width - 20;				
			}
		top = 0;
		left = 0;
	} else {
		scrol = 'no';
	}
	opciones = 'scrollbars='+scrol+',resizable=no,width='+w+',height='+h+',top='+top+',left='+left+'';
	pagina += '.html'
	window.open (pagina,nombre,opciones);
}	

//-abrirv-//Esta función abre una nueva ventana
function abrirphp(pagina,w,h){
	var opciones='';
	var scrol = '';
	var nombre = 'fotog';
	var top = (screen.height-h)/2;
	var left = (screen.width-w)/2;
	if (screen.height < h || screen.width < w) {
		scrol = 'yes';
			if (screen.height < h) {
					h = screen.height - 50;				
			} else {
				h = h + 20;
			}
			if (screen.width < w) {
					w = screen.width - 20;				
			}
		top = 0;
		left = 0;
	} else {
		scrol = 'no';
	}
	opciones = 'scrollbars='+scrol+',resizable=no,width='+w+',height='+h+',top='+top+',left='+left+'';
	//pagina += '.html'
	window.open (pagina,nombre,opciones);
}	