header = $.flash.create({
	swf: 'images/10peaks-header.swf',
	height: 220,
	width: 850,
	wmode: 'transparent',
	hasVersion: 10,
	expressInstaller: 'expressInstall.swf'
});


openFAQ = null;

$(document).ready(function () {
	$('#header').html(header);

	$('.faqs dd').hide();
	$('.faqs dt').click(function() {
		// see if it is already open
		if (!$(this).hasClass('open')) {
			if (openFAQ != null) {
				// close last one
				$(openFAQ).next().slideUp('fast');
				$(openFAQ).removeClass('open');
			}
			// open new one
			openFAQ = $(this);
			$(openFAQ).addClass('open');
			$(openFAQ).next().slideDown('fast').addClass('open');
		}		
	});

	if ($('.message')) {
		$('.message').show().animate({opacity: 1}, 5000).slideUp('slow');
	}

	$('#nav img').hover(function() {
		var image = $(this).attr('src');
		if (image.indexOf('-over.png') == -1) {
			image = image.replace(/.png/i, '-over.png');
			$(this).attr('src', image);
		}
	}, function() {
		var image = $(this).attr('src');
		if (!$(this).hasClass('active')) {
			image = image.replace(/-over.png/i, '.png');
			$(this).attr('src', image);
		}
	});
});
