var pic = null;
var popImg = null;
var picTitle = null;
var imgCount = 0;
var imgWinName = "popImg";
var s1 = "<title>BoxWave - Close-up Picture</title>" + "<body bgcolor='#ffffff'>";
var s3 = "</body>";

var priorPic = new Array();
var noPic = 0;

function openPopImg(picName,  windowTitle, windowWidth, windowHeight){
	var i = 0;
	var foundit = false;
	if(pic == picName && winOpen()){
		popImg.focus();}
	else{
		foundit = false;
		for(i=0; i<=noPic; i++){
			if (priorPic[i] == picName);
			foundit = true;
		}
		pic = picName;
		closePopImg();
		picTitle = windowTitle;
		imgWinName = "popImg" + imgCount++;
		popImg = window.open("" , imgWinName,
				"toolbar=no,scrollbars=no,resizable=no,top=0,left=0,width="
				+ (parseInt(windowWidth) + 25) + ",height=" + (parseInt(windowHeight)+63));
		if(foundit){
			fabricatePage();
		}else{
			priorPic[noPic++] = pic;
			fabricateNewImagePage();
		}
	}
}

function fabricatePage(){
	popImg.document.open();
	var s2 = '<table border=0 cellpadding=0 cellspacing=0 height=\"100%\" align=center><tr valign=middle><td height=100%><img src='+pic+' border=0></td></tr><tr><td><img src=\"/images_bw/dot_trans.gif\" height=20 width=1><br></td></tr><tr><td align=\"center\"><input type=\"button\" value=\"Close\" onclick=\"self.close();\" class=\"Text_Standard\"></td></tr></table>';
	popImg.document.open();
	popImg.document.write(s1+s2+s3);
	popImg.document.close();
}

function fabricateNewImagePage(){
	var s2 = '<table border=0 cellpadding=0 cellspacing=0 height=\"100%\" align=center><tr valign=middle><td height=100%><img src='+pic+' border=0></td></tr><tr><td><img src=\"/images_bw/dot_trans.gif\" height=20 width=1><br></td></tr><tr><td align=\"center\"><input type=\"button\" value=\"Close\" onclick=\"self.close();\" class=\"Text_Standard\"></td></tr></table>';
	popImg.document.write(s1+s2+s3);
	popImg.document.close();
}

function winOpen(){
	if(popImg != null){
		if(popImg.closed != true) return true; 
	else return false;
	} else return false;
}

function closePopImg(){
	if (navigator.appName != "Microsoft Internet Explorer" || parseInt(navigator.appVersion) >=4)
	if(popImg != null && !popImg.closed) popImg.close();
}

function doNothing(){}


function putImage(imgDocID,imgObjName) {
	document.images[imgDocID].src = eval(imgObjName + ".src");
}
