function getLatestGallery()
{
    //loadNews('getLatestNews')
}

function loadGalleryPage()
{
    loadGallery('getAllGalleries');
}

function showPicture(pictureID)
{
    loadGallery('showPicture&pictureid=' + pictureID);
}

function getGallery(galleryID)
{
    loadGallery('getGallery&galleryid=' + galleryID);
    //loadNews('getNewsPage&start=' + page)
}

function loadGallery(param)
{
	loadingtxt = "<p align=\"center\"><br/><br/><br/>";
        loadingtxt += "<img src=\"graphics/ajax-loader.gif\"><br/>";
        loadingtxt += "<span class=\"news_title\">Ładowanie...</span></p>";

	if (xmlHttp)
	{
		try
		{
			display(loadingtxt);

			name = "pages/gallery.php?action=" + param;
			xmlHttp.open("GET", name, true);
			xmlHttp.onreadystatechange = handleGettingPage;
			xmlHttp.send(null);
		}
		catch(e)
		{
			displayError(e.toString());
		}
	}
}

// shows and hides galleries from every year
gallery_status = new Array();
function showHide(theid){
    if (document.getElementById)
	{
	var switch_id = document.getElementById(theid);
        if(gallery_status[theid] != 'show')
	{
           switch_id.className = 'show';
           gallery_status[theid] = 'show';
        }
	else
	{
           switch_id.className = 'hide';
           gallery_status[theid] = 'hide';
        }
    }
}
