// -------------------------------------------------------------------
// Switch Content Script II (icon based)- By Dynamic Drive, available at: http://www.dynamicdrive.com
// Last updated April 8th, 07. Requires switchcontent.js!
// -------------------------------------------------------------------

var strHeader = "-title";

function switchicon(className, filtertag, idSuffix){
	this.idSuffix = idSuffix || strHeader;
	switchcontent.call(this, className, filtertag, idSuffix); //inherit primary properties from switchcontent class
}

switchicon.prototype=new switchcontent; //inherit methods from switchcontent class
switchicon.prototype.constructor=switchicon;

switchicon.prototype.setStatus=null;
switchicon.prototype.setColor=null;

switchicon.prototype.setHeader=function(openHTML, closeHTML){ //PUBLIC
	this.openHTML=openHTML;
	this.closeHTML='';
}

//PRIVATE: Contracts a content based on its corresponding header entered

switchicon.prototype.contractcontent=function(header){
	var innercontent=document.getElementById(header.id.replace(this.idSuffix, "")); //Reference content for this header
	innercontent.style.display="none";
	header.innerHTML=this.closeHTML;
	header=null;
}


//PRIVATE: Expands a content based on its corresponding header entered

switchicon.prototype.expandcontent=function(header){
	var innercontent=document.getElementById(header.id.replace(this.idSuffix, ""));
	innercontent.style.display="block";
	//alert(header.id);
	header.innerHTML=this.openHTML;
	header=null;
}


/* Footer toggle */

switchicon.prototype.setFooter=function(openHTML, closeHTML){ //PUBLIC
	this.openHTML=openHTML;
	this.closeHTML=closeHTML;
}

switchicon.prototype.contractcontent=function(footer){
	var innercontent=document.getElementById(footer.id.replace(this.idSuffix, "")); //Reference content for this footer
	innercontent.style.display="none";
	footer.innerHTML=this.closeHTML;
	footer=null;
	var header = document.getElementById(innercontent.id + strHeader);
	header.innerHTML='<img src="assets/images/toggle_down.jpg" alt="Down Arrow" title="Open" width="17" height="15" />';
	header=null;
}


