﻿// This next section sets up the fading images for the Sponsors section on the sidebar. 
// SPEED: In milliseconds - how long the transition should take.
// TYPE: Type of slideshow: 'sequence', 'random' or 'random_start'
// CONTAINERHEIGHT: The height of the div that is calling the innerfade method.

$(function() {
    $('div.fadeit').innerfade({
		animationtype: 'fade',
        speed: 500,
        timeout: 10000,
        type: 'random',
        containerheight: '180px'
    });

});


//Slider instructions
	$(document).ready(function(){
	  
	  $('.slider').advancedSlider({width:650, height:261, hideTimer:true, slideProperties:{}
									});
	});
	
	
//page scroller instructions
	$(document).ready(function(){

	// hide #back-top first
	$("#back-top").hide();
	
	// fade in #back-top
	$(function () {
		$(window).scroll(function () {
			if ($(this).scrollTop() > 100) {
				$('#back-top').fadeIn();
			} else {
				$('#back-top').fadeOut();
			}
		});

		// scroll body to 0px on click
		$('#back-top a').click(function () {
			$('body,html').animate({
				scrollTop: 0
			}, 800);
			return false;
		});
	});

});
	

//page pagination instuctons
	$(document).ready(function(){
				$('#main_box_page_paginated').pajinate({
				num_page_links_to_display : 3,
				
				});
			});	
			
			
			$(function() {
        $('#blog_link').hover(function() {
            $(this).stop().animate({ "right" : '293px'}, 200);   
        },function() {
            $(this).stop().animate({ "right" : '193px'}, 200);       
        });
    });	
			
	
//colorbox javascript insctructions
	$(document).ready(function(){
				$(".colorbox").colorbox({maxWidth:800, maxHeight:600, scalePhotos:true});
			});
	
//formtowizard instructions
 $(document).ready(function(){
            $("#WaitingLists").formToWizard({ submitButton: 'SubmitWaitLists' })
        });
 
 
 //Waiting lists form javascript validation
 $().ready(function() {
	

	$("#WaitingLists").validate({
		rules: {
			name: "required",
			phone: {
				required: true,
				number:true,
				minlength: 10
			},
			birthday: "required",
			datecare: "required",
		},
		messages: {
			name: "Please enter your name",
			phone: "Please enter a valid phone number (no spaces) ex.2061235678",
			birthday: "Please enter due date or birthday",
			datecare: "Please enter when the date of care is needed"
		}
	});

});
