﻿///<reference path = "jquery-1.3.2.js"/>
$(window).load(function() {
    $("#Cato .t2").append("<img src = 'image/subtract.jpg'/><span class = 'viewspan'>View Less</span>");
   // $("#Cato .t2").find("span").css("text-decoration", "underline");
    $("#Cato .t2").css("cursor", "pointer");
    //  $("#Cato .t2").eq(0).children("img").attr("src", "image/subtract.jpg");
    $("#Cato .t2").bind("click", function() {
        var next = [];
        var m = $(this).next("div");
        while (m && !m.hasClass("t2") && !m.hasClass("none")) {
            next.push(m);
            m = m.next("div");
        };
        var t = $(this).find("img");
        if (t.attr("src").indexOf("add.jpg") >= 0) {
            t.attr("src", "image/subtract.jpg");
            $(this).find("span").html("View Less");
            for (var i = 0; i < next.length; i++) {
                next[i].show();
            }
        }
        else {
            t.attr("src", "image/add.jpg");
            $(this).find("span").html("View More");
            for (var i = 0; i < next.length; i++) {
                next[i].hide();
            }
        }
    });
});

