arImageSrc = new Array ("/viewer/loading.gif","/viewer/loaded.gif");
arImageList = new Array ();
for (counter in arImageSrc) {
arImageList[counter] = new Image();
arImageList[counter].src = arImageSrc[counter];
}
var height = screen.height;
var width = screen.width;
var leftpos = width / 2 - 50;
var toppos = height / 2 - 50;
function encode(str){ // Netscape fix thanks to Cyanide_7
return escape(str.replace(/ /g,'+'));
}


function view(what, title, imgid, date, verybig) {
var url = 'viewer.php?pic='+encode(what)+'&Image_Title='+encode(title)+'&Image_ID='+encode(imgid)+'&Image_Date='+encode(date)+'&Image_Big='+encode(verybig) ;
window.open(url,'WIN','directories=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=1,location=no,menu=no,width=100,height=100,left=' + leftpos + ',top=' + toppos);
}

function view2(what, title) {
var url2 = 'viewer2.php?pic='+encode(what)+'&Image_Title='+encode(title) ;
window.open(url2,'WINBIG','directories=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=1,location=no,menu=no,left=0,top=0','replace=true');
}


function getParams() {
var idx = document.URL.indexOf('?');
var params = new Array();
if (idx != -1) {
var pairs = document.URL.substring(idx+1, document.URL.length).split('&');
for (var i=0; i<pairs.length; i++) {
nameVal = pairs[i].split('=');
params[nameVal[0]] = nameVal[1];
   }
}
return params;
}
params = getParams();

function resize() {
if (eval(pic).height) {
	var name = navigator.appName
	if (name == "Microsoft Internet Explorer") {
	myHeight = eval(pic).height + 136;
	myWidth = eval(pic).width + 32;
	}
	else {
	myHeight = eval(pic).height + 130;
	myWidth = eval(pic).width + 17;
	}
	clearTimeout();
	var height = screen.height;
	var width = screen.width;

	var leftpos = width / 2 - myWidth / 2;
	var toppos = height / 2 - myHeight / 2; 
	
	self.moveTo(leftpos, toppos);
	self.resizeTo(myWidth, myHeight);
}
else setTimeOut(resize(), 100);
}


function resize2() {
if (eval(pic).height) {
	var name = navigator.appName
	if (name == "Microsoft Internet Explorer") {
	myHeight = eval(pic).height + 136;
	myWidth = eval(pic).width + 28;
	}
	else {
	myHeight = eval(pic).height + 69;
	myWidth = eval(pic).width;
	}
	clearTimeout();
	var height = screen.height;
	var width = screen.width;

	var leftpos = width / 2 - myWidth / 2;
	var toppos = height / 2 - myHeight / 2; 
	
	self.moveTo(leftpos, toppos);
}
else setTimeOut(resize(), 100);
}


