/**
##############################################################################################
#
#		Title: Ouch! Generic Article Script
#
#		Description: Behaviour common to all generic articles
#
##############################################################################################
#   $Source: $
#   $Author: $
#   $Revision: $
#   $Date: $ 
##############################################################################################
*/
GenericArticle = {
	
	/**
	 * Function: init
	 * 
	 * Description: Performs onLoad initialisation of behaviour
	 */
	init : function(){
		if ($('print-this')){
			// Show and add listeners to the print button
			$('print-this').style.display = "block";
			bbcjs.dom.addEventListener($('print-this'),'click',GenericArticle.onClickPrint);
		}
		else{
			// if the print icon is not yet available try again
			setTimeout(GenericArticle.init,500);
		}
	},
	
	/**
	 * Function: onClickPrint
	 * 
	 * Description: Prints current page on click
	 */
	onClickPrint: function(){
		window.print();
	}
	
};


/**
 * Compile-time executed code
 */
bbcjs.addOnLoadItem(GenericArticle.init);
/**
  * END
  */
