jQuery(document).ready(function($){
	//**************************************************Replace align attribute with class**************************************************//
	$('img[align="left"]').addClass('left').removeAttr('align');
	$('img[align="right"]').addClass('right').removeAttr('align');
	$('img[align="middle"]').addClass('middle').removeAttr('align');
	//**************************************************Replace target attribute with class**************************************************//
	$('a[target]').addClass('newwindow').removeAttr('target');
	//**************************************************The following function make it possible to have web standard popups**************************************************//
	$('a.newwindow').click(function() {
		window.open($(this).attr('href'));
    return false;
	});
	
	//**************************************************Clear search text out search box on focus**************************************************//
	$('#txtSearch').focus(function() {
    if ($(this).val() == "SEARCH") {
      $(this).val('');
	  }
  });
  //**************************************************Toggle the search box**************************************************//
  $('#searchForm').hide();
	$('ul#utilityNav li a.search').click(function () {
     $('#searchForm').slideToggle('slow');
	   return false;
   });   
	//************************************************Toggle Testimonials*****************************************************************//
	$('.blurb h5').hide();
	$('.blurb h6').hide();
	$('.testimonyWrap h4').addClass('inactive');
	$('.testimonyWrap h4').click(function () {
		$(this).toggleClass('inactive');
		$(this).toggleClass('active');		
	  	$(this).parent().find('.blurb h5').slideToggle();
		$(this).parent().find('.blurb h6').slideToggle();
		$(this).parent().find('.blurb h5 span').slideToggle();
	});
	//************************************************Toggle All Testimonial Answers*****************************************************************//
	$('p.showAllTestimonials span').click(function () {
    if($(this).html() == 'Show All Case Studies') {
    	$(this).parent().parent().find('.blurb h5').slideToggle('');
		$(this).parent().parent().find('.blurb h6').slideToggle('');
		$(this).parent().parent().find('.blurb h5 span').slideToggle('');
		$(this).html('Hide All Case Studies');
        $(this).parent().parent().find('.testimonyWrap h4').toggleClass('inactive');
        $(this).parent().parent().find('.testimonyWrap h4').toggleClass('active');
    } else {
        $(this).parent().parent().find('.blurb h5').slideToggle();
	    $(this).parent().parent().find('.blurb h6').slideToggle();
	    $(this).parent().parent().find('.blurb h5 span').slideToggle();
        $(this).parent().parent().find(this).html('Show All Case Studies');
        $(this).parent().parent().find('.testimonyWrap h4').toggleClass('active');
        $(this).parent().parent().find('.testimonyWrap h4').toggleClass('inactive');
    }
  });


  //**************************************************Toggle Categories************************************************************//
	$('h5 span').hide();
	$('p.pdf').hide();
	$('.sectionWrap h4').addClass('inactive');
	$('.sectionWrap h4').click(function () {
		$(this).toggleClass('inactive');
		$(this).toggleClass('active');
		$('p.showAll span').hide();
		$('.faqList').hide();
		$('h5 span').removeClass('active');
		$('h5 span').addClass('inactive');		
	  	$(this).parent().find('h5 span').slideToggle();
		$(this).parent().find('p.pdf').slideToggle();
  });	
  //**************************************************Toggle Category Lists************************************************************//
	$('.faqList').hide();
	$('p.showAll span').hide();
	$('h5 span').addClass('inactive');
	$('h5 span').click(function () {
		$(this).toggleClass('inactive');
		$(this).toggleClass('active');
	  $(this).parent().parent().find('p.showAll span').slideToggle();
	  $(this).parent().parent().find('.faqList').slideToggle('');
  });
  //**************************************************Toggle All Answers************************************************************//
  $('.faqList h6').addClass('inactive');
	$('p.showAll span').click(function () {
    if($(this).html() == 'Show All Answers') {
    	$(this).parent().parent().find('.faqList div:visible').slideToggle('');
    	$(this).parent().parent().find('.faqList div').slideToggle('');
    	$(this).html('Hide All Answers');
  		$(this).parent().parent().find('.faqList h6').removeClass('inactive');
  	    $(this).parent().parent().find('.faqList h6').addClass('active');
    } else {
        $(this).parent().parent().find('.faqList div:hidden').slideToggle('');
        $(this).parent().parent().find('.faqList div').slideToggle('');
        $(this).parent().parent().find(this).html('Show All Answers');
        $(this).parent().parent().find('.faqList h6').removeClass('active');
        $(this).parent().parent().find('.faqList h6').addClass('inactive');
    }
  });
  //**************************************************Toggle FAQ Question/Answer************************************************************//
  $('.faqList div').hide();
  $('.faqList h6').click(function () {
		$(this).toggleClass('inactive');
		$(this).toggleClass('active');
      	$($(this).next('div')).slideToggle('');
  });
   //********************************************Toggle Who Uses iClicker**************************************//
	  $('div.toggle').hide();
	  $('.reveal').addClass('inactive');
	  $('.revealCopyWrap .reveal').click(function () {	
		$(this).toggleClass('inactive');
		$(this).toggleClass('active');
	  	$(this).parent().find('div.toggle').slideToggle();
	  });	
	//*****Add swfobject flash call**************************************************//
/*	var flashvars = {};
	var params = {};
	params.wmode = "transparent";
	var attributes = {};
	swfobject.embedSWF("/swf/home.swf", "flash-content", "685", "306", "8.0.0", false, flashvars, params, attributes);
	swfobject.embedSWF("/swf/higher-ed.swf", "flashhighereducation", "227", "93", "8.0.0", false, flashvars, params, attributes);
	swfobject.embedSWF("/swf/k-12.swf", "flashk12education", "227", "93", "8.0.0", false, flashvars, params, attributes);
	swfobject.embedSWF("/swf/corporate.swf", "flashcorporategovernmentnonprofit", "227", "93", "8.0.0", false, flashvars, params, attributes);
	swfobject.embedSWF("/swf/timeline.swf", "flash-timeline", "605", "458", "8.0.0", false, flashvars, params, attributes);
	swfobject.embedSWF("/swf/partners.swf", "partnersFlash", "227", "93", "8.0.0", false, flashvars, params, attributes);
	*/
});
//**************************************************Custom Animation Methods jQuery**************************************************//