
$(document).ready(function(){


//============ HOMEPAGE IMAGE ROTATOR - Using Cycle Plugin - jquery.cycle.all.min.v2.88.js ======================

	$('div.image_rotator').cycle({
        fx: 'fade',
        speed: 2000,
        timeout: 8000,
        pause: 0,
        pagerEvent: 'mouseover',
        pager: 'ul.homepage_subheader_menu', 
        pagerAnchorBuilder: function(idx, slide) { 
        // return selector string for existing anchor
        return 'ul.homepage_subheader_menu li:eq(' + idx + ') a';      
    	} 
        });

 
//============ HOMEPAGE - SCROLLING DIV AT THE BOTTOM OF THE PAGE - jScroll Pane & Mouse Wheel Plugin - jScrollPane.js - jquery.mousewheel.js ======================

	$('div#seo_footer_text_container').jScrollPane();


//============ FORM TEXT FIELD CLEAR - Clear Input Plugin - jquery.clearinput.js ======================

    $("input[type='text']").clearInput();
	$("textarea").clearInput(); 
   
   /*
	$(document).ready(function(){
		$("input[type='text']").each(function(){
			if ($(this).val() == ("")){
				$(this).val($(this).attr("default"));
			}

			$(this).focus(function(){
				if ($(this).val() == $(this).attr("default")){
					$(this).val("");
				}
			});

			$(this).blur(function(){
				if ($(this).val() == ("")){
					$(this).val($(this).attr("default"));
				}
			});
		});
	});
 */ 
	

//============ SUB PAGE SNAP IN SNAP OUT - Jquery function ======================

	// $('div.image_snap_in_snap_out_container').hide();
	
	
	$("a.snap_out_panel").click(function () {
		  $(this).toggleClass("open");
	});
	

	$('a.snap_out_panel').click(function() {
	  $('div.image_snap_in_snap_out_container').slideToggle('slow', function() {
		// Animation complete.
	  });
	});

	//================= CPD COURSE PAGE ACCORDIAN - Jquery UI Plugin jquery-ui-1.8.7.custom.min.js ======================
	
	if ($("#accordion").length!=0) {
		$("#accordion" ).accordion({
				collapsible: true,
				active: false,
				autoHeight: false
		});
	}
	

//============ SUB NAVIGATION DROP DOWN - No Plugin - Jquery function ======================

		$('ul.sub_nav li a.snap_in_snap_out').bind('click', function (e) {
            e.preventDefault();
            $(this).next('ul.drop_down_sub_nav').slideToggle();
        });
        //MO - Commented out below because it was forcing page to semi reload forcing window position to top of page so added statement above
		//	$("ul.sub_nav li a.snap_in_snap_out").click(function(){		
		//	  $(this).next('ul.drop_down_sub_nav').slideToggle();
		//	});



});
