var myimages=new Array()
var imageExists;
var	hiResImage;
var popUp;
function preloadimages(){
	for (i=0;i<preloadimages.arguments.length;i++){
		myimages[i]=new Image()
		myimages[i].src=preloadimages.arguments[i]
	} // end for
} // end function

function getImgHeight(imgSrc)
{
	for (var i=0; i<myimages.length; i++) {
		if (myimages[i].src==imgSrc) {return myimages[i].height+10;}
	} // end for
}
function doesFileExist(fileName) {
	var fso = new ActiveXObject("Scripting.FileSystemObject");
	return fso.FileExists(fileName);
} // end function
function doesImageExist(path) {
	var oImg = new Image();
	oImg.onload = function(){onImageEvent(oImg, true);};
	oImg.onerror = function(){onImageEvent(null, false)};
	oImg.src = path;
} // end function
function doReturn() {
	return true;	
} // end function
function dontReturn() {
	return false;
} // end function
function onImageEvent(img, loaded) {
	imageExists=loaded;
	hiResImage="";
	document.getElementById("hiPop").onClick=dontReturn();
	document.getElementById("hiPop").style.cursor="default";
	document.getElementById("hiPop").href="";
	document.getElementById("hiPop").rel="";
	document.getElementById("hiPop").stopGoing = true;
	if (imageExists) {
		hiResImage=img.src;
		document.getElementById("hiPop").onClick=doReturn();
		document.getElementById("hiPop").style.cursor="pointer";
		document.getElementById("hiPop").href=hiResImage;
		document.getElementById("hiPop").rel="shadowbox[IntellisitesGallery"+nAlbCurrent+"];options={handleLgImages:'resize'};options={counterType:'skip',continuous:true}";
		document.getElementById("hiPop").stopGoing = false;
	} // end if
	Shadowbox.setup();
} // end function
