function initAccessibility() { 
	if (!document.getElementById) return;	
	if(objectExists('accessibility')) {
		var accessibility = document.getElementById('accessibility');
		accessibility.className = 'show';	
			
		//add print
		var print = document.getElementById('print');
		print.onclick = function() {window.print()};
		
		//add increase font size
		var increase = document.getElementById('increase');
		increase.onclick = function() {changeFontSize('+');
		    try{
                if ($('related1') != null)
                {
                    if ($('related0').clientHeight > $('related1').clientHeight)
                    {
                        $('related1').style.height = $('related0').clientHeight.toString() + "px"
                    }else if ($('related1').clientHeight > $('related0').clientHeight)
                    {
                        $('related0').style.height = $('related1').clientHeight.toString() + "px"
                    }
                    
                    if ($('related3') != null)
                    {
                        if ($('related2').clientHeight > $('related3').clientHeight)
                        {
                            $('related3').style.height = $('related2').clientHeight.toString() + "px"
                        }else if ($('related3').clientHeight > $('related2').clientHeight)
                        {
                            $('related2').style.height = $('related3').clientHeight.toString() + "px"
                        }
                    }
                }
            }catch(err)
            {
            }
        };
		
		//add decrease font size
		var decrease = document.getElementById('decrease');
		decrease.onclick = function() {changeFontSize('-');
		    try{
		        if ($('related0') != null)
		        {
		            $('related0').style.height = "";
		        }
		        if ($('related1') != null)
		        {
		            $('related1').style.height = "";
		        }
		        if ($('related2') != null)
		        {
		            $('related2').style.height = "";
		        }
		        if ($('related3') != null)
		        {
		            $('related3').style.height = "";
		        }
		    
                if ($('related1') != null)
                {
                    if ($('related0').clientHeight > $('related1').clientHeight)
                    {
                        $('related1').style.height = $('related0').clientHeight.toString() + "px"
                    }else if ($('related1').clientHeight > $('related0').clientHeight)
                    {
                        $('related0').style.height = $('related1').clientHeight.toString() + "px"
                    }
                    
                    if ($('related3') != null)
                    {
                        if ($('related2').clientHeight > $('related3').clientHeight)
                        {
                            $('related3').style.height = $('related2').clientHeight.toString() + "px"
                        }else if ($('related3').clientHeight > $('related2').clientHeight)
                        {
                            $('related2').style.height = $('related3').clientHeight.toString() + "px"
                        }
                    }
                }
            }catch(err)
            {
            }
        };
	}
}

function objectExists(objectID) {
	return (document.getElementById(objectID) != null) ? true : false; 
}

var max = 2.00;
var min = 0.75;
var defaultSize = 1.00;
var variation = 0.25;

function changeFontSize(direction) {
	
	var addAmount = (direction == '+') ? variation : -1*variation;

	var content = document.getElementById('content');
	
	if (content == null)
	{
	    content = document.getElementById('contentwhat');
	}
	
	var curentfontSize;
	if(content.style.fontSize) 
		curentfontSize = parseFloat(content.style.fontSize.replace("em",""));
	else
		curentfontSize = defaultSize;
		
	//alert(curentfontSize+addAmount);
	if(curentfontSize+(addAmount) >= min && curentfontSize+(addAmount) <= max) {
		content.style.fontSize = (curentfontSize+(addAmount))+"em";
		content.style.lineHeight = ((curentfontSize+(addAmount))*1.5)+"em";
	}
}

addLoadEvent(function() {
    setTimeout(initAccessibility, 50);
});