document.write("<style type='text/css'>#fadeimg img {visibility:hidden;}<\/style>");


function showPic (whichpic) {
	var imageId = 'fadeimg';

	if (document.getElementById) {

		document.getElementById('fadeimg').childNodes[0].src = whichpic.href;
	
		//fadeIn('theimg',0);
		
		if (whichpic.title) {
			document.getElementById('desc').childNodes[0].nodeValue = whichpic.title;
		} else {
			document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue;
		}
		
		return false;
		
	} else {
		return true;
	}
}

function tableruler()
{
	if (document.getElementById && document.createTextNode)
	{
		var tables=document.getElementsByTagName('table');
		for (var i=0;i<tables.length;i++)
		{
			if(tables[i].className=='specTable')
			{
				var trs=tables[i].getElementsByTagName('tr');
				for(var j=0;j<trs.length;j++)
				{
					if(trs[j].parentNode.nodeName=='TBODY')
					{
						trs[j].onmouseover=function(){this.className='ruled';return false}
						trs[j].onmouseout=function(){this.className='';return false}
					}
				}
			}
		}
	}
}

function toggle ( targetId ) {
	if ( document.getElementById ) {
			target = document.getElementById ( targetId );
				if ( target.style.display == "none" ) {
					target.style.display = "block";
				} else {
					target.style.display = "none";
				}
	}
}


function initFade() {

	var wrapId = 'fadeimg'; // ID of the div wrapper
	var imageId = 'theimg'; // ID to assign to the img

	if(document.getElementById(wrapId)) {
		var wrap = document.getElementById(wrapId);
	} else { return false; }
	var images = wrap.getElementsByTagName('img');
	var image = images[0]; // Select first img from array

	image.setAttribute("id", imageId); // Set the ID to the image
	setOpacity(image,0); // Set the image opacity to 0
	image.style.visibility = "visible"; // Then make it visible in the css
	fadeIn(imageId,0); // The fade it in

}

function fadeIn(objId,opacity) {
	if (document.getElementById) {
		obj = document.getElementById(objId);
		if (opacity <= 100) {
			setOpacity(obj, opacity);
			opacity += 10;
			window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100);
		}
	}
}

function setOpacity(obj, opacity) {
	opacity = (opacity == 100) ? 99 : opacity;
	// IE/Win
	obj.style.filter = "alpha(opacity:"+opacity+")";
	// Safari<1.2, Konqueror
	obj.style.KHTMLOpacity = opacity/100;
	// Older Mozilla and Firefox
	obj.style.MozOpacity = opacity/100;
	// Safari 1.2, newer Firefox and Mozilla, CSS3
	obj.style.opacity = opacity/100;
}

window.onload = function() { initFade() }