$(document).ready(function(){
	// Adding background to current item
		$("ul#navigation li a.current").append('<span class="tab-close"> </span>')

	// Removes padding/margins for first/last elements
		$("ul#navigation li:last-child").css({"margin-right": "0"});
		$("ul#links li:last-child a").css({"padding-right": "0"});
		$("ul#vote-for-us li:first-child").css({"margin-left": "0"});
		$("ul#vote-for-us li:last-child").css({"margin-right": "0"});
		$("div.box:last-child").css({"margin-bottom": "0"});
	
	// Rounded corners on images and boxes
		$("li#event-image").prepend('<span class="mask"> </span>');

		if($("div.box:first")){
			$('div.box').prepend('<span class="box-top-first"> </span>');	
		} else {
			$('div.box').prepend('<span class="box-top"> </span>');				
		}
		$("div.box").append('<span class="box-bottom"> </span>');		

		$("div#main").prepend('<span class="content-top"> </span>');
		$("div#main").append('<span class="content-bottom"> </span>');				

		$("ul#status-boxes").prepend('<span class="full-top"> </span>');
		$("ul#status-boxes").append('<span class="full-bottom"> </span>');		
	
	
	// Checks servers status and adds proper class
		$("ul#indicator li").each(function(){
			var status = $(this).find('div').text();
			$(this).find('span').addClass(status);
		});
	
	// Form stuff
		$('form#account div.field input').focus(function () {
			$(this).parent().addClass('focus');
	    }).blur(function () {
			$(this).parent().removeClass('focus');
		});
		
		$('form#account div.field label').each(function(){
			var lblWidth = $(this).width(); // Gets width of every field
			var inptWidth = 230 - lblWidth; // Calculates width of input
		
			$(this).parent().find('input').width(inptWidth);
		});
	
	// Twitter
        $(".twitter").tweet();

	// Text shadow
		// $('span.bigstep').each( function(){
		// 	var shadow = $(this).text();
		// 	$(this).prepend("<strong>"+shadow+"</strong>");
		// });

});
Cufon.replace('ul#navigation li a, #footer h2 a, #status-boxes h2, div.box h2, #main h1');