// JavaScript Document

function showMedia(currentID, mediaID){
	url = '/showMedia.php?current='+currentID+'&media='+mediaID;
	Spry.Utils.updateContent('mediaContainer', url);
}

function loadGallery(mid,galleryID){
	url = '/includes/media_loadGallery.php?mid='+mid;
	if(galleryID)
		url = '/includes/media_loadGallery.php?mid='+mid+'&gid='+galleryID;	
	
	Spry.Utils.updateContent('mediaOutput', url);
}

function get_gallery(mid){
	//Hide Media Viewer Overlay
	hideMedia();
	
	// Select Gallery Media Based on Selection
	selectedGallery = document.getElementById('galleries').value;
	if(selectedGallery != 0){
		//Load Selected Gallery
		loadGallery(mid,selectedGallery);
	} else {
		loadGallery(mid,0);
	}
		
}

function viewMedia(currentID, GID, numMedia){
	url = '/includes/media_viewMedia.php?currentMedia='+currentID+'&gid='+GID+'&numMedia='+numMedia;	

	Spry.Utils.updateContent('mediaViewer', url);
	document.getElementById('mediaViewer').style.display = 'block';
}

function hideMedia(){
	document.getElementById('mediaViewer').style.display = 'none';
}


