jQuery(document).ready(function() {	
								
	//run cycle on courses images
	if(jQuery('#topimg').length > 0){
		jQuery('#topimg').cycle({
			 fx:    'fade', 
    		 speed:  500,
			 sync: 1,
			 cleartype:   0,
			 pause:  1,
			 prev: '#previous',
			 next: '#next',
			 before: swapCaption
		});		
		
	}
	// set the date format for the calendar plugin
    $.datePicker.setDateFormat('mdy', '/');
	// initalize
    $('input#teedate').datePicker();
    
    // course selection in the courses section
    $("#courseSelect").change(function(){
    	var url = $("#courseSelect option:selected").val();
    	window.location.href = url;
    });
    
    // fancybox
    $("#course-photos a").fancybox();
	
	$('#textSmall, #textLarge').hover(
		function() {
			$(this).css('cursor','pointer');
		},
		function() {
			$(this).css('cursor','default');
		}
	);

	$('#textSmall').click(function(){
		var currentSize = $('#right-content p').css('font-size');
		currentSize = parseInt(currentSize);
		currentSize = currentSize - 2;
		currentSize = currentSize + 'px';
		
		$('#right-content p, div.asset-body').css('font-size',currentSize);
	});
	
	$('#textLarge').click(function(){
		var currentSize = $('#right-content p').css('font-size');
		currentSize = parseInt(currentSize);
		currentSize = currentSize + 2;
		currentSize = currentSize + 'px';
		
		$('#right-content p, div.asset-body').css('font-size',currentSize);
	});
	
	// external links
	$(function(){$('a[href][rel*=external]').each(function(i){this.target = "_blank";});});
}); //close doc.ready


// creates a caption feature for the photo gallery
function swapCaption() {
	$('#photo-caption').html(this.alt); 
}

//toggle package long description
function togglePkgDesc(pkg){
	//alert(pkg);
	$('.'+pkg).toggle('fast');
}