
// Text Only

function textOnly(){
  var cv = Cookie.read('textonly');
  if(cv == 'on'){
    Cookie.write('textonly', 'off', {duration: 7});
    window.location.reload();
  }else{
    Cookie.write('textonly', 'on', {duration: 7});
    window.location.reload();
  }
}

// Change Contrast

function changeContrast(){
  var cv = Cookie.read('contrast');
  if(cv == 'on'){
    Cookie.write('contrast', 'off', {duration: 7});
    window.location.reload();
  }else{
    Cookie.write('contrast', 'on', {duration: 7});
    window.location.reload();
  }
}

// Change Font Size

function changeFont(size){
  Cookie.write('fontsize', size, {duration: 7});
  window.location.reload();
}

// DOM Functions

document.addEvent('domready', function(){

  var url = window.location;
  var sub = $$('#primary ul ul li a');
  
  if(sub.length > 0){
    sub.each(function(el){
      if(el.get('href') == url){
        el.addClass('currentnow');
      }
    });
  }
  
  $$('#content .acc-handle').each(function(el){
    el.addEvent('click', function(){
      var ac = el.getNext('div.acc-content');
      if(ac.getStyle('display') == 'none'){
        ac.setStyle('display', 'block');
      }else{
        ac.setStyle('display', 'none');
      }
    });
  });

});

