// jQuery Javascript file for http://www.icsep.org.il v2
// by EngagingNet http://www.engaging.net
// Dependencies: jquery, jquery-ui, hoverIntent, jcarousel, accordion

// TWO BUTTONS FOR TESTIMONIALS CAROUSEL

function mycarousel_initCallback(carousel)
{
	jQuery('#testimonials-prev').bind('click', function() 
	{
		carousel.next();
		$("#testimonials-prev").css();
		return false;
	});
};

$(function()
{

	// HOVERINTENT FOR PROGRAMS MATRIX

	$(".program-title").hoverIntent(function()
	{
		$(".program-body").hide();
		$(".program-read-more").hide();
		$(".program-title").parent().removeClass("active");

		$(this).parent().addClass("active");
		$(this).parent().next().show().effect("highlight",
		{
			color: "#fda72d"
		}
		,
		1000
		);
		$(this).parent().next().next().show();
	},
	function()
	{
	});

	// ACCORDIONS

	$(".accordion").accordion(
	{
		event: 'mouseover',
		autoHeight: false,
		animated: 'easeInOutExpo',
		changestart: function(event, ui)
		{
			$(ui.oldHeader).children().children().filter(".subtitle").css(
			{
				'border-top' : '6px solid #fff',
				'border-bottom' : '6px solid #fff'
			});
			$(ui.newHeader).children().children().filter(".subtitle").css(
			{
				'border-top' : '6px solid #187db5',
				'border-bottom' : '6px solid #187db5'
			});
			$(ui.newHeader).children().children().filter("h3").css(
			{
				'font-weight' : 'bold'
			});
			$(ui.oldHeader).children().children().filter("h3").css(
			{
				'font-weight' : 'normal'
			});
		}
	});

	// TESTIMONIALS CAROUSEL

	$('#testimonials').jcarousel(
	{
		scroll: 1,
		auto: 3,
		animation: 2000,
		easing: "easeInOutExpo",
		wrap: 'both',
		initCallback: mycarousel_initCallback
	});

	// LOAD HOMEPAGE WITH MISSION STATEMENT DISPLAYED

	$("#mission-statement-body").show().effect("highlight",
		{
			color: "#fda72d"
		}
		,
		1000
	);
	$("#mission-statement-read-more").show();
	
});
