﻿
window.addEvent('domready', function() {
	var status = {
		'true': 'open',
		'false': 'close'
		
	};	
	
	// MENU MAIN
	
	$$('.menuMain').addEvents({
		'mouseenter': function()
		{
			this.getElement('img').setProperty('src', this.getElement('img').src.replace('_n.gif', '_a.gif'));
			this.setProperty('class', 'sfhover');
		},
		'mouseleave': function()
		{
			this.getElement('img').setProperty('src', this.getElement('img').src.replace('_a.gif', '_n.gif'));
			this.setProperty('class', '');
		}
	});
	
	$$('.menuMainItem').addEvents({
		'mouseenter': function()
		{
			this.getElement('img').setProperty('src', this.getElement('img').src.replace('_a.gif', '_h.gif'));
			this.getElement('img').setProperty('src', this.getElement('img').src.replace('_n.gif', '_h.gif'));
		},
		'mouseleave': function()
		{
			this.getElement('img').setProperty('src', this.getElement('img').src.replace('_h.gif', '_a.gif'));
		}
	});
	
	
	
	// HELP PANELS
	
	$$('.helpPanel').each(function(item, index){
		var hSlider = new Fx.Slide( item, { duration: 500 } ).hide();
		$$('.helpToggle')[index].addEvent( 'click', function(){ hSlider.cancel(); hSlider.toggle(); } );
		$$('.helpClose')[index].addEvent( 'click', function(){ hSlider.slideOut(); } );  
	} );
	
	$$('.helpWrapper').setStyle('display', 'inline');

	
});



// IMAGE VIEWER

function imageView(filename, thumbnail)
{
	try
	{
		$('imageMain').src = filename;
		
		for (var i = 0; i < $("thumbnails").getElements("a").length; i++)
		{
			$("thumbnails").getElements("a")[i].setAttribute("class", "thumbnail");
			
		}

		$(thumbnail).setAttribute("class", "active");
	}
	catch (ex)
	{
		
	}
}

