﻿///<reference path="jquery-1.2.6-vsdoc.js"/>

//we're just going to use jQuery instead of the $ due to a conflict with using $ in BlogEngine
jQuery(function(){ 

    //collapse the tables at first.
 /*   jQuery("#archive > h2").each(function(idx){
        jQuery(this).next("table:eq(0)").toggle();
    });
 */   
    
    jQuery("#archive > h2").hover(function(e){    
        jQuery(this).css("cursor", "pointer").css("_cursor", "hand").attr("title", "Expand/Collapse category");
    }, function(e) {
        jQuery(this).css("cursor", "default");
        
    });
    
    jQuery("#archive > h2 > a").click(function(e){
        e.stopPropagation();
    });
    
    jQuery("#archive > h2").click(function(e){
        jQuery(this).next("table:eq(0)").toggle();
    });
    
    jQuery("#archive > ul > li > a").each(function(idx){
        jQuery(this).click(function(e){        
            jQuery("#archive table[summary='" + jQuery(this).text() + "']").show("slow").find("td.title").width("100%");
        });
    });
    
    
    //highlight the rows in the archive table
    jQuery("#archive table").each(function(idx){
        jQuery("tr:not(:first)", jQuery(this)).hover(function(e){
            jQuery(this).addClass("highlight");         
        },function(e){
            jQuery(this).removeClass("highlight");
        });
    });
});