// JavaScript Document


// DATE FUCNTION

	date = new Date();
	copyrightYear = date.getFullYear();


// NAV DROPDOWNS FOR IE6

	sfHover = function() {
		var sfEls = document.getElementById("nav").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			}
		}
	}

	if (window.attachEvent) window.attachEvent("onload", sfHover);

	
// PRELOAD NAV IMAGES

	function MM_preloadImages() { //v3.0
	  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}


// SIMPLE SLIDESHOW

	function slideSwitch() {
		var $active = $('#slideshow IMG.active');
	
		if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
	
		var $next =  $active.next().length ? $active.next()
			: $('#slideshow IMG:first');
	
		// uncomment below to pull the divs randomly
		// var $sibs  = $active.siblings();
		// var rndNum = Math.floor(Math.random() * $sibs.length );
		// var $next  = $( $sibs[ rndNum ] );

		$active.addClass('last-active');
	
		$next.css({opacity: 0.0})
			.addClass('active')
			.animate({opacity: 1.0}, 1000, function() {
				$active.removeClass('active last-active');
			});
	}
	
	$(function() {
		setInterval( "slideSwitch()", 3000 );
	});



