/**
* --------------------------------------------------------------------------------------
* Scripts
* ----------------------------------------------------
* Modified April 08, 2009 by Chris
* @version 4.0.1
* @author Curtis <curtis@navigatormm.com>
* ----------------------------------------------------
*
* --------------------------------------------------------------------------------------
*/

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

$(function() {

$('#homeFade').cycle({ 
    fx:    'fade', 
    speed:  1800 
 });

	
});

/* LightBox Script
--------------------------------------------------------------------------------------- */
$(function() {
  $('a[rel*="gallery"]').lightBox({
  	overlayBgColor:	'#000000',
	overlayOpacity:	0.8,
	imageLoading:	'http://www.batnunilake.com/images/lightbox/lightbox-ico-loading.gif',
	imageBtnClose:'http://www.batnunilake.com/images/lightbox/lightbox-btn-close.gif',
	imageBtnPrev:	'http://www.batnunilake.com/images/lightbox/lightbox-btn-prev.gif',
	imageBtnNext:	'http://www.batnunilake.com/images/lightbox/lightbox-btn-next.gif',
	imageBlank:		'http://www.batnunilake.com/images/lightbox/lightbox-blank.gif',
	containerResizeSpeed: 400,
	txtImage:	'Photo',
	txtOf:		'of',
	keyToClose:	'c',
	keyToPrev:	'p',
	keyToNext:	'n'
   });
});

/* LightBox Script
--------------------------------------------------------------------------------------- */
$(document).ready(function()
{
$('.content input, .content textarea, .content select').focus(function(){
$(this).parents('.right').addClass("over");
}).blur(function(){
$(this).parents('.right').removeClass("over");
});
});

/* 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 (url) {
		$('#nav li a[href*="' + url + '"]').addClass('selected');
	} else {
		$('.home a').addClass('selected');
	}

});

