
function loadNewPhotos(path,username,numpics) {
		if ((document.getElementById('flickrLoadIndicator')) && (document.getElementById('photos')))
		{
			var ajax;
			var loadingDiv = document.getElementById('flickrLoadIndicator');
			var photoDiv = document.getElementById('photos');
			document.getElementById('flickrLoadIndicator').style.display = 'block';
			if (document.getElementById('dropPhotoset'))
				var photoset = document.getElementById('dropPhotoset').options[document.getElementById('dropPhotoset').selectedIndex].value;
			else
				var photoset = '';
			if (document.getElementById('dropSort'))
				var sort = document.getElementById('dropSort').options[document.getElementById('dropSort').selectedIndex].value;
			else
				var sort = '';
			 ajax =  new Ajax.Updater(
			 'photos',        // DIV id must be declared before the method was called
			 path + '/photoUpdateHandler.php?loadNew=1&ps='+photoset+'&sort='+sort+'&userName=' + username + '&numPics=' + numpics,        // URL
			 {                // options
			   method:'get',
			   onComplete:function(){ initLightbox(); document.getElementById('flickrLoadIndicator').style.display = 'none';}            
			 });
		}

}


function movePhotos(direction,path,numpics) {
		if ((document.getElementById('flickrLoadIndicator')) && (document.getElementById('photos')))
		{
			 //direction = 0 - previous group
			 //direction = 1 - previous picture
			 //direction = 2 - next picture
			 //direction = 3 - next group
			var ajax;
			var loadingDiv = document.getElementById('flickrLoadIndicator');
			var photoDiv = document.getElementById('photos');
			 document.getElementById('flickrLoadIndicator').style.display = 'block';       
			 ajax =  new Ajax.Updater(
			 'photos',        // DIV id must be declared before the method was called
			 path + '/photoUpdateHandler.php?move=' + direction + '&numPics=' + numpics,        // URL
			 {                // options
			   method:'get',
			   onComplete:function(){ initLightbox(); document.getElementById('flickrLoadIndicator').style.display = 'none';}            
			 });
		 }
}

function showhide(id){
	if (document.getElementById){
		obj = document.getElementById(id);
		if (obj.style.display == "none"){
			obj.style.display = "";
		} else {
			obj.style.display = "none";
		}
	}
} 
