var highContrast = false; 
var highContrastChange = false;
var highContrastCookieName = 'GDAhighContrastCookie';
var highContrastCookie = readCookie(highContrastCookieName);
var contrastRun = function() {
	if(!highContrast)
	{
		$('head').append('<link id="high-contrast-css" rel="stylesheet" href="' + temp_dir + '/high-contrast.css" type="text/css" />');
		highContrastChange = true;
	}
	
	if(highContrast)
	{
		$("link#high-contrast-css").remove();
		highContrastChange = true;
	}
	
	if(highContrastChange)
	{
		highContrast = (highContrast) ? false : true ;
		createCookie(highContrastCookieName, highContrast, 7);
	}
	
	highContrastChange = false;

}

$(document).ready(function() {

	if(highContrastCookie != null)
	{
		if(highContrastCookie === 'true')
		{
			contrastRun();
		}
	}
	$("a[rel='contrast']").click(function(e) {
		contrastRun();
		e.preventDefault();
    });

});
