// POP-UP FUNCTIONS USED BY CMS
// ---------------------------------------------------------------------------------------

function open_in_popup_window(url, name, width, height) {
	window.open(url.href,name,'width=' + width + ',height=' + height + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
	return false;
}
function open_in_new_window(url) {
	window.open(url.href,'external_link','toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
	return false;
}

// CODE FOR DROP-DOWN MENU SUPPORT IN IE6
// ---------------------------------------------------------------------------------------

//sfHover = function() {
//	var sfEls = document.getElementById("main_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);


// JQUERY SCRIPTS FOR LIGHTBOX AND SLIDING PANELS
// ---------------------------------------------------------------------------------------
$(function() {
	$('a[rel="external"]').click(function(event){
		event.preventDefault();
		window.open(this.href);
	});
		
	$person = $('.slide');
	if ($person.length > 0) {
		$person.not(':first').add('.back-to-top').hide();
		$peopleNavLinks = $('#slide-nav a');
		$peopleNavLinks.filter(':first').addClass('selected');
		$peopleNavLinks.each(function(i,e){
			$(e).click(function(event){
				event.preventDefault();
				$peopleNavLinks.filter('.selected').removeClass('selected');
				$(e).addClass('selected');
				$person.filter(':visible').slideUp(function(){
					$person.eq(i).slideDown();
				});
			});
		});
	}
});