/* author: Felicia Betancourt
date: 01.07.2009
Control visibility of a Joomla! module based on existance of a marker div in main area
*/

window.onload = showDiv;

function showDiv()
{
	/*showDiv: show div with id = "***_mod" only if there exists
	  a div with id = "***"
	 */
	
//El Salvador 2001 EQ
	if(document.getElementById("elsalx2")) 
		{document.getElementById("elsalx2_mod").className="visible_module";
		// use jQuery code to activate slideshow of list items
		$('div#elsalx2_mod ul').innerfade({ animationtype: 'slide', speed: 2000, timeout: 5000, type: 'sequence', containerheight: '1em' });
	}
	
//Wenchuan 2008	
	if(document.getElementById("wen08")) 
		{document.getElementById("wen08_mod").className="visible_module2";
		$('div#wen08_mod ul').innerfade({ animationtype: 'slide', speed: 2000, timeout: 5000, type: 'sequence', containerheight: '1em' });
	}
	
//L'Aquila	2009
	if(document.getElementById("laq09")) 
		{document.getElementById("laq09_mod").className="visible_module2";
		$('div#laq09_mod ul').innerfade({ animationtype: 'slide', speed: 2000, timeout: 5000, type: 'sequence', containerheight: '1em' });
	}
	
//Yunnan 2009
	if(document.getElementById("yun09")) 
		{document.getElementById("yun09_mod").className="visible_module";
		$('div#yun09_mod ul').innerfade({ animationtype: 'slide', speed: 2000, timeout: 5000, type: 'sequence', containerheight: '1em' });
	}
	
//Samoa 2009
	if(document.getElementById("sam09")) 
		{document.getElementById("sam09_mod").className="visible_module3";
		$('div#sam09_mod ul').innerfade({ animationtype: 'slide', speed: 2000, timeout: 7000, type: 'sequence', containerheight: '1em' });
	}

//Haiti 2010
	if(document.getElementById("hai10")) 
		{document.getElementById("hai10_mod").className="visible_module";
		$('div#hai10_mod ul').innerfade({ animationtype: 'slide', speed: 2000, timeout: 7000, type: 'sequence', containerheight: '1em' });
	}

	
// TEMPLATE
	// 	if(document.getElementById("xxx")) {document.getElementById("xxx_mod").className="visible_module";
	// 	$('div#xxx_mod ul').innerfade({ animationtype: 'slide', speed: 2000, timeout: 5000, type: 'sequence', containerheight: '1em' });}
	
}
