﻿﻿$(document).ready(function(){
﻿	
	$.ajax({
		type: 'POST',
		url: '/SliderContent',
		dataType: 'html',
		success: function (data) {
			$('#slider_holder').html(data);

			$('.carousel').jCarouselLite({
				start: 0,
				btnNext: '.next',
				btnPrev: '.prev',
				circular: true,
				visible: 1,
				auto: 10000,
				speed: 500,
				btnGo: ['#goto-0', '#goto-1', '#goto-2', '#goto-3', '#goto-4', '#goto-5', '#goto-6', '#goto-7', '#goto-8', '#goto-9', '#goto-10'],
				afterEnd: function(a) {
					var id = a.attr('data-nr');
					$('#splash-navigation li').removeClass('active');
					$('#goto-'+id).addClass('active');
				}
			});
		},
		error: function (XMLHttpRequest, textStatus, errorThrown) {
			//alert("Error: " + textStatus);
		}
	});
﻿	

﻿	$.ajax({
		type: 'POST',
		url: '/FrontpageArticles',
		dataType: 'html',
		success: function (data) {
			$('.zone-footer-quad-first ul').html(data);
		},
		error: function (XMLHttpRequest, textStatus, errorThrown) {
			//alert("Error: " + textStatus);
		}
	});
﻿	
﻿	$.ajax({
		type: 'POST',
		url: '/FrontpageNews',
		dataType: 'html',
		success: function (data) {
			$('.zone-footer-quad-second ul').html(data);
		},
		error: function (XMLHttpRequest, textStatus, errorThrown) {
			//alert("Error: " + textStatus);
		}
	});
﻿	
﻿	
﻿	getTwitters('tweet', {
		id: '#TD2012',
		count: 16,
		enableLinks: false,
		ignoreReplies: true,
		clearContents: true,
		template: '<div class="user-image"><img src="%user_profile_image_url%" alt="%user_screen_name%" /></div><div class="text"><h2><a href="http://twitter.com/%user_screen_name%">@%user_screen_name%</a></h2><p>%text%</p></div>',
		callback: function () {

			$('#tweet li').each(function (index) {
				$(this).addClass('group');

				var text = $(this).find('p').html();
				text = text.substring(0, 60);
				$(this).find('p').html(text+'...');
				
				var image = $(this).find('.user-image').html();
				var link = $(this).find('a').attr('href');
				$(this).find('a').attr('target', '_blank');

				image = '<a target="_blank" href="' + link + '">' + image + '</a>';
				$(this).find('.user-image').html(image);	
			});
			
			$('#tweet').jCarouselLite({
				btnNext: "#twitter-down",
				btnPrev: "#twitter-up",
				visible: 4,
				scroll: 1,
				circular: false,
				vertical: true,
				afterEnd: function(a) {
					if (a.index() == 0) {
						$('#twitter-up').css('background-position', '0px 0px');
					} else {
						$('#twitter-up').css('background-position', '-13px 0px');
					}

					if (a.index() == $('#tweet li').length-4) {
						$('#twitter-down').css('background-position', '0px 0px');
					} else {
						$('#twitter-down').css('background-position', '-13px 0px');
					}	
				}
			});
		}
	});
﻿});
