$(document).ready(function(){
	// round corners
	$('.RoundCorner,.HomeBox,.grayBox').corner("10px");
	
	// drop down nav
	$('td#NavBar ul li ul').hide();
	$('a#nutrition-services,ul#nav-nutrition-services').hover(
		function() {
			$('ul#nav-nutrition-services').show();
		},
		function() {
			$('ul#nav-nutrition-services').hide();				
		}
	);
	$('a#our-programs,ul#nav-our-programs').hover(
		function() {
			$('ul#nav-our-programs').show();
		},
		function() {
			$('ul#nav-our-programs').hide();				
		}
	);
	$('a#our-clients,ul#nav-our-clients').hover(
		function() {
			$('ul#nav-our-clients').show();
		},
		function() {
			$('ul#nav-our-clients').hide();				
		}
	);
	$('a#about-rania,ul#nav-about-rania').hover(
		function() {
			$('ul#nav-about-rania').show();
		},
		function() {
			$('ul#nav-about-rania').hide();				
		}
	);
	
	// client stories
	$('div.clientStory').hide();
	$('a.clientStoryLink').toggle(
		function() {
			$(this).parent('div.clientStoryDiv').children('div.clientStory').slideDown();
			$(this).text('Hide the story >');
		},
		function() {
			$(this).parent('div.clientStoryDiv').children('div.clientStory').slideUp();	
			$(this).text('Read the story >');
		}
	);
	
	// video clips
	$('div.videoCategory').hide();
	$('div.videoCategory:first').show();
	$('div#videoCategories a img:first').addClass('active');
	
	$('div#videoCategories a').toggle(function(){
		$('div.videoCategory').hide();
		$('div#videoCategories a img').removeClass();
		$(this).children('img').addClass('active');
		var strDetailLink = $(this).attr('rel');
		$("#"+strDetailLink).show();
	},function(){
		$('div.videoCategory').hide();
		$(this).children('img').removeClass('active');
		var strDetailLink = $(this).attr('rel');
		$("#"+strDetailLink).hide();
	});
	
	// food facts slideshow
	$('#foodFacts').cycle({
		height:  '165px',	// container height 
	    fade:     1,		// true for fade, false for slide 
	    speed:    1000,		// any valid fx speed value 
	    timeout:  4000,		// 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: 0        // 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) 
	});
	
	// anti spam form validation
	$('input,textarea').keypress(function(){
		this.form.elements.pv.value='verified';
	});
	
	// png fix for old IE browsers
	$(document).pngFix();
});