$(document).ready(function(){

	//Open all links with rel="external" in new window
	$('a[rel="external"]').click( function() {
			window.open( $(this).attr('href') );
			return false;
    });
	
	//Embed Twitter post
	getTwitters('tweet', { 
		id: 'amanda_holden', 
		count: 1, 
		enableLinks: true, 
		ignoreReplies: true, 
		clearContents: true,
		template: '"%text%" <a href="http://twitter.com/%user_screen_name%/statuses/%id%/">%time%</a>'
	});
	
	//Embed Twitter post
	getTwitters('tweets', { 
		id: 'amanda_holden', 
		count: 4, 
		enableLinks: true, 
		ignoreReplies: true, 
		clearContents: true,
		template: '"%text%" <a href="http://twitter.com/%user_screen_name%/statuses/%id%/">%time%</a>'
	});
	
	//Agent Selector
	$(".uk").addClass('active');
	$(".uk").css('cursor','pointer');
	$(".usa").css('cursor','pointer');
	$(".pr").css('cursor','pointer');
	$(".us-agent").hide();
	$(".pr-info").hide();
	$(".uk").click(
		function(){
			$(this).addClass("active");
			$(this).siblings().removeClass("active");
			$(".us-agent").hide();
			$(".uk-agent").show();
			$(".pr-info").hide();
			return false;
		}
	);
	$(".usa").click(
		function(){
			$(this).addClass("active");
			$(this).siblings().removeClass("active");
			$(".uk-agent").hide();
			$(".pr-info").hide();
			$(".us-agent").show();
			return false;
		}
	);
	$(".pr").click(
		function(){
			$(this).addClass("active");
			$(this).siblings().removeClass("active");
			$(".uk-agent").hide();
			$(".us-agent").hide();
			$(".pr-info").show();
			return false;
		}
	);	
	
	if($("#list1b").length != 0) {
		$('#list1b').accordion({
			autoheight: false
		});
	}


		$(".basic a").click(function() {
			$(this).next().toggle('fast');
			
			return false;
		}).next().hide();

	
	

	if($("#list2b").length != 0) {
		$('#list2b').accordion({
			autoheight: false
			
		});
		
	}
	
	if($("#list3b").length != 0) {
		$('#list3b').accordion({
			autoheight: false
		});
	}
	
	if($("#list4b").length != 0) {
		$('#list4b').accordion({
			autoheight: false
		});
	}
	
	if($("#list5b").length != 0) {
		$('#list5b').accordion({
			autoheight: false
		});
	}
	
	if($("#list6b").length != 0) {
		$('#list6b').accordion({
			autoheight: false
		});
	}
	
	if($("#list7b").length != 0) {
		$('#list7b').accordion({
			autoheight: false
		});
	}
	
	if($("#list8b").length != 0) {
		$('#list8b').accordion({
			autoheight: false
		});
	}
	
	if($("#list9b").length != 0) {
		$('#list9b').accordion({
			autoheight: false
		});
	}
	
	if($("#list10b").length != 0) {
		$('#list10b').accordion({
			autoheight: false,
			active: 3
		});
	}
	
	if($("#list11b").length != 0) {
		$('#list11b').accordion({
			autoheight: false,
			active: 2
		});
	}
	if($("#list12b").length != 0) {
		$('#list12b').accordion({
			autoheight: false
		});
	}
	if($("#list13b").length != 0) {
		$('#list13b').accordion({
			autoheight: false
		});
	}
	if($("#list14b").length != 0) {
		$('#list14b').accordion({
			autoheight: false
		});
	}
	if($("#list15b").length != 0) {
		$('#list15b').accordion({
			autoheight: false
		});
	}
	if($("#list16b").length != 0) {
		$('#list16b').accordion({
			autoheight: false
		});
	}
	if($("#list17b").length != 0) {
		$('#list17b').accordion({
			autoheight: false
		});
	}
	
	if($("#list18b").length != 0) {
		$('#list18b').accordion({
			autoheight: false
		});
	}
	
	if($("#list19b").length != 0) {
		$('#list19b').accordion({
			autoheight: false
		});
	}
	
	//show hide timeline
	$('#showhide').hide();

	
	//Toggle
	$('.timeline-btn').toggle(
		function() {
			$(this).toggleClass('close').blur();
			$('#showhide').slideDown(1000);
		},
		function() {
			$(this).toggleClass('close').blur();
			$('#showhide').slideUp(1000);
		}
	);
	
	//Diary Tables - Remove border from last row 
	$(".diaryDatesTable tr:last td").addClass("no-border");
	
	//Zebra Stripe table
	$('.linksTable tr:odd').addClass('odd');

	
});
