    jQuery(document).ready(function(){    
        $("#MainContent #Accordion li div.Accordion").css("display", "none");
        $("#MainContent #Accordion li.selected div.Accordion").css("display", "block");
        if (getCookie("CSSBodyFontSize") != null) {    
            $("body").css({ fontSize:getCookie("CSSBodyFontSize") + "%" });
        }
    	$("#Accordion a.header").click(function() {
		    $(this).next().slideToggle("slow");
            $(this).toggleClass("selected");        
            return false;
	    }).next();
	
	$("#PageToolsIncreaseFontSize a").click(function() {
	  return changeBodyFontSize(1.15);	  
	}).next();
	
	$("#PageToolsDecreaseFontSize a").click(function() {
	  return changeBodyFontSize(0.8695652);	  
	}).next();
		
	function changeBodyFontSize(factor) {	
	  var strCurrentFontSize;	  	  
	  var decNewFontSize;
	  strCurrentFontSize = document.getElementsByTagName("body").item(0).style.fontSize; 
	  if (strCurrentFontSize == "") {
	       strCurrentFontSize = "66.66%"	  
	  }	  
	  decNewFontSize = strCurrentFontSize.replace("%","") * factor;
	  if (decNewFontSize >= 100 | decNewFontSize <= 45)  {
	    return false;
	  }	    	  
      $("body").css({ fontSize:decNewFontSize + "%" });
      setCookie("CSSBodyFontSize",decNewFontSize,365);
      return false;		
	}
	
	function setCookie(name,value,days){
	    if(days){
    		var date = new Date();
		    date.setTime(date.getTime()+(days*24*60*60*1000));
		    var expires = "; expires="+date.toGMTString();
	    }else{
    		var expires = "";
    	}
    	document.cookie = name+"="+value+expires+"; path=/";
    }
    
    function getCookie(name){
    	name += "=";
	    var s = document.cookie.split("; ");
    	for(var i=0; i<s.length; i++){
	    	var c = s[i];
		    if(c.indexOf(name) == 0){
    			return unescape(c.substring(name.length,c.length));
		    }
    	}
    	return null;
    }
	
});

