﻿/*
*	Walton Regional Medical Center
*	Copyright © 2009, McMurry Inc.
*	http://www.mcmurry.com
*
*	Home Javascript
*/
var centurygothic = { src: '/ClientResources/Flash/sIFR/sifr-Century_Gothic.swf' };
sIFR.useStyleCheck = true;
sIFR.activate(centurygothic);
sIFR.replace(centurygothic, { selector: '#main_content h1', css: { '.sIFR-root': { 'color': '#000000', 'font-size': '24px'} }, transparent: true });
sIFR.replace(centurygothic, { selector: '#featuredphysician h2', css: { '.sIFR-root': { 'color': '#18556e', 'font-size': '18px'} }, transparent: true });
sIFR.replace(centurygothic, { selector: '#videolibrary h2', css: { '.sIFR-root': { 'color': '#454545', 'font-size': '18px'} }, transparent: true });

$(function() {

	$('#top #header').append('<div id="marquee-pager">');
	$('#top #marquee-wrap').cycle({ fx: 'fade', speed: '300', timeout: '5000', pager: '#top #header #marquee-pager' });

	$('#erwaittimes .erwaittimes-location-name').text('Current Wait Time:');
	$('#midwidget h3').hover(function() {
		$(this).addClass('hover');
	}, function() {
		$(this).removeClass('hover');
	});
	$('#midwidget h3').click(function() {
		var i = $(this).parent('.widget');
		if (!i.hasClass('selected')) {
			i.addClass('selected');
			i.siblings('.widget').removeClass('selected');
		}
	});
	
	if($('#mw-careercenter #recentjobs-wrap .job').length > 1){
		$('#mw-careercenter #recentjobs-wrap').before('<a href="javascript:void(0);" class="button btn-prev">&laquo; Back</a> <a href="javascript:void(0);" class="button btn-next">Next &raquo;</a>');
		$('#mw-careercenter #recentjobs-wrap').scrollable({ clickable: false, items: '#recentjobs', next: '.btn-next', prev: '.btn-prev', size: 1, speed: 500 }).circular().mousewheel().autoscroll({ autopause: true, steps: 1 });
	}
	
	if($('#ctabuttons-wrap #ctabuttons li').length > 3){
		$('#ctabuttons-wrap #ctabuttons').before('<a href="javascript:void(0);" class="button btn-prev">&laquo; Back</a> <a href="javascript:void(0);" class="button btn-next">Next &raquo;</a>');
		$('#ctabuttons-wrap #ctabuttons').scrollable({ clickable: false, items: '.ctas', next: '.btn-next', prev: '.btn-prev', size: 3, speed: 500 }).circular().mousewheel().autoscroll({ autopause: true, steps: 1 });
	}
	
	if($('#videolibrary #videos-wrap .video').length > 3){
		$('#videolibrary #videos-wrap').before('<a href="javascript:void(0);" class="button btn-next">Next &raquo;</a>');
		$('#videolibrary #videos-wrap').scrollable({ clickable: false, items: '.videos', next: '.btn-next', size: 3, speed: 500, vertical: true }).circular().mousewheel().autoscroll({ autopause: true, steps: 1 });
	}
	
});
