/*
 * $Id: components.js 4727 2010-09-28 05:54:35Z ba\yasmor $
 */

jQuery(function($){
	var ff = fujifilm;
	var $contentsBody = ( ff.contentsBody ) ? ff.contentsBody : $('#contentsBody');
	var $contentPanel01 = $contentsBody.find('div.panelAreaC div.eci01-contentPanel01');
	$contentPanel01.find('div.navigation ul li.withChild').each(function(){
		var $child = $(this).find('div.child');
		if ( !$child.length ) return;
		
		//define close area
		var $closeArea = $('<div />').css({
			position: 'absolute',
			right: 0,
			top: 0
		}).bind('mouseover.nav',function(){
			$child.css('visibility', 'hidden');
		});

		setTimeout(fujifilm.delegate(this, function(){
			var $label = $(this).find('div.headerLabel');
			if ( $label.length ) {
				$label.css('background-color','transparent');
				var w = 200 - $label.find('> a').width();
				var h = $label.find('> a').height();
				$closeArea.height(h).width(w);
				$label.append($closeArea);
			}
		}),1000);

		$(this).hover(function(evt){
			$child.css('visibility','visible');
		}, function(evt){
			$child.css('visibility','hidden');
		});

		if ( $.browser.msie && $.browser.version < 7 ) {
			if ( $(this).attr('class').match(/stay/) ) $(this).addClass('withChildActive-stay');
			else $(this).addClass('withChildActive');
		}
	});
});

