jQuery.fn.extend({
  check: function() {
    return this.each(function() { this.checked = true; });
  },
  uncheck: function() {
    return this.each(function() { this.checked = false; });
  }
});

$(document).ready(function(){ 
    $(".haccordion").haccordion();
    $('.toggle').click(overlayToggle);
});

var overlayToggle = function() {
    $('#overlay').toggle();
}

// SeViR Simple Horizontal Accordion @2007
// http://letmehaveblog.blogspot.com
jQuery.fn.extend({
  haccordion: function(params){
    var jQ = jQuery;
    var params = jQ.extend({
      speed: 500,
      headerclass: "header",
      contentclass: "content"
    },params);
    return this.each(function(){
      jQ("."+params.headerclass,this).click(function(){
        var p = jQ(this).parent()[0];
        
		if (p.opened != "undefined"){
          jQ(p.opened).next("div."+params.contentclass).animate({
            width: "0px"
          },params.speed);
        }
		
        p.opened = this;
        jQ(this).next("div."+params.contentclass).animate({
          width: jQ(this).attr("contentwidth")
        }, params.speed);
      });
    });
  }
});