//--------------------------------------------------------------------------------
// Check Current Page - Used for side navigation Highlighting
//--------------------------------------------------------------------------------
jQuery(document).ready(function(){
	currPage = ""+window.location;
	trimPathStart = currPage.lastIndexOf('/') + 1;
	trimPathEnd = currPage.lastIndexOf('.php');
	trimPathLength = trimPathEnd - trimPathStart;
	currPage = currPage.substr(trimPathStart, trimPathLength);
	if(currPage == ""){
	currPage = "index"
	}
	
});
//--------------------------------------------------------------------------------
// Side Nav Highlighter
//--------------------------------------------------------------------------------
jQuery(document).ready(function(){
	jQuery(".fadesidenav > a").fadeTo(100, 0.6); // set all items to half opacity
	jQuery(".fadesidenav > a").hover(function(){
		jQuery(this).fadeTo(100, 1.0); // set the opacity to 100% on hover
	},function(){
			if ((this).className.indexOf('itemOn') < 0){ // if this item is not set to 'on' fade out on mouse out
				jQuery(this).fadeTo(250, 0.6); 
			}

	});
	jQuery(".fadesidenav > a").click(function(){
		jQuery(".fadesidenav > a").fadeTo(0, 0.6); // reset all items to half opacity
		jQuery(".fadesidenav > a").removeClass('itemOn'); //remove on class from all items					  
		jQuery(this).addClass('itemOn'); // add on class to this item
		jQuery(this).fadeTo(0, 1.0); // fade this item to full opacity								  
	});
});

jQuery(document).ready(function(){
	if(typeof(currPage) != "undefined"){
		//alert(currPage);
		currPage = ''+currPage;
		jQuery("."+currPage).addClass('itemOn');
		jQuery("."+currPage).fadeTo(0, 1.0);
	};
});
//--------------------------------------------------------------------------------
// Top Nav Hilighter
//--------------------------------------------------------------------------------
jQuery(document).ready(function(){
	jQuery(".fadetopnav a").fadeTo(0, 0.6); // set all to half opacity
	jQuery(".fadetopnav a").hover(function(){
		jQuery(this).fadeTo(150, 1.0); // set the opacity to 100% on hover
	},function(){
		/* Check Path ------------------------- */
		var myURL = ""+window.location;
		var removehttp = myURL.split('//');
		var removedomain = removehttp[1].split('/');
		if(removedomain[2] != undefined){
			var myDir = removedomain[2];
		} else {
			var myDir = "Home";
		}
		/* ------------------------------------ */
		if ((this).className != myDir){
			jQuery(this).fadeTo(350, 0.6); // This should set the opacity back to 60% on mouseout
		}
	});
});
$(document).ready(function(){ // fade current page menu item to full opacity
		/* Check Path ------------------------- */
		var myURL = ""+window.location;
		var removehttp = myURL.split('//');
		var removedomain = removehttp[1].split('/');
		if(removedomain[2] != undefined){
			var myDir = removedomain[2];
		} else {
			var myDir = "Home";
		}
		/* ------------------------------------ */
		jQuery("."+myDir).fadeTo(0, 1.0);

});

