window.addEvent('domready', function() {
	
	//create our Accordion instance
	var myAccordion = new Accordion($('accordion'), 'h2.toggler', 'div.element', {
		opacity: false,
		onActive: function(toggler, element){
			toggler.setStyle('color', '#86775A');
		},
		onBackground: function(toggler, element){
			toggler.setStyle('color', '#86775A');
		}
	});


});
//once the dom is ready
window.addEvent('domready', function() {
	//hide all answers
	$$('.answer').each(function(el) {
		el.set('display','none');
	});
	//for every question div
	$$('.question').each(function(el) {
		//create a slider
		var slyder = new Fx.Slide(el.get('rel')).hide();
		//click event
		el.addEvent('click', function(e) {
			//toggle!
			e = new Event(e); slyder.toggle(); e.stop();
		});
	});
	//"show" all answers
	$$('.answer').each(function(el) {
		el.set('display','block');
	});
});

jQuery.noConflict();

(function($){ 
	   $(document).ready(
				function(){
						$('ul#slideshow').innerfade({
						speed: 1000,
						timeout: 5000,
						type: 'sequence',
						containerheight: '300px'
					        });
                                }
           );
})(jQuery); 

(function($){ 
//***************************************
// Target Login Pages
//***************************************
$(function(){
$('#content .document-title:contains(Login)').each(function(){
$("body").addClass("loginPage");
});
});

//***************************************
// Set text on auto-gen Login Page
//***************************************
$(function(){
$('.loginPage .body:contains(Identify yourself with this website. All requests to log into this website are logged. Repeated failed login attempts will result in lock out.)').each(function(){
var str = $(this).html();
$(this).html(str.replace('Identify yourself with this website. All requests to log into this website are logged. Repeated failed login attempts will result in lock out.','Warning: All requests to log into this website are logged. Repeated failed login attempts will result in lock out.'));
});
});

$(function(){
$('.loginPage .eror-text:contains(You are attempting to access a resource on this site which is restricted. Please login below. After re-logging in, you will be automatically directed to the page you were attempting to access.)').each(function(){
var str = $(this).html();
$(this).html(str.replace('You are attempting to access a resource on this site which is restricted. Please login below. After re-logging in, you will be automatically directed to the page you were attempting to access.',''));
});
});

})(jQuery); 

(function($){ 
// remove lightbox trigger on initial big image
$(document).ready(function(){
$('#main-picture-wrapper a').removeAttr("href");
});

// Redefine full image click to an empty function
SSLightbox.showFullImage = function() {};

})(jQuery); 

(function($){ 
function badBrowser(){
	if($.browser.msie && parseInt($.browser.version) <= 6){ return true;}
	
	return false;
}

function getBadBrowser(c_name)
{
	if (document.cookie.length>0)
	{
	c_start=document.cookie.indexOf(c_name + "=");
	if (c_start!=-1)
		{ 
		c_start=c_start + c_name.length+1; 
		c_end=document.cookie.indexOf(";",c_start);
		if (c_end==-1) c_end=document.cookie.length;
		return unescape(document.cookie.substring(c_start,c_end));
		} 
	}
	return "";
}	

function setBadBrowser(c_name,value,expiredays)
{
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value) + ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

if(badBrowser() && getBadBrowser('browserWarning') != 'seen' ){
	$(function(){
		$("<div id='browserWarning'>You appear to be using an older browser. This site takes advantage of advanced formatting features supported by <a href='http://getfirefox.com'>FireFox</a>, <a href='http://www.opera.com/download/'>Opera</a>, <a href='http://www.apple.com/safari/'>Safari</a>, and <a href='http://www.microsoft.com/windows/internet-explorer/default.aspx'>Internet Explorer 8</a>.<br />Formatting irregularities may appear when using Internet Explorer 6 or below. For those stuck with an older browser, we apologize for these minor layout issues.&nbsp;&nbsp;&nbsp;[<a href='#' id='warningClose'>close</a>]</div> ")
			.css({
				backgroundColor: '#ff0000',
				'z-index': '999',
				'width': '100%',
				'border-top': 'solid 1px #000',
				'border-bottom': 'solid 1px #000',
				'text-align': 'center',
				padding:'5px 0px 5px 0px'
			})
			.prependTo("body");
		
		$('#warningClose').click(function(){
			setBadBrowser('browserWarning','seen');
			$('#browserWarning').slideUp('slow');
			return false;
		});
	});	
}
})(jQuery); 
