// JavaScript Document

// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this notice.

// SETUPS:
// ===============================

// Set the horizontal and vertical position for the popup

PositionX = 100;
PositionY = 10;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 500;
defaultHeight = 500;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
var isNN=(navigator.appName=="Netscape")?1:0;
var isSafari=(navigator.appVersion.toLowerCase().indexOf("safari")!=-1)?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='directories=no,location=no,menubar=no,toolbar=no,scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
var optSafari='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;

function popImage(imageURL,imageTitle){
 
if (isIE){
	imgWin=window.open('archivobc.html','',optIE);
} else if(isSafari) {
	imgWin=window.open('about:blank','',optNN);
} else {
	imgWin=window.open('about:blank','',optNN);
}

with (imgWin.document){
writeln('<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Loading...</title><style>body{margin:0px;}</style>');
writeln('<title>about:ArchivoBC</title>');
writeln('<script>function MM_preloadImages() { var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}}</script>');

writeln('<sc'+'ript>');
writeln('var isNN,isIE,isSafari;');

writeln('isNN=(navigator.appName=="Netscape")?1:0;');
writeln('isSafari=(navigator.appVersion.toLowerCase().indexOf("safari")!=-1)?1:0;');
writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;');


writeln('function reSizeToImage(){');

writeln('if (isIE){ ');
	writeln(' if (navigator.appVersion.indexOf("MSIE 7")!=-1) { ');
		writeln('width=(document.images[0].width)+10;');
		writeln('height=(document.images[0].height)+80;');
		writeln('window.resizeTo(width,height);');
	writeln(' } else {');
		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('}');
	
writeln('} else if (isSafari) {');
	//writeln('window.alert(document.getElementById("George").height+" :: "+document.getElementById("George").width);');
//	writeln('window.innerWidth='+px+';');
//	writeln('window.innerHeight='+py+';');
//	writeln('window.alert('+py+');');
	writeln('window.resizeTo('+px+','+py+');');
writeln('} else {');

	writeln('window.innerWidth=document.getElementById("George").width;');
	writeln('window.innerHeight=document.getElementById("George").height;}}');

writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage(); doTitle(); self.focus();">')
else writeln('</head><body bgcolor="#000000" scroll="no" onload="reSizeToImage(); doTitle(); self.focus()" onblur="self.close()">');
writeln('<img id="George" name="George" src="'+imageURL+'" style="display:block"></body></html>');

close();		
}}


