function HideIf(sDivID, o, vValue) {
	var d = document.getElementById(sDivID);
	if (o.options[o.selectedIndex].value == vValue) {
		d.style.display = "none";
	} else {
		d.style.display = "block";
	}
}

//Generic window opener which loads a specified image into a tight window.
function OpenIm(id, url, iWidth) {
	imid = id;
	var imgsrc;

	if (url == '' || url == null) {
		url = 'im.asp?id='+ id
	}

	imurl = url;

	tempImage = new Image();
	
	imgsrc = 'displayimage.asp?id=' + id
	
	if (iWidth != null) imgsrc += '&width=' + iWidth;
	
	tempImage.src = imgsrc
	
	CheckImLoaded();
}

function CheckImLoaded() {
	intervalid = setTimeout("tempImage.height==0 ? CheckLoaded() : LoadWin()", 100);
}

function CheckLoaded() {
	if (tempImage.height != 0) {
		clearTimeout(intervalid)
		LoadWin();
	} else {
		CheckImLoaded();
	}
}

function LoadWin() {
	winheight	= tempImage.height + 30;
	winwidth	= tempImage.width + 30;
	winname		= "Win" + Math.floor(Math.random() * 10);
	var windet	= 'WIDTH=' + winwidth + ',HEIGHT=' + winheight + ',scrollbars=1,resizable=1';
	var newwin  = window.open(imurl, winname, windet);
	newwin.focus();
}