
window.addEvent('domready', function() 
{

	window.stat = new Array();
	// chowamy wszystkie

	$$('.firma').each(function(element)
	{
		var id = element.id;
		id = id.split('_');
		window.stat[id[1]] = 0;	
		
	});

	$$('.firma_opis').each(function(element)
	{
		element.slide('hide');
	});
	$$('.firma').addEvent('click', function()
	{
		var id = this.id;
		id = id.split('_');
		//alert(window.stat[id[1]] + ' ' + id[1]);
		if (window.stat[id[1]] == 0)
		{
			//var myFx = new Fx.Slide('p_' + window.selected).slideOut().chain(function(){
				//$('ma_' + window.selected).src='img/arrow7.gif';
			    var myFx = new Fx.Slide('p_' + id[1]).slideIn();
				$('ma_' + id[1]).src='img/arrow8.gif';
				window.stat[id[1]] = 1;				
			//});
			

		}
		else
		{
			var myFx = new Fx.Slide('p_' + id[1]).slideOut();
			$('ma_' + id[1]).src='img/arrow7.gif';
			window.stat[id[1]] = 0;
		}
	});
	
	$$('a.tipz').each(function(element,index) {
        var content = element.get('title').split('::');
        element.store('tip:title', content[0]);
        element.store('tip:text', content[1]);
    });
     
    //create the tooltips
    var tipz = new Tips('.tipz',{
        className: 'tipz',
        fixed: true,
        hideDelay: 50,
        showDelay: 50,
		offset: {'x': 50, 'y': 8}
    });	
	
	
/*(	tipz.addEvent('hide', function(tip, el){
    tip.fade('out');});
	tipz.addEvent('show', function(tip, el){
    tip.fade('in');});*/



	
});


