﻿/*::::::::::::::::::::::::::::::::::::::::::::
		Base JS
		Copyright © 2010 McMurry
::::::::::::::::::::::::::::::::::::::::::::*/

(function($) {
	$(function() {
		// jQuery
		
		// Site Search
		$('#header #site-search input').val('Search The Website...');
		$('#header #site-search input').focus(function() {
			$(this).filter(function() {
				return $(this).val() == '' || $(this).val() == 'Search The Website...';
			}).val('').parent('div').addClass('focus');
		}).blur(function() {
			$(this).filter(function() {
				return $(this).val() == '';
			}).val('Search The Website...').parent('div').removeClass('focus');
		});
		$('#header #site-search input').keydown(function(event){
			if(event.keyCode == '13'){
				event.preventDefault();
				if($('#header #site-search input').val().length > 0){
					window.location = '/SearchResults.aspx?searchterm=' + $(this).val();
				}
			}
		});
	});
})(jQuery);


$(function() {

	// About Us

$('#submenu-about').replaceAll('#li_about_parrish .subnav');
	
	// Programs

$('#submenu-services').replaceAll('#li_programs_services .subnav');
	
	// Patient Guide

$('#submenu-patients').replaceAll('#li_patient_guide .subnav');
	
	// Education

$('#submenu-education').replaceAll('#li_education_news .subnav');
	
	// Healing
	
	$('#submenu-healing').replaceAll('#li_healing_experiences .subnav');

	$('.navigation ul li').hoverIntent(dPanel);
	$('.navigation a').removeAttr('title');
});
var dPanel = { interval: 100, sensitivity: 10, over: addPanel, timeout: 100, out: removePanel };
function addPanel() { $($(this).find('div.submenu-wrap')).fadeIn('fast'); $(this).addClass('hover'); }
function removePanel() { $($(this).find('div.submenu-wrap')).fadeOut('fast'); $(this).removeClass('hover'); }
