/* Author: Octavio Corral
*/
 
$(document).ready(function(){ 
						   
	$(":header:contains('&')").each(function(){
			$(this).html($(this).html().replace(/&amp;/, "<span class='amp'>&amp;</span>"))
	});					   
						   
    $("ul.mainnav").superfish({	
		delay:         800,                // the delay in milliseconds that the mouse can remain outside a submenu without it closing 
		animation:     {opacity:'show'},   // an object equivalent to first parameter of jQuery’s .animate() method 
		speed:         'fast',           // speed of the animation. Equivalent to second parameter of jQuery’s .animate() method 
		autoArrows:    true,               // if true, arrow mark-up generated automatically = cleaner source code at expense of initialisation performance 
		dropShadows:   false 
		
		}); 
    }); 
 
 	$('.mainnav li:last-child').addClass('last');

	$('#s7').cycle({
	fx:     'fade',			   
    timeout: 3500,
    speed:   1000,
	sync: 1,
	cleartype:       true,  // true if clearType corrections should be applied (for IE) 
    cleartypeNoBg: true,
	next:'.arrow',
	pager:  '#pager',
	pagerAnchorBuilder: function(idx, slide) { 
        // return selector string for existing anchor 
        return '#pager li:eq(' + idx + ') a'; 
    }/*, 
	before:     onBefore,  Uncomment for 100% Width Slideshow
	after:     onAfter
    */});
	/*
function onBefore() { 
    $(this).css('width','100%');  Uncomment for 100% Width Slideshow
} 

function onAfter() { 
    $(this).css('width','100%'); 
} */
	

$('#initiative1').click(function() { 
    $('#s7').cycle(0);
	$('#s7').cycle('pause'); 
    return false; 
}); 
 
$('#initiative2').click(function() {  
    $('#s7').cycle(1);
	$('#s7').cycle('pause'); 
    return false;  
}); 


$('#initiative3').click(function() {  
    $('#s7').cycle(2);
	$('#s7').cycle('pause'); 
    return false;  
}); 


$('#initiative4').click(function() {  
    $('#s7').cycle(3); 
	$('#s7').cycle('pause'); 
    return false;  
}); 



/* Auto-run
$(function(){
	$(".tabs").idTabs();
});*/


/*
var fade = function(id,s){
  s.tabs.removeClass(s.selected);
  s.tab(id).addClass(s.selected);
  s.items.fadeOut();
  s.item(id).fadeIn();
  return false;
};
$.fn.fadeTabs = $.idTabs.extend(fade);
$(".tabs").fadeTabs();
*/



$("a.readmore3").click(function(){
		if ($(this).text() == 'Read More') {
			$(".summary").removeClass("expandable2").slideDown('slow');
			$(this).text("View Less");
		} else {
			$(".summary").addClass("expandable2");
			$(this).text("Read More");
		}
		return false;
});


$("a.readmore4").click(function(){
		if ($(this).text() == 'Read More') {
			$(this).parent().parent().removeClass("expandable3");
			$(this).text("View Less");
		} else {
			$(this).parent().parent().addClass("expandable3");
			$(this).text("Read More");
		}
		return false;
});


/*
$(".tab-item img.entry-image").click(function(){				  
		if ($(this).parent().parent().hasClass('expandable1')) {
			$(this).parent().parent().removeClass("expandable1");
			$(this).child('a.readmore2').text("View Less");
		} else {
			$(this).parent().parent().addClass("expandable1"); 
			$(this).child('a.readmore2').text("Read More");
		}
		return false;
});*/














