
	function switchTabs(mIdentifier,iElementShow,iElementTotal)
 	{
		var oItemToShow 	= $("#" + mIdentifier + "_" + iElementShow);
		var oItemTrigger 	= $("#" + mIdentifier + "_" + iElementShow + "_trigger");

		for (var n = 1; n <= iElementTotal; n++)
		{
			if (n != iElementShow)
			{
				$("#" + mIdentifier + "_" + n).css("display","none");
				$("#" + mIdentifier + "_" + n + "_trigger").removeClass("current");
			}
		}

		oItemToShow.css("display","block");
		oItemTrigger.addClass("current");
 	}

 	function highlightHomeArticle(iArticleKey)
 	{
 		var oArticleHeadline 	= $("#article_headline_" + iArticleKey);
 		var oArticleContent 	= $("#article_content_" + iArticleKey);
 		var oArticleLink		 	= $("#article_url_" + iArticleKey);
 		var oArticleImage 		= $("#article_src_" + iArticleKey);

 		var s_article_link 		= oArticleLink.html();

 		// fix me
 		$("#article_trigger_" + iArticleKey).addClass("current");

		$("#article_headline_main").html(oArticleHeadline.html());
		$("#article_headline_main").attr("href",s_article_link);
		$("#article_headline_content").html(oArticleContent.html());
		$("#article_headline_content").attr("href",s_article_link);
		$("#article_headline_src").attr("src",oArticleImage.attr("src"));
		$("#article_headline_url").attr("href",s_article_link);
 	}

 	function nextMatchBox(type)
 	{
 		switch(type)
 		{
 			case 'table':
 				$("#nextBoxFooter").css("display","none");
 				break;

 			case 'next':
 				$("#nextBoxFooter").css("display","block");
 				$("#nextBoxOneLink").html("Ticket News");
 				$("#nextBoxOneLink").attr("href", $("#link_url_1").html());
 				$("#nextBoxTwoLink").html("Match Preview");
 				$("#nextBoxTwoLink").attr("href","http://evertontv.evertonfc.com");
 				break;

 			case 'last':
 				$("#nextBoxFooter").css("display","block");
 				$("#nextBoxOneLink").html("Match Report");
 				$("#nextBoxOneLink").attr("href","http://www.evertonfc.com/lastmatch/");
 				$("#nextBoxTwoLink").html("evertonTV");
 				$("#nextBoxTwoLink").attr("href","http://evertontv.evertonfc.com");
 				break;
 		}
 	}

  function selectJump(select_id)
  {
      var newIndex = document.getElementById(select_id).selectedIndex;
      var cururl = document.getElementById(select_id).options[document.getElementById(select_id).selectedIndex].value;
      window.location = cururl;
  }

  function initializeAccordion(show_element,total_elements,group_name)
  {
  	for(var i=1; i<=total_elements; i++)
  	{
  		if (i != show_element)
  		{
  	  	$("#" + group_name + "_" + i).css("display","none");
  	  	$("#" + group_name + "header_" + i).removeClass("boxtitleactivenav");
  	  	$("#" + group_name + "header_" + i).addClass("boxtitleinactivenav");
  		}
  	}
  }

  function groupAccordion(show_element,group_name,count_name)
  {
  	var total_elements = $("input[name='"+count_name+"']").val() - 1;

  	if ($("#" + group_name + "_" + show_element).css("display") == "none")
  	{
  		for (var i = 1; i <= total_elements; i++)
  		{
  			if (i != show_element && $("#" + group_name + "_" + i).css("display") != "none")
  			{
  				$("#" + group_name + "_" + i).slideUp("fast", function() {
  					$("#" + group_name + "_" + i).css("display","none");
  				});

  				$("#" + group_name + "header_" + i).removeClass("boxtitleactivenav");
  				$("#" + group_name + "header_" + i).addClass("boxtitleinactivenav");
  			}
  			else if (i == show_element)
  			{
  				$("#" + group_name + "_" + i).slideDown("fast");
  				$("#" + group_name + "header_" + i).removeClass("boxtitleinactivenav");
  	  		$("#" + group_name + "header_" + i).addClass("boxtitleactivenav");
  			}
  		}
  	}
  }