//document.writeln ('<link rel="stylesheet" href="/css/fader.css" type="text/css">') ; 

var o
var maxHeight = 200
function show(x,what) 
{	y = MM_findObj (x); hideAllLayers(); 
	y.style.visibility="visible"; y.style.display="block"; 
	r=g=b=255; 
	chR = chG= chB= -20;  
	o = 0
	startFade()	
	}
function hide(x,what) 
{	y = MM_findObj (x); 
	r=g=b=0; 
	chR = chG= chB= 20;  
	startFade()
	doOnLoad()
	}

function hideAllLayers() { 
 var eles = document.getElementsByTagName("div"); 
 for(i=0;i<eles.length;i++) 
 	{  if (eles[i].id!='')
		{	
			eles[i].style.visibility="hidden"; 
			eles[i].style.display="none"; 
			eles[i].style.color="rgb(255,255,255)"; 
			eles[i].style.opacity = 0;
			eles[i].style.filter = "Alpha(opacity=0)";
		}
	}

 } 

function doOnLoad()
{	if (typeof(writeFade) !="undefined" ) 
	{ 
		if (writeFade !="" ) 
		{ 
			show(writeFade); 
			if (parent.document.getElementById("contentSpacer")) 
			{maxHeight = parent.document.getElementById("contentTable").height} 
		}
	} 
} 

function startFade(incoming) { theDiv = incoming;  fadeReal();  }
function startFadeOut(incoming) { theDiv = incoming;  fadeReal()  }


function fadeReal( ) {  r += chR;g += chG; b += chB; o += 0.08;// alert(o)
if ( ( r >= 0 ) && ( r < 256 ) && ( g >= 0 ) && ( g < 256 ) && ( b >= 0 ) && ( b < 256 ) ) 
	{
	y.style.color = "rgb(" + r + "," + g + "," + b + ")";
	y.style.opacity = o
	ieo = (o*100); //alert(ieo)
	y.style.filter = "Alpha(opacity="+ieo+")";
	timer = setTimeout ("fadeReal(" + chR + "," + chG + "," + chB +","+o+")", 50); } 
	else if (r>=240)//	alert (r+" " + g+ " " + b)
	{	y.style.visibility="hidden"; y.style.display="none"; 
		y.style.color="rgb(255,255,255)"; doOnLoad(); }
	else { updateHeight() }

}//}

function updateHeight() { if (parent.document.getElementById("contentSpacer")) {
	thisHeight = parent.document.getElementById("contentTable").offsetHeight
	if (thisHeight >= maxHeight) { maxHeight = thisHeight; parent.document.getElementById("contentSpacer").style.height = maxHeight }
}}

var r = g = b = 10;

var timer = null;

//function setColor(R, G, B) { chR = R;chG = G; chB = B;  }

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&id.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


