    //stick the footer at the bottom of the page if we're on an iPad/iPhone due to viewport/page bugs in mobile webkit
 jQuery(document).ready(function($) {
if(navigator.platform == 'iPad' || navigator.platform == 'iPhone' || navigator.platform == 'iPod')
{
$("#footer_contain").css("position", "static");
};
});

$(document).ready(function() {
var prompt = "Site Search";

 $('#search').focus(function() {
   if ($(this).val() == prompt) {
     $(this).val('');
   }
 });
 $('#search').blur(function() {
   if ($(this).val() == '') {
     $(this).val(prompt);
   }
 });
 $('#search').blur();
}); 






$(document).ready(function() {
    $('#slideshow2').cycle({
        fx:     'scrollHorz',
		cleartype: true,
	  cleartypeNoBg: true,
      timeout: 0,
      next: '#next2',
      prev: '#prev2'
       
    });
        });


$(document).ready(function() {

    $('.slideshow3').cycle({
        fx:     'scrollDown',
		cleartype: true,
	  cleartypeNoBg: true,
        speed:  'slow',    
       timeout: 0,
	    //after: onAfter,
	   pagerEvent: 'mouseover',
        pager:  '#calendar-contain',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#calendar-contain .cal-date:eq(' + (idx) + ') a';
        }
    });
        });
		//function onAfter(curr, next, opts, fwd) {
 // var $ht = $(this).height();

  //set the container's height to that of the current slide
 // $(this).parent().animate({height: $ht});
//}

		
		
$(document).ready(function() {

    $('.slideshow4').cycle({
        fx:     'scrollRight',
		cleartype: true,
	  cleartypeNoBg: true,
        speed:  'slow',
		next: '#next3',
       timeout: 0,
	   after: onAfter
	  
    });
        });
		function onAfter(curr, next, opts, fwd) {
  var $ht = $(this).height();

  //set the container's height to that of the current slide
  $(this).parent().animate({height: $ht});
}


var clicked = 0;
	
$(document).ready(function() {

	$('.tip-contain').hide();
	
	$('.tip-show').click(function() {
		var disp = $(this).parent().siblings('.tip-contain').first().css('display');
		if (disp === 'none') {
			$(this).parent().parent().animate({width: '332px'}, 400);
			$(this).parent().siblings('.tip-contain').first().show(400);
			clicked = 1;
		} else {
			$(this).parent().siblings('.tip-contain').first().hide(400);
			$(this).parent().parent().animate({width: '37px'}, 400);
			clicked = 1;
		}
		return false;
	});
	
	$(window).scroll(function() {
		var disp = $('.toggleshow').css('display');
		if (clicked === 0) {
			if(($('#foot-sync').offset().top - $('.tip-contain').offset().top) <= 1250){
				if (disp === 'none') {
					$('.toggleshow').parent().animate({width: '332px'}, 400);
					$('.toggleshow').show(400);
				}
			} else {
				if (disp !== 'none') {
					$('.toggleshow').parent().animate({width: '37px'}, 400);
					$('.toggleshow').hide(400);
				}
			}
		}
	});

});
