function scroll(from, to )
{
	var direction = from > to ? 'Left' : 'Right';

	var hideImgId = 'type_'+parseInt(direction == 'Left' ? img_first_visible : img_first_visible + viewed_img - 1 );
	var viewImgId = 'type_'+parseInt(direction == 'Left' ? img_first_visible + viewed_img : img_first_visible - 1 );

	var hideImg = new Fx.Styles(hideImgId, {duration: slide_duration, transition: Fx.Transitions.linear});
	var viewImg = new Fx.Styles(viewImgId, {duration: slide_duration, transition: Fx.Transitions.linear});

	if ( direction == 'Left' && img_first_visible <= img_max_scroll || direction == 'Right' && img_first_visible > 1 )
	{
		( direction == 'Left' ? hideImg : viewImg ).start({'margin-left': [from, to] });
		direction == 'Left' ? img_first_visible++ : img_first_visible--;
	}
}

function AddFavorite(linkObj,addUrl,addTitle)
{
	if (document.all && !window.opera)
	{
		window.external.AddFavorite(addUrl,addTitle);
		return false;
	}
	else if (window.opera && window.print)
	{
		linkObj.title = addTitle;
		return true;
	}
	else if ((typeof window.sidebar == 'object') && (typeof window.sidebar.addPanel == 'function'))
	{
			window.sidebar.addPanel(addTitle,addUrl,'');
			return false;
	}
	window.alert('Po potvrzení stiskněte CTRL-D,\nstránka bude přidána k vašim oblíbeným odkazům.');
	return false;
}

function mapItem(img_name, width, height )
{
	img_prefix = '/images/world-'+img_name;
	this.slide_img = new Image (width, height );
	this.slide_img.src = img_prefix + ".png";
}

function addMapItem(img_name, width, height )
{
	mapItem [img_name] = new mapItem (img_name, width, height );
}

function mapOver(itemID )
{
	current_overID = itemID;
	if ( current_overID != last_overID )
	{
		document.worldmap.src = mapItem [current_overID].slide_img.src;
	}
}

var elParent;

function thumb(el )
{
	if ( !elParent || el.tagName == 'P' )
	{
		elParent = el.parentNode;
		elView = getChild(elParent, 'P' );
		if ( elView )
		{
			elParent.style.position = 'relative';
			elView.style.display = 'block';
		}
	}
	else
	{
		elHide = getChild(elParent, 'P' );
		if ( elHide )
		{
			elHide.style.display = 'none';
			elParent.style.position = 'static';
		}
		elParent = null;
	}
}

function getChild(node, tag )
{
	for ( i = 0; i <= node.childNodes.length; i++ )
	{
		if ( node.childNodes[i].tagName == tag )
		{
			return node.childNodes[i];
		}
	}
	return false;
}
