/* Copyright (c) 2008 Inticco Solutions ISSA SA, www.inticco.com */

if( typeof(jQuery) == 'function' ){
	/* show fancybox image pop-ups gallery */
	jQuery(document).ready(function(){
		$("a.fancy-gallery").attr('rel', 'fancybox').fancybox({
			'centerOnScroll': true,
			'padding': 3,
			'margin': 0,
			'autoDimensions': false,
			'imageScale': true,
			'frameWidth': 600,
			'width': 600,
			'height': 'auto',
			'opacity'       : true,
			'transitionIn'	: 'elastic',
			'transitionOut'	: 'elastic',
			'easingIn'      : 'swing',
			'easingOut'     : 'swing',
			'titlePosition' : 'inside', /*'over/inside/outside/float'*/
			
/*			'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
				return '<span id="fancybox-title-over"><small> ' + (currentIndex + 1) + ' / ' + currentArray.length +  '</small>' + (title.length ? '<br />' + title : '') + '</span>';
			},
*/			
			onComplete: function(){
				/* -po załadowaniu - powinien już być p#fancybox-error- */
				//var hfe = $("p#fancybox-error").html();
				//if(hfe) $("p#fancybox-error").html('Wystąpił bład.<br />Nie znaleziono obrazka.<br /><small>Kontynuuj przeglądanie następnych obrazków.</small>');
			},


																													
		});
	});
}




function addEvent(obj, type, fn)
{
	if(obj.addEventListener)
	{
		obj.addEventListener(type, fn, false);
	}
	else if (obj.attachEvent)
	{
		obj["e"+type+fn] = fn;
		obj[type+fn] = function(){obj["e"+type+fn](window.event);}
		obj.attachEvent("on"+type, obj[type+fn]);
	}
}

addEvent(window, 'load', function(x,i)
{
	if(!document.getElementById)
	{
		return false;
	}

/*	if(document.getElementById('col-1').getElementsByTagName('ul')[0])
	{
		for(i in x = document.getElementById('col-1').getElementsByTagName('ul')[0].childNodes)
		{
			if(x[i] && x[i].tagName && x[i].tagName.toLowerCase() == 'li' && x[i].getElementsByTagName('ul') && x[i].getElementsByTagName('ul')[0])
			{
				x[i].getElementsByTagName('strong')[0].getElementsByTagName('a')[0].onfocus = function() /* tu wali b��d!!! *//*
				{
					this.parentNode.parentNode.className = this.parentNode.parentNode.className ? this.parentNode.parentNode.className + ' expand' : 'expand';
				}
				x[i].onmouseover = function()
				{
					this.className = this.className ? this.className + ' expand' : 'expand';
				}
				x[i].onmouseout = function()
				{
					this.className = this.className.replace(/ ?expand/, '');
				}
			}
		}
	}*/

});
