/***********************************************************
* gUncle Development
* http://www.guncle.com
* 
* common.js
Page that contains all common javascript functions 
***********************************************************/

/***********************************************************
* function to display pages dropdown
* -variables-
* page = url of current page
***********************************************************/
function pagesTop(page) {
	var url = document.getElementById("pagesDropdownTop").value;
	window.location = page + "?pstart=" + url;
}
function pagesBottom(page) {
	var url = document.getElementById("pagesDropdownBottom").value;
	window.location = page + "?pstart=" + url;
}


/***********************************************************
* function to pop open photo window
* -variables-
* url = folder name for photos
* pyear = year of the photos for folder
***********************************************************/
function photo(url,pyear) {
	var photos = "/photos/" + pyear + "/" + url + "/index.html";
	window.open(photos,"photos","toolbar=no,location=no,status=no,menubar=no,resizable=yes,width=850,height=750");
}

/***********************************************************
* function that processes an action when a select box is
* changed
* -variables-
* page = url of current page
* selectbox = name of select box
* variable = name of url variable
***********************************************************/
function select_refresh(page,selectbox,variable) {
	var obj = document.getElementById(selectbox).value;
	window.location = page + variable + "=" + obj;
}

/***********************************************************
* function to toggle e-mail messages
* -variables-
* key = id of message
***********************************************************/
function toggleMessage(key) {
	if( document.getElementById('message' + key).style.display == 'none' ) {
		document.getElementById('message' + key).style.display = '';
	}
	else {
		document.getElementById('message' + key).style.display = 'none';
	}
}


/***********************************************************
* function to toggle e-mail messages
* -variables-
* key = id of message
***********************************************************/
function commentBox() {
	if( document.getElementById('commentbox').style.display == 'none' ) {
		document.getElementById('commentbox').style.display = '';
	}
	else {
		document.getElementById('commentbox').style.display = 'none';
	}
}


/***********************************************************
* starts photo slideshow
***********************************************************/
function viewSlideshow() {
	$('lightboxSSFirst').onclick();
	Lightbox.prototype.startSlideshow();
}
