$(document).ready(function() {
		if($.cookie('TEXT_SIZE')) {
			$('body').addClass($.cookie('TEXT_SIZE'));	
		}
		$('.resizer a').click(function() {
			var textSize = $(this).parent().attr('class');
			$('body').removeClass('small medium large').addClass(textSize);
			$.cookie('TEXT_SIZE',textSize, { path: '/', expires: 10000 });
			return false;
		});
		
		$('.default a').click(function() {
			if($.cookie('STYLESHEET_LINKS')) {
				var StyleSheetLinkOne = "/layouts/AET2/css/screen.css";
				var StyleSheetLinkTwo = "/layouts/AET2/css/print.css";
				var StyleSheetRel = "stylesheet";
				var StyleSheetMediaOne = "screen";
				var StyleSheetMediaTwo = "print";
				var StyleSheetType = "text/css";
				$.cookie('STYLESHEET_LINKONE',StyleSheetLinkOne, { path: '/', expires: 10000 });
				$.cookie('STYLESHEET_LINKTWO',StyleSheetLinkTwo, { path: '/', expires: 10000 });
				$.cookie('STYLESHEET_REL',StyleSheetRel, { path: '/', expires: 10000 });
				$.cookie('STYLESHEET_MEDIAONE',StyleSheetMediaOne, { path: '/', expires: 10000 });
				$.cookie('STYLESHEET_MEDIATWO',StyleSheetMediaTwo, { path: '/', expires: 10000 });
				$.cookie('STYLESHEET_TYPE',StyleSheetType, { path: '/', expires: 10000 });
				$.cookie('STYLESHEET_ALL','all', { path: '/', expires: 10000 });			
				$.cookie('STYLESHEET_LINKS','TRUE', { path: '/', expires: 10000 });			
				$.cookie('STYLESHEET_NONE', null);
				$('head').append('<link href="'+StyleSheetLinkOne+'" rel="'+StyleSheetRel+'" media="'+StyleSheetMediaOne+'" type="'+StyleSheetType+'" /><link href="'+StyleSheetLinkTwo+'" rel="'+StyleSheetRel+'" media="'+StyleSheetMediaTwo+'" type="'+StyleSheetType+'" />');	
				location.reload();
			}
				$('body').removeClass('small medium large').addClass('small');
				return;
		});
		
		 $("#fldQuestion").click(function(){ $(this).val(''); });
		
		$('.textOnly a').click(function() {
			$.cookie('STYLESHEET_LINKONE', null);
			$.cookie('STYLESHEET_LINKTWO', null);
			$.cookie('STYLESHEET_REL', null);
			$.cookie('STYLESHEET_MEDIAONE', null);
			$.cookie('STYLESHEET_MEDIATWO', null);
			$.cookie('STYLESHEET_TYPE', null);
			$.cookie('STYLESHEET_NONE','none', { path: '/', expires: 10000 });
			$.cookie('STYLESHEET_LINKS','TRUE', { path: '/', expires: 10000 });
			$.cookie('STYLESHEET_ALL', null);
			$('link[rel=stylesheet]').remove();
		});
		
		if($.cookie('STYLESHEET_LINKS')) {
			if($.cookie('STYLESHEET_NONE')) {
				$('link[rel=stylesheet]').remove();
			}
			if($.cookie('STYLESHEET_ALL')) {
				$.cookie('STYLESHEET_ALL', null);
				$('head').append('<link href="'+$.cookie('STYLESHEET_LINKONE')+'" rel="'+$.cookie('STYLESHEET_REL')+'" media="'+$.cookie('STYLESHEET_MEDIAONE')+'" type="'+$.cookie('STYLESHEET_TYPE')+'" /><link href="'+$.cookie('STYLESHEET_LINKTWO')+'" rel="'+$.cookie('STYLESHEET_REL')+'" media="'+$.cookie('STYLESHEET_MEDIATWO')+'" type="'+$.cookie('STYLESHEET_TYPE')+'" />');	
				$('body').removeClass('small medium large').addClass('small');
			}
		}
	});

