/*
Author: Marcello Barile aka Aistu
Year: 2008

Usage:

############## CSS ###############

.explodeButton {
		
	cursor: hand;
	cursor: pointer;
	
	font-size: 11px;
	font-style: italic;
	
	background-image: url(./images/icons/explode.gif);
	background-repeat: no-repeat;
	background-position: left center;
	
	text-indent: 18px;
}
.collapseButton {
	
	cursor: hand;
	cursor: pointer;
	
	font-size: 11px;
	font-style: italic;
	
	background-image: url(./images/icons/collapse.gif);
	background-repeat: no-repeat;
	background-position: left center;
	
	text-indent: 18px;
}

##################################




############# HTML ###############

<div id="button_1" class="explodeButton" onclick="javascript:switchAction('div_1', this.className, this.id);">Visualizza DIV</div>

<div id="div_1" style="display:none;">
	YOUR CONTENTS TO COLLAPSE/EXPLODE
</div>

##################################

*/

function switchAction(divID, buttonClass, buttonID){
	if(buttonClass == "explodeButton"){
		/* apro il DIV */
		myDiv = document.getElementById(divID);
		myDiv.style.display = '';
		
		/* cambio classe al bottone */
		myButton = document.getElementById(buttonID);
		myButton.className = "collapseButton";
	}else if(buttonClass == "collapseButton"){
		/* chiudo il DIV */
		myDiv = document.getElementById(divID);
		myDiv.style.display = "none";
		
		/* cambio classe al bottone */
		myButton = document.getElementById(buttonID);
		myButton.className = "explodeButton";
	}
	// Riposiziono il Footer
	setFooterPos();
	//
}
