	function confirmLink(msg)
	{
	    confirmCheck = confirm(msg);
	    if (confirmCheck)
	        return true;
		 else
	        return false;
	}

	function openWindow(url, name, w, h)
	{
	  w += 32;
	  h += 96;
	  wleft = (screen.width - w) / 2;
	  wtop = (screen.height - h) / 2;
	  var win = window.open(url, name,
	    'width=' + w + ', height=' + h + ', ' +
	    'left=' + wleft + ', top=' + wtop + ', ' +
	    'location=no, menubar=no, ' +
	    'status=no, toolbar=no, scrollbars=no, resizable=no');

//	    alert(w + ' - ' + h);
	  // Just in case width and height are ignored
	  win.resizeTo(w, h);
	  // Just in case left and top are ignored
	  win.moveTo(wleft, wtop);
	  win.focus();
	}

	function SetImage(newImg)
	{
		var elem = document.getElementById("bigimg");
		if (elem != null)
			elem.src = String(newImg);

		return false;
	}

	function resizeImage(img, wMax, hMax, bMargin)
	{
		if (img == null)
			return false;

		var wt = wMax;
		var ht = hMax;
		var aspect = 1.0;

		var pic = new Image;
		pic.src = String(img.src);

		wt = pic.width;
		ht = pic.height;

		if ((wt <= 0) || (ht <= 0))
			return true;
/*
		$aspect = 1;
		$new_h = $new_w = $wMax;

		if ($w >= $h)
		{
			$aspect = $h/$w;
			$new_w = $wMax;
			$new_h = $new_w * $aspect;
		}
		else
		{
			$aspect = $w/$h;
			$new_h = $wMax;
			$new_w = $new_h * $aspect;
		}
		*/
		aspect = 1.0;
//		wt = ht = wMax;

		if (wt >= ht)
		{
			aspect = ht/wt;
			wt = wMax;
			ht = Math.round(wt * aspect);
		}
		else
		{
			aspect = wt/ht;
			ht = hMax;
			wt = Math.round(ht * aspect);
		}
		
//			alert(wt + ", " + ht + ", " + aspect + ", ");

/*		if (wt > ht)
		{
			aspect = ht/wt;
			wt = wMax;
			ht = wt * aspect;

			if (ht > hMax)
			{
				ht = hMax;
				wt = ht * aspect;
			}
		}
*/
		if (bw.ns4)
		{
			img.offsetWidth = wt;
			img.offsetHeight = ht;

			img.width = wt;
			img.height = ht;
		}
		else
		{
			img.width = wt;
			img.height = ht;
		}

		if (bMargin == true)
		{
			xMargin = Math.round((wMax - wt)/2.0) + 1;
			yMargin = Math.round((hMax - ht)/2.0);
			img.style.margin = (yMargin+1) +"px " + xMargin +"px " + yMargin +"px " + xMargin +"px";

//			alert(xMargin + " " + yMargin);
		}

		return true;
	}

