	$(document).ready(
	function() {
		initRollovers();
	}
);

function initRollovers () {
	$('.rollover').not('.active').mouseover( 
		function() {
			var _this = $(this);
			var src = _this.attr('src');
			var ext = src.match(/.[\w]+$/);
			var newSrc = src.replace('_0.', '_1.');
			_this.attr('src', newSrc);
		}
	 ).mouseout (
		function() {
			var _this = $(this);
			var src = _this.attr('src');
			var newSrc = src.replace('_1.', '_0.');
			_this.attr('src', newSrc);
		}
	 );
	 
	 
	// determine whether this page is represented in left nav - if so, make it active

	// some pages are sub level pages with a parent in the left nav.  since we're identifying pages based on the current url,
	// sub pages need to identify the parent item to be highlighted.  if this is one of those pages
	// it will have defined sLeftNavHighlightUrl already 

	if( (typeof window.sLeftNavHighlightUrl) == 'undefined' ) {
		window.sLeftNavHighlightUrl = window.location.href.replace('http://' + window.location.host, '');
	}
	
 	var aAnchors = $('#secondary-nav li a');
	aAnchors.each(
		function() {
			var qAnchor = $(this);
			if( qAnchor.attr('href') == sLeftNavHighlightUrl ) {
				// if item is located, class item as active 
				qAnchor.addClass('active');
				// ...and discontinue the search by reducing the collection length to 0
				aAnchors.eq(-1);
			}
			
		}
	);
}

var newWin = null;
function openWin(url, w, h) {
	var props = "width=" + w + ",height=" + h + ",toolbar=no,menubar=no,personalbar=no,copyhistory=no,scrollbars=yes";
	var handle = "oNewWin";
	if(newWin && !newWin.closed) {
		newWin.focus();
	}
	newWin = window.open(url, handle, props);
}

function goToUrl(obj) {
	var url = obj[obj.selectedIndex].value;
	if( url == '') return false;

	// if a target attribute specified on the option element is "_blank", open this url in a new window
	var option = $(obj[obj.selectedIndex]);
	if( option.attr('target') == '_blank') {
		window.open(url)
	} else {
		window.location = url;
	}
}