// *********** AUTOSIZE POPUP IMAGEN
// *********** Script Source: CodeLifter.com

PositionX = 100;
PositionY = 100;

defaultWidth  = 500;
defaultHeight = 500;

var AutoClose = true;

if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popup(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Cargando...</title><meta http-equiv=imagetoolbar content=no><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["BFImageName"].width;');writeln('window.innerHeight=document.images["BFImageName"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');
writeln('function SelfMove(){self.moveTo(((screen.width/2-document.body.clientWidth)/2),((screen.height/2-document.body.clientHeight)/2-50));}');
writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="SelfMove();reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onclick="self.close()" onload="SelfMove();reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('');
writeln('<img title="Clic para cerrar" name="BFImageName" src="'+imageURL+'" style="display:block"></body></html>');
close();		
}}

// *********** POP UP

function AbrirVentana(mypage,myname,w,h,menubar,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/3 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',menubar='+menubar+',scrollbars='+scroll+',resizable=no'
	win = window.open(mypage,myname,settings)
}

// *********** NO MOSTRAR LINKS EN BARRA DE ESTADO

//var text = '';
//function setstatus(){
//      window.status = text;
//	timerID= setTimeout("setstatus()", 25);
//}
//setstatus();

// *********** LINKS DE NAVEGACION

function favoritos(url, titulo){
	if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4)) {
	var url=url;
	var titulo=titulo;
	window.external.AddFavorite(url,titulo);
	}
	else {
	if(navigator.appName == "Netscape") 
	alert ("Presione Crtl+D para agregar "+titulo+" en sus Bookmarks");
	}
}

function paginadeinicio(src, url){
	src.style.behavior='url(#default#homepage)';
	src.setHomePage(url);
}

// *********** MANEJAR CAPAS

function ReloadNav4(init) {  //reloads the window if Nav4 resized
	if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)){
	document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_ReloadNav4; }}
	else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

ReloadNav4(true);

ie4=(document.all)? true:false
ns4=(document.layers)? true:false

var LayerActivo
var Mostrar
var Ocultar

function SeleccionarLayer(NombreLayer){
	if (ie4){LayerActivo = document.all[NombreLayer].style; Mostrar = "visible"; Ocultar = "hidden"}
	else
	if (ns4){LayerActivo = document.layers[NombreLayer]; Mostrar = "show"; Ocultar = "hide";}
	return LayerActivo;
}
function MuestraLayer(NombreLayer){
	OcultarTodos();
	(SeleccionarLayer(NombreLayer)).visibility = Mostrar
}
function OcultaLayer(NombreLayer){
	(SeleccionarLayer(NombreLayer)).visibility = Ocultar
}
function OcultarTodos(){
	for (i=1; i<=3 ; i++){OcultaLayer("Capa"+i)}
}
function MostrarTodos(){
	for (i=1; i<=3 ; i++){MuestraLayer("Capa"+i)}
}

// *********** FRAME BREAKER

if (top.location != self.location) {
	top.location = self.location.href
}