function toggleLayer(id1, id2)
{
	if (document.getElementById)
	{
		// this is the way the standards work
		var style1 = document.getElementById(id1).style;
		var style2 = document.getElementById(id2).style;
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		var style1 = document.all[id1].style;
		var style2 = document.all[id2].style;
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		var style1 = document.layers[id1].style;
		var style2 = document.layers[id2].style;
	}
	style1.display = style1.display ? "" : "none";
	style2.display = style2.display ? "" : "";
}

function fade(amt) {
	if(amt <= 100) {
		setFade(amt);
		amt += 10;
		setTimeout("fade("+amt+")", 5);
    }
}

function setFade(amt) {
	obj = document.getElementById('previewImg');
	
	amt = (amt == 100)?99.999:amt;
  
	// IE
	obj.style.filter = "alpha(opacity:"+amt+")";
  
	// Safari<1.2, Konqueror
	obj.style.KHTMLOpacity = amt/100;
  
	// Mozilla and Firefox
	obj.style.MozOpacity = amt/100;
  
	// Safari 1.2, newer Firefox and Mozilla, CSS3
	obj.style.opacity = amt/100;
}