
var Slider = new Class({ Implements: [Options], numNav: new Array(), timer: null, isSliding: 0, direction: 1, options: { slideTimer: 6000, slideFirst: true, orientation: "horizontal", fade: true, isPaused: false, pauseOnHover: true, transitionTime: 1100, transitionType: "cubic:out", container: null, items: null, itemNum: 0, slideNav: null, slideNavActive: false, slideNavType: "numbers", playBtn: null, prevBtn: null, nextBtn: null }, initialize: function(b) { var a = this; this.setOptions(b); a.options.container.setStyle("overflow", "hidden"); if (a.options.items.length > 1) { if (a.options.isPaused == false && a.options.pauseOnHover == true) { a.options.container.addEvents({ mouseenter: function() { a.pauseIt() }, mouseleave: function() { a.pauseIt() } }) } if (a.options.playBtn != null) { a.options.playBtn.addEvents({ click: function() { a.pauseIt("playBtn") } }) } if (a.options.prevBtn && a.options.nextBtn) { a.options.prevBtn.addEvents({ click: function() { if (a.isSliding == 0) { if (a.options.isPaused == false) { $clear(a.timer); a.timer = a.slideIt.periodical(a.options.slideTimer, a, null) } a.direction = 0; a.slideIt() } } }); this.options.nextBtn.addEvents({ click: function() { if (a.isSliding == 0) { if (a.options.isPaused == false) { $clear(a.timer); a.timer = a.slideIt.periodical(a.options.slideTimer, a, null) } a.direction = 1; a.slideIt() } } }) } if (a.options.slideNav != null) { a.options.slideNavActive = true } a.options.items.each(function(e, d) { e.setStyle("position", "absolute"); var c = e.getSize().y; var k = e.getSize().x; if (a.options.orientation == "vertical") { e.setStyle("top", (-1 * c)); e.setStyle("left", 0) } else { if (a.options.orientation == "none") { e.setStyle("left", 0); e.setStyle("top", 0); e.set("opacity", 0) } else { e.setStyle("left", (-1 * k)) } } if (a.options.slideNavActive == true) { if (a.options.slideNavType == "titles" && $(e).getElement("h3") != null) { var j = $(e).getElement("h3").get("html") } else { if (a.options.slideNavType == "thumbs" && $(e).getElement("img.thumb") != null) { var j = '<img src="' + $(e).getElement("img.thumb").get("src") + '" />' } else { var j = (d + 1) } } var h = new Element("li", { id: "num" + d }); var g = new Element("a", { "class": "numbtn", html: j }); h.adopt(g); a.options.slideNav.adopt(h); a.numNav.push(g); g.set("morph", { duration: 100, transition: Fx.Transitions.linear, link: "ignore" }); g.addEvents({ click: function() { a.numPress(d) } }); if (d == a.options.itemNum) { var f = a.numNav[d]; f.addClass("active") } } }) } else { if (a.options.playBtn != null) { a.options.playBtn.setStyle("display", "none") } if (a.options.prevBtn != null) { a.options.prevBtn.setStyle("display", "none") } if (a.options.nextBtn != null) { a.options.nextBtn.setStyle("display", "none") } if (a.options.slideNav != null) { a.options.slideNav.setStyle("display", "none") } } }, start: function() { var a = this; a.slideIt(a.options.itemNum, 0); if (a.options.items.length > 1 && a.options.isPaused == false) { a.timer = a.slideIt.periodical(a.options.slideTimer, a, null); if (a.options.playBtn) { if (a.options.playBtn.get("text") != "") { a.options.playBtn.set("text", "Pause") } a.options.playBtn.addClass("active") } } else { if (a.options.playBtn && a.options.playBtn.get("text") != "") { a.options.playBtn.set("text", "Play") } } }, slideIt: function(j, e) { var k = this; var m = k.options.items[k.options.itemNum]; if (k.options.slideNavActive == true) { var i = k.numNav[k.options.itemNum] } if (j != null) { if (k.options.itemNum != j) { if (k.options.itemNum > j) { k.direction = 0 } else { k.direction = 1 } k.options.itemNum = j } } else { k.changeIndex() } var f = k.options.items[k.options.itemNum]; if (k.direction == 0) { var c = k.options.container.getSize().x; var a = (-1 * f.getSize().x); var b = k.options.container.getSize().y; var l = (-1 * f.getSize().y) } else { var c = (-1 * k.options.container.getSize().x); var a = f.getSize().x; var b = (-1 * k.options.container.getSize().y); var l = f.getSize().y } if (k.options.slideNavActive == true) { var h = k.numNav[k.options.itemNum]; h.addClass("active") } var g = new Fx.Morph(f, { duration: k.options.transitionTime, transition: k.options.transitionType, link: "ignore", onStart: function() { k.isSliding = 1 }, onComplete: function() { k.isSliding = 0 } }); if (k.options.items.length > 1) { if (k.options.itemNum == 0 & e == 0 & k.options.slideFirst == false) { g.start({ opacity: [1, 1], left: [0, 0], top: [0, 0] }) } if (k.options.orientation == "vertical") { if (k.options.fade == true) { g.start({ opacity: [0, 1], top: [l, 0] }) } else { g.start({ top: [l, 0] }) } } else { if (k.options.orientation == "none") { g.start({ opacity: [0, 1] }) } else { if (k.options.fade == true) { g.start({ opacity: [0, 1], left: [a, 0] }) } else { g.start({ left: [a, 0] }) } } } if (m != f) { var d = new Fx.Morph(m, { duration: k.options.transitionTime, transition: k.options.transitionType, link: "ignore" }); if (k.options.slideNavActive == true) { i.removeClass("active") } if (k.options.orientation == "vertical") { if (k.options.fade == true) { d.start({ opacity: [0], top: [(b)] }) } else { d.start({ top: [(b)] }) } } else { if (k.options.orientation == "none") { d.start({ opacity: [1, 0] }) } else { if (k.options.fade == true) { d.start({ opacity: [0], left: [(c)] }) } else { d.start({ left: [(c)] }) } } } } } }, pauseIt: function(b) { var a = this; if (a.isSliding == 0 && a.options.items.length > 1) { if (a.options.isPaused == false) { a.options.isPaused = true; $clear(a.timer); if (a.options.playBtn != null) { if (a.options.playBtn.get("text") != "") { a.options.playBtn.set("text", "Play") } a.options.playBtn.removeClass("active") } } else { a.options.isPaused = false; a.slideIt(); a.timer = a.slideIt.periodical(a.options.slideTimer, this, null); if (a.options.playBtn != null) { if (a.options.playBtn.get("text") != "") { a.options.playBtn.set("text", "Pause") } a.options.playBtn.addClass("active") } } } if (b == "playBtn" && a.options.isPaused == true) { a.options.container.removeEvents("mouseenter"); a.options.container.removeEvents("mouseleave") } else { if (b == "playBtn" && a.options.isPaused == false) { a.options.container.removeEvents("mouseenter"); a.options.container.removeEvents("mouseleave"); a.options.container.addEvents({ mouseenter: function() { a.pauseIt() }, mouseleave: function() { a.pauseIt() } }) } else { } } }, changeIndex: function() { var a = this; var b = a.options.items.length; if (a.direction == 1) { if (a.options.itemNum < (b - 1)) { a.options.itemNum++ } else { a.options.itemNum = 0 } } else { if (a.direction == 0) { if (a.options.itemNum > 0) { a.options.itemNum-- } else { a.options.itemNum = (b - 1) } } } }, numPress: function(b) { var a = this; if ((a.isSliding == 0) && (a.options.itemNum != b)) { if (a.options.isPaused == false) { $clear(a.timer); a.timer = a.slideIt.periodical(a.options.slideTimer, this, null) } a.slideIt(b) } } }); var MenuMatic = new Class({ Implements: Options, options: { id: "nav", subMenusContainerId: "subMenusContainer", effect: "slide & fade", duration: 600, physics: Fx.Transitions.Pow.easeOut, hideDelay: 1000, stretchMainMenu: false, matchWidthMode: false, orientation: "horizontal", direction: { x: "right", y: "down" }, tweakInitial: { x: 0, y: 0 }, tweakSubsequent: { x: 0, y: 0 }, center: false, opacity: 95, mmbFocusedClassName: null, mmbClassName: null, killDivider: null, fixHasLayoutBug: false, onHideAllSubMenusNow_begin: (function() { }), onHideAllSubMenusNow_complete: (function() { }), onInit_begin: (function() { }), onInit_complete: (function() { }) }, hideAllMenusTimeout: null, allSubMenus: [], subMenuZindex: 1, initialize: function(d) { this.setOptions(d); this.options.onInit_begin(); if (this.options.opacity > 99) { this.options.opacity = 99.9 } this.options.opacity = this.options.opacity / 100; Element.implement({ getId: function() { if (!this.id) { var e = this.get("tag") + "-" + $time(); while ($(e)) { e = this.get("tag") + "-" + $time() } this.id = e } return this.id } }); this.options.direction.x = this.options.direction.x.toLowerCase(); this.options.direction.y = this.options.direction.y.toLowerCase(); if (this.options.direction.x === "right") { this.options.direction.xInverse = "left" } else { if (this.options.direction.x === "left") { this.options.direction.xInverse = "right" } } if (this.options.direction.y === "up") { this.options.direction.yInverse = "down" } else { if (this.options.direction.y === "down") { this.options.direction.yInverse = "up" } } var a = $(this.options.id).getElements("a"); a.each(function(e, f) { e.store("parentLinks", e.getParent().getParents("li").getFirst("a")); e.store("parentLinks", e.retrieve("parentLinks").erase(e.retrieve("parentLinks").getFirst())); e.store("childMenu", e.getNext("ul") || e.getNext("ol")); theSubMenuType = "subsequent"; if ($(e.getParent("ul") || e.getParent("ol")).id === this.options.id) { theSubMenuType = "initial" } e.store("subMenuType", theSubMenuType); if (theSubMenuType === "initial" && $(e.getNext("ul") || e.getNext("ol"))) { e.addClass("mainMenuParentBtn") } else { if ($(e.getNext("ul") || e.getNext("ol"))) { e.addClass("subMenuParentBtn") } } } .bind(this)); var b = new Element("div", { id: this.options.subMenusContainerId }).inject($(document.body), "bottom"); $(this.options.id).getElements("ul, ol").each(function(e, f) { new Element("div", { "class": "smOW" }).inject(b).grab(e) } .bind(this)); b.getElements("a").set("tabindex", "-1"); a.each(function(e, g) { if (!e.retrieve("childMenu")) { return } e.store("childMenu", e.retrieve("childMenu").getParent("div")); this.allSubMenus.include(e.retrieve("childMenu")); e.store("parentSubMenus", e.retrieve("parentLinks").retrieve("childMenu")); var f = new MenuMaticSubMenu(this.options, this, e) } .bind(this)); var c = $(this.options.id).getElements("a").filter(function(e, f) { return !e.retrieve("childMenu") }); c.each(function(e, f) { e.addEvents({ mouseenter: function(g) { this.hideAllSubMenusNow(); if (this.options.mmbClassName && this.options.mmbFocusedClassName) { $(e).retrieve("btnMorph", new Fx.Morph(e, { duration: (this.options.duration / 2), transition: this.options.physics, link: "cancel" })).start(this.options.mmbFocusedClassName) } } .bind(this), focus: function(g) { this.hideAllSubMenusNow(); if (this.options.mmbClassName && this.options.mmbFocusedClassName) { $(e).retrieve("btnMorph", new Fx.Morph(e, { duration: (this.options.duration / 2), transition: this.options.physics, link: "cancel" })).start(this.options.mmbFocusedClassName) } } .bind(this), mouseleave: function(g) { if (this.options.mmbClassName && this.options.mmbFocusedClassName) { $(e).retrieve("btnMorph", new Fx.Morph(e, { duration: (this.options.duration * 5), transition: this.options.physics, link: "cancel" })).start(this.options.mmbClassName) } } .bind(this), blur: function(g) { if (this.options.mmbClassName && this.options.mmbFocusedClassName) { $(e).retrieve("btnMorph", new Fx.Morph(e, { duration: (this.options.duration * 5), transition: this.options.physics, link: "cancel" })).start(this.options.mmbClassName) } } .bind(this), keydown: function(g) { var h = new Event(g); if (g.key === "up" || g.key === "down" || g.key === "left" || g.key === "right") { g.stop() } if (g.key === "left" && this.options.orientation === "horizontal" || g.key === "up" && this.options.orientation === "vertical") { if (e.getParent("li").getPrevious("li")) { e.getParent("li").getPrevious("li").getFirst("a").focus() } else { e.getParent("li").getParent().getLast("li").getFirst("a").focus() } } else { if (g.key === "right" && this.options.orientation === "horizontal" || g.key === "down" && this.options.orientation === "vertical") { if (e.getParent("li").getNext("li")) { e.getParent("li").getNext("li").getFirst("a").focus() } else { e.getParent("li").getParent().getFirst("li").getFirst("a").focus() } } } } .bind(this) }) }, this); this.stretch(); this.killDivider(); this.center(); this.fixHasLayoutBug(); this.options.onInit_complete() }, fixHasLayoutBug: function() { if (Browser.Engine.trident && this.options.fixHasLayoutBug) { $(this.options.id).getParents().setStyle("zoom", 1); $(this.options.id).setStyle("zoom", 1); $(this.options.id).getChildren().setStyle("zoom", 1); $(this.options.subMenusContainerId).setStyle("zoom", 1); $(this.options.subMenusContainerId).getChildren().setStyle("zoom", 1) } }, center: function() { if (!this.options.center) { return } $(this.options.id).setStyles({ left: "50%", "margin-left": -($(this.options.id).getSize().x / 2) }) }, stretch: function() { if (this.options.stretchMainMenu && this.options.orientation === "horizontal") { var c = parseFloat($(this.options.id).getCoordinates().width); var b = 0; var d = $(this.options.id).getElements("a"); d.setStyles({ "padding-left": 0, "padding-right": 0 }); d.each(function(e, f) { b += e.getSize().x } .bind(this)); if (c < b) { return } var a = (c - b) / d.length; d.each(function(e, f) { e.setStyle("width", e.getSize().x + a) } .bind(this)); d.getLast().setStyle("width", d.getLast().getSize().x - 1) } }, killDivider: function() { if (this.options.killDivider && this.options.killDivider.toLowerCase() === "first") { $($(this.options.id).getElements("li")[0]).setStyles({ background: "none" }) } else { if (this.options.killDivider && this.options.killDivider.toLowerCase() === "last") { $($(this.options.id).getElements("li").getLast()).setStyles({ background: "none" }) } } }, hideAllSubMenusNow: function() { this.options.onHideAllSubMenusNow_begin(); $clear(this.hideAllMenusTimeout); $$(this.allSubMenus).fireEvent("hide"); this.options.onHideAllSubMenusNow_complete() } }); var MenuMaticSubMenu = new Class({ Implements: Options, Extends: MenuMatic, options: { onSubMenuInit_begin: (function(a) { }), onSubMenuInit_complete: (function(a) { }), onMatchWidth_begin: (function(a) { }), onMatchWidth_complete: (function(a) { }), onHideSubMenu_begin: (function(a) { }), onHideSubMenu_complete: (function(a) { }), onHideOtherSubMenus_begin: (function(a) { }), onHideOtherSubMenus_complete: (function(a) { }), onHideAllSubMenus_begin: (function(a) { }), onHideAllSubMenus_complete: (function(a) { }), onPositionSubMenu_begin: (function(a) { }), onPositionSubMenu_complete: (function(a) { }), onShowSubMenu_begin: (function(a) { }), onShowSubMenu_complete: (function(a) { }) }, root: null, btn: null, hidden: true, myEffect: null, initialize: function(d, a, c) { this.setOptions(d); this.root = a; this.btn = c; this.childMenu = this.btn.retrieve("childMenu"); this.subMenuType = this.btn.retrieve("subMenuType"); this.childMenu = this.btn.retrieve("childMenu"); this.parentSubMenus = $$(this.btn.retrieve("parentSubMenus")); this.parentLinks = $$(this.btn.retrieve("parentLinks")); this.parentSubMenu = $(this.parentSubMenus[0]); if (this.parentSubMenu) { this.parentSubMenu = this.parentSubMenu.retrieve("class") } this.childMenu.store("class", this); this.btn.store("class", this); this.childMenu.store("status", "closed"); this.options.onSubMenuInit_begin(this); this.childMenu.addEvent("hide", function() { this.hideSubMenu() } .bind(this)); this.childMenu.addEvent("show", function() { this.showSubMenu() } .bind(this)); if (this.options.effect) { this.myEffect = new Fx.Morph($(this.childMenu).getFirst(), { duration: this.options.duration, transition: this.options.physics, link: "cancel" }) } if (this.options.effect === "slide" || this.options.effect === "slide & fade") { if (this.subMenuType == "initial" && this.options.orientation === "horizontal") { this.childMenu.getFirst().setStyle("margin-top", "0") } else { this.childMenu.getFirst().setStyle("margin-left", "0") } } else { if (this.options.effect === "fade" || this.options.effect === "slide & fade") { this.childMenu.getFirst().setStyle("opacity", 0) } } if (this.options.effect != "fade" && this.options.effect != "slide & fade") { this.childMenu.getFirst().setStyle("opacity", this.options.opacity) } var b = $(this.childMenu).getElements("a").filter(function(e, f) { return !e.retrieve("childMenu") }); b.each(function(e, f) { $(e).addClass("subMenuBtn"); e.addEvents({ mouseenter: function(g) { this.childMenu.fireEvent("show"); this.cancellHideAllSubMenus(); this.hideOtherSubMenus() } .bind(this), focus: function(g) { this.childMenu.fireEvent("show"); this.cancellHideAllSubMenus(); this.hideOtherSubMenus() } .bind(this), mouseleave: function(g) { this.cancellHideAllSubMenus(); this.hideAllSubMenus() } .bind(this), blur: function(g) { this.cancellHideAllSubMenus(); this.hideAllSubMenus() } .bind(this), keydown: function(g) { var h = new Event(g); if (g.key === "up" || g.key === "down" || g.key === "left" || g.key === "right" || g.key === "tab") { g.stop() } if (g.key === "up") { if (e.getParent("li").getPrevious("li")) { e.getParent("li").getPrevious("li").getFirst("a").focus() } else { if (this.options.direction.y === "down") { this.btn.focus() } else { if (this.options.direction.y === "up") { e.getParent("li").getParent().getLast("li").getFirst("a").focus() } } } } else { if (g.key === "down") { if (e.getParent("li").getNext("li")) { e.getParent("li").getNext("li").getFirst("a").focus() } else { if (this.options.direction.y === "down") { e.getParent("li").getParent().getFirst("li").getFirst("a").focus() } else { if (this.options.direction.y === "up") { this.btn.focus() } } } } else { if (g.key === this.options.direction.xInverse) { this.btn.focus() } } } } .bind(this) }) }, this); $(this.btn).removeClass("subMenuBtn"); if (this.subMenuType == "initial") { this.btn.addClass("mainParentBtn") } else { this.btn.addClass("subParentBtn") } $(this.btn).addEvents({ mouseenter: function(e) { this.cancellHideAllSubMenus(); this.hideOtherSubMenus(); this.showSubMenu(); if (this.subMenuType === "initial" && this.options.mmbClassName && this.options.mmbFocusedClassName) { $(this.btn).retrieve("btnMorph", new Fx.Morph($(this.btn), { duration: (this.options.duration / 2), transition: this.options.physics, link: "cancel" })).start(this.options.mmbFocusedClassName) } } .bind(this), focus: function(e) { this.cancellHideAllSubMenus(); this.hideOtherSubMenus(); this.showSubMenu(); if (this.subMenuType === "initial" && this.options.mmbClassName && this.options.mmbFocusedClassName) { $(this.btn).retrieve("btnMorph", new Fx.Morph($(this.btn), { duration: (this.options.duration / 2), transition: this.options.physics, link: "cancel" })).start(this.options.mmbFocusedClassName) } } .bind(this), mouseleave: function(e) { this.cancellHideAllSubMenus(); this.hideAllSubMenus() } .bind(this), blur: function(e) { this.cancellHideAllSubMenus(); this.hideAllSubMenus() } .bind(this), keydown: function(e) { e = new Event(e); if (e.key === "up" || e.key === "down" || e.key === "left" || e.key === "right") { e.stop() } if (!this.parentSubMenu) { if (this.options.orientation === "horizontal" && e.key === this.options.direction.y || this.options.orientation === "vertical" && e.key === this.options.direction.x) { if (this.options.direction.y === "down") { this.childMenu.getFirst().getFirst("li").getFirst("a").focus() } else { if (this.options.direction.y === "up") { this.childMenu.getFirst().getLast("li").getFirst("a").focus() } } } else { if (this.options.orientation === "horizontal" && e.key === "left" || this.options.orientation === "vertical" && e.key === this.options.direction.yInverse) { if (this.btn.getParent().getPrevious()) { this.btn.getParent().getPrevious().getFirst().focus() } else { this.btn.getParent().getParent().getLast().getFirst().focus() } } else { if (this.options.orientation === "horizontal" && e.key === "right" || this.options.orientation === "vertical" && e.key === this.options.direction.y) { if (this.btn.getParent().getNext()) { this.btn.getParent().getNext().getFirst().focus() } else { this.btn.getParent().getParent().getFirst().getFirst().focus() } } } } } else { if (e.key === "tab") { e.stop() } if (e.key === "up") { if (this.btn.getParent("li").getPrevious("li")) { this.btn.getParent("li").getPrevious("li").getFirst("a").focus() } else { if (this.options.direction.y === "down") { this.parentSubMenu.btn.focus() } else { if (this.options.direction.y === "up") { this.btn.getParent("li").getParent().getLast("li").getFirst("a").focus() } } } } else { if (e.key === "down") { if (this.btn.getParent("li").getNext("li")) { this.btn.getParent("li").getNext("li").getFirst("a").focus() } else { if (this.options.direction.y === "down") { this.btn.getParent("li").getParent().getFirst("li").getFirst("a").focus() } else { if (this.options.direction.y === "up") { this.parentSubMenu.btn.focus() } } } } else { if (e.key === this.options.direction.xInverse) { this.parentSubMenu.btn.focus() } else { if (e.key === this.options.direction.x) { if (this.options.direction.y === "down") { this.childMenu.getFirst().getFirst("li").getFirst("a").focus() } else { if (this.options.direction.y === "up") { } } } } } } } } .bind(this) }); this.options.onSubMenuInit_complete(this) }, matchWidth: function() { if (this.widthMatched || !this.options.matchWidthMode || this.subMenuType === "subsequent") { return } this.options.onMatchWidth_begin(this); var a = this.btn.getCoordinates().width; $(this.childMenu).getElements("a").each(function(c, d) { var e = parseFloat($(this.childMenu).getFirst().getStyle("border-left-width")) + parseFloat($(this.childMenu).getFirst().getStyle("border-right-width")); var f = parseFloat(c.getStyle("padding-left")) + parseFloat(c.getStyle("padding-right")); var b = e + f; if (a > c.getCoordinates().width) { c.setStyle("width", a - b); c.setStyle("margin-right", -e) } } .bind(this)); this.width = this.childMenu.getFirst().getCoordinates().width; this.widthMatched = true; this.options.onMatchWidth_complete(this) }, hideSubMenu: function() { if (this.childMenu.retrieve("status") === "closed") { return } this.options.onHideSubMenu_begin(this); if (this.subMenuType == "initial") { if (this.options.mmbClassName && this.options.mmbFocusedClassName) { $(this.btn).retrieve("btnMorph", new Fx.Morph($(this.btn), { duration: (this.options.duration), transition: this.options.physics, link: "cancel" })).start(this.options.mmbClassName).chain(function() { $(this.btn).removeClass("mainMenuParentBtnFocused"); $(this.btn).addClass("mainMenuParentBtn") } .bind(this)) } else { $(this.btn).removeClass("mainMenuParentBtnFocused"); $(this.btn).addClass("mainMenuParentBtn") } } else { $(this.btn).removeClass("subMenuParentBtnFocused"); $(this.btn).addClass("subMenuParentBtn") } this.childMenu.setStyle("z-index", 1); if (this.options.effect && this.options.effect.toLowerCase() === "slide") { if (this.subMenuType == "initial" && this.options.orientation === "horizontal" && this.options.direction.y === "down") { this.myEffect.start({ "margin-top": -this.height }).chain(function() { this.childMenu.style.display = "none" } .bind(this)) } else { if (this.subMenuType == "initial" && this.options.orientation === "horizontal" && this.options.direction.y === "up") { this.myEffect.start({ "margin-top": this.height }).chain(function() { this.childMenu.style.display = "none" } .bind(this)) } else { if (this.options.direction.x === "right") { this.myEffect.start({ "margin-left": -this.width }).chain(function() { this.childMenu.style.display = "none" } .bind(this)) } else { if (this.options.direction.x === "left") { this.myEffect.start({ "margin-left": this.width }).chain(function() { this.childMenu.style.display = "none" } .bind(this)) } } } } } else { if (this.options.effect == "fade") { this.myEffect.start({ opacity: 0 }).chain(function() { this.childMenu.style.display = "none" } .bind(this)) } else { if (this.options.effect == "slide & fade") { if (this.subMenuType == "initial" && this.options.orientation === "horizontal" && this.options.direction.y === "down") { this.myEffect.start({ "margin-top": -this.height, opacity: 0 }).chain(function() { this.childMenu.style.display = "none" } .bind(this)) } else { if (this.subMenuType == "initial" && this.options.orientation === "horizontal" && this.options.direction.y === "up") { this.myEffect.start({ "margin-top": this.height, opacity: 0 }).chain(function() { this.childMenu.style.display = "none" } .bind(this)) } else { if (this.options.direction.x === "right") { this.myEffect.start({ "margin-left": -this.width, opacity: 0 }).chain(function() { this.childMenu.style.display = "none" } .bind(this)) } else { if (this.options.direction.x === "left") { this.myEffect.start({ "margin-left": this.width, opacity: 0 }).chain(function() { this.childMenu.style.display = "none" } .bind(this)) } } } } } else { this.childMenu.style.display = "none" } } } this.childMenu.store("status", "closed"); this.options.onHideSubMenu_complete(this) }, hideOtherSubMenus: function() { this.options.onHideOtherSubMenus_begin(this); if (!this.btn.retrieve("otherSubMenus")) { this.btn.store("otherSubMenus", $$(this.root.allSubMenus.filter(function(a) { return !this.btn.retrieve("parentSubMenus").contains(a) && a != this.childMenu } .bind(this)))) } this.parentSubMenus.fireEvent("show"); this.btn.retrieve("otherSubMenus").fireEvent("hide"); this.options.onHideOtherSubMenus_complete(this) }, hideAllSubMenus: function() { this.options.onHideAllSubMenus_begin(this); $clear(this.root.hideAllMenusTimeout); this.root.hideAllMenusTimeout = (function() { $clear(this.hideAllMenusTimeout); $$(this.root.allSubMenus).fireEvent("hide") }).bind(this).delay(this.options.hideDelay); this.options.onHideAllSubMenus_complete(this) }, cancellHideAllSubMenus: function() { $clear(this.root.hideAllMenusTimeout) }, showSubMenu: function(a) { if (this.childMenu.retrieve("status") === "open") { return } this.options.onShowSubMenu_begin(this); if (this.subMenuType == "initial") { $(this.btn).removeClass("mainMenuParentBtn"); $(this.btn).addClass("mainMenuParentBtnFocused") } else { $(this.btn).removeClass("subMenuParentBtn"); $(this.btn).addClass("subMenuParentBtnFocused") } this.root.subMenuZindex++; this.childMenu.setStyles({ display: "block", visibility: "hidden", "z-index": this.root.subMenuZindex }); if (!this.width || !this.height) { this.width = this.childMenu.getFirst().getCoordinates().width; this.height = this.childMenu.getFirst().getCoordinates().height; this.childMenu.setStyle("height", this.height, "border"); if (this.options.effect === "slide" || this.options.effect === "slide & fade") { if (this.subMenuType == "initial" && this.options.orientation === "horizontal") { this.childMenu.getFirst().setStyle("margin-top", "0"); if (this.options.direction.y === "down") { this.myEffect.set({ "margin-top": -this.height }) } else { if (this.options.direction.y === "up") { this.myEffect.set({ "margin-top": this.height }) } } } else { if (this.options.direction.x === "left") { this.myEffect.set({ "margin-left": this.width }) } else { this.myEffect.set({ "margin-left": -this.width }) } } } } this.matchWidth(); this.positionSubMenu(); if (this.options.effect === "slide") { this.childMenu.setStyles({ display: "block", visibility: "visible" }); if (this.subMenuType === "initial" && this.options.orientation === "horizontal") { if (a) { this.myEffect.set({ "margin-top": 0 }).chain(function() { this.showSubMenuComplete() } .bind(this)) } else { this.myEffect.start({ "margin-top": 0 }).chain(function() { this.showSubMenuComplete() } .bind(this)) } } else { if (a) { this.myEffect.set({ "margin-left": 0 }).chain(function() { this.showSubMenuComplete() } .bind(this)) } else { this.myEffect.start({ "margin-left": 0 }).chain(function() { this.showSubMenuComplete() } .bind(this)) } } } else { if (this.options.effect === "fade") { if (a) { this.myEffect.set({ opacity: this.options.opacity }).chain(function() { this.showSubMenuComplete() } .bind(this)) } else { this.myEffect.start({ opacity: this.options.opacity }).chain(function() { this.showSubMenuComplete() } .bind(this)) } } else { if (this.options.effect == "slide & fade") { this.childMenu.setStyles({ display: "block", visibility: "visible" }); this.childMenu.getFirst().setStyles({ left: 0 }); if (this.subMenuType === "initial" && this.options.orientation === "horizontal") { if (a) { this.myEffect.set({ "margin-top": 0, opacity: this.options.opacity }).chain(function() { this.showSubMenuComplete() } .bind(this)) } else { this.myEffect.start({ "margin-top": 0, opacity: this.options.opacity }).chain(function() { this.showSubMenuComplete() } .bind(this)) } } else { if (a) { if (this.options.direction.x === "right") { this.myEffect.set({ "margin-left": 0, opacity: this.options.opacity }).chain(function() { this.showSubMenuComplete() } .bind(this)) } else { if (this.options.direction.x === "left") { this.myEffect.set({ "margin-left": 0, opacity: this.options.opacity }).chain(function() { this.showSubMenuComplete() } .bind(this)) } } } else { if (this.options.direction.x === "right") { this.myEffect.set({ "margin-left": -this.width, opacity: this.options.opacity }); this.myEffect.start({ "margin-left": 0, opacity: this.options.opacity }).chain(function() { this.showSubMenuComplete() } .bind(this)) } else { if (this.options.direction.x === "left") { this.myEffect.start({ "margin-left": 0, opacity: this.options.opacity }).chain(function() { this.showSubMenuComplete() } .bind(this)) } } } } } else { this.childMenu.setStyles({ display: "block", visibility: "visible" }).chain(function() { this.showSubMenuComplete(this) } .bind(this)) } } } this.childMenu.store("status", "open") }, showSubMenuComplete: function() { this.options.onShowSubMenu_complete(this) }, positionSubMenu: function() { this.options.onPositionSubMenu_begin(this); this.childMenu.setStyle("width", this.width); this.childMenu.getFirst().setStyle("width", this.width); if (this.subMenuType === "subsequent") { if (this.parentSubMenu && this.options.direction.x != this.parentSubMenu.options.direction.x) { if (this.parentSubMenu.options.direction.x === "left" && this.options.effect && this.options.effect.contains("slide")) { this.myEffect.set({ "margin-left": this.width }) } } this.options.direction.x = this.parentSubMenu.options.direction.x; this.options.direction.xInverse = this.parentSubMenu.options.direction.xInverse; this.options.direction.y = this.parentSubMenu.options.direction.y; this.options.direction.yInverse = this.parentSubMenu.options.direction.yInverse } var c; var a; if (this.subMenuType == "initial") { if (this.options.direction.y === "up") { if (this.options.orientation === "vertical") { c = this.btn.getCoordinates().bottom - this.height + this.options.tweakInitial.y } else { c = this.btn.getCoordinates().top - this.height + this.options.tweakInitial.y } this.childMenu.style.top = c + "px" } else { if (this.options.orientation == "horizontal") { this.childMenu.style.top = this.btn.getCoordinates().bottom + this.options.tweakInitial.y + "px" } else { if (this.options.orientation == "vertical") { c = this.btn.getPosition().y + this.options.tweakInitial.y; if ((c + this.childMenu.getSize().y) >= $(document.body).getScrollSize().y) { a = (c + this.childMenu.getSize().y) - $(document.body).getScrollSize().y; c = c - a - 20 } this.childMenu.style.top = c + "px" } } } if (this.options.orientation == "horizontal") { this.childMenu.style.left = this.btn.getPosition().x + this.options.tweakInitial.x + "px" } else { if (this.options.direction.x == "left") { this.childMenu.style.left = this.btn.getPosition().x - this.childMenu.getCoordinates().width + this.options.tweakInitial.x + "px" } else { if (this.options.direction.x == "right") { this.childMenu.style.left = this.btn.getCoordinates().right + this.options.tweakInitial.x + "px" } } } } else { if (this.subMenuType == "subsequent") { if (this.options.direction.y === "down") { if ((this.btn.getCoordinates().top + this.options.tweakSubsequent.y + this.childMenu.getSize().y) >= $(document.body).getScrollSize().y) { a = (this.btn.getCoordinates().top + this.options.tweakSubsequent.y + this.childMenu.getSize().y) - $(document.body).getScrollSize().y; this.childMenu.style.top = (this.btn.getCoordinates().top + this.options.tweakSubsequent.y) - a - 20 + "px" } else { this.childMenu.style.top = this.btn.getCoordinates().top + this.options.tweakSubsequent.y + "px" } } else { if (this.options.direction.y === "up") { if ((this.btn.getCoordinates().bottom - this.height + this.options.tweakSubsequent.y) < 1) { this.options.direction.y = "down"; this.options.direction.yInverse = "up"; this.childMenu.style.top = this.btn.getCoordinates().top + this.options.tweakSubsequent.y + "px" } else { this.childMenu.style.top = this.btn.getCoordinates().bottom - this.height + this.options.tweakSubsequent.y + "px" } } } if (this.options.direction.x == "left") { this.childMenu.style.left = this.btn.getCoordinates().left - this.childMenu.getCoordinates().width + this.options.tweakSubsequent.x + "px"; if (this.childMenu.getPosition().x < 0) { this.options.direction.x = "right"; this.options.direction.xInverse = "left"; this.childMenu.style.left = this.btn.getPosition().x + this.btn.getCoordinates().width + this.options.tweakSubsequent.x + "px"; if (this.options.effect === "slide" || this.options.effect === "slide & fade") { this.myEffect.set({ "margin-left": -this.width, opacity: this.options.opacity }) } } } else { if (this.options.direction.x == "right") { this.childMenu.style.left = this.btn.getCoordinates().right + this.options.tweakSubsequent.x + "px"; var b = this.childMenu.getCoordinates().right; var d = document.getCoordinates().width + window.getScroll().x; if (b > d) { this.options.direction.x = "left"; this.options.direction.xInverse = "right"; this.childMenu.style.left = this.btn.getCoordinates().left - this.childMenu.getCoordinates().width + this.options.tweakSubsequent.x + "px"; if (this.options.effect === "slide" || this.options.effect === "slide & fade") { this.myEffect.set({ "margin-left": this.width, opacity: this.options.opacity }) } } } } } } this.options.onPositionSubMenu_complete(this) } }); var Mediabox; (function() { var A, h, P, H, O, n, F, l, m, k, J, y, t, z = new Image(), V = new Image(), r = false, w = false, S, b, j, c, U, E, M, T, W, e, D, Q, G, x, B, o, i = "none", f, d = "mediaBox", C; window.addEvent("domready", function() { $(document.body).adopt($$([S = new Element("div", { id: "mbOverlay" }).addEvent("click", N), b = new Element("div", { id: "mbCenter" })]).setStyle("display", "none")); j = new Element("div", { id: "mbImage" }).injectInside(b); c = new Element("div", { id: "mbBottom" }).injectInside(b).adopt(new Element("a", { id: "mbCloseLink", href: "#" }).addEvent("click", N), e = new Element("a", { id: "mbNextLink", href: "#" }).addEvent("click", g), T = new Element("a", { id: "mbPrevLink", href: "#" }).addEvent("click", K), E = new Element("div", { id: "mbTitle" }), W = new Element("div", { id: "mbNumber" }), M = new Element("div", { id: "mbCaption" })); y = { overlay: new Fx.Tween(S, { property: "opacity", duration: 360 }).set(0), image: new Fx.Tween(j, { property: "opacity", duration: 360, onComplete: I }), bottom: new Fx.Tween(c, { property: "opacity", duration: 240 }).set(0)} }); Mediabox = { close: function() { N() }, open: function(Z, Y, X) { A = $extend({ loop: false, stopKey: true, overlayOpacity: 0.7, resizeOpening: true, resizeDuration: 240, resizeTransition: false, initialWidth: 320, initialHeight: 180, defaultWidth: 640, defaultHeight: 360, showCaption: true, showCounter: true, counterText: "({x} of {y})", imgBackground: false, imgPadding: 70, scriptaccess: "true", fullscreen: "true", fullscreenNum: "1", autoplay: "true", autoplayNum: "1", autoplayYes: "yes", volume: "100", medialoop: "true", bgcolor: "#000000", wmode: "opaque", useNB: true, playerpath: "/includes/scripts/NonverBlaster.swf", controlColor: "0xFFFFFF", controlBackColor: "0x000000", showTimecode: "false", JWplayerpath: "/js/player.swf", backcolor: "000000", frontcolor: "999999", lightcolor: "000000", screencolor: "000000", controlbar: "over", controller: "true", flInfo: "true", revverID: "187866", revverFullscreen: "true", revverBack: "000000", revverFront: "ffffff", revverGrad: "000000", usViewers: "true", ytBorder: "0", ytColor1: "000000", ytColor2: "333333", ytQuality: "&ap=%2526fmt%3D18", ytRel: "0", ytInfo: "1", ytSearch: "0", vuPlayer: "basic", vmTitle: "1", vmByline: "1", vmPortrait: "1", vmColor: "ffffff" }, X || {}); if ((Browser.Engine.gecko) && (Browser.Engine.version < 19)) { r = true; A.overlayOpacity = 1; S.className = "mbOverlayFF" } if (typeof Z == "string") { Z = [[Z, Y, X]]; Y = 0 } h = Z; A.loop = A.loop && (h.length > 1); if ((Browser.Engine.trident) && (Browser.Engine.version < 5)) { w = true; S.className = "mbOverlayIE"; S.setStyle("position", "absolute"); L() } q(); s(true); n = window.getScrollTop() + (window.getHeight() / 2); l = window.getScrollLeft() + (window.getWidth() / 2); y.resize = new Fx.Morph(b, $extend({ duration: A.resizeDuration, onComplete: R }, A.resizeTransition ? { transition: A.resizeTransition} : {})); b.setStyles({ top: n, left: l, width: A.initialWidth, height: A.initialHeight, marginTop: -(A.initialHeight / 2), marginLeft: -(A.initialWidth / 2), display: "" }); y.overlay.start(A.overlayOpacity); return a(Y) } }; Element.implement({ mediabox: function(X, Y) { $$(this).mediabox(X, Y); return this } }); Elements.implement({ mediabox: function(X, aa, Z) { aa = aa || function(ab) { x = ab.rel.split(/[\[\]]/); x = x[1]; return [ab.href, ab.title, x] }; Z = Z || function() { return true }; var Y = this; Y.addEvent("contextmenu", function(ab) { if (this.toString().match(/\.gif|\.jpg|\.png/i)) { ab.stop() } }); Y.removeEvents("click").addEvent("click", function() { var ac = Y.filter(Z, this); var ad = []; var ab = []; ac.each(function(af, ae) { if (ab.indexOf(af.toString()) < 0) { ad.include(ac[ae]); ab.include(ac[ae].toString()) } }); return Mediabox.open(ad.map(aa), ab.indexOf(this.toString()), X) }); return Y } }); function L() { S.setStyles({ top: window.getScrollTop(), left: window.getScrollLeft() }) } function q() { k = window.getWidth(); J = window.getHeight(); S.setStyles({ width: k, height: J }) } function s(X) { ["object", window.ie ? "select" : "embed"].forEach(function(Z) { Array.forEach(document.getElementsByTagName(Z), function(aa) { if (X) { aa._mediabox = aa.style.visibility } aa.style.visibility = X ? "hidden" : aa._mediabox }) }); S.style.display = X ? "" : "none"; var Y = X ? "addEvent" : "removeEvent"; if (w) { window[Y]("scroll", L) } window[Y]("resize", q); document[Y]("keydown", u) } function u(X) { switch (X.code) { case 27: case 88: case 67: N(); break; case 37: case 80: K(); break; case 39: case 78: g() } if (A.stopKey) { return false } } function K() { return a(H) } function g() { return a(O) } function a(X) { if (X >= 0) { j.set("html", ""); P = X; H = ((P || !A.loop) ? P : h.length) - 1; O = P + 1; if (O == h.length) { O = A.loop ? 0 : -1 } v(); b.className = "mbLoading"; if (!h[X][2]) { h[X][2] = "" } Q = h[X][2].split(" "); G = Q.length; if (G > 1) { B = (Q[G - 2].match("%")) ? (window.getWidth() * ((Q[G - 2].replace("%", "")) * 0.01)) + "px" : Q[G - 2] + "px"; o = (Q[G - 1].match("%")) ? (window.getHeight() * ((Q[G - 1].replace("%", "")) * 0.01)) + "px" : Q[G - 1] + "px" } else { B = ""; o = "" } D = h[X][0]; D = encodeURI(D).replace("(", "%28").replace(")", "%29"); U = h[P][1].split("::"); if (D.match(/quietube\.com/i)) { f = D.split("v.php/"); D = f[1] } else { if (D.match(/\/\/yfrog/i)) { i = (D.substring(D.length - 1)); if (i.match(/b|g|j|p|t/i)) { i = "image" } if (i == "s") { i = "flash" } if (i.match(/f|z/i)) { i = "video" } D = D + ":iphone" } } if (D.match(/\.gif|\.jpg|\.png|twitpic\.com/i) || i == "image") { i = "img"; D = D.replace(/twitpic\.com/i, "twitpic.com/show/full"); t = new Image(); t.onload = p; t.src = D } else { if (D.match(/\.flv|\.mp4/i) || i == "video") { i = "obj"; B = B || A.defaultWidth; o = o || A.defaultHeight; if (A.useNB) { t = new Swiff("" + A.playerpath + "?mediaURL=" + D + "&allowSmoothing=true&autoPlay=" + A.autoplay + "&buffer=6&showTimecode=" + A.showTimecode + "&loop=" + A.medialoop + "&controlColor=" + A.controlColor + "&controlBackColor=" + A.controlBackColor + "&defaultVolume=" + A.volume + "&scaleIfFullScreen=true&showScalingButton=true&crop=false", { id: "MediaboxSWF", width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }) } else { t = new Swiff("" + A.JWplayerpath + "?file=" + D + "&backcolor=" + A.backcolor + "&frontcolor=" + A.frontcolor + "&lightcolor=" + A.lightcolor + "&screencolor=" + A.screencolor + "&autostart=" + A.autoplay + "&controlbar=" + A.controlbar, { id: "MediaboxSWF", width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }) } p() } else { if (D.match(/\.mp3|\.aac|tweetmic\.com|tmic\.fm/i) || i == "audio") { i = "obj"; B = B || A.defaultWidth; o = o || "20px"; if (D.match(/tweetmic\.com|tmic\.fm/i)) { D = D.split("/"); D[4] = D[4] || D[3]; D = "http://media4.fjarnet.net/tweet/tweetmicapp-" + D[4] + ".mp3" } if (A.useNB) { t = new Swiff("" + A.playerpath + "?mediaURL=" + D + "&allowSmoothing=true&autoPlay=" + A.autoplay + "&buffer=6&showTimecode=" + A.showTimecode + "&loop=" + A.medialoop + "&controlColor=" + A.controlColor + "&controlBackColor=" + A.controlBackColor + "&defaultVolume=" + A.volume + "&scaleIfFullScreen=true&showScalingButton=true&crop=false", { id: "MediaboxSWF", width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }) } else { t = new Swiff("" + A.JWplayerpath + "?file=" + D + "&backcolor=" + A.backcolor + "&frontcolor=" + A.frontcolor + "&lightcolor=" + A.lightcolor + "&screencolor=" + A.screencolor + "&autostart=" + A.autoplay, { id: "MediaboxSWF", width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }) } p() } else { if (D.match(/\.swf/i) || i == "flash") { i = "obj"; B = B || A.defaultWidth; o = o || A.defaultHeight; t = new Swiff(D, { id: "MediaboxSWF", width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }); p() } else { if (D.match(/\.mov|\.m4v|\.m4a|\.aiff|\.avi|\.caf|\.dv|\.mid|\.m3u|\.mp3|\.mp2|\.mp4|\.qtz/i) || i == "qt") { i = "qt"; B = B || A.defaultWidth; o = (parseInt(o) + 16) + "px" || A.defaultHeight; t = new Quickie(D, { id: "MediaboxQT", width: B, height: o, container: "mbImage", attributes: { controller: A.controller, autoplay: A.autoplay, volume: A.volume, loop: A.medialoop, bgcolor: A.bgcolor} }); p() } else { if (D.match(/blip\.tv/i)) { i = "obj"; B = B || "640px"; o = o || "390px"; t = new Swiff(D, { src: D, width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }); p() } else { if (D.match(/break\.com/i)) { i = "obj"; B = B || "464px"; o = o || "376px"; d = D.match(/\d{6}/g); t = new Swiff("http://embed.break.com/" + d, { width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }); p() } else { if (D.match(/dailymotion\.com/i)) { i = "obj"; B = B || "480px"; o = o || "381px"; t = new Swiff(D, { id: d, width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }); p() } else { if (D.match(/facebook\.com/i)) { i = "obj"; B = B || "320px"; o = o || "240px"; f = D.split("v="); f = f[1].split("&"); d = f[0]; t = new Swiff("http://www.facebook.com/v/" + d, { movie: "http://www.facebook.com/v/" + d, classid: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }); p() } else { if (D.match(/flickr\.com/i)) { i = "obj"; B = B || "500px"; o = o || "375px"; f = D.split("/"); d = f[5]; t = new Swiff("http://www.flickr.com/apps/video/stewart.swf", { id: d, classid: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", width: B, height: o, params: { flashvars: "photo_id=" + d + "&show_info_box=" + A.flInfo, wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }); p() } else { if (D.match(/fliggo\.com/i)) { i = "obj"; B = B || "425px"; o = o || "355px"; D = D.replace("/video/", "/embed/"); t = new Swiff(D, { width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }); p() } else { if (D.match(/gametrailers\.com/i)) { i = "obj"; B = B || "480px"; o = o || "392px"; d = D.match(/\d{5}/g); t = new Swiff("http://www.gametrailers.com/remote_wrap.php?mid=" + d, { id: d, width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }); p() } else { if (D.match(/google\.com\/videoplay/i)) { i = "obj"; B = B || "400px"; o = o || "326px"; f = D.split("="); d = f[1]; t = new Swiff("http://video.google.com/googleplayer.swf?docId=" + d + "&autoplay=" + A.autoplayNum, { id: d, width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }); p() } else { if (D.match(/megavideo\.com/i)) { i = "obj"; B = B || "640px"; o = o || "360px"; f = D.split("="); d = f[1]; t = new Swiff("http://wwwstatic.megavideo.com/mv_player.swf?v=" + d, { id: d, width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }); p() } else { if (D.match(/metacafe\.com\/watch/i)) { i = "obj"; B = B || "400px"; o = o || "345px"; f = D.split("/"); d = f[4]; t = new Swiff("http://www.metacafe.com/fplayer/" + d + "/.swf?playerVars=autoPlay=" + A.autoplayYes, { id: d, width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }); p() } else { if (D.match(/myspacetv\.com|vids\.myspace\.com/i)) { i = "obj"; B = B || "425px"; o = o || "360px"; f = D.split("="); d = f[2]; t = new Swiff("http://lads.myspace.com/videos/vplayer.swf?m=" + d + "&v=2&a=" + A.autoplayNum + "&type=video", { id: d, width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }); p() } else { if (D.match(/revver\.com/i)) { i = "obj"; B = B || "480px"; o = o || "392px"; f = D.split("/"); d = f[4]; t = new Swiff("http://flash.revver.com/player/1.0/player.swf?mediaId=" + d + "&affiliateId=" + A.revverID + "&allowFullScreen=" + A.revverFullscreen + "&autoStart=" + A.autoplay + "&backColor=#" + A.revverBack + "&frontColor=#" + A.revverFront + "&gradColor=#" + A.revverGrad + "&shareUrl=revver", { id: d, width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }); p() } else { if (D.match(/rutube\.ru/i)) { i = "obj"; B = B || "470px"; o = o || "353px"; f = D.split("="); d = f[1]; t = new Swiff("http://video.rutube.ru/" + d, { movie: "http://video.rutube.ru/" + d, width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }); p() } else { if (D.match(/seesmic\.com/i)) { i = "obj"; B = B || "435px"; o = o || "355px"; f = D.split("/"); d = f[5]; t = new Swiff("http://seesmic.com/Standalone.swf?video=" + d, { id: d, width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }); p() } else { if (D.match(/tudou\.com/i)) { i = "obj"; B = B || "400px"; o = o || "340px"; f = D.split("/"); d = f[5]; t = new Swiff("http://www.tudou.com/v/" + d, { width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }); p() } else { if (D.match(/twitcam\.com/i)) { i = "obj"; B = B || "320px"; o = o || "265px"; f = D.split("/"); d = f[3]; t = new Swiff("http://static.livestream.com/chromelessPlayer/wrappers/TwitcamPlayer.swf?hash=" + d, { width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }); p() } else { if (D.match(/twitvid\.com/i)) { i = "obj"; B = B || "600px"; o = o || "338px"; f = D.split("/"); d = f[3]; t = new Swiff("http://www.twitvid.com/player/" + d, { width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }); p() } else { if (D.match(/twitvid\.io/i)) { i = "obj"; B = B || "580px"; o = o || "323px"; f = D.split("/"); d = f[3]; t = new Swiff("http://twitvid.io/embed/" + d, { width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }); p() } else { if (D.match(/ustream\.tv/i)) { i = "obj"; B = B || "400px"; o = o || "326px"; t = new Swiff(D + "&viewcount=" + A.usViewers + "&autoplay=" + A.autoplay, { width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }); p() } else { if (D.match(/youku\.com/i)) { i = "obj"; B = B || "480px"; o = o || "400px"; f = D.split("id_"); d = f[1]; t = new Swiff("http://player.youku.com/player.php/sid/" + d + "=/v.swf", { width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }); p() } else { if (D.match(/youtube\.com\/watch/i)) { i = "obj"; f = D.split("v="); d = f[1]; if (d.match(/fmt=18/i)) { C = "&ap=%2526fmt%3D18"; B = B || "560px"; o = o || "345px" } else { if (d.match(/fmt=22/i)) { C = "&ap=%2526fmt%3D22"; B = B || "640px"; o = o || "385px" } else { C = A.ytQuality; B = B || "480px"; o = o || "295px" } } t = new Swiff("http://www.youtube.com/v/" + d + "&autoplay=" + A.autoplayNum + "&fs=" + A.fullscreenNum + C + "&border=" + A.ytBorder + "&color1=0x" + A.ytColor1 + "&color2=0x" + A.ytColor2 + "&rel=" + A.ytRel + "&showinfo=" + A.ytInfo + "&showsearch=" + A.ytSearch, { id: d, width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }); p() } else { if (D.match(/youtube\.com\/view/i)) { i = "obj"; f = D.split("p="); d = f[1]; B = B || "480px"; o = o || "385px"; t = new Swiff("http://www.youtube.com/p/" + d + "&autoplay=" + A.autoplayNum + "&fs=" + A.fullscreenNum + C + "&border=" + A.ytBorder + "&color1=0x" + A.ytColor1 + "&color2=0x" + A.ytColor2 + "&rel=" + A.ytRel + "&showinfo=" + A.ytInfo + "&showsearch=" + A.ytSearch, { id: d, width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }); p() } else { if (D.match(/veoh\.com/i)) { i = "obj"; B = B || "410px"; o = o || "341px"; f = D.split("videos/"); d = f[1]; t = new Swiff("http://www.veoh.com/videodetails2.swf?permalinkId=" + d + "&player=videodetailsembedded&videoAutoPlay=" + A.AutoplayNum, { id: d, width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }); p() } else { if (D.match(/viddler\.com/i)) { i = "obj"; B = B || "437px"; o = o || "370px"; f = D.split("/"); d = f[4]; t = new Swiff(D, { id: "viddler_" + d, movie: D, classid: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen, id: "viddler_" + d, movie: D} }); p() } else { if (D.match(/viddyou\.com/i)) { i = "obj"; B = B || "416px"; o = o || "312px"; f = D.split("="); d = f[1]; t = new Swiff("http://www.viddyou.com/get/v2_" + A.vuPlayer + "/" + d + ".swf", { id: d, movie: "http://www.viddyou.com/get/v2_" + A.vuPlayer + "/" + d + ".swf", width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }); p() } else { if (D.match(/vimeo\.com/i)) { i = "obj"; B = B || "640px"; o = o || "360px"; f = D.split("/"); d = f[3]; t = new Swiff("http://www.vimeo.com/moogaloop.swf?clip_id=" + d + "&server=www.vimeo.com&fullscreen=" + A.fullscreenNum + "&autoplay=" + A.autoplayNum + "&show_title=" + A.vmTitle + "&show_byline=" + A.vmByline + "&show_portrait=" + A.vmPortrait + "&color=" + A.vmColor, { id: d, width: B, height: o, params: { wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }); p() } else { if (D.match(/12seconds\.tv/i)) { i = "obj"; B = B || "430px"; o = o || "360px"; f = D.split("/"); d = f[5]; t = new Swiff("http://embed.12seconds.tv/players/remotePlayer.swf", { id: d, width: B, height: o, params: { flashvars: "vid=" + d + "", wmode: A.wmode, bgcolor: A.bgcolor, allowscriptaccess: A.scriptaccess, allowfullscreen: A.fullscreen} }); p() } else { if (D.match(/\#mb_/i)) { i = "inline"; B = B || A.defaultWidth; o = o || A.defaultHeight; URLsplit = D.split("#"); t = $(URLsplit[1]).get("html"); p() } else { i = "url"; B = B || A.defaultWidth; o = o || A.defaultHeight; d = "mediaId_" + new Date().getTime(); t = new Element("iframe", { src: D, id: d, width: B, height: o, frameborder: 0 }); p() } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } return false } function p() { if (i == "img") { B = t.width; o = t.height; if (A.imgBackground) { j.setStyles({ backgroundImage: "url(" + D + ")", display: "" }) } else { if (o >= J - A.imgPadding && (o / J) >= (B / k)) { o = J - A.imgPadding; B = t.width = parseInt((o / t.height) * B); t.height = o } else { if (B >= k - A.imgPadding && (o / J) < (B / k)) { B = k - A.imgPadding; o = t.height = parseInt((B / t.width) * o); t.width = B } } if (Browser.Engine.trident) { t = $(t) } t.addEvent("mousedown", function(X) { X.stop() }).addEvent("contextmenu", function(X) { X.stop() }); j.setStyles({ backgroundImage: "none", display: "" }); t.inject(j) } } else { if (i == "obj") { if (Browser.Plugins.Flash.version < 8) { j.setStyles({ backgroundImage: "none", display: "" }); j.set("html", '<div id="mbError"><b>Error</b><br/>Adobe Flash is either not installed or not up to date, please visit <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" title="Get Flash" target="_new">Adobe.com</a> to download the free player.</div>'); B = A.DefaultWidth; o = A.DefaultHeight } else { j.setStyles({ backgroundImage: "none", display: "" }); t.inject(j) } } else { if (i == "qt") { j.setStyles({ backgroundImage: "none", display: "" }); t } else { if (i == "inline") { j.setStyles({ backgroundImage: "none", display: "" }); j.set("html", t) } else { if (i == "url") { j.setStyles({ backgroundImage: "none", display: "" }); t.inject(j) } else { j.setStyles({ backgroundImage: "none", display: "" }); j.set("html", '<div id="mbError"><b>Error</b><br/>A file type error has occoured, please visit <a href="iaian7.com/webcode/mediaboxAdvanced" title="mediaboxAdvanced" target="_new">iaian7.com</a> or contact the website author for more information.</div>'); B = A.defaultWidth; o = A.defaultHeight } } } } } j.setStyles({ width: B, height: o }); E.set("html", (A.showCaption) ? U[0] : ""); M.set("html", (A.showCaption && (U.length > 1)) ? U[1] : ""); W.set("html", (A.showCounter && (h.length > 1)) ? A.counterText.replace(/{x}/, P + 1).replace(/{y}/, h.length) : ""); if ((H >= 0) && (h[H][0].match(/\.gif|\.jpg|\.png|twitpic\.com/i))) { z.src = h[H][0].replace(/twitpic\.com/i, "twitpic.com/show/full") } if ((O >= 0) && (h[O][0].match(/\.gif|\.jpg|\.png|twitpic\.com/i))) { V.src = h[O][0].replace(/twitpic\.com/i, "twitpic.com/show/full") } B = j.offsetWidth; o = j.offsetHeight + c.offsetHeight; if (o >= n + n - 10) { F = -(n - 10) } else { F = -(o / 2) } if (B >= l + l - 10) { m = -(l - 10) } else { m = -(B / 2) } if (A.resizeOpening) { y.resize.start({ width: B, height: o, marginTop: F, marginLeft: m }) } else { b.setStyles({ width: B, height: o, marginTop: F, marginLeft: m }); R() } } function R() { y.image.start(1) } function I() { b.className = ""; if (H >= 0) { T.style.display = "" } if (O >= 0) { e.style.display = "" } y.bottom.start(1) } function v() { if (t) { t.onload = $empty } y.resize.cancel(); y.image.cancel().set(0); y.bottom.cancel().set(0); $$(T, e).setStyle("display", "none") } function N() { if (P >= 0) { t.onload = $empty; j.set("html", ""); for (var X in y) { y[X].cancel() } b.setStyle("display", "none"); y.overlay.chain(s).start(0) } return false } })(); Mediabox.scanPage = function() { var a = $$("a").filter(function(b) { return b.rel && b.rel.test(/^lightbox/i) }); $$(a).mediabox({}, null, function(c) { var b = this.rel.replace(/[[]|]/gi, " "); var d = b.split(" "); return (this == c) || ((this.rel.length > 8) && c.rel.match(d[1])) }) }; window.addEvent("domready", Mediabox.scanPage);
