$(document).ready(function(){ 
	//accordion map
	$('#docMap').accordion({
	header: 'div.title',
	active: false,
	alwaysOpen: false,
	animated: false, 
	autoheight: false
	});
	
   // Reset Font Size
  var originalFontSize = $('html').css('font-size');
  $(".resetFont").click(function(){
  $('html').css('font-size', originalFontSize);
  });
  // Increase Font Size
  $(".increaseFont").click(function(){
  	var currentFontSize = $('html').css('font-size');
 	var currentFontSizeNum = parseFloat(currentFontSize, 10);
    var newFontSize = currentFontSizeNum*1.1;
	$('html').css('font-size', newFontSize);
	return false;
  });
  // Decrease Font Size
  $(".decreaseFont").click(function(){
  	var currentFontSize = $('html').css('font-size');
 	var currentFontSizeNum = parseFloat(currentFontSize, 10);
    var newFontSize = currentFontSizeNum*0.9;
	$('html').css('font-size', newFontSize);
	return false;
  });
  
	// Contrast Style Switcher 
	// light w/ dark txt
	$("#css-light").click(function() {
	$("link[rel=stylesheet]").attr({href : "css/screen.css"});
	});
	
	// dark w/ light txt
	$("#css-dark").click(function() {
	$("link[rel=stylesheet]").attr({href : "css/dark.css"});
	})
	
	// External Links in a new window
	/*$('a[href^="http://"]').click(function(){
		window.open(this.href);
		return false;
	});*/
	
	//Superfish
        $('ul.sf-menu').superfish({ 
            delay:       1000,                            // one second delay on mouseout 
            animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
            speed:       'fast',                          // faster animation speed 
            autoArrows:  false,                           // disable generation of arrow mark-up 
            dropShadows: false                            // disable drop shadows 
        }); 
	 
	// Carousel 
	$(".externalControl .jCarouselLite").jCarouselLite({
		visible: 1,
		start: 0,
		auto: 10000,
	    speed: 2000,
		btnGo:
		[".externalControl .1", ".externalControl .2",
		".externalControl .3", ".externalControl .4"]
	});
	
	// Collapsable mini form 
	$(".qc-hidden").hide(); 		
	// Show the hidden fields
	$("textarea").focus(function() {		   
	   $(".qc-hidden").fadeIn("slow");
	});
	// If you click any of the defined elements below you will close the open fields. 
	$("#mast, #header, #top-navigation, #left-column, #footer").click(function(){
		$(".qc-hidden").fadeOut();
	});
	
	// Toggle Sitemap
	$('#sitemap').hide();
	$('a#toggle-sitemap-links').click(function() {
		$('#sitemap').slideToggle(400);
		return false;
	}); 
	$('div.read-more').hide();
	$('a.expand').click(function() {
		$('div.read-more').slideToggle(400);
		return false;
	}); 
	
//Comented out the below line because this site is no longer useing "pngFix.pack.js" for ie6, and instead is useing "DD-belatedPNG" This line seemed to breake the expanding tags at the bottom of the Doctors pages. example "laurel-eye-clinic.html"

/*	$(document).pngFix();*/


$.fn.search = function() {
		return this.focus(function() {
			if( this.value == this.defaultValue ) {
				this.value = "";
			}
		}).blur(function() {
			if( !this.value.length ) {
				this.value = this.defaultValue;
			}
		});
	};
	$("#search").search();
	
	// Tabbed area for D/C sections
	$('ul.tabNav a').click(function() {
	var curChildIndex = $(this).parent().prevAll().length + 1;
	$(this).parent().parent().children('.current').removeClass('current');
	$(this).parent().addClass('current');
	$(this).parent().parent().next('.tabContainer').children('.current').fadeOut('fast',function() {
		$(this).removeClass('current');
		$(this).parent().children('div:nth-child('+curChildIndex+')').fadeIn('normal',function() {
			$(this).addClass('current');
		});
	});
	return false;
});

}); 

 

