$(document).ready(function() {
	if ($.fn.cycle && $('#monitor').length > 0) {
		$("#monitor").cycle({
				fx: 'fade',
				speed: 400,
				timeout: 6000,
				nowrap: 1
			}	
		);
	}

	var zoom = readCookie('zoom');

	$('.clearMeFocus').focus(function() {
		if ($(this).val() == $(this).attr('title')) {
			$(this).val('');
		}
	});

	$('.clearMeFocus').blur(function() {
		if ($(this).val() == '') {
			$(this).val($(this).attr('title'));
		}
	});

	$('#enlarge-text span').click(function() {
		if ($(this).hasClass('normal-text')) {
			zoom = 1.0;
		} else if ($(this).hasClass('medium-text')) {
			zoom = 1.1;
		} else if ($(this).hasClass('large-text')) {
			zoom = 1.25;
		}

		if (zoom) {
			var a = $(document).width();
			$('#wrapper').css({
				zoom: zoom,
				'-moz-transform': 'scale(' + zoom + ')',
				'-moz-transform-origin': '0 0'
			});
		}

		createCookie('zoom', zoom, 1);
	});

	$('#tab-int').click(function() {
		$('#foot-tab-menu li').each(function() {
			$(this).removeClass('active normal');
		});
		$(this).parent().addClass('active');
		$('#tidrapport').hide();
		$('#intranet').show();

		return false;
	});

	$('#tab-tid').click(function() {
		$('#foot-tab-menu li').each(function(element) {
			$(this).removeClass('active normal');
		});
		$(this).parent().addClass('active');
		$('#intranet').hide();
		$('#tidrapport').show();

		return false;
	});
});

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}























































