$(document).ready(function() {
  $('div#welcome ul:not(:first)').hide();
  $('div#welcome h4').click(function() {
	$('div#welcome ul').toggle('500');
	return false;
  });
});

$(document).ready(function() {
  $('div#categorylist ul:not(:first)').hide();
  $('h4#navcategories').click(function() {
	$('div#categorylist ul').toggle('500');
	return false;
  });
});

$(document).ready(function() {
  $('div#brandlist ul').hide();
  $('h4#navbrands').click(function() {
	$('div#brandlist ul').toggle('500');
	return false;
  });
});

$(document).ready(function() {
  $('div#beta div.c3 ul').hide();
  $('div#beta div.c3 h2').click(function() {
	$('div#beta div.c3 ul').toggle('500');
	return false;
  });
});


$(document).ready(function() {
  $('div#beta div.c4 div#allbrands:not(:first)').hide();
  $('div#beta div.c4 h2').click(function() {
	$('div#beta div.c4 div#allbrands').toggle('500');
	return false;
  });
});

$(document).ready(function(){
  $(".additionalimages img").fadeTo("slow", 0.6); // This sets the opacity of the thumbs to fade down to 60% when the page loads

  $(".additionalimages img").hover(function(){
   $(this).fadeTo("fast", 1.0); // This should set the opacity to 100% on hover
      },function(){
     $(this).fadeTo("slow", 0.6); // This should set the opacity back to 60% on mouseout
  });
});

$(window).bind('load', function() {
    var preload = new Array();
    $(".hover").each(function() {
        s = $(this).attr("src").replace(/\.(.+)$/i, "_on.$1");
        preload.push(s)
    });
    var img = document.createElement('img');
    $(img).bind('load', function() {
        if(preload[0]) {
            this.src = preload.shift();
        }
    }).trigger('load');
});

$(document).ready(function() {

    /* general hovers */
    $(".hover").each(function() {
        if ($(this).attr("src").match(/_on\.(.+)$/i)) {
            $(this).removeClass("hover");
        }
    });
    $(".hover").hover(function() {
        s = $(this).attr("src").replace(/\.(.+)$/i, "_on.$1");
        $(this).attr("src", s);
    }, function() {
        s = $(this).attr("src").replace(/_on\.(.+)$/i, ".$1");
        $(this).attr("src", s);
    });
});


/*$(document).ready(function(){
  $("div#alpha ul:not(:first)").hide();
  $("div#alpha h4.flash-replaced").click(function(){
  $("div#alpha ul:visible").slideUp("slow");
    $(this).parent().next().slideDown("slow");
return false;
});
})*/

/*jQuery('#alpha').accordion({ 
    active: false, 
    header: '.flash-replaced', 
    navigation: true, 
    event: 'mouseover', 
    fillSpace: true, 
    animated: 'easeslide' 
});*/
