/**
 * Jammeleon Javascript stuff.
 * 
 * @version 1.0.0 initial version
 *
 */
var Jammeleon = {

	/**
	 * Initialize.
	 */
	initialize : function(){
		
		// init
		Jammeleon.initPrintLinks();
		Jammeleon.initMessages();
		
		// template home
		if (jQuery("body.home").size() > 0) {
			Jammeleon.initTemplateHome();
		}
	},	
	/**
	* Initializes the print stuff.
	*/
	initPrintLinks: function() {
		jQuery(".printLink").click(function(){window.print();});
	},
	/**
	* Initializes the messages.
	*/
	initMessages: function() {
		if (jQuery("#comments").size() > 0) {
			// hide
			jQuery("#writeComment").hide();
			jQuery("#commentToggler").toggle(
				function(){
					jQuery(this).removeClass("closed");
					jQuery(this).addClass("open");
					jQuery("#writeComment").slideDown(600);
				},
				function(){
					jQuery(this).removeClass("open");
					jQuery(this).addClass("closed");
					jQuery("#writeComment").slideUp(400);
				}
				);
		}
	},
	/**
	* Initializes the home template.
	*/
	initTemplateHome: function() {		
		// visual
		jQuery("#visual").slideshow({slWidth:760,slHeight:500,slInterval:6000});
	}
}
jQuery(document).ready(function(){
	Jammeleon.initialize();
});




