// 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",
      contentwidth: 250
    },params);
    return this.each(function(){
      jQ("."+params.headerclass,this).click(function(){
       if ($("#about").is(':hidden')){
        var p = jQ(this).parent()[0];
        if (p.opened != "undefined"){
          jQ(p.opened).next("div."+params.contentclass).animate({
            width: "0px",
	    height: "600px"
          },params.speed);
        }
        if (p.opened == this){
          p.opened = "undefined";
        }
        else {
        p.opened = this;
          jQ(this).next("div."+params.contentclass).animate({
                width: params.contentwidth + "px",
          }, params.speed, function() { //);
	jQ(p.opened).next("div."+params.contentclass).css('height','auto'); });
        }
       }
      });
    });
  }
});

$(document).ready(function() {
	$("#content-navigation").haccordion(
		{
			headerclass: "category-header",
			contentclass: "category-list",
			contentwidth: 260
		}
	);

	$("a#aboutlink").click(function() {
		$(".category-list").animate({ width: "0px" }, 700, function(){

			if ($("#about").is(':hidden')){
				$(".category-list").animate({ width: "0px" }, 700);
				$("#about").show();
				$("#about").animate(
					{ left: "-=395" },
					700
					);
				$("a#aboutlink").html("[x] close");
			}
		});		
		if ($("#about").is(':visible')) {
			$("#about").animate(
				{ left: "+=395" },
				700,
				function() {
					$("#about").hide();
				});
			$("a#aboutlink").html("Biography");
		}
	});

	$("a#contentlink").click();
});

