
function navo(o){
	var img = o.getElementsByTagName('IMG')[0]
	var src = img.src;
	var off = src.replace('_on.gif', '.gif');
	var on = off.replace('.gif', '_on.gif');
	img.src = on;
}

function navu(o){
	var img = o.getElementsByTagName('IMG')[0]
	var src = img.src;
	var off = src.replace('_on.gif', '.gif');
	var on = src.replace('.gif', '_on.gif');
	img.src = off;
}

function toggle(o)
{
	var box = 'div_'+o;
	var img = 'img_'+o;
	var oBox = document.getElementById(box);

	if( oBox == null ) return;

	var current = oBox.style.display;
	
	//alert( current );
	
	if( current == 'none' ){
		oBox.style.display = 'block';
		eval("document."+img).src = "/images/nb/arrow_down.gif";
	}
	if( current == 'block' ){
		oBox.style.display = 'none';
		eval("document."+img).src = "/images/nb/arrow.gif";
	}
	 
}

function openWindow(url, winWidth, winHeight, opts){
	var posLeft = (screen.width - winWidth) / 2;
	var posTop = (screen.height - winHeight) / 2;
	var wtf = "location=no,width="+winWidth+",height="+winHeight+",left="+posLeft+",top="+posTop+opts;
	var popped = window.open(url,"LBSPOP",wtf);
	popped.focus();
}

/***
	Simple jQuery Slideshow Script
	Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc.  Please link out to me if you like it :)
***/

function slideSwitch() {
	
	var $active = $('#slideshow img.active');

	if ( $active.length == 0 ) $active = $('#slideshow img:last');

	// use this to pull the images in the order they appear in the markup
	var $next =  $active.next().length ? $active.next()
		: $('#slideshow img:first');

	$active.addClass('last-active');

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

$(document).ready(function() {
  if($('#slideshow').length == 0) return;
  if($('#slideshow img').length == 1) return;
  setInterval( "slideSwitch()", 5000 );
});
/* ***/
