(function ($, undefined) {
    $.extend(_TMS, {
		presets:{
			diagonalExpand:{"reverseWay":false,"duration":400,"interval":40,"blocksX":12,"blocksY":6,"easing":"easeInQuad","way":"diagonal","anim":"expand"}
		},
        ways: {
            diagonal: function () {
                var opt=this,
					ret = [],
                    h = opt.blocksY,
                    w = opt.blocksX,
                    i = j = n = 0
                    for (i = 0; i < w; i++)
                    for (ret[i] = [], j = 0; j <= i; j++)
                    if (j < h) ret[i].push(opt.matrix[j][i - j])
                    for (i = 1; i < h; i++)
                    for (j = 0, ret[n = ret.length] = []; j < h - i; j++)
                    ret[n].push(opt.matrix[i + j][w - 1 - j])
                    return ret
            }
        },
        anims: {
            expand: function (el, last) {
				var opt=this
                $(el).each(function () {
                    $(this).hide().show(+opt.duration, function () {
                        if (last) opt.afterShow()
                    })
                })
            }
        }
    })
})(jQuery)
