/*
 * Tele2 Annual Report custom jQuery
 */

$(document).ready(function(){
	// START Board of directors/executives
	$(function() {
		$("ul.tabs").tabs("div.panes > div", {
		effect: 'fade',
		fadeInSpeed:'500'
		});
	});

	//toggle choose country slider
	$('#country-toggle').click(function () {
			$('.toggleme ul').animate({
				opacity: 'toggle',
				height: 'toggle'
			});
		});
		
	//toggle social links
	$('.mediacontent.socialmedia a').click(function () {
			$('#colorbox2').animate({
				opacity: 'toggle',
				height: 'toggle'
			});
		});
	$('#cboxClose').click(function () {
			$('#colorbox2').animate({
				opacity: 'toggle',
				height: 'toggle'
			});
		});
	$('#cboxLoadedContent li a').click(function () {
			$('#colorbox2').animate({
				opacity: 'toggle',
				height: 'toggle'
			});
		});



	//Navigation
	$(".navigation ul li:first-child ").addClass("first")
	$(".navigation ul li:last-child ").addClass("last")
	//Social balk nav 
	$("ul.social-balk li:last-child").addClass("last")
	
	$(".mediacontent .slide-wrap:first-child").addClass("first")
	$(".mediacontent .slide-wrap:last-child").addClass("last")
	
	//footer
	$(".footerContent .footerSection:first-child ").addClass("first")
	$(".footerContent .footerSection:last-child").addClass("last")
	//Rightcontent h2 border top
	$(".rightContentWrap h2:first").addClass("first")
	//Marginal under h1 på ordlistesidan
	$("h1+div").addClass("top-margin")
	$("h1+img").addClass("top-margin")
 	// Döljer sökdiven initialt
	//$('#slideSearch').hide();
	// shows the slideSearch DIV on clicking the link with an Class of "navigationSearchSubmit"
	$('.navigationSearchSubmit').click(function() {
		$('#slideSearch').slideDown(800);
		return false;
	});
	// Döljer sökDiven vid klick
	$('.hideme').click(function() {
		$('#slideSearch').slideUp('slow');
		return false;
	});
	$(".report-list ul li:last-child").addClass("last")
	//end search
	//Report Archive table
	$("table.report-archive tbody td:nth-child(2)").addClass("td-nr2")
	$("table.report-archive tbody td:nth-child(3)").addClass("td-nr3")
	$("table.report-archive tbody td:nth-child(4)").addClass("td-nr4")
	$("table.report-archive tbody td:nth-child(5)").addClass("td-nr5")
	$("table.report-archive tbody td:nth-child(6)").addClass("td-nr6")
	$("table.report-archive tbody td:nth-child(7)").addClass("td-nr7")
	$("table.report-archive tbody td:nth-child(8)").addClass("td-nr8")
	$("table.report-archive tbody td:nth-child(9)").addClass("td-nr9")
	NoCufon()
	FixTable();
	Paging();
	HighSlide();

});

function HighSlide()
{
	$(".rounded-white.table-hs tbody tr:last").prev().addClass("border-lr"); 
}
function NoCufon()
{
	$(".rightColumn h3 ").addClass("noCufon");
	$(".mainContent h3 ").addClass("noCufon");
	$(".mainContent h4 ").addClass("noCufon");
	$("#slideSearch h4 ").addClass("noCufon");
	$(".slide-wrap h5 ").addClass("noCufon");
	$(".navigationSubMenu a span ").addClass("noCufon");
}
function FixTable()
{
	$("table tbody tr:even ").addClass("odd");
	$("table tr td:first-child ").addClass("first");
	$("table tr td:last-child ").addClass("last");
	$("table tr th:first-child ").addClass("first");
	$("table tr th:last-child ").addClass("last");
	$("table+ol").addClass("legend");
	$(".glossary").parent().addClass("glossary-wrapper");
}
function Glossary()
{
	$(".glossary").parent().addClass("glossary-wrapper");
}
function Paging()
{
	$(".pagingContainer ul li:first-child").addClass("first");
	$(".pagingContainer ul li:last-child").addClass("last");
}
function FixHeaders()
{
	Cufon.replace("h1[class!=noCufon], h2[class!=noCufon]", { fontFamily: "boton" });
}

if ($.fn.selectBox == null){ 
   $.fn.selectBox = function(){ 
      return true;
   }
}