//--------------------------------------------------------------------------------
// Main Image Fader
//--------------------------------------------------------------------------------
jQuery(document).ready(function(){
  jQuery("#header_pic").hide() 
    .load(function () { 
		jQuery("#header_pic").fadeIn(800); 
	});
	setTimeout("fadeMainImage()",1000);
});
function fadeMainImage(target){
	jQuery('#header_pic').fadeIn(800); 
}
//--------------------------------------------------------------------------------
// JCarousel (jcarousellite_1.0.1.pack.js) - Used for homepage carousel
//--------------------------------------------------------------------------------
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(6($){$.1g.1w=6(o){o=$.1f({r:n,x:n,N:n,17:q,J:n,L:1a,16:n,y:q,u:12,H:3,B:0,k:1,K:n,I:n},o||{});8 G.R(6(){p b=q,A=o.y?"15":"w",P=o.y?"t":"s";p c=$(G),9=$("9",c),E=$("10",9),W=E.Y(),v=o.H;7(o.u){9.1h(E.D(W-v-1+1).V()).1d(E.D(0,v).V());o.B+=v}p f=$("10",9),l=f.Y(),4=o.B;c.5("1c","H");f.5({U:"T",1b:o.y?"S":"w"});9.5({19:"0",18:"0",Q:"13","1v-1s-1r":"S","z-14":"1"});c.5({U:"T",Q:"13","z-14":"2",w:"1q"});p g=o.y?t(f):s(f);p h=g*l;p j=g*v;f.5({s:f.s(),t:f.t()});9.5(P,h+"C").5(A,-(4*g));c.5(P,j+"C");7(o.r)$(o.r).O(6(){8 m(4-o.k)});7(o.x)$(o.x).O(6(){8 m(4+o.k)});7(o.N)$.R(o.N,6(i,a){$(a).O(6(){8 m(o.u?o.H+i:i)})});7(o.17&&c.11)c.11(6(e,d){8 d>0?m(4-o.k):m(4+o.k)});7(o.J)1p(6(){m(4+o.k)},o.J+o.L);6 M(){8 f.D(4).D(0,v)};6 m(a){7(!b){7(o.K)o.K.Z(G,M());7(o.u){7(a<=o.B-v-1){9.5(A,-((l-(v*2))*g)+"C");4=a==o.B-v-1?l-(v*2)-1:l-(v*2)-o.k}F 7(a>=l-v+1){9.5(A,-((v)*g)+"C");4=a==l-v+1?v+1:v+o.k}F 4=a}F{7(a<0||a>l-v)8;F 4=a}b=12;9.1o(A=="w"?{w:-(4*g)}:{15:-(4*g)},o.L,o.16,6(){7(o.I)o.I.Z(G,M());b=q});7(!o.u){$(o.r+","+o.x).1n("X");$((4-o.k<0&&o.r)||(4+o.k>l-v&&o.x)||[]).1m("X")}}8 q}})};6 5(a,b){8 1l($.5(a[0],b))||0};6 s(a){8 a[0].1k+5(a,\'1j\')+5(a,\'1i\')};6 t(a){8 a[0].1t+5(a,\'1u\')+5(a,\'1e\')}})(1x);',62,96,'||||curr|css|function|if|return|ul|||||||||||scroll|itemLength|go|null||var|false|btnPrev|width|height|circular||left|btnNext|vertical||animCss|start|px|slice|tLi|else|this|visible|afterEnd|auto|beforeStart|speed|vis|btnGo|click|sizeCss|position|each|none|hidden|overflow|clone|tl|disabled|size|call|li|mousewheel|true|relative|index|top|easing|mouseWheel|padding|margin|200|float|visibility|append|marginBottom|extend|fn|prepend|marginRight|marginLeft|offsetWidth|parseInt|addClass|removeClass|animate|setInterval|0px|type|style|offsetHeight|marginTop|list|jCarouselLite|jQuery'.split('|'),0,{}))
//--------------------------------------------------------------------------------
// Captify (captify.tiny.js) - Used for homepage carousel captions
//--------------------------------------------------------------------------------
jQuery.fn.extend({captify:function(a){var a=$.extend({speedOver:"fast",speedOut:"normal",hideDelay:500,animation:"slide",prefix:"",opacity:"0.35",className:"caption-bottom",position:"bottom",spanWidth:"100%"},a);$(this).each(function(){var b=this;$(this).load(function(){$this=b;if(this.hasInit){return false}this.hasInit=true;var d=false;var m=false;var g=$("#"+$(this).attr("rel"));var f=!g.length?$(this).attr("alt"):g.html();g.remove();var h=this.parent&&this.parent.tagName=="a"?this.parent:$(this);var c=h.wrap("<div></div>").parent();c.css({overflow:"hidden",padding:0,fontSize:0.1});c.addClass("caption-wrapper");c.width($(this).width());c.height($(this).height());$.map(["top","right","bottom","left"],function(p){c.css("margin-"+p,$(b).css("margin-"+p));$.map(["style","width","color"],function(q){var r="border-"+p+"-"+q;c.css(r,$(b).css(r))})});$(b).css({border:"0 none"});var o=$("div:last",c.append("<div></div>")).addClass(a.className);var l=$("div:last",c.append("<div></div>")).addClass(a.className).append(a.prefix).append(f);$("*",c).css({margin:0}).show();var j=jQuery.browser.msie?"static":"relative";o.css({zIndex:1,position:j,opacity:a.animation=="fade"?0:a.opacity,width:a.spanWidth});if(a.position=="bottom"){var k=parseInt(o.css("border-top-width").replace("px",""))+parseInt(l.css("padding-top").replace("px",""))-1;l.css("paddingTop",k)}l.css({position:j,zIndex:2,background:"none",border:"0 none",opacity:a.animation=="fade"?0:1,width:a.spanWidth});o.width(l.outerWidth());o.height(l.height());var n=(a.position=="bottom"&&jQuery.browser.msie)?-4:0;var i=(a.position=="top")?{hide:-$(b).height()-o.outerHeight()-1,show:-$(b).height()}:{hide:0,show:-o.outerHeight()+n};l.css("marginTop",-o.outerHeight());o.css("marginTop",i[a.animation=="fade"||a.animation=="always-on"?"show":"hide"]);var e=function(){if(!d&&!m){var p=a.animation=="fade"?{opacity:0}:{marginTop:i.hide};o.animate(p,a.speedOut);if(a.animation=="fade"){l.animate({opacity:0},a.speedOver)}}};if(a.animation!="always-on"){$(this).hover(function(){m=true;if(!d){var p=a.animation=="fade"?{opacity:a.opacity}:{marginTop:i.show};o.animate(p,a.speedOver);if(a.animation=="fade"){l.animate({opacity:1},a.speedOver/2)}}},function(){m=false;window.setTimeout(e,a.hideDelay)});$("div",c).hover(function(){d=true},function(){d=false;window.setTimeout(e,a.hideDelay)})}});if(this.complete||this.naturalWidth>0){$(b).trigger("load")}})}});
