$(document).ready(function(){
	// testimonials toggle
	$('.result-full').hide().before('<div class="read-full-result">Read the Full Result &gt;</div>');
	$('.read-full-result').click(function(){
		$(this).next().slideToggle();
		if ($(this).text() == 'Read the Full Result >') {
			$(this).text('< Hide Result');
		} else {
			$(this).text('Read the Full Result >');
		}
	});
	
	// round corners
	$('.RoundCorner').corner("10px");
	
	// drop down nav
	$('#NavBar ul div').hide();
	$('#NavBar ul li a,#NavBar ul li div').hover(
		function() { $(this).parent('li').children('div').show(); },
		function() { $(this).parent('li').children('div').hide(); }
	);
	
	// banner slideshow
	$('#banner').cycle({
		height:  '200px',	// container height 
	    fade:     1,		// true for fade, false for slide 
	    speed:    2000,		// any valid fx speed value 
	    timeout:  5000,		// ms duration for each slide 
	    random:   0,       // true for random, false for sequence 
	    fit:      0,       // force slides to fit container 
	    pause:    0,       // true to enable "pause on hover" 
	    autostop: 1        // true to end slideshow after X slides have been shown (where X == slide count) (note that if random == true not all slides are guaranteed to have been shown) 
	});
	
	// testimonials slideshow
	$('#testimonialSlides').cycle({
		height:  'auto',	// container height 
	    fx:    	 'fade',	// none, fade, etc. 
	    speed:    1000,		// any valid fx speed value 
	    timeout:  10000,
		containerResize:0,
		fit:0,
		after: function (curr, next, opts, fwd) {
			//get the height of the current slide
			var $ht = $(this).height();
			if (!top.bSubsequent) {
				top.bSubsequent = 1;
				$(this).parent().css({height: $ht});
			} else {
				//set the container's height to that of the current slide
				$(this).parent().animate({height: $ht});
			}
		}
	});

	// anti spam form validation
	$('input,textarea').keypress(function(){
		this.form.elements.pv.value='verified';
	});
	
	// png fix for old IE browsers
	$(document).pngFix();
});
