﻿/*::::::::::::::::::::::::::::::::::::::::::::
		Home JS
		Copyright © 2010 McMurry
::::::::::::::::::::::::::::::::::::::::::::*/

(function($) {
	$(function() {
		// jQuery
		$.preLoadImages('/ClientResources/Images/whereithurts-ankle.jpg', '/ClientResources/Images/whereithurts-back.jpg', '/ClientResources/Images/whereithurts-elbow.jpg', '/ClientResources/Images/whereithurts-foot.jpg', '/ClientResources/Images/whereithurts-hand.jpg', '/ClientResources/Images/whereithurts-hip.jpg', '/ClientResources/Images/whereithurts-knee.jpg', '/ClientResources/Images/whereithurts-neck.jpg', '/ClientResources/Images/whereithurts-shoulder.jpg');
		
		$('#marquee-wrap .where-does-it-hurt p').text('Select from the list below or click the figure to the right.');
		$('#marquee-wrap .where-does-it-hurt').prepend('<img src="/ClientResources/Images/whereithurts-default.jpg" alt="" border="0" class="ooc-man" usemap="#whereithurtsman" />');
		$('#marquee-wrap .where-does-it-hurt ul li a, #whereithurtsman area').hover(function(){
			$('#marquee-wrap .where-does-it-hurt .ooc-man').attr('src', '/ClientResources/Images/whereithurts-' + $(this).attr('class') + '.jpg');
			$('#marquee-wrap .where-does-it-hurt ul li a[class=' + $(this).attr('class') + ']').addClass('hover');
		}, function(){
			$('#marquee-wrap .where-does-it-hurt .ooc-man').attr('src', '/ClientResources/Images/whereithurts-default.jpg');
			$('#marquee-wrap .where-does-it-hurt ul li a').removeClass('hover');
		});
		if($('#marquee-wrap .slide').length > 1){
			$('#marquee-wrap').prepend('<div class="marquee-pager"></div>');
			$('#marquee-wrap #marquee').cycle({ fx: 'fade', pager: '.marquee-pager', pause: 1, speed: '777', timeout: '7000' });
			$('#whereithurtsman area').hover(function () { $('#marquee-wrap #marquee').cycle('pause'); }, function () { $('#marquee-wrap #marquee').cycle('resume'); });
			$('#marquee a.videos').hover(function () { $('#marquee-wrap #marquee').cycle('pause'); }, function () { $('#marquee-wrap #marquee').cycle('resume'); });
		}
		
		$('#content-wrap .content h2').click(function(){
			$('#content-wrap .content .section').removeClass('section-active');
			$(this).parent('.section').addClass('section-active');
		});
	});
})(jQuery);
