jQuery(document).ready(function() {

// start media carousel 
    $('.p-rotator .stgslide').cycle({
        fx: 'fade',
		timeout: 900,
		speed: 2000,
        before: onBefore,
        pager: '.stgbtnwrpr .stgbtngrp',
        pagerAnchorBuilder: function(idx, slide) {
            idxNUM = idx + 1;
			if (idxNUM == 1)
	            return 'd<div id="stgbtn' + idxNUM + '" class="stgbtnoff stgbtnon">' + idxNUM + '</div>';
			else
            	return '<div id="stgbtn' + idxNUM + '" class="stgbtnoff">' + idxNUM + '</div>';
        }
    });

	$('.p-rotator .stgbtngrp .stgbtnoff').click(function(){
		$('.p-rotator .stgslide').cycle('stop');
	});
	
	$.fn.cycle.updateActivePagerLink = function(pager, currSlideIndex) {
    $(pager).find('div').removeClass('stgbtnon')
        .filter('div:eq(' + currSlideIndex + ')').addClass('stgbtnon');
	};

// end media carousel 

// start how do I.. 
    $("#toptasks_tgl").click(function () {
	if ($("#toptasksdetail").is(':hidden'))
	  $("#toptasksdetail").show("fast");
	else
	  $("#toptasksdetail").hide("fast");
	});    
// end how do I.. 

	$(".getconnected_service img").fadeTo(10, 0.2);
	
	 $(".getconnected_service").hover(function(){
		$(this).find('img').fadeTo(250, 1.0); // This should set the opacity to 100% on hover
		},function(){
		$(this).find('img').fadeTo(250, 0.2); // This should set the opacity back to 60% on mouseout
	 });

// Preload news tab
jQuery("<img>").attr("src", "images/ed_mn_nf_tab_news.jpg");


// switch to news tab
$("#features_section_body").hide();
$("#news_section_body").show();
$("#nf_tab").attr("src","images/ed_mn_nf_tab_news.jpg");


});

function onBefore() {
	$('.stghrimg').html($('.stgslideheading', this).html());
	$('.stghrtxt').html($('.stgslidecontent', this).html());
	$('.stghrmore').html($('.stgslidemore', this).html());	
}

function toggleNF(section)
{
	switch (section)
	{
		case "news":
			$("#features_section_body").hide();
			$("#news_section_body").show();
			$("#nf_tab").attr("src","images/ed_mn_nf_tab_news.jpg");
			break;
		case "features":
			$("#features_section_body").show();
			$("#news_section_body").hide();
			$("#nf_tab").attr("src","images/ed_mn_nf_tab_features.jpg");
			break;
	}
}



