/*   ********************************************************
     *                                                      *
     *      	Librería de funciones Javascript            *
     *            Proyecto Final de Carrera de              *
     *                PAMELA LÓPEZ ALMAGRO                  *
     *                                                      *
     *           Realizada en Marzo de 2003 por             *
     *             Francisco Álvarez Martínez               *
     *         (c) Copyright 2003 by Cónvero.Net            *
     *                                                      *
     ********************************************************/


// FUNCIONES VARIAS DEL PROGRAMA
function enlace(nombrepeich)
{
window.open("http://" + nombrepeich, "enlext", "top=100 left=100 width=640 height=480 toolbar=no menubar=no scrollbars=yes statusbar=no status=no directories=no resizable=yes padding-top=0 padding-left=0 padding-right=0 padding-bottom=0");
}

function grafica(nombrefich, resx, resy, titulo) {
window.open("../cargaimagen.html?imagen="+nombrefich+"&resx="+resx+"&resy="+resy+"&tit="+titulo, "grafico", "top=150 left=150 width="+ (resx-4) +" height="+ (resy-4) +" toolbar=no menubar=no scrollbars=no statusbar=no status=no directories=no padding-top=0 padding-left=0 padding-right=0 padding-bottom=0");
}

function barracolor()
	{
	document.body.style.scrollbarFaceColor='#000000';
	document.body.style.scrollbarShadowColor='#000000';
	document.body.style.scrollbarTrackColor='#000000';
	document.body.style.scrollbarHighlightColor='#000000';
	document.body.style.scrollbar3dlightColor='#000000';
	document.body.style.scrollbarDarkShadowColor='#000000';
	document.body.style.scrollbarBaseColor='#000000';
	document.body.style.scrollbarArrowColor='#000000';
	}

function barracolor2()
	{
	document.body.style.scrollbarFaceColor='#FFFFFF';
	document.body.style.scrollbarShadowColor='#FFFFFF';
	document.body.style.scrollbarTrackColor='#FFFFFF';
	document.body.style.scrollbarHighlightColor='#FFFFFF';
	document.body.style.scrollbar3dlightColor='#FFFFFF';
	document.body.style.scrollbarDarkShadowColor='#FFFFFF';
	document.body.style.scrollbarBaseColor='#ffffff';
	document.body.style.scrollbarArrowColor='#000000';
	}

function cerrar_ventana()
	{
	this.window.close();
	}

<!-- Protección contra el click con el botón derecho

function right(e)
{
if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2))
{
alert("Gestión Integrada en Empresas Constructoras. Cónvero.Net, 2003®");
return false;
}
else 
if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3))
{
alert("Gestión Integrada en Empresas Constructoras. Cónvero.Net, 2003®");
return false;
}
return true;
}
document.onmousedown=right;
document.onmouseup=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=right;
window.onmouseup=right;

var musica;
//  Fin del script de protección del botón derecho -->

// CARGA DE IMÁGENES (ENRUTADO) PARA LA PRESENTACIÓN
fotico=new Array();
fotico[1]="img/G.gif";
fotico[2]="fotos/castellbell1.jpg";
fotico[3]="fotos/02.jpg";
fotico[4]="fotos/andamio_colgado1.jpg";
fotico[5]="fotos/bloque2.jpg";
fotico[6]="fotos/norte-sur.jpg";
fotico[7]="img/I.gif";
fotico[8]="fotos/obra_e1.gif";
fotico[9]="fotos/sierra.jpg";
fotico[10]="fotos/obra_a21_2.gif";
fotico[11]="fotos/inestableseg.jpg";
fotico[12]="fotos/obra_f22_2.gif";
fotico[13]="fotos/obra_n1_2.jpg";
fotico[14]="img/E.gif";
fotico[15]="fotos/castellbell1.jpg";
fotico[16]="fotos/02.jpg";
fotico[17]="fotos/andamio_colgado1.jpg";
fotico[18]="fotos/bloque2.jpg";
fotico[19]="fotos/norte-sur.jpg";
fotico[20]="img/C.gif";
fotico[21]="img/epis.jpg";
fotico[22]="fotos/sur.jpg";
fotico[23]="fotos/tuberia.jpg";
fotico[24]="fotos/obra_d2_2.jpg";
fotico[25]="fotos/norte.jpg";
fotico[26]="img/pamela.gif";

