function swapstylesheet()
{
	var defaultSheet = 'font-medium';
	/*Save the new size in a cookie*/
	function clearStates(){
		$('#font-small').parent().removeClass('swapstylesheet-indicator-active');
		$('#font-medium').parent().removeClass('swapstylesheet-indicator-active');
		$('#font-large').parent().removeClass('swapstylesheet-indicator-active');
		$('#font-xlarge').parent().removeClass('swapstylesheet-indicator-active');
		
		$('#font-small').parent().addClass('swapstylesheet-indicator');
		$('#font-medium').parent().addClass('swapstylesheet-indicator');
		$('#font-large').parent().addClass('swapstylesheet-indicator');
		$('#font-xlarge').parent().addClass('swapstylesheet-indicator');
		}
	function setState(sheet){
		clearStates();
		$('#' + sheet).parent().removeClass('swapstylesheet-indicator');
		$('#' + sheet).parent().addClass('swapstylesheet-indicator-active');
	}
	function saveState(curSheet) {	var date = new Date(); date.setTime(date.getTime()+(7*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); document.cookie = "stylesheetswapper"+"="+curSheet+expires+"; path=/"; }
	function doswap(sheet){$('#style-sheet').attr('href', '/assets/css/' + sheet + '.css'); setState(sheet);}
	function getCookie(c_name) { if (document.cookie.length>0) { c_start=document.cookie.indexOf(c_name + "="); if (c_start!=-1) { c_start=c_start + c_name.length+1; c_end=document.cookie.indexOf(";",c_start); if (c_end==-1) c_end=document.cookie.length; return unescape(document.cookie.substring(c_start,c_end)); } } return ""; }
		
		
	$('#swapstylesheet span a').click( function(){
		
		var selectedSheet = $(this).attr('id');
		/*now save the selected value into a cookie*/
		saveState(selectedSheet);
		var savedSheet = getCookie('stylesheetswapper');
	
	
		if (savedSheet!="") {
			doswap(savedSheet);
		}else{
			doswap(defaultSheet);
		}
		
		// tigger the page to resize, this is used when the assessment is embedded using Javascript.
		$('body').trigger('resizeFrame', false);
		
	});
}