function ShowPicture()
{
	document.all.loadingDiv.style.visibility = "hidden";
	document.all.picDiv.style.display = "block";
	document.all.picDiv.filters.blendTrans.play();
	document.all.xDiv.style.display = "block";
}

function showPicture(picName)
{
	var w = document.body.clientWidth;
	var h = document.body.clientHeight;
	var top, left;
	var picW = 720;
	var picH = 480;

	if(h > picH)
	{
		top = (h / 2) - (picH / 2) + document.body.scrollTop;
	}
	else
	{
		top = 0;
	}

	if(w > picW)
	{
		left = (w / 2) - (picW / 2) - 20;
	}
	else
	{
		left = 0;
	}
	
	document.all.picDiv.style.left = left;
	document.all.picDiv.style.top = top;
	document.all.picDiv.filters.blendTrans.apply();
	document.all.picDiv.innerHTML = "<IMG src=\""+picName+"M.JPG\" hspace=\"0\" vspace=\"0\" style=\"border: solid 1px black;\" onload=\"ShowPicture();\"><br/><center><a href=\"javascript:downloadPicture('"+picName+"L.JPG');\"><b>download large picture</b></a></center>";

	document.all.xDiv.style.top = top + 3;
	document.all.xDiv.style.left = left + picW + 32 + 3 - 11;

	document.all.loadingDiv.style.top = top + (picH / 2) - 16;
	document.all.loadingDiv.style.left = left + (picW / 2) - 100;
	document.all.loadingDiv.style.visibility = "visible";
}

function hiddPicture(picName)
{
	document.all.picDiv.style.display = "none";
	document.all.xDiv.style.display = "none";
}

function makevisible(cur, which)
{
	var strength = (which == 0) ? 1 : 0.5

	if (cur.style.MozOpacity)
		cur.style.MozOpacity = strength;
	else if (cur.filters)
		cur.filters.alpha.opacity = strength * 100;
}

function downloadPicture(url)
{
    downloading();
    document.all.dImg.src = url;
}

/*
function saveImageAs(imgOrURL)
{
    if (typeof imgOrURL == 'object')
        imgOrURL = imgOrURL.src;
    window.win = open(imgOrURL);
    setTimeout('win.document.execCommand("SaveAs")', 500);
}
*/

function saveImageAs()
{
    window.win = open(document.all.dImg.src, "big_pic", "width=0,height=0");
    setTimeout('win.document.execCommand("SaveAs")', 500);
    setTimeout('win.close()', 1000);
	document.all.loadingDiv2.style.visibility = "hidden";
}

function downloading()
{
	var w = document.body.clientWidth;
	var h = document.body.clientHeight;
	var top, left;
	var picW = 720;
	var picH = 480;

	if(h > picH)
	{
		top = (h / 2) - (picH / 2) + document.body.scrollTop;
	}
	else
	{
		top = 0;
	}

	if(w > picW)
	{
		left = (w / 2) - (picW / 2) - 20;
	}
	else
	{
		left = 0;
	}
	
	document.all.loadingDiv2.style.top = top + (picH / 2) - 30;
	document.all.loadingDiv2.style.left = left + (picW / 2) - 30;
	document.all.loadingDiv2.style.visibility = "visible";
}
