/*

.: Description:
-----------------------
Function to display the view switcher div. Animated show/hide functionality

.: Declarations:
-----------------------
setTimeout augmentation to send multiple arguments through a standard setTimeout call... */



/*

.: Usage:
-----------------------
It has been designed for use with the report page viewSwitcher element.
To show the view switcher from a link would be as follows:

<a href="javascript:reveal('viewSwitcher01');">Change</a>
The div would need to be written in HTML beneath the link.

The numbers would need to be written incrementally so that it targets a specific element.

There should also be another div of the same class written below the table

.: The Script:
-----------------------

*/

var showShowing;
var showallstr = "Show All";
var hidestr = "Hide"; 
function showContent(targetElement)
{
	var target=document.getElementById(targetElement);
	var initHeight = parseInt(target.style.minHeight);	
	
	if(initHeight == ''){
		initHeight = 0;
	}
	if(!target.style.height){		
		var heightOfMask = initHeight;
	}else{
		var heightOfMask = parseInt(target.style.height);
	}
	
	var heightOfBox = calcHeight(target);
	if(heightOfMask > initHeight && showShowing==true){
		var targetId = target.id;
		var callBack = document.getElementById(targetId+"_callBack");
		callBack.innerHTML = showallstr;
		showShowing = false;
		target.style.height = initHeight+'px';		
		
	}else if(heightOfBox < heightOfMask){
		alert("No more content!");
	}else{
		var targetId = target.id;
		var callBack = document.getElementById(targetId+"_callBack");
		callBack.innerHTML = hidestr;
		showShowing = true;
		
		target.style.height = heightOfBox+'px';		
		
	}
		
}





