var winHandle = null;	// help window reference
var strURL = null;		// current help window tab
var helpInit = 'width=610,height=615,resizable=yes,menubar=no,toolbar=no,location=no,scrollbars=yes,status=no';
window.name = "main";

// customer service popup
function initHelpPop() {
	var help = $$('#nav-help a');
	if (help) {
		for (var i = 0; i < help.length; ++i) {
			help[i].addEvent('click', function(e) {
				e = new Event(e);
				e.preventDefault();
				e.stopPropagation();
				if (this.getAttribute('href')) {
					if (winHandle == null || winHandle.closed || this.getAttribute('href') != strURL) {
						winHandle = window.open(this.getAttribute('href'), 'help', helpInit);
						winHandle.focus();
					}
					else {
						winHandle.focus();
					}
					strURL = this.getAttribute('href');
				}
			});
		}
	}
}
window.addEvent('domready', initHelpPop);

// toggles
function initToggles() {
	var togglers = $$('.toggler');
	var stretchers = $$('.stretcher');
	
	var accordion = new Fx.Accordion(togglers, stretchers, {
		show: -1, 
		alwaysHide: true,
		opacity: false,
		onActive: function(togglers, i){togglers.addClass('open');},
		onBackground: function(togglers, i){togglers.removeClass('open');}				
	});
}
window.addEvent('domready', initToggles);
// MediaNav - delays the display of the media nav because of the modal window scripting.
function initMediaNav() {
	var media = $('nav-media');
	if (media) {
		media.setStyles('visibility: visible;');
	}	
}
window.addEvent('domready', initMediaNav);

//initalize sIFR
if(typeof sIFR == "function"){
	sIFR.replaceElement(named({sSelector:"#titlehead h1", sFlashSrc:"/swf/BlairMdITCTTMedium.swf", sColor:"#413212", sWmode:"transparent"}));
}