﻿/* Accessibility supporting  functions */

function changeTextSize(size) {
    if (size) {
        var e = document.getElementById('ctl00_stylesheetTextSize');
        if (e) {
            e.href = '/Style Library/Enable/' + size + '.css';
            $.setCookie('textSize', size, { duration: 30, path: '/' })
        }
    }
}

function toggleContrast() {
    var e = document.getElementById('ctl00_stylesheetContrast');
    var maxImageVar = document.getElementById('enableBackground');
    if (e) {
        var cssRef = e.href;
        if (cssRef.indexOf('contrastOn')>=0) {
            e.href = cssRef.replace('contrastOn', 'contrastOff');
	    if (maxImageVar)
	    {
	       maxImageVar.src='/Style Library/Enable/images/background.jpg';
	    }
        }
        else {
            e.href = cssRef.replace('contrastOff', 'contrastOn');
	    if (maxImageVar)
	    {
	       maxImageVar.src='/Style Library/Enable/images/enableBlack.png';
	    }
        }
        $.setCookie('contrast', e.href, { duration: 30, path: '/' })
    }
}

function setContrast(contrast) {
    if (contrast) {
        var e = document.getElementById('ctl00_stylesheetContrast');
        var maxImageVar = document.getElementById('enableBackground');
        if (e) {
             e.href = contrast;
	     if (contrast.indexOf('contrastOn')>=0) 
	     {
	        if (maxImageVar)
		{
		   maxImageVar.src='/Style Library/Enable/images/enableBlack.png';
		}
	     }	
         }
    }
}