function tirapatras(chungi)
{
if (parent.window.document.images["fleizq"])
{
parent.window.document.images["fleizq"].src="img/izq.gif";

// PRIMERO COGEMOS EL NOMBRE DEL ENLACE SUPERIOR

patras=parent.location.href;
cabeza=patras.substring(0,patras.lastIndexOf("cod=")+4);
peich=patras.substring(patras.indexOf("cod=")+4, patras.lastIndexOf("&"));
cola=patras.substring(patras.lastIndexOf("&"), patras.length);
//alert ("pagina: " + peich + "\n\ncola: " + cola);

// DESPUÉS, COGEMOS EL NOMBRE DEL FRAME

ptras=parent.window.texto.location.href;
cabza=ptras.substring(0,ptras.lastIndexOf("/")+1);
puch=ptras.substring(ptras.lastIndexOf("/")+1, ptras.lastIndexOf(".html"));
coul=ptras.substring(ptras.lastIndexOf(".html"), ptras.length);
//alert ("pagina: " + puch + "\n\ncola: " + coul);

if (puch==peich)
{
// AQUÍ VIENE CUANDO LA DIRECCIÓN DEL FRAME COINCIDE CON EL COD= DE LA PÁGINA CONTENEDORA
if (peich=="0400")
parent.document.links[2].href="index.html?cod=0110&alto=240";
else
  {
tiri=peich-1;
if (peich=="0410")
tiri=400;
if (chungi)
cola="&imagen=" + chungi;
parent.document.links[2].href="index.html?cod=0" + tiri + cola;
  }
}
else
{
// AQUÍ VIENE CUANDO LA DIRECCIÓN DEL FRAME ES DIFERENTE A LA DE LA PÁGINA CONTENEDORA
var chas=puch-1;
if (puch=="0410")
chas=400;
parent.document.links[2].href="index.html?cod=0" + chas + cola;
}
}
}


function tirapalante(chungi)
{
if (parent.window.document.images["fleder"])
{
parent.window.document.images["fleder"].src="img/der.gif";

// PRIMERO COGEMOS EL NOMBRE DEL ENLACE SUPERIOR

patras=parent.location.href;
cabeza=patras.substring(0,patras.lastIndexOf("cod=")+4);
peich=patras.substring(patras.indexOf("cod=")+4, patras.lastIndexOf("&"));
cola=patras.substring(patras.lastIndexOf("&"), patras.length);
//alert ("pagina: " + peich + "\n\ncola: " + cola);

// DESPUÉS, COGEMOS EL NOMBRE DEL FRAME

ptras=parent.window.texto.location.href;
cabza=ptras.substring(0,ptras.lastIndexOf("/")+1);
puch=ptras.substring(ptras.lastIndexOf("/")+1, ptras.lastIndexOf(".html"));
coul=ptras.substring(ptras.lastIndexOf(".html"), ptras.length);
//alert ("pagina: " + puch + "\n\ncola: " + coul);

if (puch==peich)
{
// AQUÍ VIENE CUANDO LA DIRECCIÓN DEL FRAME COINCIDE CON EL COD= DE LA PÁGINA CONTENEDORA
if (peich=="0400")
tiri=410;
else
tiri=(peich-1)+2;
if (chungi)
cola="&imagen=" + chungi;
parent.document.links[3].href="index.html?cod=0" + tiri + cola;
}
else
{
// AQUÍ VIENE CUANDO LA DIRECCIÓN DEL FRAME ES DIFERENTE A LA DE LA PÁGINA CONTENEDORA
if (puch=="0400")
chas=410;
else
chas=(puch-1)+2;
parent.document.links[3].href="index.html?cod=0" + chas + cola;
}
 }
}

function imprimetexto()
{
//ENLACE PRINCIPAL
var pish=parent.location.href;
var petri=parent.window.texto.location.href;
//CORTES DEL ENLACE ATRÁS
var chur=parent.document.links[2].href;
//CORTES DEL ENLACE ADELANTE
var coro=parent.document.links[3].href;

if ((chur=="#") && (coro=="#"))
{
//alert(petri);
seto=pish.substring(pish.indexOf("cod=")+4, pish.lastIndexOf("&"));
site="html/"+ seto + ".html";
//alert(seto);

}
else
if ((chur!="#") && (coro=="#"))
{
seto=chur.substring(chur.indexOf("cod=")+4, chur.lastIndexOf("&"));
takenlace=(pish-1)+3; // pish ya es el enlace de la página anterior, por eso, si le resto 1, necesito sumarle 3 para que sea equivalente a la página actual.
//alert(seto + " , " + takenlace);
site="html/"+ takenlace + ".html";
}
else
if ((chur=="#") && (coro!="#"))
{
seto=coro.substring(coro.indexOf("cod=")+4, coro.lastIndexOf("&"));
takenlace=seto-2; // coro ya es el enlace de la página siguiente, por eso, si le resto 1 será la página actual.
//alert(seto + " , " + takenlace);
site="html/"+ seto + ".html";
}
else
if ((chur!="#") && (coro!="#"))
{
seto=pish.substring(pish.indexOf("cod=")+4, pish.lastIndexOf("&"));
//alert(" Ambos iguales \n\n" + seto);
site="html/"+ seto + ".html";
//alert(" Ambos iguales \n\n" + site);
}

pepe=window.open(site,"_blank", "top=10000 left=10000 width=10 height=10 visible=no toolbar=no menubar=no scrollbars=no statusbar=no status=no directories=no resizable=no padding-top=0 padding-left=0 padding-right=0 padding-bottom=0");
pepe.print();
pepe.close();
pepe="";
}

function cargapdf(nombre_pdf)
{
window.open("../cargapdf.html?id=" + nombre_pdf, "pdf", "top=100 left=100 width=637 height=477 toolbar=no menubar=no scrollbars=no statusbar=no status=no directories=no resizable=no padding-top=0 padding-left=0 padding-right=0 padding-bottom=0");
}

// FIN DE LA LIBRERIA DE FUNCIONES ESPECIALES
