// When the document loads do everything inside here ...
$(document).ready(function()
{
	// When a link is clicked
	$("a.tab").click(function () 
	{
		// switch all tabs off
		$(".activemenu").removeClass("activemenu");

		// switch this tab on
		$(this).addClass("activemenu");

		// slide all content up
		$(".commcontent").slideUp();

		// slide this content up
		var commcontent_show = $(this).attr("title");
		$("#"+commcontent_show).slideDown();
		
		//$('div.thelanguage').slideDown();
	});
});

/*********************************************************************/
/*		JQuery Toggle Show All - Hide All Function with Text Change		*/
/*********************************************************************/

jQuery(document).ready(function()
{
	var content = [".toggleShowHideAll",".thelanguage"];
	if (content)
	{
		if(content.length == 2)
		{
			var toggler = content[0];
			var togglee = content[1];
			menuToggler(toggler,togglee);
		}
	}
});

function menuToggler(toggler, togglee)
{
	var original_text = $(toggler).text();
	var divName = $('div.technology').next('div.thelanguage');
	
	//$(togglee).hide();
	
	$(toggler).toggle(
	function()
	{
		if(divName.is(':visible'))
		{
			$(togglee).slideUp();
			$(toggler).text("Expand All");			
			$('div.technology').removeClass('irToggleClose');
			$('div.technology').addClass('irToggleOpen');
		}
		else
		{
			$(togglee).slideDown();
			$(toggler).text(original_text);
			$('div.technology').removeClass('irToggleOpen');
			$('div.technology').addClass('irToggleClose');		
		}
	},
	function()
	{
		if(divName.is(':visible'))
		{
			$(togglee).slideUp();
			$(toggler).text("Expand All");			
			$('div.technology').removeClass('irToggleClose');
			$('div.technology').addClass('irToggleOpen');
		}
		else
		{
			$(togglee).slideDown();
			$(toggler).text(original_text);
			$('div.technology').removeClass('irToggleOpen');
			$('div.technology').addClass('irToggleClose');		
		}		
	});
}/**/

/****************************************************/
$(document).ready(function() {
	$('div.thelanguage').show();
	$('div.technology').addClass('irToggleClose');
	
	$('div.technology').click(function() 
	{
		var answer = $(this).next('div.thelanguage');
		if (answer.is(':visible')) {
			answer.slideUp();
			$(this).removeClass('irToggleClose');
			$(this).addClass('irToggleOpen');
		} 
		else 
		{
			answer.slideDown();
			$(this).removeClass('irToggleOpen');
			$(this).addClass('irToggleClose');
		}
	});
});
