/**
* --------------------------------------------------------------------------------------
* Scripts
* ----------------------------------------------------
* Modified April 08, 2009 by Chris
* @version 4.0.1
* @author Curtis <curtis@navigatormm.com>
* ----------------------------------------------------
*
* --------------------------------------------------------------------------------------
*/
/* LightBox Script
--------------------------------------------------------------------------------------- */
$(function() {
  $('a[rel*="gallery"]').lightBox({
  	overlayBgColor:	'#000000',
	overlayOpacity:	0.8,
	imageLoading:	'http://www.lymanlures.com/images/lightbox/lightbox-ico-loading.gif',
	imageBtnClose:	'http://www.lymanlures.com/images/lightbox/lightbox-btn-close.gif',
	imageBtnPrev:	'http://www.lymanlures.com/images/lightbox/lightbox-btn-prev.gif',
	imageBtnNext:	'http://www.lymanlures.com/images/lightbox/lightbox-btn-next.gif',
	imageBlank:		'http://www.lymanlures.com/images/lightbox/lightbox-blank.gif',
	containerResizeSpeed: 400,
	txtImage:	'Photo',
	txtOf:		'of',
	keyToClose:	'c',
	keyToPrev:	'p',
	keyToNext:	'n'
   });
});

/* Other Scripts
--------------------------------------------------------------------------------------- */
function parse_email(user, server, domain, subject) {
	if(user && server && domain){
		emailto = "mailto:"+user+'@'+server+'.'+domain+"?subject="+subject;
		window.location = emailto;
	}
}


//Gallery Script//
$(document).ready(function(){
	$(".categories").click(function() {
  		window.location = $(this).find("h2:first a:first").attr("href");
	});

	$(".photo-gallery").click(function() {
  		window.location = $(this).find("h2:first a:first").attr("href");
	});

});

/* Scroll Pane
--------------------------------------------------------------------------------------- */
$(function()
{
$('.jScrollPane').jScrollPane({scrollbarWidth:24, scrollbarMargin:0,showArrows:true});
});

/* DETECT NAVIGATION ON STATE SCRIPT
--------------------------------------------------------------------------------------- */
$(document).ready(function(){
	var url = location.pathname.substring(1);
	var path = url.split("/");
	//path.shift();  /required only if its tested under a subfolder
	if(path.length>1){
		path.pop();
		path='/'+path.join('/')+'/';
	}
	else path=path[0];

	if ( path ) {
		$('#navigation li a[href*="' + path + '"]').addClass('selected');
	} else if (url) {
		$('#navigation li a[href*="' + url + '"]').addClass('selected');
	} else {
		$('.home a').addClass('selected');
	}

});
