$(document).ready(function(){
         /*Since all the tabs are hidden with css we are displaying the tab with class .active_tab using fadeIn()
         function. If you just want it to show with no effect, just put show() instead of fadeIn() */
        $('.active_tab').fadeIn();

        //when a tab link is clicked...
        $('.tab_link').live('click', function(event){

            /*...prevent the default behaviour...*/
            event.preventDefault();

            /* ...remove the tab_link_selected class from current active link... */
            $('.tab_link_selected').removeClass('tab_link_selected');

            /* ...and add it to the new active link */
            $(this).addClass('tab_link_selected');

            /*...get the title attribute (which corensponds to the id of the needed text container),
            but you can use any attribute you want*/
            var container_id = $(this).attr('title');

            //...animate the current active_tab by changing it's height and opacity ...'
            $('.active_tab').animate({

                height : 'toggle' , opacity : 'toggle'

            //...and when that animation ends...
            },function(){

                //...remove the active_tab class from the current active tab...
                $(this).removeClass('active_tab');

                //...and add that class to the tab that corensponds the clicked link...
                $(container_id).addClass('active_tab');

                //...and animate the new active_tab by using toggle on height and opacity again...
                $('.active_tab').animate({

                    height : 'toggle' , opacity : 'toggle'

                });
            });

        });
	
//Set default open/close settings
$('.acc_container').hide(); //Hide/close all containers
//$('.acc_trigger:first').addClass('active').next().show(); Add "active" class to first trigger, then show/open the immediate next container

//On Click
$('.acc_trigger').click(function(){
	if ( $(this).hasClass('active') ) {
	  $('.acc_trigger').removeClass('active').next().slideUp();
	}
	if( $(this).next().is(':hidden') ) { //If immediate next container is closed...
		$('.acc_trigger').removeClass('active').next().slideUp(); //Remove all .acc_trigger classes and slide up the immediate next container
		$(this).toggleClass('active').next().slideDown(); //Add .acc_trigger class to clicked trigger and slide down the immediate next container
	}
	return false; //Prevent the browser jump to the link anchor
});

        $('#slider1').bxSlider({
            mode: 'horizontal',                 // 'horizontal', 'vertical', 'fade'
infiniteLoop: true,                 // true, false - display first slide after last
hideControlOnEnd: false,            // true, false - if true, will hide 'next' control on last slide and 'prev' control on first
controls: true,                     // true, false - previous and next controls
speed: 500,                         // integer - in ms, duration of time slide transitions will occupy
easing: 'swing',                    // used with jquery.easing.1.3.js - see http://gsgd.co.uk/sandbox/jquery/easing/ for available options
pager: true,                        // true / false - display a pager
pagerSelector: null,                // jQuery selector - element to contain the pager. ex: '#pager'
pagerType: 'full',                  // 'full', 'short' - if 'full' pager displays 1,2,3... if 'short' pager displays 1 / 4
pagerLocation: 'top',            // 'bottom', 'top' - location of pager
pagerShortSeparator: '/',           // string - ex: 'of' pager would display 1 of 4
pagerActiveClass: 'pager-active',   // string - classname attached to the active pager link
nextText: 'next',                   // string - text displayed for 'next' control
nextImage: '',                      // string - filepath of image used for 'next' control. ex: 'images/next.jpg'
nextSelector: null,                 // jQuery selector - element to contain the next control. ex: '#next'
prevText: 'prev',                   // string - text displayed for 'previous' control
prevImage: '',                      // string - filepath of image used for 'previous' control. ex: 'images/prev.jpg'
prevSelector: null,                 // jQuery selector - element to contain the previous control. ex: '#next'
captions: false,                    // true, false - display image captions (reads the image 'title' tag)
captionsSelector: null,             // jQuery selector - element to contain the captions. ex: '#captions'
auto: false,                        // true, false - make slideshow change automatically
autoDirection: 'next',              // 'next', 'prev' - direction in which auto show will traverse
autoControls: false,                // true, false - show 'start' and 'stop' controls for auto show
autoControlsSelector: null,         // jQuery selector - element to contain the auto controls. ex: '#auto-controls'
autoStart: true,                    // true, false - if false show will wait for 'start' control to activate
autoHover: false,                   // true, false - if true show will pause on mouseover
autoDelay: 0,                       // integer - in ms, the amount of time before starting the auto show
pause: 8000,                        // integer - in ms, the duration between each slide transition
startText: 'start',                 // string - text displayed for 'start' control
startImage: '',                     // string - filepath of image used for 'start' control. ex: 'images/start.jpg'
stopText: 'stop',                   // string - text displayed for 'stop' control
stopImage: '',                      // string - filepath of image used for 'stop' control. ex: 'images/stop.jpg'
ticker: false,                      // true, false - continuous motion ticker mode (think news ticker)
                                    // note: autoControls and autoControlsSelector apply to ticker!
tickerSpeed: 5000,                  // integer - has an inverse effect on speed. therefore, a value of 10000 will 
                                    // scroll very slowly while a value of 50 will scroll very quickly.
tickerDirection: 'next',            // 'next', 'prev' - direction in which ticker show will traverse
tickerHover: false,                 // true, false - if true ticker will pause on mouseover
wrapperClass: 'bx-wrapper',         // string - classname attached to the slider wraper
startingSlide: 0,                   // integer - show will start on specified slide. note: slides are zero based!
displaySlideQty: 1,                 // integer - number of slides to display at once
moveSlideQty: 1,                    // integer - number of slides to move at once
randomStart: false                 // true, false - if true show will start on a random slide       
        });
        
        $('#slider2').bxSlider({
            mode: 'horizontal',                 // 'horizontal', 'vertical', 'fade'
infiniteLoop: true,                 // true, false - display first slide after last
hideControlOnEnd: false,            // true, false - if true, will hide 'next' control on last slide and 'prev' control on first
controls: true,                     // true, false - previous and next controls
speed: 500,                         // integer - in ms, duration of time slide transitions will occupy
easing: 'swing',                    // used with jquery.easing.1.3.js - see http://gsgd.co.uk/sandbox/jquery/easing/ for available options
pager: true,                        // true / false - display a pager
pagerSelector: null,                // jQuery selector - element to contain the pager. ex: '#pager'
pagerType: 'full',                  // 'full', 'short' - if 'full' pager displays 1,2,3... if 'short' pager displays 1 / 4
pagerLocation: 'top',            // 'bottom', 'top' - location of pager
pagerShortSeparator: '/',           // string - ex: 'of' pager would display 1 of 4
pagerActiveClass: 'pager-active',   // string - classname attached to the active pager link
nextText: 'next',                   // string - text displayed for 'next' control
nextImage: '',                      // string - filepath of image used for 'next' control. ex: 'images/next.jpg'
nextSelector: null,                 // jQuery selector - element to contain the next control. ex: '#next'
prevText: 'prev',                   // string - text displayed for 'previous' control
prevImage: '',                      // string - filepath of image used for 'previous' control. ex: 'images/prev.jpg'
prevSelector: null,                 // jQuery selector - element to contain the previous control. ex: '#next'
captions: false,                    // true, false - display image captions (reads the image 'title' tag)
captionsSelector: null,             // jQuery selector - element to contain the captions. ex: '#captions'
auto: false,                        // true, false - make slideshow change automatically
autoDirection: 'next',              // 'next', 'prev' - direction in which auto show will traverse
autoControls: false,                // true, false - show 'start' and 'stop' controls for auto show
autoControlsSelector: null,         // jQuery selector - element to contain the auto controls. ex: '#auto-controls'
autoStart: true,                    // true, false - if false show will wait for 'start' control to activate
autoHover: false,                   // true, false - if true show will pause on mouseover
autoDelay: 0,                       // integer - in ms, the amount of time before starting the auto show
pause: 8000,                        // integer - in ms, the duration between each slide transition
startText: 'start',                 // string - text displayed for 'start' control
startImage: '',                     // string - filepath of image used for 'start' control. ex: 'images/start.jpg'
stopText: 'stop',                   // string - text displayed for 'stop' control
stopImage: '',                      // string - filepath of image used for 'stop' control. ex: 'images/stop.jpg'
ticker: false,                      // true, false - continuous motion ticker mode (think news ticker)
                                    // note: autoControls and autoControlsSelector apply to ticker!
tickerSpeed: 5000,                  // integer - has an inverse effect on speed. therefore, a value of 10000 will 
                                    // scroll very slowly while a value of 50 will scroll very quickly.
tickerDirection: 'next',            // 'next', 'prev' - direction in which ticker show will traverse
tickerHover: false,                 // true, false - if true ticker will pause on mouseover
wrapperClass: 'bx-wrapper',         // string - classname attached to the slider wraper
startingSlide: 0,                   // integer - show will start on specified slide. note: slides are zero based!
displaySlideQty: 1,                 // integer - number of slides to display at once
moveSlideQty: 1,                    // integer - number of slides to move at once
randomStart: false                 // true, false - if true show will start on a random slide       
        });
   
        $('#slider3').bxSlider({
            mode: 'horizontal',                 // 'horizontal', 'vertical', 'fade'
infiniteLoop: true,                 // true, false - display first slide after last
hideControlOnEnd: false,            // true, false - if true, will hide 'next' control on last slide and 'prev' control on first
controls: true,                     // true, false - previous and next controls
speed: 500,                         // integer - in ms, duration of time slide transitions will occupy
easing: 'swing',                    // used with jquery.easing.1.3.js - see http://gsgd.co.uk/sandbox/jquery/easing/ for available options
pager: true,                        // true / false - display a pager
pagerSelector: null,                // jQuery selector - element to contain the pager. ex: '#pager'
pagerType: 'full',                  // 'full', 'short' - if 'full' pager displays 1,2,3... if 'short' pager displays 1 / 4
pagerLocation: 'top',            // 'bottom', 'top' - location of pager
pagerShortSeparator: '/',           // string - ex: 'of' pager would display 1 of 4
pagerActiveClass: 'pager-active',   // string - classname attached to the active pager link
nextText: 'next',                   // string - text displayed for 'next' control
nextImage: '',                      // string - filepath of image used for 'next' control. ex: 'images/next.jpg'
nextSelector: null,                 // jQuery selector - element to contain the next control. ex: '#next'
prevText: 'prev',                   // string - text displayed for 'previous' control
prevImage: '',                      // string - filepath of image used for 'previous' control. ex: 'images/prev.jpg'
prevSelector: null,                 // jQuery selector - element to contain the previous control. ex: '#next'
captions: false,                    // true, false - display image captions (reads the image 'title' tag)
captionsSelector: null,             // jQuery selector - element to contain the captions. ex: '#captions'
auto: false,                        // true, false - make slideshow change automatically
autoDirection: 'next',              // 'next', 'prev' - direction in which auto show will traverse
autoControls: false,                // true, false - show 'start' and 'stop' controls for auto show
autoControlsSelector: null,         // jQuery selector - element to contain the auto controls. ex: '#auto-controls'
autoStart: true,                    // true, false - if false show will wait for 'start' control to activate
autoHover: false,                   // true, false - if true show will pause on mouseover
autoDelay: 0,                       // integer - in ms, the amount of time before starting the auto show
pause: 8000,                        // integer - in ms, the duration between each slide transition
startText: 'start',                 // string - text displayed for 'start' control
startImage: '',                     // string - filepath of image used for 'start' control. ex: 'images/start.jpg'
stopText: 'stop',                   // string - text displayed for 'stop' control
stopImage: '',                      // string - filepath of image used for 'stop' control. ex: 'images/stop.jpg'
ticker: false,                      // true, false - continuous motion ticker mode (think news ticker)
                                    // note: autoControls and autoControlsSelector apply to ticker!
tickerSpeed: 5000,                  // integer - has an inverse effect on speed. therefore, a value of 10000 will 
                                    // scroll very slowly while a value of 50 will scroll very quickly.
tickerDirection: 'next',            // 'next', 'prev' - direction in which ticker show will traverse
tickerHover: false,                 // true, false - if true ticker will pause on mouseover
wrapperClass: 'bx-wrapper',         // string - classname attached to the slider wraper
startingSlide: 0,                   // integer - show will start on specified slide. note: slides are zero based!
displaySlideQty: 1,                 // integer - number of slides to display at once
moveSlideQty: 1,                    // integer - number of slides to move at once
randomStart: false                 // true, false - if true show will start on a random slide       
        });
		
		$('#slider4').bxSlider({
            mode: 'horizontal',                 // 'horizontal', 'vertical', 'fade'
infiniteLoop: true,                 // true, false - display first slide after last
hideControlOnEnd: false,            // true, false - if true, will hide 'next' control on last slide and 'prev' control on first
controls: true,                     // true, false - previous and next controls
speed: 500,                         // integer - in ms, duration of time slide transitions will occupy
easing: 'swing',                    // used with jquery.easing.1.3.js - see http://gsgd.co.uk/sandbox/jquery/easing/ for available options
pager: true,                        // true / false - display a pager
pagerSelector: null,                // jQuery selector - element to contain the pager. ex: '#pager'
pagerType: 'full',                  // 'full', 'short' - if 'full' pager displays 1,2,3... if 'short' pager displays 1 / 4
pagerLocation: 'top',            // 'bottom', 'top' - location of pager
pagerShortSeparator: '/',           // string - ex: 'of' pager would display 1 of 4
pagerActiveClass: 'pager-active',   // string - classname attached to the active pager link
nextText: 'next',                   // string - text displayed for 'next' control
nextImage: '',                      // string - filepath of image used for 'next' control. ex: 'images/next.jpg'
nextSelector: null,                 // jQuery selector - element to contain the next control. ex: '#next'
prevText: 'prev',                   // string - text displayed for 'previous' control
prevImage: '',                      // string - filepath of image used for 'previous' control. ex: 'images/prev.jpg'
prevSelector: null,                 // jQuery selector - element to contain the previous control. ex: '#next'
captions: false,                    // true, false - display image captions (reads the image 'title' tag)
captionsSelector: null,             // jQuery selector - element to contain the captions. ex: '#captions'
auto: false,                        // true, false - make slideshow change automatically
autoDirection: 'next',              // 'next', 'prev' - direction in which auto show will traverse
autoControls: false,                // true, false - show 'start' and 'stop' controls for auto show
autoControlsSelector: null,         // jQuery selector - element to contain the auto controls. ex: '#auto-controls'
autoStart: true,                    // true, false - if false show will wait for 'start' control to activate
autoHover: false,                   // true, false - if true show will pause on mouseover
autoDelay: 0,                       // integer - in ms, the amount of time before starting the auto show
pause: 8000,                        // integer - in ms, the duration between each slide transition
startText: 'start',                 // string - text displayed for 'start' control
startImage: '',                     // string - filepath of image used for 'start' control. ex: 'images/start.jpg'
stopText: 'stop',                   // string - text displayed for 'stop' control
stopImage: '',                      // string - filepath of image used for 'stop' control. ex: 'images/stop.jpg'
ticker: false,                      // true, false - continuous motion ticker mode (think news ticker)
                                    // note: autoControls and autoControlsSelector apply to ticker!
tickerSpeed: 5000,                  // integer - has an inverse effect on speed. therefore, a value of 10000 will 
                                    // scroll very slowly while a value of 50 will scroll very quickly.
tickerDirection: 'next',            // 'next', 'prev' - direction in which ticker show will traverse
tickerHover: false,                 // true, false - if true ticker will pause on mouseover
wrapperClass: 'bx-wrapper',         // string - classname attached to the slider wraper
startingSlide: 0,                   // integer - show will start on specified slide. note: slides are zero based!
displaySlideQty: 1,                 // integer - number of slides to display at once
moveSlideQty: 1,                    // integer - number of slides to move at once
randomStart: false                 // true, false - if true show will start on a random slide       
        });
	
	// set up array of future applicable degrees for each of the degrees available
	var degreeMatch = {
						lpn: {
						  futureDegrees: 'lpnrn,rnbsn,msn,dnp,phd'
						},
						adn: {
						  futureDegrees: 'rnbsn,rnmsn,msn,dnp,phd'
						},
						bsn: {
							futureDegrees: 'msn,dnp,phd'
						},
						secondbsn: {
						  futureDegrees: 'msn,dnp,phd'
						},
						lpnrn: {
						  futureDegrees: 'rnbsn,rnmsn,msn,dnp,phd'
						},
						rnbsn: {
							futureDegrees: 'msn,dnp,phd'
						},
						msn: {
							futureDegrees: 'dnp,phd'	
						},
						demsn: {
						  futureDegrees: 'dnp,phd'
						},
						rnmsn: {
							futureDegrees: 'dnp,phd'
						},
						dnp: {
							futureDegrees: ''
						},
						phd: {
							futureDegrees: ''
						}
					   };
					   
	// every time someone changes the answer in the select box
	$('#degreeSelect').change(function() {
									   
		// clear the decks - de-select all degrees, hide any open degree blurbs
		$('div.degree').removeClass('chosen');
		$('div.degree').removeClass('future');
		$('div.degree span.next').remove();
		$('div.blurb:visible').toggle('fast',function(){
			// toggle complete
		});
		
		var degreeChosen = $('#degreeSelect > option:selected').val().split(',');
		
		// we need to iterate through because some visitor profiles have multiple immediately applicable degrees
		$.each(degreeChosen, function(){
			
			// highlight the degrees that are immediately applicable to them given their background
			$('#'+this+'').addClass('chosen');
			$('#'+this+' h2').append(' <span class="next"></span>');
			
		});
		
	});
	
	// when someone clicks on a degree box
	$('div.degree').click(function(){
		// check to see if this degree is applicable to them based on the select menu option chosen
		if ($(this).hasClass('chosen') || $(this).hasClass('future')) {
    
			var degree = this.id;
	  
			// clear "picked"  
	  		$('div.degree').removeClass('picked');
	  		$('#'+degree+'').addClass('picked');
	  
      		// if we're clicking on an immediate next degree, reset the future degree options
	    	if ($(this).hasClass('chosen')) {
			  $('div.future h2 span.next').remove();
			  $('div.degree').removeClass('future');
			}
			
			// hide any open degree blurbs
			$('div.blurb:visible').toggle('fast',function(){
				// toggle complete
			});
			
			// show this degree blurb if it isn't already shown
			$('.'+degree+':hidden').toggle('fast',function(){
				// toggle complete
			});
			
			// if there are future degrees applicable to them after they complete the next degree, highlight those too
			
			if(degreeMatch[degree].futureDegrees) {
				var futureDegrees = degreeMatch[degree].futureDegrees.split(',');
				$.each(futureDegrees,function(){
					var futureDegree = this;
	        		$('#'+futureDegree+'').removeClass('chosen');
					$('#'+futureDegree+'').addClass('future');
					$('#'+futureDegree+' h2 span.next').remove();
					$('#'+futureDegree+' h2').append(' <span class="next"></span>');
				});
			}
			
			
		}
	});
	
});
