").addClass(this.getClass("grid")).css({
position: "absolute",
left: 0,
top: 0,
right: 0,
width: d,
display: "table"
}),
f = 0,
e = 0,
h = 0,
g = 0;
do {
var p = b("
").addClass(this.getClass("gridRow")).css("display", "table-row");
do {
var m = b("
").addClass(this.getClass("gridCell")).width(d).height(n);
l && b(m).height(n / l);
k && b(m).width(d / k);
o && b(m).css({
"background-image": "url(" + o + ")",
"background-position": (-e + "px ") + (-f + "px ")
});
b(m).css({
display: b.support.radioValue ? "inline-block" : "table-cell",
position: "relative"
});
p.append(m);
e += k ? (d / k) : d;
g++
} while (g < k);
c.append(p);
f += l ? (n / l) : n;
h++;
g = 0
} while (h < l);
return (c)
},
sortRandom: function(d) {
var c = [],
f = this.getEffectList();
for (var e = 0; e < f.length; e++) {
if (f[e].indexOf(d) !== -1 && f[e] !== d) {
c.push(f[e])
}
}
return (c[Math.floor(Math.random() * c.length)])
},
effect: {
random: function(e, c, f) {
var d = this.getEffectList();
return (this.effect[d[Math.floor(Math.random() * d.length)]].call(this, e, c, f))
},
selectRandom: function(g, e, h) {
var c = this.getOption("select");
if (c) {
c = c.split(",");
if (c.length) {
var d = c[Math.floor(Math.random() * c.length)],
f = this.getEffectList();
if (b.inArray(d, f) !== -1) {
return (this.effect[d].call(this, g, e, h))
}
}
}
return (this.effect.random.call(this, g, e, h))
},
randomSlide: function(d, c, e) {
return (this.effect[this.sortRandom("slide")].call(this, d, c, e))
},
randomStrips: function(d, c, e) {
return (this.effect[this.sortRandom("strips")].call(this, d, c, e))
},
fade: function(d, c, e) {
b(d).fadeOut(e.speed);
this.saveStyle(c, ["position"]);
b(c).css("position", "absolute").fadeIn(e.speed, b.proxy(function(f) {
this.restoreStyle(f)
}, this, c))
},
slideX: function(e, d, f, c) {
this.saveStyle(d, ["position", "top", "z-index", "height"]);
this.saveStyle(e, ["margin-left"]);
b(d).css({
position: "absolute",
top: 0,
height: f.current.offset,
"z-index": (parseInt(b(e).css("z-index")) - 1)
}).show();
b(e).stop().animate({
"margin-left": c
}, f.speed, b.proxy(function(g, h) {
b(g).hide();
this.restoreStyle(h);
this.restoreStyle(g)
}, this, e, d))
},
slideY: function(e, d, f, g) {
this.saveStyle(d, ["position", g, "z-index", "height"]);
var c = {
css: {
position: "absolute",
height: f.current.offset,
"z-index": (parseInt(b(d).css("z-index")) + 1)
},
animate: {}
};
c.css[g] = -f.current.height;
c.animate[g] = f.current.height - f.current.offset;
b(d).css(c.css).show().animate(c.animate, f.speed, b.proxy(function(h, i) {
b(h).hide();
this.restoreStyle(i)
}, this, e, d))
},
slideUp: function(d, c, e) {
this.effect.slideY.call(this, d, c, e, "bottom")
},
slideDown: function(d, c, e) {
this.effect.slideY.call(this, d, c, e, "top")
},
slideLeft: function(d, c, e) {
this.effect.slideX.call(this, d, c, e, -e.current.width)
},
slideRight: function(d, c, e) {
this.effect.slideX.call(this, d, c, e, e.current.width)
},
strips: function(f, d, g, c, e) {
if (!b(f).find("img").length || !b(d).find("img").length) {
return (this.effect.random.call(this, f, d, g))
}
var h = b(d).css("z-index");
this.saveStyle(f, ["z-index"]);
b(f).find("img, div").hide().end().append(c).css("z-index", parseInt(h) + 2);
this.saveStyle(d, ["position", "z-index"]);
b(d).css({
position: "absolute",
"z-index": parseInt(h) + 1
}).show();
b(e).each(function(j) {
b(this).delay(((g.speed / g.cell) * j) / 2).animate({
opacity: 0
}, (g.speed / g.cell) * ((g.cell / 2)))
});
setTimeout(b.proxy(function(j, k, i) {
i.remove();
b(j).find("img, div").show();
this.restoreStyle(j);
this.restoreStyle(k)
}, this, f, d, c), g.speed)
},
stripsRight: function(f, e, g) {
var d = g.current,
c = this.createGrid(d.width, d.height, g.cell, 0, d.src);
this.effect.strips.call(this, f, e, g, c, b(c).find(this.getClass("gridCell", true)))
},
stripsLeft: function(g, f, h) {
var e = h.current,
d = this.createGrid(e.width, e.height, h.cell, 0, e.src),
c = b(b(d).find(this.getClass("gridCell", true)).toArray().reverse());
this.effect.strips.call(this, g, f, h, d, c)
},
eraser: function(g, e, h) {
if (!b(g).find("img").length || !b(e).find("img").length) {
return (this.effect.random.call(this, g, e, h))
}
this.setOption("speed", h.speed * ((h.cell / h.row) / 2));
var f = this.getOption("speed"),
d = h.current,
c = this.createGrid(d.width, d.height, h.cell, 0, d.src),
i = b(e).css("z-index");
this.saveStyle(g, ["z-index"]);
b(g).find("img, div").hide().end().append(c).css("z-index", parseInt(i) + 2);
this.saveStyle(e, ["position", "z-index"]);
b(e).css({
position: "absolute",
"z-index": parseInt(i) + 1
}).show();
b(c).find(this.getClass("gridCell", true)).each(function(l) {
var k = {},
j = (l % 2) ? "top" : "bottom";
k[j] = -d.height;
b(this).delay(((f / h.cell) * l) / 2).animate(k, (f / h.cell) * ((h.cell / 2)))
});
setTimeout(b.proxy(function(k, l, j, m) {
j.remove();
b(k).css("z-index", 1).find("img, div").show();
this.restoreStyle(k);
this.restoreStyle(l);
this.setOption("speed", m.speed)
}, this, g, e, c, h), f)
}
}
};
b(function() {
b(".jis-trigger").jis()
})
})(jQuery);