// (c)2008 Sergi Meseguer http://zigotica.com/ under CC license:

TOGGLE = {
	activator : "activator",
	toggled : "comentarios",
	
	start : function(){ 
		var activatorElm = document.getElementById(TOGGLE.activator);
		var toggledElm = document.getElementById(TOGGLE.toggled);

		// fix for IE5.x cursor property:
		if(navigator.appVersion.indexOf("MSIE 5") > -1 && !window.opera) activatorElm.style.cursor = "hand";
		else activatorElm.style.cursor = "pointer";
		if(navigator.appVersion.indexOf("MSIE 5") > -1 && !window.opera) toggledElm.style.cursor = "hand";
		else toggledElm.style.cursor = "pointer";

		toggledElm.style.display = "none"; 
		TOGGLE.prepare(toggledElm,activatorElm);

	},
	
	prepare : function(toggledElm,activatorElm){ 
		toggledElm.style.display = "none";
		activatorElm.onclick = function(){
			TOGGLE.runFirst(toggledElm,activatorElm);
		}
		toggledElm.onclick = function(){
			TOGGLE.runBack(toggledElm);
		}
	},
	
	runFirst : function(toggledElm,activatorElm) { 
		if(toggledElm.style.display == "block") toggledElm.style.display = "none";
		else toggledElm.style.display = "block";
	},
	
	runBack : function(toggledElm) { 
		toggledElm.style.display = "none";
	}
}

if (document.getElementsByTagName) window.onload = TOGGLE.start;
