/**
* NM_ComMetaNavigation.js
*
* @author		Torsten Lutz <torsten.lutz@dmc.de>
* @copyright	Copyright (c) dmc - digital media center GmbH
* @version		$Id: NM_ComMetaNavigation.js 66437 2010-06-14 05:23:03Z sheinzelmann $
*/
var NM_ComMetaNavigation = NM_Component.extend({

	/**
	* constructor
	**/
	initialize: function( objParam )
	{

		this.parent( objParam );

		this.blnShow = objParam.bln_show;
		this.arrSubNavi = objParam.sub_navi;

		if ( this.blnShow == true )
		{
			this.arrSubNavi.each( function( strLayer )
			{
				elm	= $( 'metaNavigationButton_' + strLayer );
				elm.addEvent('mouseenter', function()
				{
					this.toggleLayer( strLayer );
				}.bind(this));

				elm	= $( 'metaNavigationLayer_' + strLayer );
				elm.addEvent('mouseleave', function()
				{
					this.toggleLayer( strLayer );
				}.bind(this));
			}.bind(this)
			)
		}
	},


	/**
	* scrollToElement()
	*
	* scroll to given element an sets the prev/next-buttons to right value
	* @param object objectResponse
	**/
	toggleLayer: function( strLayer )
	{
		elm	= $( 'metaNavigationLayer_' + strLayer );

		if( elm.hasClass( 'hide' ) )
		{
			elm.removeClass( 'hide' );
		}
		else
		{
			elm.addClass( 'hide' );
		}
	}

} );