function popuppic (p,w,h,alt) {
	var id = "Pic";
	var globalProps = "resizable=yes,menubar=no,status=no,scrollbars=no,toolbar=no,directories=no,location=no";
	var win = window.open('/pic.php?p='+p+'&w='+w+'&h='+h+'&a='+alt,id,'width='+w+',height='+h+','+globalProps);
	win.focus();
    return false;
}

// - - - - - - - - - - - - - - - - - - -
// BROWSER/PLATFORM IDENTIFIERS
// - - - - - - - - - - - - - - - - - - -

var isNS = document.layers;
var isIE = document.all;

userAgent = window.navigator.userAgent;
browserVers = parseInt(userAgent.charAt(userAgent.indexOf("/")+1),10);

// - - - - - - - - - - - - - - - - - - -
// RELOADS THE PAGE IF WINDOW IS RESIZED (NETSCAPE ONLY)
//  in netscape, when window is resized, font properties are lost
//  forcing the window to resize forces those properties back
// - - - - - - - - - - - - - - - - - - -

if (isNS) {
	widthCheck = window.innerWidth;
	heightCheck = window.innerHeight;
	window.onResize = resizeFix;
}

function resizeFix() {
	if (widthCheck != window.innerWidth || heightCheck != window.innerHeight) {
		document.location.href = document.location.href;
		document.location.reload();
	}	
}

// - - - - - - - - - - - - - - - - - - -

function findElement(n,ly) {
	if (browserVers < 4) return document[n];
	var curDoc = ly ? ly.document : document;
	var elem = curDoc[n];
	if (!elem) {
		for (var i=0;i<curDoc.layers.length;i++) {
			elem = findElement(n,curDoc.layers[i]);
			if (elem) return elem;
		}
	}
	return elem;
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}


imageArray = new Array();
function load_img (name_src) {
	if (document.images) {
		var temp = imageArray[name_src];
		if (!temp) {
			temp = new Image();
			temp.src = name_src;
			imageArray[name_src] = temp;
		}
		return temp;
	}
}

function changeImages() {
	if (document.images) {
		var img;
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			img = null;
			if (isNS)
				img = findElement(changeImages.arguments[i],0);
			else
				img = document.images[changeImages.arguments[i]];

			if (img) {
				img.src = load_img(changeImages.arguments[i+1]).src;
//				img.src = changeImages.arguments[i+1];
			}
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		preloadFlag = true;
	}
}