$(document).ready(function() {

	// Scroll initially if there's a hash (#something) in the url
	$.localScroll.hash({
		target: '#diagnosis-wrapper', // Could be a selector or a jQuery object too.
		queue:true,
		duration:1500
	}); 
	
	$('#diagnosis-nav-wrapper').localScroll({
	   target:'#diagnosis-window',
	   axis:'x'
	});
	
	$('.go-left, .go-right').localScroll({
	   target:'#diagnosis-window',
	   duration:400,
	   axis:'x'
	});
	
	
	
	// on click, reload page and scroll
	$('a.large-get-smaller').click(function(){
		location.reload();
		$.scrollTo('#diagnosis-nav-wrapper', 1000, { queue:true} );
		return false;
	});
	
	$('textarea[maxlength]').keyup(function(){  
         //get the limit from maxlength attribute  
         var limit = parseInt($(this).attr('maxlength'));  
         //get the current text inside the textarea  
         var text = $(this).val();  
         //count the number of characters in the text  
         var chars = text.length;  
   
         //check if there are more characters then allowed  
         if(chars > limit){  
             //and if there are use substr to get the text before the limit  
             var new_text = text.substr(0, limit);  
   
             //and change the current text with the new text  
             $(this).val(new_text);  
         }  
     });  
	
	
	// Adds odd / even to Doctors list
	
	//$("ol li:nth-child(1 < 10)").addClass("doctors-top10");
	$("ol li:first").addClass("doctors-top");
	$("ol li:eq(9)").addClass("doctors-10");
	$("ol li:lt(10)").addClass("doctors-top10");
	$("ol li:even").addClass("doctors-even");
	$("ol li:odd").addClass("doctors-odd");

	
	
});


