
function slideDown(cat_height,id,type)
{
	effect = type;
	e = document.getElementById(id);
	x = 26;

	if (effect == "wipe_down")
		height = 300;
	else
		height = cat_height;

	//myDims = alertSize();
	//browserH = myDims[1];
	//browserW = myDims[0];

	elemY = getXY(e,1);
	elemX = getXY(e,2);

	//cssTop = (100/browserH)*elemY;
	//cssLeft = (100/browserW)*elemX;

	//alert(cssLeft+" "+cssTop);

	if (effect == "wipe_down")
	{
		e.style.position = "absolute";
		e.style.width = "118px";
		e.style.clip = "rect(0px,500px,"+x+"px,0px)";
	}
	else if (effect == "shift_down")
	{
		e.style.position = "absolute";
		start = elemY - height;
		e.style.top = start+"px";
		e.style.left = elemX+"px";
		e.style.width = "118px";
		e.style.clip = "rect("+height+"px,500px,"+x+"px,0px)";
	}

	timer = setTimeout('revealDown(e)',1);
}

function alertSize()
{
	myDims = new Array;
	myDims[0] = 0;
	myDims[1] = 0;

	if ( typeof( window.innerWidth ) == 'number' )
	{
    	//Non-IE
		myDims[0] = window.innerWidth;
		myDims[1] = window.innerHeight;
	}
	else if ( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
	{
    	//IE 6+ in 'standards compliant mode'
    	myDims[0] = document.documentElement.clientWidth;
    	myDims[1] = document.documentElement.clientHeight;
	}
	else if ( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
	{
		//IE 4 compatible
		myDims[0] = document.body.clientWidth;
		myDims[1] = document.body.clientHeight;
	}
	return myDims;
}

function getXY(element,dimension)
{
	var rv = 0;
	while(element != null)
	{
		if (dimension == 1)
			rv += element.offsetTop;
		else
			rv += element.offsetLeft;

		element = element.offsetParent;
	}
	return rv;
}

function revealDown(e)
{
	clearTimeout(timer);

	x += 4;
	if (effect == "wipe_down")
	{
		if (x >= height)
		{
			return;
		}
		else
		{
			e.style.clip = "rect(0px,500px,"+x+"px,0px)";
			timer = setTimeout('revealDown(e)',1);
		}
	}
	else if (effect == "shift_down")
	{
		if (x >= elemY)
		{
			return;
		}
		else
		{
			start += 4;
			height -= 4;
			e.style.top = start+"px";
			e.style.clip = "rect("+height+"px,500px,"+x+"px,0px)";
			timer = setTimeout('revealDown(e)',100);
		}
	}
}