﻿var rowHeights=new Array();
var currentSlide=1;
var timeOut=5000; //used to hold the time lapse for the timer function
var timer; //variable to be used for the setTimeout call
var timerToggle="off"; //used for toggle between start/stop (on/off) for timer function

function setHeight()
{
	var row;
	
	for(var i=0; i<arguments.length; i++)
	{
		row=document.getElementById(arguments[i]);
		row.style.display="block";
		row.style.overflow="hidden";
		rowHeights[arguments[i]]=row.offsetHeight;
		row.style.height=1+"px";
	}
}

function dud()
{
	return;
}

function expandRow(documentID, direction, height)
{
	var row=document.getElementById(documentID);
	
	switch (direction)
	{
		case "show":
			height+=10;
			row.style.height=height+"px";
			if (height<=rowHeights[documentID])
				setTimeout("expandRow('"+documentID+"', '"+direction+"', "+height+")", 15);
			else
			{
				row.style.height=rowHeights[documentID]+"px";
				return;
			}
			break;
		case "hide":
			height-=10;
			row.style.height=height+"px";
			if (height>10)
				setTimeout("expandRow('"+documentID+"', '"+direction+"', "+height+")", 15);
			else
			{
				row.style.height=1+"px";
				return;
			}
			break;
	}
}

function toggleDetails(documentID, type)
{
	var showDocument=document.getElementById(documentID);
	
	if (arguments.length>1)
	{
		if (arguments[1]=="expand")
		{
			if (showDocument.style.display=="none")
				setHeight(documentID);
			if (showDocument.style.height=="1px")
				expandRow(documentID, "show", 0);
			else
				expandRow(documentID, "hide", rowHeights[documentID]);
		}
	}
	else
	{
		if (showDocument.style.display=="none")
			showDocument.style.display="block";
		else
			showDocument.style.display="none";
	}
}

function showMore(documentID, linkID)
{
	var showDocument=document.getElementById(documentID);;
	var moreLink;
	
	showDocument.style.display="block";
	if (linkID!=null)
	{
		moreLink=document.getElementById(linkID);
		moreLink.style.display="none";
	}
}

function hideMore(documentID, linkID)
{
	var showDocument=document.getElementById(documentID);
	var moreLink;
	
	
	showDocument.style.display="none";
	if (linkID!=null)
	{
		moreLink=document.getElementById(linkID);
		moreLink.style.display="block";
	}
}
