﻿/// <reference name="MicrosoftAjax.js"/>
/// <reference path="~/Script/jquery-1.2.6.js"/>

$(document).ready(function() {
    var expanderHtml = "<div style='position:absolute; right:1px; top:1px; height:15px; width:15px; z-index:1000; cursor:pointer; text-align:center; background-color:#EEEEEE; font-weight:bold'>+</div>";

    $(".collapsable").each(function() {

        var content = $(this);

        //wrap the content
        $(this).wrap("<div style='position:relative; background-color:#EEEEEE; min-height:16px; border:solid 0px lime; width:" + content.innerWidth() + "px;'></div>");

        //add an expander
        $(this).before(
            $(expanderHtml).click(function() {

                content.slideToggle('fast');

            }));

    }); //end each func
}); //end ready func
