#2 JavaScript::Eval (size: 32844, repeated: 1) (function(c, h) {
c.fn.jPlayer = function(a) {
var b = typeof a === "string",
d = Array.prototype.slice.call(arguments, 1),
f = this;
a = !b && d.length ? c.extend.apply(null, [true, a].concat(d)) : a;
if (b && a.charAt(0) === "_") return f;
b ? this.each(function() {
var e = c.data(this, "jPlayer"),
g = e && c.isFunction(e[a]) ? e[a].apply(e, d) : e;
if (g !== e && g !== h) {
f = g;
return false
}
}) : this.each(function() {
var e = c.data(this, "jPlayer");
if (e) {
e.option(a || {})._init();
e.option(a || {})
} else c.data(this, "jPlayer", new c.jPlayer(a, this))
});
return f
};
c.jPlayer = function(a, b) {
if (arguments.length) {
this.element = c(b);
this.options = c.extend(true, {}, this.options, a);
var d = this;
this.element.bind("remove.jPlayer", function() {
d.destroy()
});
this._init()
}
};
c.jPlayer.event = {
ready: "jPlayer_ready",
resize: "jPlayer_resize",
error: "jPlayer_error",
warning: "jPlayer_warning",
loadstart: "jPlayer_loadstart",
progress: "jPlayer_progress",
suspend: "jPlayer_suspend",
abort: "jPlayer_abort",
emptied: "jPlayer_emptied",
stalled: "jPlayer_stalled",
play: "jPlayer_play",
pause: "jPlayer_pause",
loadedmetadata: "jPlayer_loadedmetadata",
loadeddata: "jPlayer_loadeddata",
waiting: "jPlayer_waiting",
playing: "jPlayer_playing",
canplay: "jPlayer_canplay",
canplaythrough: "jPlayer_canplaythrough",
seeking: "jPlayer_seeking",
seeked: "jPlayer_seeked",
timeupdate: "jPlayer_timeupdate",
ended: "jPlayer_ended",
ratechange: "jPlayer_ratechange",
durationchange: "jPlayer_durationchange",
volumechange: "jPlayer_volumechange"
};
c.jPlayer.htmlEvent = ["loadstart", "abort", "emptied", "stalled", "loadedmetadata", "loadeddata", "canplaythrough", "ratechange"];
c.jPlayer.pause = function() {
c.each(c.jPlayer.prototype.instances, function(a, b) {
b.data("jPlayer").status.srcSet && b.jPlayer("pause")
})
};
c.jPlayer.timeFormat = {
showHour: false,
showMin: true,
showSec: true,
padHour: false,
padMin: true,
padSec: true,
sepHour: ":",
sepMin: ":",
sepSec: ""
};
c.jPlayer.convertTime = function(a) {
a = new Date(a * 1E3);
var b = a.getUTCHours(),
d = a.getUTCMinutes();
a = a.getUTCSeconds();
b = c.jPlayer.timeFormat.padHour && b < 10 ? "0" + b : b;
d = c.jPlayer.timeFormat.padMin && d < 10 ? "0" + d : d;
a = c.jPlayer.timeFormat.padSec && a < 10 ? "0" + a : a;
return (c.jPlayer.timeFormat.showHour ? b + c.jPlayer.timeFormat.sepHour : "") + (c.jPlayer.timeFormat.showMin ? d + c.jPlayer.timeFormat.sepMin : "") + (c.jPlayer.timeFormat.showSec ? a + c.jPlayer.timeFormat.sepSec : "")
};
c.jPlayer.uaMatch = function(a) {
a = a.toLowerCase();
var b = /(opera)(?:.*version)?[ \/]([\w.]+)/,
d = /(msie) ([\w.]+)/,
f = /(mozilla)(?:.*? rv:([\w.]+))?/;
a = /(webkit)[ \/]([\w.]+)/.exec(a) || b.exec(a) || d.exec(a) || a.indexOf("compatible") < 0 && f.exec(a) || [];
return {
browser: a[1] || "",
version: a[2] || "0"
}
};
c.jPlayer.browser = {};
var m = c.jPlayer.uaMatch(navigator.userAgent);
if (m.browser) {
c.jPlayer.browser[m.browser] = true;
c.jPlayer.browser.version = m.version
}
c.jPlayer.prototype = {
count: 0,
version: {
script: "2.0.0",
needFlash: "2.0.0",
flash: "unknown"
},
options: {
swfPath: "js",
solution: "html, flash",
supplied: "mp3",
preload: "metadata",
volume: 0.8,
muted: false,
backgroundColor: "",
cssSelectorAncestor: "#jp_interface_1",
cssSelector: {
videoPlay: ".jp-video-play",
play: ".jp-play",
pause: ".jp-pause",
stop: ".jp-stop",
seekBar: ".jp-seek-bar",
playBar: ".jp-play-bar",
mute: ".jp-mute",
unmute: ".jp-unmute",
volumeBar: ".jp-volume-bar",
volumeBarValue: ".jp-volume-bar-value",
currentTime: ".jp-current-time",
duration: ".jp-duration"
},
idPrefix: "jp",
errorAlerts: false,
warningAlerts: false
},
instances: {},
status: {
src: "",
media: {},
paused: true,
format: {},
formatType: "",
waitForPlay: true,
waitForLoad: true,
srcSet: false,
video: false,
seekPercent: 0,
currentPercentRelative: 0,
currentPercentAbsolute: 0,
currentTime: 0,
duration: 0
},
_status: {
volume: h,
muted: false,
width: 0,
height: 0
},
internal: {
ready: false,
instance: h,
htmlDlyCmdId: h
},
solution: {
html: true,
flash: true
},
format: {
mp3: {
codec: 'audio/mpeg; codecs="mp3"',
flashCanPlay: true,
media: "audio"
},
m4a: {
codec: 'audio/mp4; codecs="mp4a.40.2"',
flashCanPlay: true,
media: "audio"
},
oga: {
codec: 'audio/ogg; codecs="vorbis"',
flashCanPlay: false,
media: "audio"
},
wav: {
codec: 'audio/wav; codecs="1"',
flashCanPlay: false,
media: "audio"
},
webma: {
codec: 'audio/webm; codecs="vorbis"',
flashCanPlay: false,
media: "audio"
},
m4v: {
codec: 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',
flashCanPlay: true,
media: "video"
},
ogv: {
codec: 'video/ogg; codecs="theora, vorbis"',
flashCanPlay: false,
media: "video"
},
webmv: {
codec: 'video/webm; codecs="vorbis, vp8"',
flashCanPlay: false,
media: "video"
}
},
_init: function() {
var a = this;
this.element.empty();
this.status = c.extend({}, this.status, this._status);
this.internal = c.extend({}, this.internal);
this.formats = [];
this.solutions = [];
this.require = {};
this.htmlElement = {};
this.html = {};
this.html.audio = {};
this.html.video = {};
this.flash = {};
this.css = {};
this.css.cs = {};
this.css.jq = {};
this.status.volume = this._limitValue(this.options.volume, 0, 1);
this.status.muted = this.options.muted;
this.status.width = this.element.css("width");
this.status.height = this.element.css("height");
this.element.css({
"background-color": this.options.backgroundColor
});
c.each(this.options.supplied.toLowerCase().split(","), function(e, g) {
var i = g.replace(/^\s+|\s+$/g, "");
if (a.format[i]) {
var j = false;
c.each(a.formats, function(n, k) {
if (i === k) {
j = true;
return false
}
});
j || a.formats.push(i)
}
});
c.each(this.options.solution.toLowerCase().split(","), function(e, g) {
var i = g.replace(/^\s+|\s+$/g, "");
if (a.solution[i]) {
var j = false;
c.each(a.solutions, function(n, k) {
if (i === k) {
j = true;
return false
}
});
j || a.solutions.push(i)
}
});
this.internal.instance = "jp_" + this.count;
this.instances[this.internal.instance] = this.element;
this.element.attr("id") === "" && this.element.attr("id", this.options.idPrefix + "_jplayer_" + this.count);
this.internal.self = c.extend({}, {
id: this.element.attr("id"),
jq: this.element
});
this.internal.audio = c.extend({}, {
id: this.options.idPrefix + "_audio_" + this.count,
jq: h
});
this.internal.video = c.extend({}, {
id: this.options.idPrefix + "_video_" + this.count,
jq: h
});
this.internal.flash = c.extend({}, {
id: this.options.idPrefix + "_flash_" + this.count,
jq: h,
swf: this.options.swfPath + (this.options.swfPath !== "" && this.options.swfPath.slice(-1) !== "/" ? "/" : "") + "Jplayer.swf"
});
this.internal.poster = c.extend({}, {
id: this.options.idPrefix + "_poster_" + this.count,
jq: h
});
c.each(c.jPlayer.event, function(e, g) {
if (a.options[e] !== h) {
a.element.bind(g + ".jPlayer", a.options[e]);
a.options[e] = h
}
});
this.htmlElement.poster = document.createElement("img");
this.htmlElement.poster.id = this.internal.poster.id;
this.htmlElement.poster.onload = function() {
if (!a.status.video || a.status.waitForPlay) a.internal.poster.jq.show()
};
this.element.append(this.htmlElement.poster);
this.internal.poster.jq = c("#" + this.internal.poster.id);
this.internal.poster.jq.css({
width: this.status.width,
height: this.status.height
});
this.internal.poster.jq.hide();
this.require.audio = false;
this.require.video = false;
c.each(this.formats, function(e, g) {
a.require[a.format[g].media] = true
});
this.html.audio.available = false;
if (this.require.audio) {
this.htmlElement.audio = document.createElement("audio");
this.htmlElement.audio.id = this.internal.audio.id;
this.html.audio.available = !! this.htmlElement.audio.canPlayType
}
this.html.video.available = false;
if (this.require.video) {
this.htmlElement.video = document.createElement("video");
this.htmlElement.video.id = this.internal.video.id;
this.html.video.available = !! this.htmlElement.video.canPlayType
}
this.flash.available = this._checkForFlash(10);
this.html.canPlay = {};
this.flash.canPlay = {};
c.each(this.formats, function(e, g) {
a.html.canPlay[g] = a.html[a.format[g].media].available && "" !== a.htmlElement[a.format[g].media].canPlayType(a.format[g].codec);
a.flash.canPlay[g] = a.format[g].flashCanPlay && a.flash.available
});
this.html.desired = false;
this.flash.desired = false;
c.each(this.solutions, function(e, g) {
if (e === 0) a[g].desired = true;
else {
var i = false,
j = false;
c.each(a.formats, function(n, k) {
if (a[a.solutions[0]].canPlay[k]) if (a.format[k].media === "video") j = true;
else i = true
});
a[g].desired = a.require.audio && !i || a.require.video && !j
}
});
this.html.support = {};
this.flash.support = {};
c.each(this.formats, function(e, g) {
a.html.support[g] = a.html.canPlay[g] && a.html.desired;
a.flash.support[g] = a.flash.canPlay[g] && a.flash.desired
});
this.html.used = false;
this.flash.used = false;
c.each(this.solutions, function(e, g) {
c.each(a.formats, function(i, j) {
if (a[g].support[j]) {
a[g].used = true;
return false
}
})
});
this.html.used || this.flash.used || this._error({
type: c.jPlayer.error.NO_SOLUTION,
context: "{solution:'" + this.options.solution + "', supplied:'" + this.options.supplied + "'}",
message: c.jPlayer.errorMsg.NO_SOLUTION,
hint: c.jPlayer.errorHint.NO_SOLUTION
});
this.html.active = false;
this.html.audio.gate = false;
this.html.video.gate = false;
this.flash.active = false;
this.flash.gate = false;
if (this.flash.used) {
var b = "id=" + escape(this.internal.self.id) + "&vol=" + this.status.volume + "&muted=" + this.status.muted;
if (c.browser.msie && Number(c.browser.version) <= 8) {
var d = '<object id="' + this.internal.flash.id + '"';
d += ' classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"';
d += ' codebase="' + document.URL.substring(0, document.URL.indexOf(":")) + '://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"';
d += ' type="application/x-shockwave-flash"';
d += ' width="0" height="0">';
d += "</object>";
var f = [];
f[0] = '<param name="movie" value="' + this.internal.flash.swf + '" />';
f[1] = '<param name="quality" value="high" />';
f[2] = '<param name="FlashVars" value="' + b + '" />';
f[3] = '<param name="allowScriptAccess" value="always" />';
f[4] = '<param name="bgcolor" value="' + this.options.backgroundColor + '" />';
b = document.createElement(d);
for (d = 0; d < f.length; d++) b.appendChild(document.createElement(f[d]));
this.element.append(b)
} else {
f = '<embed name="' + this.internal.flash.id + '" id="' + this.internal.flash.id + '" src="' + this.internal.flash.swf + '"';
f += ' width="0" height="0" bgcolor="' + this.options.backgroundColor + '"';
f += ' quality="high" FlashVars="' + b + '"';
f += ' allowScriptAccess="always"';
f += ' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
this.element.append(f)
}
this.internal.flash.jq = c("#" + this.internal.flash.id);
this.internal.flash.jq.css({
width: "0px",
height: "0px"
})
}
if (this.html.used) {
if (this.html.audio.available) {
this._addHtmlEventListeners(this.htmlElement.audio, this.html.audio);
this.element.append(this.htmlElement.audio);
this.internal.audio.jq = c("#" + this.internal.audio.id)
}
if (this.html.video.available) {
this._addHtmlEventListeners(this.htmlElement.video, this.html.video);
this.element.append(this.htmlElement.video);
this.internal.video.jq = c("#" + this.internal.video.id);
this.internal.video.jq.css({
width: "0px",
height: "0px"
})
}
}
this.html.used && !this.flash.used && window.setTimeout(function() {
a.internal.ready = true;
a.version.flash = "n/a";
a._trigger(c.jPlayer.event.ready)
}, 100);
c.each(this.options.cssSelector, function(e, g) {
a._cssSelector(e, g)
});
this._updateInterface();
this._updateButtons(false);
this._updateVolume(this.status.volume);
this._updateMute(this.status.muted);
this.css.jq.videoPlay.length && this.css.jq.videoPlay.hide();
c.jPlayer.prototype.count++
},
destroy: function() {
this._resetStatus();
this._updateInterface();
this._seeked();
this.css.jq.currentTime.length && this.css.jq.currentTime.text("");
this.css.jq.duration.length && this.css.jq.duration.text("");
this.status.srcSet && this.pause();
c.each(this.css.jq, function(a, b) {
b.unbind(".jPlayer")
});
this.element.removeData("jPlayer");
this.element.unbind(".jPlayer");
this.element.empty();
this.instances[this.internal.instance] = h
},
enable: function() {},
disable: function() {},
_addHtmlEventListeners: function(a, b) {
var d = this;
a.preload = this.options.preload;
a.muted = this.options.muted;
a.addEventListener("progress", function() {
if (b.gate && !d.status.waitForLoad) {
d._getHtmlStatus(a);
d._updateInterface();
d._trigger(c.jPlayer.event.progress)
}
}, false);
a.addEventListener("timeupdate", function() {
if (b.gate && !d.status.waitForLoad) {
d._getHtmlStatus(a);
d._updateInterface();
d._trigger(c.jPlayer.event.timeupdate)
}
}, false);
a.addEventListener("durationchange", function() {
if (b.gate && !d.status.waitForLoad) {
d.status.duration = this.duration;
d._getHtmlStatus(a);
d._updateInterface();
d._trigger(c.jPlayer.event.durationchange)
}
}, false);
a.addEventListener("play", function() {
if (b.gate && !d.status.waitForLoad) {
d._updateButtons(true);
d._trigger(c.jPlayer.event.play)
}
}, false);
a.addEventListener("playing", function() {
if (b.gate && !d.status.waitForLoad) {
d._updateButtons(true);
d._seeked();
d._trigger(c.jPlayer.event.playing)
}
}, false);
a.addEventListener("pause", function() {
if (b.gate && !d.status.waitForLoad) {
d._updateButtons(false);
d._trigger(c.jPlayer.event.pause)
}
}, false);
a.addEventListener("waiting", function() {
if (b.gate && !d.status.waitForLoad) {
d._seeking();
d._trigger(c.jPlayer.event.waiting)
}
}, false);
a.addEventListener("canplay", function() {
if (b.gate && !d.status.waitForLoad) {
a.volume = d._volumeFix(d.status.volume);
d._trigger(c.jPlayer.event.canplay)
}
}, false);
a.addEventListener("seeking", function() {
if (b.gate && !d.status.waitForLoad) {
d._seeking();
d._trigger(c.jPlayer.event.seeking)
}
}, false);
a.addEventListener("seeked", function() {
if (b.gate && !d.status.waitForLoad) {
d._seeked();
d._trigger(c.jPlayer.event.seeked)
}
}, false);
a.addEventListener("suspend", function() {
if (b.gate && !d.status.waitForLoad) {
d._seeked();
d._trigger(c.jPlayer.event.suspend)
}
}, false);
a.addEventListener("ended", function() {
if (b.gate && !d.status.waitForLoad) {
if (!c.jPlayer.browser.webkit) d.htmlElement.media.currentTime = 0;
d.htmlElement.media.pause();
d._updateButtons(false);
d._getHtmlStatus(a, true);
d._updateInterface();
d._trigger(c.jPlayer.event.ended)
}
}, false);
a.addEventListener("error", function() {
if (b.gate && !d.status.waitForLoad) {
d._updateButtons(false);
d._seeked();
if (d.status.srcSet) {
d.status.waitForLoad = true;
d.status.waitForPlay = true;
d.status.video && d.internal.video.jq.css({
width: "0px",
height: "0px"
});
d._validString(d.status.media.poster) && d.internal.poster.jq.show();
d.css.jq.videoPlay.length && d.css.jq.videoPlay.show();
d._error({
type: c.jPlayer.error.URL,
context: d.status.src,
message: c.jPlayer.errorMsg.URL,
hint: c.jPlayer.errorHint.URL
})
}
}
}, false);
c.each(c.jPlayer.htmlEvent, function(f, e) {
a.addEventListener(this, function() {
b.gate && !d.status.waitForLoad && d._trigger(c.jPlayer.event[e])
}, false)
})
},
_getHtmlStatus: function(a, b) {
var d = 0,
f = 0,
e = 0,
g = 0;
d = a.currentTime;
f = this.status.duration > 0 ? 100 * d / this.status.duration : 0;
if (typeof a.seekable === "object" && a.seekable.length > 0) {
e = this.status.duration > 0 ? 100 * a.seekable.end(a.seekable.length - 1) / this.status.duration : 100;
g = 100 * a.currentTime / a.seekable.end(a.seekable.length - 1)
} else {
e = 100;
g = f
}
if (b) f = g = d = 0;
this.status.seekPercent = e;
this.status.currentPercentRelative = g;
this.status.currentPercentAbsolute = f;
this.status.currentTime = d
},
_resetStatus: function() {
this.status = c.extend({}, this.status, c.jPlayer.prototype.status)
},
_trigger: function(a, b, d) {
a = c.Event(a);
a.jPlayer = {};
a.jPlayer.version = c.extend({}, this.version);
a.jPlayer.status = c.extend(true, {}, this.status);
a.jPlayer.html = c.extend(true, {}, this.html);
a.jPlayer.flash = c.extend(true, {}, this.flash);
if (b) a.jPlayer.error = c.extend({}, b);
if (d) a.jPlayer.warning = c.extend({}, d);
this.element.trigger(a)
},
jPlayerFlashEvent: function(a, b) {
if (a === c.jPlayer.event.ready && !this.internal.ready) {
this.internal.ready = true;
this.version.flash = b.version;
this.version.needFlash !== this.version.flash && this._error({
type: c.jPlayer.error.VERSION,
context: this.version.flash,
message: c.jPlayer.errorMsg.VERSION + this.version.flash,
hint: c.jPlayer.errorHint.VERSION
});
this._trigger(a)
}
if (this.flash.gate) switch (a) {
case c.jPlayer.event.progress:
this._getFlashStatus(b);
this._updateInterface();
this._trigger(a);
break;
case c.jPlayer.event.timeupdate:
this._getFlashStatus(b);
this._updateInterface();
this._trigger(a);
break;
case c.jPlayer.event.play:
this._seeked();
this._updateButtons(true);
this._trigger(a);
break;
case c.jPlayer.event.pause:
this._updateButtons(false);
this._trigger(a);
break;
case c.jPlayer.event.ended:
this._updateButtons(false);
this._trigger(a);
break;
case c.jPlayer.event.error:
this.status.waitForLoad = true;
this.status.waitForPlay = true;
this.status.video && this.internal.flash.jq.css({
width: "0px",
height: "0px"
});
this._validString(this.status.media.poster) && this.internal.poster.jq.show();
this.css.jq.videoPlay.length && this.css.jq.videoPlay.show();
this.status.video ? this._flash_setVideo(this.status.media) : this._flash_setAudio(this.status.media);
this._error({
type: c.jPlayer.error.URL,
context: b.src,
message: c.jPlayer.errorMsg.URL,
hint: c.jPlayer.errorHint.URL
});
break;
case c.jPlayer.event.seeking:
this._seeking();
this._trigger(a);
break;
case c.jPlayer.event.seeked:
this._seeked();
this._trigger(a);
break;
default:
this._trigger(a)
}
return false
},
_getFlashStatus: function(a) {
this.status.seekPercent = a.seekPercent;
this.status.currentPercentRelative = a.currentPercentRelative;
this.status.currentPercentAbsolute = a.currentPercentAbsolute;
this.status.currentTime = a.currentTime;
this.status.duration = a.duration
},
_updateButtons: function(a) {
this.status.paused = !a;
if (this.css.jq.play.length && this.css.jq.pause.length) if (a) {
this.css.jq.play.hide();
this.css.jq.pause.show()
} else {
this.css.jq.play.show();
this.css.jq.pause.hide()
}
},
_updateInterface: function() {
this.css.jq.seekBar.length && this.css.jq.seekBar.width(this.status.seekPercent + "%");
this.css.jq.playBar.length && this.css.jq.playBar.width(this.status.currentPercentRelative + "%");
this.css.jq.currentTime.length && this.css.jq.currentTime.text(c.jPlayer.convertTime(this.status.currentTime));
this.css.jq.duration.length && this.css.jq.duration.text(c.jPlayer.convertTime(this.status.duration))
},
_seeking: function() {
this.css.jq.seekBar.length && this.css.jq.seekBar.addClass("jp-seeking-bg")
},
_seeked: function() {
this.css.jq.seekBar.length && this.css.jq.seekBar.removeClass("jp-seeking-bg")
},
setMedia: function(a) {
var b = this;
this._seeked();
clearTimeout(this.internal.htmlDlyCmdId);
var d = this.html.audio.gate,
f = this.html.video.gate,
e = false;
c.each(this.formats, function(g, i) {
var j = b.format[i].media === "video";
c.each(b.solutions, function(n, k) {
if (b[k].support[i] && b._validString(a[i])) {
var l = k === "html";
if (j) if (l) {
b.html.audio.gate = false;
b.html.video.gate = true;
b.flash.gate = false
} else {
b.html.audio.gate = false;
b.html.video.gate = false;
b.flash.gate = true
} else if (l) {
b.html.audio.gate = true;
b.html.video.gate = false;
b.flash.gate = false
} else {
b.html.audio.gate = false;
b.html.video.gate = false;
b.flash.gate = true
}
if (b.flash.active || b.html.active && b.flash.gate || d === b.html.audio.gate && f === b.html.video.gate) b.clearMedia();
else if (d !== b.html.audio.gate && f !== b.html.video.gate) {
b._html_pause();
b.status.video && b.internal.video.jq.css({
width: "0px",
height: "0px"
});
b._resetStatus()
}
if (j) {
if (l) {
b._html_setVideo(a);
b.html.active = true;
b.flash.active = false
} else {
b._flash_setVideo(a);
b.html.active = false;
b.flash.active = true
}
b.css.jq.videoPlay.length && b.css.jq.videoPlay.show();
b.status.video = true
} else {
if (l) {
b._html_setAudio(a);
b.html.active = true;
b.flash.active = false
} else {
b._flash_setAudio(a);
b.html.active = false;
b.flash.active = true
}
b.css.jq.videoPlay.length && b.css.jq.videoPlay.hide();
b.status.video = false
}
e = true;
return false
}
});
if (e) return false
});
if (e) {
if (this._validString(a.poster)) if (this.htmlElement.poster.src !== a.poster) this.htmlElement.poster.src = a.poster;
else this.internal.poster.jq.show();
else this.internal.poster.jq.hide();
this.status.srcSet = true;
this.status.media = c.extend({}, a);
this._updateButtons(false);
this._updateInterface()
} else {
this.status.srcSet && !this.status.waitForPlay && this.pause();
this.html.audio.gate = false;
this.html.video.gate = false;
this.flash.gate = false;
this.html.active = false;
this.flash.active = false;
this._resetStatus();
this._updateInterface();
this._updateButtons(false);
this.internal.poster.jq.hide();
this.html.used && this.require.video && this.internal.video.jq.css({
width: "0px",
height: "0px"
});
this.flash.used && this.internal.flash.jq.css({
width: "0px",
height: "0px"
});
this._error({
type: c.jPlayer.error.NO_SUPPORT,
context: "{supplied:'" + this.options.supplied + "'}",
message: c.jPlayer.errorMsg.NO_SUPPORT,
hint: c.jPlayer.errorHint.NO_SUPPORT
})
}
},
clearMedia: function() {
this._resetStatus();
this._updateButtons(false);
this.internal.poster.jq.hide();
clearTimeout(this.internal.htmlDlyCmdId);
if (this.html.active) this._html_clearMedia();
else this.flash.active && this._flash_clearMedia()
},
load: function() {
if (this.status.srcSet) if (this.html.active) this._html_load();
else this.flash.active && this._flash_load();
else this._urlNotSetError("load")
},
play: function(a) {
a = typeof a === "number" ? a : NaN;
if (this.status.srcSet) if (this.html.active) this._html_play(a);
else this.flash.active && this._flash_play(a);
else this._urlNotSetError("play")
},
videoPlay: function() {
this.play()
},
pause: function(a) {
a = typeof a === "number" ? a : NaN;
if (this.status.srcSet) if (this.html.active) this._html_pause(a);
else this.flash.active && this._flash_pause(a);
else this._urlNotSetError("pause")
},
pauseOthers: function() {
var a = this;
c.each(this.instances, function(b, d) {
a.element !== d && d.data("jPlayer").status.srcSet && d.jPlayer("pause")
})
},
stop: function() {
if (this.status.srcSet) if (this.html.active) this._html_pause(0);
else this.flash.active && this._flash_pause(0);
else this._urlNotSetError("stop")
},
playHead: function(a) {
a = this._limitValue(a, 0, 100);
if (this.status.srcSet) if (this.html.active) this._html_playHead(a);
else this.flash.active && this._flash_playHead(a);
else this._urlNotSetError("playHead")
},
mute: function() {
this.status.muted = true;
this.html.used && this._html_mute(true);
this.flash.used && this._flash_mute(true);
this._updateMute(true);
this._updateVolume(0);
this._trigger(c.jPlayer.event.volumechange)
},
unmute: function() {
this.status.muted = false;
this.html.used && this._html_mute(false);
this.flash.used && this._flash_mute(false);
this._updateMute(false);
this._updateVolume(this.status.volume);
this._trigger(c.jPlayer.event.volumechange)
},
_updateMute: function(a) {
if (this.css.jq.mute.length && this.css.jq.unmute.length) if (a) {
this.css.jq.mute.hide();
this.css.jq.unmute.show()
} else {
this.css.jq.mute.show();
this.css.jq.unmute.hide()
}
},
volume: function(a) {
a = this._limitValue(a, 0, 1);
this.status.volume = a;
this.html.used && this._html_volume(a);
this.flash.used && this._flash_volume(a);
this.status.muted || this._updateVolume(a);
this._trigger(c.jPlayer.event.volumechange)
},
volumeBar: function(a) {
if (!this.status.muted && this.css.jq.volumeBar) {
var b = this.css.jq.volumeBar.offset();
a = a.pageX - b.left;
b = this.css.jq.volumeBar.width();
this.volume(a / b)
}
},
volumeBarValue: function(a) {
this.volumeBar(a)
},
_updateVolume: function(a) {
this.css.jq.volumeBarValue.length && this.css.jq.volumeBarValue.width(a * 100 + "%")
},
_volumeFix: function(a) {
var b = 0.0010 * Math.random();
return a + (a < 0.5 ? b : -b)
},
_cssSelectorAncestor: function(a, b) {
this.options.cssSelectorAncestor = a;
b && c.each(this.options.cssSelector, function(d, f) {
self._cssSelector(d, f)
})
},
_cssSelector: function(a, b) {
var d = this;
if (typeof b === "string") if (c.jPlayer.prototype.options.cssSelector[a]) {
this.css.jq[a] && this.css.jq[a].length && this.css.jq[a].unbind(".jPlayer");
this.options.cssSelector[a] = b;
this.css.cs[a] = this.options.cssSelectorAncestor + " " + b;
this.css.jq[a] = b ? c(this.css.cs[a]) : [];
this.css.jq[a].length && this.css.jq[a].bind("click.jPlayer", function(f) {
d[a](f);
c(this).blur();
return false
});
b && this.css.jq[a].length !== 1 && this._warning({
type: c.jPlayer.warning.CSS_SELECTOR_COUNT,
context: this.css.cs[a],
message: c.jPlayer.warningMsg.CSS_SELECTOR_COUNT + this.css.jq[a].length + " found for " + a + " method.",
hint: c.jPlayer.warningHint.CSS_SELECTOR_COUNT
})
} else this._warning({
type: c.jPlayer.warning.CSS_SELECTOR_METHOD,
context: a,
message: c.jPlayer.warningMsg.CSS_SELECTOR_METHOD,
hint: c.jPlayer.warningHint.CSS_SELECTOR_METHOD
});
else this._warning({
type: c.jPlayer.warning.CSS_SELECTOR_STRING,
context: b,
message: c.jPlayer.warningMsg.CSS_SELECTOR_STRING,
hint: c.jPlayer.warningHint.CSS_SELECTOR_STRING
})
},
seekBar: function(a) {
if (this.css.jq.seekBar) {
var b = this.css.jq.seekBar.offset();
a = a.pageX - b.left;
b = this.css.jq.seekBar.width();
this.playHead(100 * a / b)
}
},
playBar: function(a) {
this.seekBar(a)
},
currentTime: function() {},
duration: function() {},
option: function(a, b) {
var d = a;
if (arguments.length === 0) return c.extend(true, {}, this.options);
if (typeof a === "string") {
var f = a.split(".");
if (b === h) {
for (var e = c.extend(true, {}, this.options), g = 0; g < f.length; g++) if (e[f[g]] !== h) e = e[f[g]];
else {
this._warning({
type: c.jPlayer.warning.OPTION_KEY,
context: a,
message: c.jPlayer.warningMsg.OPTION_KEY,
hint: c.jPlayer.warningHint.OPTION_KEY
});
return h
}
return e
}
e = d = {};
for (g = 0; g < f.length; g++) if (g < f.length - 1) {
e[f[g]] = {};
e = e[f[g]]
} else e[f[g]] = b
}
this._setOptions(d);
return this
},
_setOptions: function(a) {
var b = this;
c.each(a, function(d, f) {
b._setOption(d, f)
});
return this
},
_setOption: function(a, b) {
var d = this;
switch (a) {
case "cssSelectorAncestor":
this.options[a] = b;
c.each(d.options.cssSelector, function(f, e) {
d._cssSelector(f, e)
});
break;
case "cssSelector":
c.each(b, function(f, e) {
d._cssSelector(f, e)
})
}
return this
},
resize: function(a) {
this.html.active && this._resizeHtml(a);
this.flash.active && this._resizeFlash(a);
this._trigger(c.jPlayer.event.resize)
},
_resizePoster: function() {},
_resizeHtml: function() {},
_resizeFlash: function(a) {
this.internal.flash.jq.css({
width: a.width,
height: a.height
})
},
_html_initMedia: function() {
this.status.srcSet && !this.status.waitForPlay && this.htmlElement.media.pause();
this.options.preload !== "none" && this._html_load();
this._trigger(c.jPlayer.event.timeupdate)
},
_html_setAudio: function(a) {
var b = this;
c.each(this.formats, function(d, f) {
if (b.html.support[f] && a[f]) {
b.status.src = a[f];
b.status.format[f] = true;
b.status.formatType = f;
return false
}
});
this.htmlElement.media = this.htmlElement.audio;
this._html_initMedia()
},
_html_setVideo: function(a) {
var b = this;
c.each(this.formats, function(d, f) {
if (b.html.support[f] && a[f]) {
b.status.src = a[f];
b.status.format[f] = true;
b.status.formatType = f;
return false
}
});
this.htmlElement.media = this.htmlElement.video;
this._html_initMedia()
},
_html_clearMedia: function() {
if (this.htmlElement.media) {
this.htmlElement.media.id === this.internal.video.id && this.internal.video.jq.css({
width: "0px",
height: "0px"
});
this.htmlElement.media.pause();
this.htmlElement.media.src = "";
c.browser.msie && Number(c.browser.version) >= 9 || this.htmlElement.media.load()
}
},
_html_load: function() {
if (this.status.waitForLoad) {
this.status.waitForLoad = false;
this.htmlElement.media.src = this.status.src;
try {
this.htmlElement.media.load()
} catch (a) {}
}
clearTimeout(this.internal.htmlDlyCmdId)
},
_html_play: function(a) {
var b = this;
this._html_load();
this.htmlElement.media.play();
if (!isNaN(a)) try {
this.htmlElement.media.currentTime = a
} catch (d) {
this.internal.htmlDlyCmdId = setTimeout(function() {
b.play(a)
}, 100);
return
}
this._html_checkWaitForPlay()
},
_html_pause: function(a) {
var b = this;
a > 0 ? this._html_load() : clearTimeout(this.internal.htmlDlyCmdId);
this.htmlElement.media.pause();
if (!isNaN(a)) try {
this.htmlElement.media.currentTime = a
} catch (d) {
this.internal.htmlDlyCmdId = setTimeout(function() {
b.pause(a)
}, 100);
return
}
a > 0 && this._html_checkWaitForPlay()
},
_html_playHead: function(a) {
var b = this;
this._html_load();
try {
if (typeof this.htmlElement.media.seekable === "object" && this.htmlElement.media.seekable.length > 0) this.htmlElement.media.currentTime = a * this.htmlElement.media.seekable.end(this.htmlElement.media.seekable.length - 1) / 100;
else if (this.htmlElement.media.duration > 0 && !isNaN(this.htmlElement.media.duration)) this.htmlElement.media.currentTime = a * this.htmlElement.media.duration / 100;
else throw "e";
} catch (d) {
this.internal.htmlDlyCmdId = setTimeout(function() {
b.playHead(a)
}, 100);
return
}
this.status.waitForLoad || this._html_checkWaitForPlay()
},
_html_checkWaitForPlay: function() {
if (this.status.waitForPlay) {
this.status.waitForPlay = false;
this.css.jq.videoPlay.length && this.css.jq.videoPlay.hide();
if (this.status.video) {
this.internal.poster.jq.hide();
this.internal.video.jq.css({
width: this.status.width,
height: this.status.height
})
}
}
},
_html_volume: function(a) {
if (this.html.audio.available) this.htmlElement.audio.volume = a;
if (this.html.video.available) this.htmlElement.video.volume = a
},
_html_mute: function(a) {
if (this.html.audio.available) this.htmlElement.audio.muted = a;
if (this.html.video.available) this.htmlElement.video.muted = a
},
_flash_setAudio: function(a) {
var b = this;
try {
c.each(this.formats, function(f, e) {
if (b.flash.support[e] && a[e]) {
switch (e) {
case "m4a":
b._getMovie().fl_setAudio_m4a(a[e]);
break;
case "mp3":
b._getMovie().fl_setAudio_mp3(a[e])
}
b.status.src = a[e];
b.status.format[e] = true;
b.status.formatType = e;
return false
}
});
if (this.options.preload === "auto") {
this._flash_load();
this.status.waitForLoad = false
}
} catch (d) {
this._flashError(d)
}
},
_flash_setVideo: function(a) {
var b = this;
try {
c.each(this.formats, function(f, e) {
if (b.flash.support[e] && a[e]) {
switch (e) {
case "m4v":
b._getMovie().fl_setVideo_m4v(a[e])
}
b.status.src = a[e];
b.status.format[e] = true;
b.status.formatType = e;
return false
}
});
if (this.options.preload === "auto") {
this._flash_load();
this.status.waitForLoad = false
}
} catch (d) {
this._flashError(d)
}
},
_flash_clearMedia: function() {
this.internal.flash.jq.css({
width: "0px",
height: "0px"
});
try {
this._getMovie().fl_clearMedia()
} catch (a) {
this._flashError(a)
}
},
_flash_load: function() {
try {
this._getMovie().fl_load()
} catch (a) {
this._flashError(a)
}
this.status.waitForLoad = false
},
_flash_play: function(a) {
try {
this._getMovie().fl_play(a)
} catch (b) {
this._flashError(b)
}
this.status.waitForLoad = false;
this._flash_checkWaitForPlay()
},
_flash_pause: function(a) {
try {
this._getMovie().fl_pause(a)
} catch (b) {
this._flashError(b)
}
if (a > 0) {
this.status.waitForLoad = false;
this._flash_checkWaitForPlay()
}
},
_flash_playHead: function(a) {
try {
this._getMovie().fl_play_head(a)
} catch (b) {
this._flashError(b)
}
this.status.waitForLoad || this._flash_checkWaitForPlay()
},
_flash_checkWaitForPlay: function() {
if (this.status.waitForPlay) {
this.status.waitForPlay = false;
this.css.jq.videoPlay.length && this.css.jq.videoPlay.hide();
if (this.status.video) {
this.internal.poster.jq.hide();
this.internal.flash.jq.css({
width: this.status.width,
height: this.status.height
})
}
}
},
_flash_volume: function(a) {
try {
this._getMovie().fl_volume(a)
} catch (b) {
this._flashError(b)
}
},
_flash_mute: function(a) {
try {
this._getMovie().fl_mute(a)
} catch (b) {
this._flashError(b)
}
},
_getMovie: function() {
return document[this.internal.flash.id]
},
_checkForFlash: function(a) {
var b = false,
d;
if (window.ActiveXObject) try {
new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + a);
b = true
} catch (f) {} else if (navigator.plugins && navigator.mimeTypes.length > 0) if (d = navigator.plugins["Shockwave Flash"]) if (navigator.plugins["Shockwave Flash"].description.replace(/.*\s(\d+\.\d+).*/, "$1") >= a) b = true;
return c.browser.msie && Number(c.browser.version) >= 9 ? false : b
},
_validString: function(a) {
return a && typeof a === "string"
},
_limitValue: function(a, b, d) {
return a < b ? b : a > d ? d : a
},
_urlNotSetError: function(a) {
this._error({
type: c.jPlayer.error.URL_NOT_SET,
context: a,
message: c.jPlayer.errorMsg.URL_NOT_SET,
hint: c.jPlayer.errorHint.URL_NOT_SET
})
},
_flashError: function(a) {
this._error({
type: c.jPlayer.error.FLASH,
context: this.internal.flash.swf,
message: c.jPlayer.errorMsg.FLASH + a.message,
hint: c.jPlayer.errorHint.FLASH
})
},
_error: function(a) {
this._trigger(c.jPlayer.event.error, a);
if (this.options.errorAlerts) this._alert("Error!" + (a.message ? "\n\n" + a.message : "") + (a.hint ? "\n\n" + a.hint : "") + "\n\nContext: " + a.context)
},
_warning: function(a) {
this._trigger(c.jPlayer.event.warning, h, a);
if (this.options.errorAlerts) this._alert("Warning!" + (a.message ? "\n\n" + a.message : "") + (a.hint ? "\n\n" + a.hint : "") + "\n\nContext: " + a.context)
},
_alert: function(a) {
alert("jPlayer " + this.version.script + " : id='" + this.internal.self.id + "' : " + a)
}
};
c.jPlayer.error = {
FLASH: "e_flash",
NO_SOLUTION: "e_no_solution",
NO_SUPPORT: "e_no_support",
URL: "e_url",
URL_NOT_SET: "e_url_not_set",
VERSION: "e_version"
};
c.jPlayer.errorMsg = {
FLASH: "jPlayer's Flash fallback is not configured correctly, or a command was issued before the jPlayer Ready event. Details: ",
NO_SOLUTION: "No solution can be found by jPlayer in this browser. Neither HTML nor Flash can be used.",
NO_SUPPORT: "It is not possible to play any media format provided in setMedia() on this browser using your current options.",
URL: "Media URL could not be loaded.",
URL_NOT_SET: "Attempt to issue media playback commands, while no media url is set.",
VERSION: "jPlayer " + c.jPlayer.prototype.version.script + " needs Jplayer.swf version " + c.jPlayer.prototype.version.needFlash + " but found "
};
c.jPlayer.errorHint = {
FLASH: "Check your swfPath option and that Jplayer.swf is there.",
NO_SOLUTION: "Review the jPlayer options: support and supplied.",
NO_SUPPORT: "Video or audio formats defined in the supplied option are missing.",
URL: "Check media URL is valid.",
URL_NOT_SET: "Use setMedia() to set the media URL.",
VERSION: "Update jPlayer files."
};
c.jPlayer.warning = {
CSS_SELECTOR_COUNT: "e_css_selector_count",
CSS_SELECTOR_METHOD: "e_css_selector_method",
CSS_SELECTOR_STRING: "e_css_selector_string",
OPTION_KEY: "e_option_key"
};
c.jPlayer.warningMsg = {
CSS_SELECTOR_COUNT: "The number of methodCssSelectors found did not equal one: ",
CSS_SELECTOR_METHOD: "The methodName given in jPlayer('cssSelector') is not a valid jPlayer method.",
CSS_SELECTOR_STRING: "The methodCssSelector given in jPlayer('cssSelector') is not a String or is empty.",
OPTION_KEY: "The option requested in jPlayer('option') is undefined."
};
c.jPlayer.warningHint = {
CSS_SELECTOR_COUNT: "Check your css selector and the ancestor.",
CSS_SELECTOR_METHOD: "Check your method name.",
CSS_SELECTOR_STRING: "Check your css selector is a string.",
OPTION_KEY: "Check your option name."
}
})(jQuery); |
#5 JavaScript::Eval (size: 3561, repeated: 1) jQuery.easing['jswing'] = jQuery.easing['swing'];
jQuery.extend(jQuery.easing, {
def: 'easeOutQuad',
swing: function(x, t, b, c, d) {
return jQuery.easing[jQuery.easing.def](x, t, b, c, d)
},
easeInQuad: function(x, t, b, c, d) {
return c * (t /= d) * t + b
},
easeOutQuad: function(x, t, b, c, d) {
return -c * (t /= d) * (t - 2) + b
},
easeInOutQuad: function(x, t, b, c, d) {
if ((t /= d / 2) < 1) return c / 2 * t * t + b;
return -c / 2 * ((--t) * (t - 2) - 1) + b
},
easeInCubic: function(x, t, b, c, d) {
return c * (t /= d) * t * t + b
},
easeOutCubic: function(x, t, b, c, d) {
return c * ((t = t / d - 1) * t * t + 1) + b
},
easeInOutCubic: function(x, t, b, c, d) {
if ((t /= d / 2) < 1) return c / 2 * t * t * t + b;
return c / 2 * ((t -= 2) * t * t + 2) + b
},
easeInQuart: function(x, t, b, c, d) {
return c * (t /= d) * t * t * t + b
},
easeOutQuart: function(x, t, b, c, d) {
return -c * ((t = t / d - 1) * t * t * t - 1) + b
},
easeInOutQuart: function(x, t, b, c, d) {
if ((t /= d / 2) < 1) return c / 2 * t * t * t * t + b;
return -c / 2 * ((t -= 2) * t * t * t - 2) + b
},
easeInQuint: function(x, t, b, c, d) {
return c * (t /= d) * t * t * t * t + b
},
easeOutQuint: function(x, t, b, c, d) {
return c * ((t = t / d - 1) * t * t * t * t + 1) + b
},
easeInOutQuint: function(x, t, b, c, d) {
if ((t /= d / 2) < 1) return c / 2 * t * t * t * t * t + b;
return c / 2 * ((t -= 2) * t * t * t * t + 2) + b
},
easeInSine: function(x, t, b, c, d) {
return -c * Math.cos(t / d * (Math.PI / 2)) + c + b
},
easeOutSine: function(x, t, b, c, d) {
return c * Math.sin(t / d * (Math.PI / 2)) + b
},
easeInOutSine: function(x, t, b, c, d) {
return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b
},
easeInExpo: function(x, t, b, c, d) {
return (t == 0) ? b : c * Math.pow(2, 10 * (t / d - 1)) + b
},
easeOutExpo: function(x, t, b, c, d) {
return (t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b
},
easeInOutExpo: function(x, t, b, c, d) {
if (t == 0) return b;
if (t == d) return b + c;
if ((t /= d / 2) < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b;
return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b
},
easeInCirc: function(x, t, b, c, d) {
return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b
},
easeOutCirc: function(x, t, b, c, d) {
return c * Math.sqrt(1 - (t = t / d - 1) * t) + b
},
easeInOutCirc: function(x, t, b, c, d) {
if ((t /= d / 2) < 1) return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b;
return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b
},
easeInElastic: function(x, t, b, c, d) {
var s = 1.70158;
var p = 0;
var a = c;
if (t == 0) return b;
if ((t /= d) == 1) return b + c;
if (!p) p = d * .3;
if (a < Math.abs(c)) {
a = c;
var s = p / 4
} else var s = p / (2 * Math.PI) * Math.asin(c / a);
return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b
},
easeOutElastic: function(x, t, b, c, d) {
var s = 1.70158;
var p = 0;
var a = c;
if (t == 0) return b;
if ((t /= d) == 1) return b + c;
if (!p) p = d * .3;
if (a < Math.abs(c)) {
a = c;
var s = p / 4
} else var s = p / (2 * Math.PI) * Math.asin(c / a);
return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b
},
easeInOutElastic: function(x, t, b, c, d) {
var s = 1.70158;
var p = 0;
var a = c;
if (t == 0) return b;
if ((t /= d / 2) == 2) return b + c;
if (!p) p = d * (.3 * 1.5);
if (a < Math.abs(c)) {
a = c;
var s = p / 4
} else var s = p / (2 * Math.PI) * Math.asin(c / a);
if (t < 1) return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b
},
easeInBack: function(x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
return c * (t /= d) * t * ((s + 1) * t - s) + b
},
easeOutBack: function(x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b
},
easeInOutBack: function(x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
if ((t /= d / 2) < 1) return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;
return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b
},
easeInBounce: function(x, t, b, c, d) {
return c - jQuery.easing.easeOutBounce(x, d - t, 0, c, d) + b
},
easeOutBounce: function(x, t, b, c, d) {
if ((t /= d) < (1 / 2.75)) {
return c * (7.5625 * t * t) + b
} else if (t < (2 / 2.75)) {
return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b
} else if (t < (2.5 / 2.75)) {
return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b
} else {
return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b
}
},
easeInOutBounce: function(x, t, b, c, d) {
if (t < d / 2) return jQuery.easing.easeInBounce(x, t * 2, 0, c, d) * .5 + b;
return jQuery.easing.easeOutBounce(x, t * 2 - d, 0, c, d) * .5 + c * .5 + b
}
}); |
#6 JavaScript::Eval (size: 18119, repeated: 1) var Cufon = (function() {
var m = function() {
return m.replace.apply(null, arguments)
};
var x = m.DOM = {
ready: (function() {
var C = false,
E = {
loaded: 1,
complete: 1
};
var B = [],
D = function() {
if (C) {
return
}
C = true;
for (var F; F = B.shift(); F()) {}
};
if (document.addEventListener) {
document.addEventListener("DOMContentLoaded", D, false);
window.addEventListener("pageshow", D, false)
}
if (!window.opera && document.readyState) {
(function() {
E[document.readyState] ? D() : setTimeout(arguments.callee, 10)
})()
}
if (document.readyState && document.createStyleSheet) {
(function() {
try {
document.body.doScroll("left");
D()
} catch (F) {
setTimeout(arguments.callee, 1)
}
})()
}
q(window, "load", D);
return function(F) {
if (!arguments.length) {
D()
} else {
C ? F() : B.push(F)
}
}
})(),
root: function() {
return document.documentElement || document.body
}
};
var n = m.CSS = {
Size: function(C, B) {
this.value = parseFloat(C);
this.unit = String(C).match(/[a-z%]*$/)[0] || "px";
this.convert = function(D) {
return D / B * this.value
};
this.convertFrom = function(D) {
return D / this.value * B
};
this.toString = function() {
return this.value + this.unit
}
},
addClass: function(C, B) {
var D = C.className;
C.className = D + (D && " ") + B;
return C
},
color: j(function(C) {
var B = {};
B.color = C.replace(/^rgba\((.*?),\s*([\d.]+)\)/, function(E, D, F) {
B.opacity = parseFloat(F);
return "rgb(" + D + ")"
});
return B
}),
fontStretch: j(function(B) {
if (typeof B == "number") {
return B
}
if (/%$/.test(B)) {
return parseFloat(B) / 100
}
return {
"ultra-condensed": 0.5,
"extra-condensed": 0.625,
condensed: 0.75,
"semi-condensed": 0.875,
"semi-expanded": 1.125,
expanded: 1.25,
"extra-expanded": 1.5,
"ultra-expanded": 2
}[B] || 1
}),
getStyle: function(C) {
var B = document.defaultView;
if (B && B.getComputedStyle) {
return new a(B.getComputedStyle(C, null))
}
if (C.currentStyle) {
return new a(C.currentStyle)
}
return new a(C.style)
},
gradient: j(function(F) {
var G = {
id: F,
type: F.match(/^-([a-z]+)-gradient\(/)[1],
stops: []
},
C = F.substr(F.indexOf("(")).match(/([\d.]+=)?(#[a-f0-9]+|[a-z]+\(.*?\)|[a-z]+)/ig);
for (var E = 0, B = C.length, D; E < B; ++E) {
D = C[E].split("=", 2).reverse();
G.stops.push([D[1] || E / (B - 1), D[0]])
}
return G
}),
quotedList: j(function(E) {
var D = [],
C = /\s*((["'])([\s\S]*?[^\\])\2|[^,]+)\s*/g,
B;
while (B = C.exec(E)) {
D.push(B[3] || B[1])
}
return D
}),
recognizesMedia: j(function(G) {
var E = document.createElement("style"),
D, C, B;
E.type = "text/css";
E.media = G;
try {
E.appendChild(document.createTextNode("/**/"))
} catch (F) {}
C = g("head")[0];
C.insertBefore(E, C.firstChild);
D = (E.sheet || E.styleSheet);
B = D && !D.disabled;
C.removeChild(E);
return B
}),
removeClass: function(D, C) {
var B = RegExp("(?:^|\\s+)" + C + "(?=\\s|$)", "g");
D.className = D.className.replace(B, "");
return D
},
supports: function(D, C) {
var B = document.createElement("span").style;
if (B[D] === undefined) {
return false
}
B[D] = C;
return B[D] === C
},
textAlign: function(E, D, B, C) {
if (D.get("textAlign") == "right") {
if (B > 0) {
E = " " + E
}
} else {
if (B < C - 1) {
E += " "
}
}
return E
},
textShadow: j(function(F) {
if (F == "none") {
return null
}
var E = [],
G = {},
B, C = 0;
var D = /(#[a-f0-9]+|[a-z]+\(.*?\)|[a-z]+)|(-?[\d.]+[a-z%]*)|,/ig;
while (B = D.exec(F)) {
if (B[0] == ",") {
E.push(G);
G = {};
C = 0
} else {
if (B[1]) {
G.color = B[1]
} else {
G[["offX", "offY", "blur"][C++]] = B[2]
}
}
}
E.push(G);
return E
}),
textTransform: (function() {
var B = {
uppercase: function(C) {
return C.toUpperCase()
},
lowercase: function(C) {
return C.toLowerCase()
},
capitalize: function(C) {
return C.replace(/\b./g, function(D) {
return D.toUpperCase()
})
}
};
return function(E, D) {
var C = B[D.get("textTransform")];
return C ? C(E) : E
}
})(),
whiteSpace: (function() {
var D = {
inline: 1,
"inline-block": 1,
"run-in": 1
};
var C = /^\s+/,
B = /\s+$/;
return function(H, F, G, E) {
if (E) {
if (E.nodeName.toLowerCase() == "br") {
H = H.replace(C, "")
}
}
if (D[F.get("display")]) {
return H
}
if (!G.previousSibling) {
H = H.replace(C, "")
}
if (!G.nextSibling) {
H = H.replace(B, "")
}
return H
}
})()
};
n.ready = (function() {
var B = !n.recognizesMedia("all"),
E = false;
var D = [],
H = function() {
B = true;
for (var K; K = D.shift(); K()) {}
};
var I = g("link"),
J = g("style");
function C(K) {
return K.disabled || G(K.sheet, K.media || "screen")
}
function G(M, P) {
if (!n.recognizesMedia(P || "all")) {
return true
}
if (!M || M.disabled) {
return false
}
try {
var Q = M.cssRules,
O;
if (Q) {
search: for (var L = 0, K = Q.length; O = Q[L], L < K; ++L) {
switch (O.type) {
case 2:
break;
case 3:
if (!G(O.styleSheet, O.media.mediaText)) {
return false
}
break;
default:
break search
}
}
}
} catch (N) {}
return true
}
function F() {
if (document.createStyleSheet) {
return true
}
var L, K;
for (K = 0; L = I[K]; ++K) {
if (L.rel.toLowerCase() == "stylesheet" && !C(L)) {
return false
}
}
for (K = 0; L = J[K]; ++K) {
if (!C(L)) {
return false
}
}
return true
}
x.ready(function() {
if (!E) {
E = n.getStyle(document.body).isUsable()
}
if (B || (E && F())) {
H()
} else {
setTimeout(arguments.callee, 10)
}
});
return function(K) {
if (B) {
K()
} else {
D.push(K)
}
}
})();
function s(D) {
var C = this.face = D.face,
B = {
"\u0020": 1,
"\u00a0": 1,
"\u3000": 1
};
this.glyphs = D.glyphs;
this.w = D.w;
this.baseSize = parseInt(C["units-per-em"], 10);
this.family = C["font-family"].toLowerCase();
this.weight = C["font-weight"];
this.style = C["font-style"] || "normal";
this.viewBox = (function() {
var F = C.bbox.split(/\s+/);
var E = {
minX: parseInt(F[0], 10),
minY: parseInt(F[1], 10),
maxX: parseInt(F[2], 10),
maxY: parseInt(F[3], 10)
};
E.width = E.maxX - E.minX;
E.height = E.maxY - E.minY;
E.toString = function() {
return [this.minX, this.minY, this.width, this.height].join(" ")
};
return E
})();
this.ascent = -parseInt(C.ascent, 10);
this.descent = -parseInt(C.descent, 10);
this.height = -this.ascent + this.descent;
this.spacing = function(L, N, E) {
var O = this.glyphs,
M, K, G, P = [],
F = 0,
J = -1,
I = -1,
H;
while (H = L[++J]) {
M = O[H] || this.missingGlyph;
if (!M) {
continue
}
if (K) {
F -= G = K[H] || 0;
P[I] -= G
}
F += P[++I] = ~~ (M.w || this.w) + N + (B[H] ? E : 0);
K = M.k
}
P.total = F;
return P
}
}
function f() {
var C = {},
B = {
oblique: "italic",
italic: "oblique"
};
this.add = function(D) {
(C[D.style] || (C[D.style] = {}))[D.weight] = D
};
this.get = function(H, I) {
var G = C[H] || C[B[H]] || C.normal || C.italic || C.oblique;
if (!G) {
return null
}
I = {
normal: 400,
bold: 700
}[I] || parseInt(I, 10);
if (G[I]) {
return G[I]
}
var E = {
1: 1,
99: 0
}[I % 100],
K = [],
F, D;
if (E === undefined) {
E = I > 400
}
if (I == 500) {
I = 400
}
for (var J in G) {
if (!k(G, J)) {
continue
}
J = parseInt(J, 10);
if (!F || J < F) {
F = J
}
if (!D || J > D) {
D = J
}
K.push(J)
}
if (I < F) {
I = F
}
if (I > D) {
I = D
}
K.sort(function(M, L) {
return (E ? (M >= I && L >= I) ? M < L : M > L : (M <= I && L <= I) ? M > L : M < L) ? -1 : 1
});
return G[K[0]]
}
}
function r() {
function D(F, G) {
if (F.contains) {
return F.contains(G)
}
return F.compareDocumentPosition(G) & 16
}
function B(G) {
var F = G.relatedTarget;
if (!F || D(this, F)) {
return
}
C(this, G.type == "mouseover")
}
function E(F) {
C(this, F.type == "mouseenter")
}
function C(F, G) {
setTimeout(function() {
var H = d.get(F).options;
m.replace(F, G ? h(H, H.hover) : H, true)
}, 10)
}
this.attach = function(F) {
if (F.onmouseenter === undefined) {
q(F, "mouseover", B);
q(F, "mouseout", B)
} else {
q(F, "mouseenter", E);
q(F, "mouseleave", E)
}
}
}
function u() {
var C = [],
D = {};
function B(H) {
var E = [],
G;
for (var F = 0; G = H[F]; ++F) {
E[F] = C[D[G]]
}
return E
}
this.add = function(F, E) {
D[F] = C.push(E) - 1
};
this.repeat = function() {
var E = arguments.length ? B(arguments) : C,
F;
for (var G = 0; F = E[G++];) {
m.replace(F[0], F[1], true)
}
}
}
function A() {
var D = {},
B = 0;
function C(E) {
return E.cufid || (E.cufid = ++B)
}
this.get = function(E) {
var F = C(E);
return D[F] || (D[F] = {})
}
}
function a(B) {
var D = {},
C = {};
this.extend = function(E) {
for (var F in E) {
if (k(E, F)) {
D[F] = E[F]
}
}
return this
};
this.get = function(E) {
return D[E] != undefined ? D[E] : B[E]
};
this.getSize = function(F, E) {
return C[F] || (C[F] = new n.Size(this.get(F), E))
};
this.isUsable = function() {
return !!B
}
}
function q(C, B, D) {
if (C.addEventListener) {
C.addEventListener(B, D, false)
} else {
if (C.attachEvent) {
C.attachEvent("on" + B, function() {
return D.call(C, window.event)
})
}
}
}
function v(C, B) {
var D = d.get(C);
if (D.options) {
return C
}
if (B.hover && B.hoverables[C.nodeName.toLowerCase()]) {
b.attach(C)
}
D.options = B;
return C
}
function j(B) {
var C = {};
return function(D) {
if (!k(C, D)) {
C[D] = B.apply(null, arguments)
}
return C[D]
}
}
function c(F, E) {
var B = n.quotedList(E.get("fontFamily").toLowerCase()),
D;
for (var C = 0; D = B[C]; ++C) {
if (i[D]) {
return i[D].get(E.get("fontStyle"), E.get("fontWeight"))
}
}
return null
}
function g(B) {
return document.getElementsByTagName(B)
}
function k(C, B) {
return C.hasOwnProperty(B)
}
function h() {
var C = {},
B, F;
for (var E = 0, D = arguments.length; B = arguments[E], E < D; ++E) {
for (F in B) {
if (k(B, F)) {
C[F] = B[F]
}
}
}
return C
}
function o(E, M, C, N, F, D) {
var K = document.createDocumentFragment(),
H;
if (M === "") {
return K
}
var L = N.separate;
var I = M.split(p[L]),
B = (L == "words");
if (B && t) {
if (/^\s/.test(M)) {
I.unshift("")
}
if (/\s$/.test(M)) {
I.push("")
}
}
for (var J = 0, G = I.length; J < G; ++J) {
H = z[N.engine](E, B ? n.textAlign(I[J], C, J, G) : I[J], C, N, F, D, J < G - 1);
if (H) {
K.appendChild(H)
}
}
return K
}
function l(D, M) {
var C = D.nodeName.toLowerCase();
if (M.ignore[C]) {
return
}
var E = !M.textless[C];
var B = n.getStyle(v(D, M)).extend(M);
var F = c(D, B),
G, K, I, H, L, J;
if (!F) {
return
}
for (G = D.firstChild; G; G = I) {
K = G.nodeType;
I = G.nextSibling;
if (E && K == 3) {
if (H) {
H.appendData(G.data);
D.removeChild(G)
} else {
H = G
}
if (I) {
continue
}
}
if (H) {
D.replaceChild(o(F, n.whiteSpace(H.data, B, H, J), B, M, G, D), H);
H = null
}
if (K == 1) {
if (G.firstChild) {
if (G.nodeName.toLowerCase() == "cufon") {
z[M.engine](F, null, B, M, G, D)
} else {
arguments.callee(G, M)
}
}
J = G
}
}
}
var t = " ".split(/\s+/).length == 0;
var d = new A();
var b = new r();
var y = new u();
var e = false;
var z = {},
i = {},
w = {
autoDetect: false,
engine: null,
forceHitArea: false,
hover: false,
hoverables: {
a: true
},
ignore: {
applet: 1,
canvas: 1,
col: 1,
colgroup: 1,
head: 1,
iframe: 1,
map: 1,
optgroup: 1,
option: 1,
script: 1,
select: 1,
style: 1,
textarea: 1,
title: 1,
pre: 1
},
printable: true,
selector: (window.Sizzle || (window.jQuery &&
function(B) {
return jQuery(B)
}) || (window.dojo && dojo.query) || (window.Ext && Ext.query) || (window.YAHOO && YAHOO.util && YAHOO.util.Selector && YAHOO.util.Selector.query) || (window.$$ &&
function(B) {
return $$(B)
}) || (window.$ &&
function(B) {
return $(B)
}) || (document.querySelectorAll &&
function(B) {
return document.querySelectorAll(B)
}) || g),
separate: "words",
textless: {
dl: 1,
html: 1,
ol: 1,
table: 1,
tbody: 1,
thead: 1,
tfoot: 1,
tr: 1,
ul: 1
},
textShadow: "none"
};
var p = {
words: /\s/.test("\u00a0") ? /[^\S\u00a0]+/ : /\s+/,
characters: "",
none: /^/
};
m.now = function() {
x.ready();
return m
};
m.refresh = function() {
y.repeat.apply(y, arguments);
return m
};
m.registerEngine = function(C, B) {
if (!B) {
return m
}
z[C] = B;
return m.set("engine", C)
};
m.registerFont = function(D) {
if (!D) {
return m
}
var B = new s(D),
C = B.family;
if (!i[C]) {
i[C] = new f()
}
i[C].add(B);
return m.set("fontFamily", '"' + C + '"')
};
m.replace = function(D, C, B) {
C = h(w, C);
if (!C.engine) {
return m
}
if (!e) {
n.addClass(x.root(), "cufon-active cufon-loading");
n.ready(function() {
n.addClass(n.removeClass(x.root(), "cufon-loading"), "cufon-ready")
});
e = true
}
if (C.hover) {
C.forceHitArea = true
}
if (C.autoDetect) {
delete C.fontFamily
}
if (typeof C.textShadow == "string") {
C.textShadow = n.textShadow(C.textShadow)
}
if (typeof C.color == "string" && /^-/.test(C.color)) {
C.textGradient = n.gradient(C.color)
} else {
delete C.textGradient
}
if (!B) {
y.add(D, arguments)
}
if (D.nodeType || typeof D == "string") {
D = [D]
}
n.ready(function() {
for (var F = 0, E = D.length; F < E; ++F) {
var G = D[F];
if (typeof G == "string") {
m.replace(C.selector(G), C, true)
} else {
l(G, C)
}
}
});
return m
};
m.set = function(B, C) {
w[B] = C;
return m
};
return m
})();
Cufon.registerEngine("vml", (function() {
var e = document.namespaces;
if (!e) {
return
}
e.add("cvml", "urn:schemas-microsoft-com:vml");
e = null;
var b = document.createElement("cvml:shape");
b.style.behavior = "url(#default#VML)";
if (!b.coordsize) {
return
}
b = null;
var h = (document.documentMode || 0) < 8;
document.write(('<style type="text/css">cufoncanvas{text-indent:0;}@media screen{cvml\\:shape,cvml\\:rect,cvml\\:fill,cvml\\:shadow{behavior:url(#default#VML);display:block;antialias:true;position:absolute;}cufoncanvas{position:absolute;text-align:left;}cufon{display:inline-block;position:relative;vertical-align:' + (h ? "middle" : "text-bottom") + ";}cufon cufontext{position:absolute;left:-10000in;font-size:1px;}a cufon{cursor:pointer}}@media print{cufon cufoncanvas{display:none;}}</style>").replace(/;/g, "!important;"));
function c(i, j) {
return a(i, /(?:em|ex|%)$|^[a-z-]+$/i.test(j) ? "1em" : j)
}
function a(l, m) {
if (m === "0") {
return 0
}
if (/px$/i.test(m)) {
return parseFloat(m)
}
var k = l.style.left,
j = l.runtimeStyle.left;
l.runtimeStyle.left = l.currentStyle.left;
l.style.left = m.replace("%", "em");
var i = l.style.pixelLeft;
l.style.left = k;
l.runtimeStyle.left = j;
return i
}
function f(l, k, j, n) {
var i = "computed" + n,
m = k[i];
if (isNaN(m)) {
m = k.get(n);
k[i] = m = (m == "normal") ? 0 : ~~j.convertFrom(a(l, m))
}
return m
}
var g = {};
function d(p) {
var q = p.id;
if (!g[q]) {
var n = p.stops,
o = document.createElement("cvml:fill"),
i = [];
o.type = "gradient";
o.angle = 180;
o.focus = "0";
o.method = "sigma";
o.color = n[0][1];
for (var m = 1, l = n.length - 1; m < l; ++m) {
i.push(n[m][0] * 100 + "% " + n[m][1])
}
o.colors = i.join(",");
o.color2 = n[l][1];
g[q] = o
}
return g[q]
}
return function(b, G, Y, C, K, e, W) {
var n = (G === null);
if (n) {
G = K.alt
}
var I = b.viewBox;
var p = Y.computedFontSize || (Y.computedFontSize = new Cufon.CSS.Size(c(e, Y.get("fontSize")) + "px", b.baseSize));
var y, q;
if (n) {
y = K;
q = K.firstChild
} else {
y = document.createElement("cufon");
y.className = "cufon cufon-vml";
y.alt = G;
q = document.createElement("cufoncanvas");
y.appendChild(q);
if (C.printable) {
var Z = document.createElement("cufontext");
Z.appendChild(document.createTextNode(G));
y.appendChild(Z)
}
if (!W) {
y.appendChild(document.createElement("cvml:shape"))
}
}
var g = y.style;
var R = q.style;
var l = p.convert(I.height),
af = Math.ceil(l);
var V = af / l;
var P = V * Cufon.CSS.fontStretch(Y.get("fontStretch"));
var U = I.minX,
T = I.minY;
R.height = af;
R.top = Math.round(p.convert(T - b.ascent));
R.left = Math.round(p.convert(U));
g.height = p.convert(b.height) + "px";
var F = Y.get("color");
var i = Cufon.CSS.textTransform(G, Y).split("");
var L = b.spacing(i, f(e, Y, p, "letterSpacing"), f(e, Y, p, "wordSpacing"));
if (!L.length) {
return null
}
var k = L.total;
var x = -U + k + (I.width - L[L.length - 1]);
var j = p.convert(x * P),
X = Math.round(j);
var O = x + "," + I.height,
m;
var J = "r" + O + "ns";
var u = C.textGradient && d(C.textGradient);
var o = b.glyphs,
S = 0;
var H = C.textShadow;
var bc = -1,
aa = 0,
w;
while (w = i[++bc]) {
var D = o[i[bc]] || b.missingGlyph,
v;
if (!D) {
continue
}
if (n) {
v = q.childNodes[aa];
while (v.firstChild) {
v.removeChild(v.firstChild)
}
} else {
v = document.createElement("cvml:shape");
q.appendChild(v)
}
v.stroked = "f";
v.coordsize = O;
v.coordorigin = m = (U - S) + "," + T;
v.path = (D.d ? "m" + D.d + "xe" : "") + "m" + m + J;
v.fillcolor = F;
if (u) {
v.appendChild(u.cloneNode(false))
}
var bd = v.style;
bd.width = X;
bd.height = af;
if (H) {
var s = H[0],
r = H[1];
var B = Cufon.CSS.color(s.color),
z;
var N = document.createElement("cvml:shadow");
N.on = "t";
N.color = B.color;
N.offset = s.offX + "," + s.offY;
if (r) {
z = Cufon.CSS.color(r.color);
N.type = "double";
N.color2 = z.color;
N.offset2 = r.offX + "," + r.offY
}
N.opacity = B.opacity || (z && z.opacity) || 1;
v.appendChild(N)
}
S += L[aa++]
}
var M = v.nextSibling,
t, A;
if (C.forceHitArea) {
if (!M) {
M = document.createElement("cvml:rect");
M.stroked = "f";
M.className = "cufon-vml-cover";
t = document.createElement("cvml:fill");
t.opacity = 0;
M.appendChild(t);
q.appendChild(M)
}
A = M.style;
A.width = X;
A.height = af
} else {
if (M) {
q.removeChild(M)
}
}
g.width = Math.max(Math.ceil(p.convert(k * P)), 0);
if (h) {
var Q = Y.computedYAdjust;
if (Q === undefined) {
var E = Y.get("lineHeight");
if (E == "normal") {
E = "1em"
} else {
if (!isNaN(E)) {
E += "em"
}
}
Y.computedYAdjust = Q = 0.5 * (a(e, E) - parseFloat(g.height))
}
if (Q) {
g.marginTop = Math.ceil(Q) + "px";
g.marginBottom = Q + "px"
}
}
return y
}
})());
Cufon.registerEngine("canvas", (function() {
var b = document.createElement("canvas");
if (!b || !b.getContext || !b.getContext.apply) {
return
}
b = null;
var a = Cufon.CSS.supports("display", "inline-block");
var e = !a && (document.compatMode == "BackCompat" || /frameset|transitional/i.test(document.doctype.publicId));
var f = document.createElement("style");
f.type = "text/css";
f.appendChild(document.createTextNode(("cufon{text-indent:0;}@media screen,projection{cufon{display:inline;display:inline-block;position:relative;vertical-align:middle;" + (e ? "" : "font-size:1px;line-height:1px;") + "}cufon cufontext{display:-moz-inline-box;display:inline-block;width:0;height:0;overflow:hidden;text-indent:-10000in;}" + (a ? "cufon canvas{position:relative;}" : "cufon canvas{position:absolute;}") + "}@media print{cufon{padding:0;}cufon canvas{display:none;}}").replace(/;/g, "!important;")));
document.getElementsByTagName("head")[0].appendChild(f);
function d(p, h) {
var n = 0,
m = 0;
var g = [],
o = /([mrvxe])([^a-z]*)/g,
k;
generate: for (var j = 0; k = o.exec(p); ++j) {
var l = k[2].split(",");
switch (k[1]) {
case "v":
g[j] = {
m: "bezierCurveTo",
a: [n + ~~l[0], m + ~~l[1], n + ~~l[2], m + ~~l[3], n += ~~l[4], m += ~~l[5]]
};
break;
case "r":
g[j] = {
m: "lineTo",
a: [n += ~~l[0], m += ~~l[1]]
};
break;
case "m":
g[j] = {
m: "moveTo",
a: [n = ~~l[0], m = ~~l[1]]
};
break;
case "x":
g[j] = {
m: "closePath"
};
break;
case "e":
break generate
}
h[g[j].m].apply(h, g[j].a)
}
return g
}
function c(m, k) {
for (var j = 0, h = m.length; j < h; ++j) {
var g = m[j];
k[g.m].apply(k, g.a)
}
}
return function(V, w, P, t, C, W) {
var k = (w === null);
if (k) {
w = C.getAttribute("alt")
}
var A = V.viewBox;
var m = P.getSize("fontSize", V.baseSize);
var B = 0,
O = 0,
N = 0,
u = 0;
var z = t.textShadow,
L = [];
if (z) {
for (var U = z.length; U--;) {
var F = z[U];
var K = m.convertFrom(parseFloat(F.offX));
var I = m.convertFrom(parseFloat(F.offY));
L[U] = [K, I];
if (I < B) {
B = I
}
if (K > O) {
O = K
}
if (I > N) {
N = I
}
if (K < u) {
u = K
}
}
}
var Z = Cufon.CSS.textTransform(w, P).split("");
var E = V.spacing(Z, ~~m.convertFrom(parseFloat(P.get("letterSpacing")) || 0), ~~m.convertFrom(parseFloat(P.get("wordSpacing")) || 0));
if (!E.length) {
return null
}
var h = E.total;
O += A.width - E[E.length - 1];
u += A.minX;
var s, n;
if (k) {
s = C;
n = C.firstChild
} else {
s = document.createElement("cufon");
s.className = "cufon cufon-canvas";
s.setAttribute("alt", w);
n = document.createElement("canvas");
s.appendChild(n);
if (t.printable) {
var S = document.createElement("cufontext");
S.appendChild(document.createTextNode(w));
s.appendChild(S)
}
}
var b = s.style;
var H = n.style;
var j = m.convert(A.height);
var Y = Math.ceil(j);
var M = Y / j;
var G = M * Cufon.CSS.fontStretch(P.get("fontStretch"));
var J = h * G;
var Q = Math.ceil(m.convert(J + O - u));
var o = Math.ceil(m.convert(A.height - B + N));
n.width = Q;
n.height = o;
H.width = Q + "px";
H.height = o + "px";
B += A.minY;
H.top = Math.round(m.convert(B - V.ascent)) + "px";
H.left = Math.round(m.convert(u)) + "px";
var r = Math.max(Math.ceil(m.convert(J)), 0) + "px";
if (a) {
b.width = r;
b.height = m.convert(V.height) + "px"
} else {
b.paddingLeft = r;
b.paddingBottom = (m.convert(V.height) - 1) + "px"
}
var X = n.getContext("2d"),
D = j / A.height;
X.scale(D, D * M);
X.translate(-u, -B);
X.save();
function T() {
var x = V.glyphs,
a, l = -1,
g = -1,
y;
X.scale(G, 1);
while (y = Z[++l]) {
var a = x[Z[l]] || V.missingGlyph;
if (!a) {
continue
}
if (a.d) {
X.beginPath();
if (a.code) {
c(a.code, X)
} else {
a.code = d("m" + a.d, X)
}
X.fill()
}
X.translate(E[++g], 0)
}
X.restore()
}
if (z) {
for (var U = z.length; U--;) {
var F = z[U];
X.save();
X.fillStyle = F.color;
X.translate.apply(X, L[U]);
T()
}
}
var q = t.textGradient;
if (q) {
var v = q.stops,
p = X.createLinearGradient(0, A.minY, 0, A.maxY);
for (var U = 0, R = v.length; U < R; ++U) {
p.addColorStop.apply(p, v[U])
}
X.fillStyle = p
} else {
X.fillStyle = P.get("color")
}
T();
return s
}
})()); |