#1 JavaScript::Eval (size: 231708, repeated: 2) (function() {
try {
var appNamespace = "$ice";
if (window[appNamespace]) {
if (window[appNamespace].logger && window[appNamespace].logger.error) {
window[appNamespace].logger.error("Global namespace already defined. Aborting.", this)
}
return
}
var what = function(obj) {
return typeof obj == "undefined" || obj === null ? "undefined" : ({}).toString.call(obj).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()
};
var $extend = function(source) {
if (this.$root.what(source) != "object") {
this.$root.logger.warn("source is not an object", this);
return
}
var key;
for (key in source) {
this[key] = source[key]
}
return this
};
var $fn = function(key, fn) {
if (!this || this == window) {
return
}
if (this.$root.what(fn) != "function") {
this.$root.logger.warn(key + " is not a function", this);
return
}
this[key] = fn;
fn.$id = key;
fn.$parent = this;
fn.$root = this.$root
};
var $create = function(id, source, extension, bindable) {
var wsource = what(source),
parent = this || window,
node, key;
if (!/object|function/.test(wsource)) {
return null
}
if (parent[id]) {
node = parent[id]
} else {
var maker = function() {
var node = function() {};
node.prototype.$id = id;
node.prototype.$parent = parent;
node.prototype.$root = parent == window ? null : parent.$root;
node.prototype.$create = $create;
node.prototype.$extend = $extend;
node.prototype.$fn = $fn;
if (bindable && parent != window && parent.$root.event) {
node.prototype.bind = parent.$root.event.bind;
node.prototype.unbind = parent.$root.event.unbind;
node.prototype.fire = parent.$root.event.fire
}
return node
};
node = parent[id] = new(new maker())
}
if (what(extension) == "object") {
node.$extend(extension)
}
for (key in source) {
switch (what(source[key])) {
case "function":
node.$fn(key, source[key]);
break;
case "object":
node.$create(key, source[key]);
break;
default:
node[key] = source[key]
}
}
return node
};
var NodesArray = function() {
this.nodes = []
};
NodesArray.prototype = {
toString: function(separator) {
var result = [],
i, len;
for (i = 0, len = this.nodes.length; i < len; i++) {
result.unshift(this.nodes[i].$id)
}
return result.join(separator || ".")
}
};
var $root = $create(appNamespace, {}, null, false);
$root.what = what;
$root.$root = $root;
$root.$extend({
NodesArray: NodesArray,
$fn: $fn
});
$root.$create("plugins", {}, {}, true);
var versionFile = "ice";
var event = $root.$create("event", {
bind: function(o) {
var rt = this.$root,
ev = rt.event,
ls, key, clone, prop, err = null;
if (!o.event) {
err = ev.msgs.me
} else {
if (!o.listener) {
err = ev.msgs.ml
}
}
if (err) {
rt.logger.error(err, this);
return false
}
o.$root = rt;
if (!ev._listeners[o.event]) {
ev._listeners[o.event] = []
}
ls = ev._listeners[o.event];
var listenerType = rt.what(o.listener);
if (listenerType == "function") {
ls[ls.length] = o
} else {
if (listenerType == "object") {
for (key in o.listener) {
if (this != ev) {
this.$fn(key, o.listener[key])
}
clone = {};
for (prop in o) {
clone[prop] = o[prop]
}
clone.listener = o.listener[key];
ls[ls.length] = clone
}
}
}
return true
},
unbind: function(event, listener) {
var rt = this.$root,
ev = rt.event,
i, len, ls = ev._listeners[event];
if (rt.what(ls) != "array") {
return false
}
if (!listener) {
delete ev._listeners[event]
} else {
for (i = 0, len = ls.length; i < len; i++) {
if (ls[i].listener === listener) {
ls.splice(i--, 1)
}
}
}
return true
},
fire: function(event, data, delay) {
var rt = this.$root,
ls = rt.event._listeners[event],
func, context, o, hasData = rt.what(data) != "undefined",
time, msg;
if (!event || rt.event.disabled || (ls && ls.disabled) || rt.what(ls) != "array") {
return false
}
for (var i = 0, len = ls.length; i < len; i++) {
o = ls[i];
if (hasData) {
o.data = data
}
func = o.listener;
context = func.$parent || window;
if (context == window) {
rt.logger.error("Probable Error: Context is window object. event: " + event, this.fire)
}
if (rt.event.log) {
msg = ['Fire "', func.$id || "Anonymous", '" on "', event, '".', data && data.hookId ? " hookId:" + data.hookId : ""].join("")
}
time = delay && rt.what(delay) == "number" ? delay : o.delay;
if (time) {
return setTimeout((function() {
var clone = rt.utils.object.clone(o);
return function() {
if (msg) {
rt.logger.log(msg, func)
}
func.call(context, clone)
}
}()), time)
} else {
if (msg) {
rt.logger.log(msg, func)
}
func.call(context, o)
}
}
},
repeat: function(event, interval, data, delay) {
var rt = this.$root,
ls = rt.event._listeners[event],
func, context, o, hasData = rt.what(data) != "undefined",
msg, wrapper;
if (!event || rt.event.disabled || (ls && ls.disabled) || rt.what(ls) != "array" || !interval || rt.what(interval) != "number") {
return false
}
if (!delay || rt.what(delay) != "number") {
delay = null
}
for (var i = 0, len = ls.length; i < len; i++) {
o = ls[i];
if (o.repeat || o.delay) {
return
}
if (hasData) {
o.data = data
}
func = o.listener;
context = func.$parent || window;
if (rt.event.log) {
msg = ['Repeat "', func.$id || "Anonymous", '" on "', event, '".'].join("")
}
o.interval = interval;
o.counter = 0;
wrapper = function() {
if (msg && !o.counter) {
rt.logger.log(msg, func)
}
o.counter++;
func.call(context, o)
};
if (delay) {
o.delay = setTimeout(function() {
o.repeat = setInterval(wrapper, interval)
}, delay)
} else {
o.repeat = setInterval(wrapper, interval)
}
}
},
stop: function(event) {
var rt = this.$root,
ls = rt.event._listeners[event],
func, o;
if (!event || !ls) {
return false
}
for (var i = 0, len = ls.length; i < len; i++) {
o = ls[i];
clearInterval(o.repeat);
clearTimeout(o.delay);
delete o.repeat;
delete o.delay;
func = o.listener;
if (rt.event.log) {
rt.logger.log(['Stop "', func.$id || "Anonymous", '" on "', event, '" after ', o.counter, " repetitions."].join(""), func)
}
o.counter = 0
}
},
disable: function(event) {
this.$root.event.able(event, true)
},
enable: function(event) {
this.$root.event.able(event, false)
},
able: function(event, disabled) {
var rt = this.$root,
i;
if (event) {
if (rt.what(event) == "string") {
event = [event]
}
for (i = 0; i < event.length; i++) {
rt.event._listeners[event].disabled = disabled
}
} else {
rt.event.disabled = disabled
}
}
}, {
_listeners: {},
log: true,
msgs: {
me: "Error: Missing event.",
ml: "Error: Misssing listener."
}
}, false);
event.$create("dom", {
bind: function(element, o) {
var rt = this.$root,
nt = rt.settings.nodeTypes,
key, clone, prop, err = null,
func;
function isAChildOf(parent, child) {
if (parent === child) {
return false
}
while (child && child !== parent) {
child = child.parentNode
}
return child === parent
}
if (!element || !(element.nodeType == nt.ELEMENT || element.nodeType == nt.DOCUMENT || element == window)) {
err = this.msgs.mbe
} else {
if (!o.event) {
err = this.$parent.msgs.me
} else {
if (!o.listener) {
err = this.$parent.msgs.ml
}
}
}
if (err) {
rt.logger.error(err, this);
return false
}
if (!element.$iceId) {
element.$iceId = ++this.elementBinder
}
o.element = element;
o.$root = rt;
if (rt.what(o.listener) == "function") {
o.listener = {
a: o.listener
}
} else {
if (rt.what(o.listener) != "object") {
return
}
}
for (key in o.listener) {
clone = {};
for (prop in o) {
clone[prop] = o[prop]
}
clone.listener = o.listener[key];
if (element.addEventListener) {
if (/mouseenter|mouseleave/.test(clone.event)) {
clone.simEvent = clone.event;
clone.event = clone.event.replace(/enter/, "over").replace(/leave/, "out")
}
}
func = (function() {
var reclone = rt.utils.object.clone(clone);
return function(domEvt) {
if (!domEvt) {
domEvt = window.event
}
if (/mouseenter|mouseleave/.test(reclone.simEvent) && domEvt.relatedTarget && this == domEvt.relatedTarget || (isAChildOf(this, domEvt.relatedTarget))) {
return
}
reclone.domEvent = domEvt;
rt.event.dom.fire(reclone)
}
})();
if (element.addEventListener) {
element.addEventListener(clone.event, func, false)
} else {
if (element.attachEvent) {
element.attachEvent("on" + clone.event, func)
}
}
var eID = element.$iceId;
var eL = this._listeners;
if (!eL[eID]) {
eL[eID] = {}
}
if (!eL[eID][clone.event]) {
eL[eID][clone.event] = []
}
rt.utils.array.push(eL[eID][clone.event], {
listener: func,
original: clone.listener
})
}
return true
},
unbind: function(element, event, listener) {
var rt = this.$root,
nt = rt.settings.nodeTypes,
i;
if (!element || !element.$iceId || !(element.nodeType == nt.ELEMENT || element.nodeType == nt.DOCUMENT || element == window)) {
rt.logger.error(this.msgs.mbe, this);
return
}
var eID = element.$iceId;
var ls = rt.event.dom._listeners[eID];
if (!ls || !ls[event]) {
return
}
for (i = 0; i < ls[event].length; i++) {
if (ls[event][i].original == listener) {
if (element.removeEventListener) {
element.removeEventListener(event, ls[event][i].listener, false)
} else {
if (element.detachEvent) {
element.detachEvent("on" + event, ls[event][i].listener)
}
}
ls[event].splice(--i, 1)
}
}
if (ls[event].length == 0) {
delete ls[event]
}
return true
},
fire: function(o) {
var rt = this.$root,
func = o.listener,
context = func.$parent || window,
msg;
if (rt.event.log) {
msg = ['Fire "', func.$id || "Anonymous", '" on "', o.event, '".', o.data && o.data.hookId ? " hookId:" + o.data.hookId : ""].join("")
}
if (o.delay && rt.what(o.delay) == "number") {
setTimeout(function() {
if (msg) {
rt.logger.log(msg, func)
}
func.call(context, o)
}, o.delay)
} else {
if (msg) {
rt.logger.log(msg, func)
}
func.call(context, o)
}
}
}, {
_listeners: {},
elementBinder: 0,
msgs: {
mbe: "Error: Missing or bad element."
}
}, false);
$root.$create("logger", {
log: function(message, context, type) {
if (!type) {
type = "log"
}
this.history[this.history.length] = {
message: message,
type: type,
time: (new Date()).getTime(),
context: context
};
if (this.output == "console" && this.$root.what(window.console) != "undefined") {
console[type](message, this.descent(context))
}
},
info: function(message, context) {
this.log(message, context, "info")
},
warn: function(message, context) {
this.log(message, context, "warn")
},
error: function(message, context, kill) {
this.log(message, context, "error");
if (kill) {
this.$root.event.disable()
}
if (this.errorReporting >= Math.ceil(Math.random() * 100)) {
this.$root.event.fire("sendErrorReport", {
msg: message
})
}
},
descent: function(context) {
var result = new this.$root.NodesArray;
while (context && context.$root && context != window) {
result.nodes[result.nodes.length] = context;
context = context.$parent
}
return result
}
}, {
history: [],
output: "none",
errorReporting: -1
});
$root.$create("browser", new function() {
var ua = this.ua = navigator.userAgent;
var uac = function(str) {
return ua.indexOf(str) != -1
};
var _found = false;
var ver = function(browser) {
if (_found) {
return false
}
var match = ua.match(new RegExp(browser + ".?([0-9][0-9\\.]+)"));
if (match != null) {
_found = true;
return match[1]
}
return false
};
this.IE = ver("MSIE");
if (this.IE == "7.0" && $root.what(Array.isArray) == "function") {
this.IE = "9.0"
}
this.Firefox = ver("Firefox");
this.Chrome = ver("Chrome");
this.Safari = this.Chrome ? false : uac("Safari") && ver("Version");
this.MobileSafari = this.Safari && uac("Mobile") ? this.Safari : false;
this.Opera = uac("Opera") && uac("Presto") ? ver("Version") || ver("Opera") : false;
this.OperaMini = this.Opera && uac("Opera Mini");
this.ucweb = ver("UCWEB") || (uac("UCWEB") ? ver("Browser") : false);
_found = false;
this.AppleWebKit = ver("AppleWebKit");
this.Gecko = ver("Gecko");
this.Mozilla = !this.Gecko && !this.AppleWebKit && uac("Mozilla/");
_found = false;
this.WindowsMobile = uac("Windows Phone OS");
this.Windows = uac("Windows ");
this.Linux = !this.Windows && (uac("Linux ") || uac("Linux;"));
this.Mac = !this.Windows && !this.Linux && uac("Mac ");
this.iPhone = !this.Windows && !this.Linux && uac("iPhone");
this.iPad = !this.Windows && !this.Linux && uac("iPad");
this.Android = (!this.Windows && uac("Android")) ? ver("Android") : false;
this.Nokia = uac("Nokia");
this.getOS = function() {
var os = ["WindowsMobile", "Windows", "iPhone", "Mac", "iPad", "Android", "Nokia", "Linux"],
i, leni = os.length;
for (i = 0; i < leni; i++) {
if (this[os[i]]) {
return os[i]
}
}
return "unknown"
};
this.isMobile = function() {
return !!(this.iPhone || this.iPad || this.Android || this.WindowsMobile || this.OperaMini || this.ucweb)
};
this.getName = function() {
var names = ["IE", "Firefox", "Chrome", "MobileSafari", "Safari", "Opera", "ucweb", "Gecko", "AppleWebKit", "Mozilla"];
for (var i = 0, leni = names.length; i < leni; i++) {
if (this[names[i]]) {
return names[i]
}
}
return "unknown"
};
this.getVersion = function(asFloat) {
var ver = this.IE || this.Firefox || this.Chrome || this.MobileSafari || this.Safari || this.Opera || this.AppleWebKit || this.ucweb || "unknown";
return asFloat ? parseFloat(ver) || -1 : ver
};
this.toString = this.getValue = function() {
return [this.getName(), this.getVersion(), this.getOS()].join(" ")
}
});
var utils = $root.$create("utils", {
VeST: function(template, data, name) {
var fn, v = this.VeST,
c;
if (!(c = v.cache)) {
c = v.cache = {};
v.encQ = function(m) {
return m.split("'").join("\t")
};
v.decQ = function(m) {
return m.split("\t").join("'")
}
}
if (name && c[name]) {
fn = c[name]
} else {
template = template.replace(/<%\-\-[\s\S]*?\-\-%>/g, "");
var tjs = template.replace(/[\r\t\n]/g, " ").replace(/<%.*?%>/g, v.encQ).replace(/'/g, "\\'").replace(/<%.*?%>/g, v.decQ).replace(/<%=(.*?)%>/g, "',$1,'").split("<%").join("');").split("%>").join("p.push('");
tjs = ["var p=[];with(obj||{}){p.push('", tjs, "');}return p.join('');"].join("");
fn = new Function("obj", tjs);
if (name) {
c[name] = fn
}
}
return fn(data)
},
doRectsOverlap: function(r1, r2) {
var temp;
if (r2[0] < r1[0]) {
temp = r1;
r1 = r2;
r2 = temp
}
if (r1[2] < r2[0] || r1[0] > r2[2]) {
return false
}
if (r2[1] < r1[1]) {
temp = r1;
r1 = r2;
r2 = temp
}
if (r1[3] < r2[1] || r1[1] > r2[3]) {
return false
}
return true
}
});
utils.$create("number", {
get: function(counter) {
return this.counters[counter]
},
next: function(counter, start) {
if (this.$root.what(this.counters[counter]) == "undefined") {
this.counters[counter] = this.$root.what(start) == "number" ? start : 0
} else {
this.counters[counter]++
}
return this.counters[counter]
}
}, {
counters: {}
});
utils.$create("string", {
capitalize: function(str) {
var arr = str.split(/\s+/);
if (arr.length > 2) {
arr[0] = arr[0].charAt(0).toUpperCase() + arr[0].slice(1)
} else {
for (var i = 0, len = arr.length; i < len; ++i) {
arr[i] = arr[i].charAt(0).toUpperCase() + arr[i].slice(1)
}
}
return arr.join(" ")
},
qw: function(str) {
return this.trim(str).split(/\s+/)
},
toObject: function(str, key, decode) {
if (str.indexOf("=") == -1) {
return null
}
if (str.indexOf("?") == 0) {
str = str.substring(1)
}
var obj = {},
pairs = str.split("&"),
kv;
for (var i = 0, leni = pairs.length; i < leni; i++) {
kv = pairs[i].split("=");
if (kv.length != 2) {
continue
}
if (decode) {
kv[0] = decodeURIComponent(kv[0]);
kv[1] = decodeURIComponent(kv[1])
}
obj[kv[0]] = kv[1]
}
return this.$root.what(key) != "undefined" ? obj[key] : obj
},
trim: function(str) {
return str.replace(/^\s+|\s+$/g, "")
},
truncate: function(str, len, suffix) {
return str.length <= len ? str : str.substring(0, len) + (suffix || "")
},
truncateToChar: function(str, len, sep, suffix) {
var str2 = str.length <= len ? str : str.substring(0, len);
if (str2.length < str.length) {
str2 = str2.substr(0, str2.lastIndexOf(sep)) + (suffix || "")
}
return str2
}
});
utils.$create("array", {
clone: function(origin, deep) {
var clone = [],
i, leni, rt = this.$root;
for (i = 0, leni = origin.length; i < leni; i++) {
if (deep && /object|array/.test(rt.what(origin[i])) && (!this.cloneDepth || this.cloneDepth < 10)) {
if (!this.cloneDepth) {
this.cloneDepth = 0
}
this.cloneDepth++;
clone[i] = rt.what(origin[i]) == "object" ? this.$parent.object.clone(origin[i], deep) : this.clone(origin[i], deep)
} else {
clone[i] = origin[i]
}
}
delete this.cloneDepth;
return clone
},
concat: function() {
var arr = [];
for (var i = 0, leni = arguments.length; i < leni; i++) {
for (var j = 0, lenj = arguments[i].length; j < lenj; j++) {
arr[arr.length] = arguments[i][j]
}
}
return arr
},
discard: function(arr, item) {
for (var i = arr.length - 1; i >= 0; i--) {
if (arr[i] == item) {
arr.splice(i, 1)
}
}
return arr
},
indexOf: function(arr, item) {
for (var i = 0, leni = arr.length; i < leni; i++) {
if (arr[i] == item) {
return i
}
}
return -1
},
insertionSort: function(arr, prop, asc) {
var i, j, value;
for (i = 1; i < arr.length; i++) {
value = arr[i];
j = i - 1;
while (j >= 0 && (asc ? arr[j][prop] > value[prop] : arr[j][prop] < value[prop])) {
arr[j + 1] = arr[j];
j--
}
arr[j + 1] = value
}
},
map: function(arr, mapper) {
for (var i = 0, leni = arr.length, res = []; i < leni; i++) {
res[i] = mapper(arr[i])
}
return res
},
push: function() {
if (arguments.length < 2) {
return
}
var arr = arguments[0];
for (var i = 1; i < arguments.length; i++) {
arr[arr.length] = arguments[i]
}
},
range: function(start, end) {
var arr = [],
i, what = this.$root.what;
if (what(start) == "number" && what(end) == "number" && start <= end) {
for (i = start; i <= end; i++) {
arr[arr.length] = i
}
}
return arr
},
sum: function(arr) {
var sum = 0,
i, len, what = this.$root.what;
for (i = 0, len = arr.length; i < len; i++) {
if (what(arr[i]) == "number") {
sum += arr[i]
}
}
return sum
},
times: function(str, x) {
var arr = this.range(1, x),
i;
for (i = 0; i < x; i++) {
arr[i] = str
}
return arr
},
toObject: function(arr, object, value) {
if (!arr) {
return object
}
var what = this.$root.what;
if (what(arr) != "array") {
arr = [arr]
}
if (!object) {
object = {}
}
var item, key, val;
for (var i = 0, leni = arr.length; i < leni; i++) {
item = arr[i];
key = what(item) == "string" ? item : item != null && what(item.toString) == "function" ? item.toString() : null;
if (key) {
val = (what(value) == "undefined") ? key : (what(value) == "function") ? value(key) : value;
object[key] = val
}
}
return object
},
uniq: function(arr) {
var i, j;
for (i = 0; i < arr.length - 1; i++) {
for (j = i + 1; j < arr.length; j++) {
if (arr[i] === arr[j]) {
arr.splice(j, 1);
j--
}
}
}
return arr
}
});
utils.$create("object", {
clean: function(obj) {
var res = {},
key, val, what = this.$root.what;
for (key in obj) {
val = obj[key];
if (what(val) == "undefined" || val === "" || val === null) {
continue
}
res[key] = obj[key]
}
return res
},
clone: function(origin, deep) {
var clone = {},
key, rt = this.$root;
for (key in origin) {
if (deep && /object|array/.test(rt.what(origin[key])) && (!this.cloneDepth || this.cloneDepth < 10)) {
if (!this.cloneDepth) {
this.cloneDepth = 0
}
this.cloneDepth++;
clone[key] = rt.what(origin[key]) == "object" ? this.clone(origin[key], deep) : this.$parent.array.clone(origin[key], deep)
} else {
clone[key] = origin[key]
}
}
delete this.cloneDepth;
return clone
},
extend: function() {
if (arguments.length < 2) {
return arguments.length ? arguments[0] : {}
}
var key, rt = this.$root,
i, leni, dest = arguments[0],
source;
if (rt.what(dest) != "object") {
return dest
}
for (i = 1, leni = arguments.length; i < leni; i++) {
source = arguments[i];
if (rt.what(source) == "object") {
for (key in source) {
dest[key] = source[key]
}
}
}
return dest
},
hasKey: function(obj, keys) {
if (!(keys instanceof Array)) {
keys = [keys]
}
for (var i = 0, leni = keys.length, what = this.$root.what; i < leni; i++) {
if (what(obj[keys[i]]) != "undefined") {
return true
}
}
return false
},
keys: function(obj) {
var arr = [];
for (var key in obj) {
arr[arr.length] = key
}
return arr
},
renamePorpery: function(o, oldName, newName) {
var rt = this.$root;
if (rt.what(o[oldName]) == "undefined") {
return
}
o[newName] = o[oldName];
delete o[oldName]
},
stringify: function(json, depth) {
var res, rt = this.$root,
type = rt.what(json),
push = rt.utils.array.push,
i, leni, key, sgf = this.stringify;
if (!depth) {
depth = 1
}
if (depth > 10) {
res = '"Exceeded max depth of 10 levels."'
} else {
if (type == "undefined") {
res = "undefined"
} else {
if (type == "number" || type == "boolean") {
res = json
} else {
if (type == "string") {
res = ['"', json.replace(/"/g, '\\"'), '"'].join("")
} else {
if (type == "function") {
res = '"[Function]"'
} else {
if (type == "array") {
res = ["["];
for (i = 0, leni = json.length; i < leni; i++) {
push(res, sgf.call(this, json[i], depth + 1), ",")
}
if (res.length > 1) {
res.pop()
}
push(res, "]");
res = res.join("")
} else {
if (json === null) {
res = "null"
} else {
if (type == "object") {
res = ["{"];
for (key in json) {
push(res, '"', key.replace(/"/g, '\\"'), '":', sgf.call(this, json[key], depth + 1), ",")
}
if (res.length > 1) {
res.pop()
}
push(res, "}");
res = res.join("")
}
}
}
}
}
}
}
}
return res
},
toQueryString: function(obj, useEncoding) {
var res = [],
key, value, push = this.$parent.array.push;
for (key in obj) {
if (useEncoding) {
key = encodeURIComponent(key);
value = encodeURIComponent(obj[key])
} else {
value = obj[key]
}
push(res, res.length ? "&" : "?", key, "=", value)
}
return res.join("")
},
values: function(obj) {
var arr = [];
for (var key in obj) {
arr[arr.length] = obj[key]
}
return arr
}
});
utils.$create("date", {
now: function() {
return new Date().getTime()
}
});
utils.$create("timer", {
start: function(id) {
var time = this.$root.utils.date.now();
this.times[id] = {
start: time
};
return time
},
stop: function(id) {
var rt = this.$root,
o = this.times[id];
if (!o || !o.start) {
rt.logger.warn(['Trying to stop timer "', id, '" which does not exist.'].join(""), this.stop);
return 0
}
o.stop = rt.utils.date.now();
o.delta = o.stop - o.start;
return o.delta
},
delta: function(id) {
var o = this.times[id];
return o && o.delta ? o.delta : 0
},
poll: function(id) {
var o = this.times[id];
if (!o || !o.start) {
return 0
}
return (o.stop || this.$root.utils.date.now()) - o.start
},
clear: function(id) {
delete this.times[id]
}
}, {
times: {}
});
utils.$create("cookie", {
set: function(name, value, expiration) {
expiration = expiration ? ("; expires=" + (this.$root.what(expiration) == "date" ? expiration.toUTCString() : new Date((new Date()).getTime() + expiration * 1000).toUTCString())) : "";
var parts = location.hostname.split(".");
var domain = "; domain=" + [parts[parts.length - 2], parts[parts.length - 1]].join(".");
document.cookie = [name, "=", encodeURIComponent(value), expiration, domain, "; path=/"].join("");
return true
},
has: function(name) {
return this.$parent.array.indexOf(this.$parent.array.map(document.cookie.split(/;\s*/), function(item) {
return item.split("=")[0]
}), name) > -1
},
remove: function(name) {
var parts = location.hostname.split(".");
var domain = "; domain=" + [parts[parts.length - 2], parts[parts.length - 1]].join(".");
document.cookie = [name, "=;expires=", new Date((new Date()).getTime() - 60000).toUTCString(), domain, "; path=/"].join("");
return true
},
get: function(name) {
var cookies = {};
this.$parent.array.map(document.cookie.split(/;\s*/), function(cookie) {
var p = cookie.split("=");
cookies[p[0]] = p[1];
return null
});
return decodeURIComponent(cookies[name]) || null
}
});
utils.$create("base64", {
init: function(str) {
if (!this.reverseBase64Chars) {
this.reverseBase64Chars = {};
for (var i = 0, leni = this.base64Chars.length; i < leni; i++) {
this.reverseBase64Chars[this.base64Chars[i]] = i
}
}
this.base64Str = str;
this.base64Count = 0
},
readBase64: function() {
if (!this.base64Str) {
return this.EOI
}
if (this.base64Count >= this.base64Str.length) {
return this.EOI
}
var c = this.base64Str.charCodeAt(this.base64Count) & 255;
this.base64Count++;
return c
},
encodeBase64: function(str) {
this.init(str);
var result = "";
var inBuffer = new Array(3);
var lineCount = 0;
var done = false;
while (!done && (inBuffer[0] = this.readBase64()) != this.EOI) {
inBuffer[1] = this.readBase64();
inBuffer[2] = this.readBase64();
result += (this.base64Chars[inBuffer[0] >> 2]);
if (inBuffer[1] != this.EOI) {
result += (this.base64Chars[((inBuffer[0] << 4) & 48) | (inBuffer[1] >> 4)]);
if (inBuffer[2] != this.EOI) {
result += (this.base64Chars[((inBuffer[1] << 2) & 60) | (inBuffer[2] >> 6)]);
result += (this.base64Chars[inBuffer[2] & 63])
} else {
result += (this.base64Chars[((inBuffer[1] << 2) & 60)]);
result += ("=");
done = true
}
} else {
result += (this.base64Chars[((inBuffer[0] << 4) & 48)]);
result += ("=");
result += ("=");
done = true
}
lineCount += 4;
if (lineCount >= 76) {
result += ("\n");
lineCount = 0
}
}
return result
},
readReverseBase64: function() {
if (!this.base64Str) {
return this.EOI
}
while (true) {
if (this.base64Count >= this.base64Str.length) {
return this.EOI
}
var nextCharacter = this.base64Str.charAt(this.base64Count);
this.base64Count++;
if (this.reverseBase64Chars[nextCharacter]) {
return this.reverseBase64Chars[nextCharacter]
}
if (nextCharacter == "A") {
return 0
}
}
},
ntos: function(n) {
n = n.toString(16);
if (n.length == 1) {
n = "0" + n
}
n = "%" + n;
return unescape(n)
},
decodeBase64: function(str) {
this.init(str);
var result = "";
var inBuffer = new Array(4);
var done = false;
while (!done && (inBuffer[0] = this.readReverseBase64()) != this.EOI && (inBuffer[1] = this.readReverseBase64()) != this.EOI) {
inBuffer[2] = this.readReverseBase64();
inBuffer[3] = this.readReverseBase64();
result += this.ntos((((inBuffer[0] << 2) & 255) | inBuffer[1] >> 4));
if (inBuffer[2] != this.EOI) {
result += this.ntos((((inBuffer[1] << 4) & 255) | inBuffer[2] >> 2));
if (inBuffer[3] != this.EOI) {
result += this.ntos((((inBuffer[2] << 6) & 255) | inBuffer[3]))
} else {
done = true
}
} else {
done = true
}
}
return result
}
}, {
EOI: -1,
base64Chars: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),
reverseBase64Chars: null,
base64Str: "",
base64Count: 0
});
utils.$create("dom", {
createDOMFragment: function(o) {
var el, rt = this.$root,
key, i, leni, child;
if (o.tag) {
var tag = o.tag.toLowerCase();
el = document.createElement(tag);
if (tag == "input") {
el.type = o.type || "text"
}
if (o.id) {
el.id = o.id
}
if (o.cls) {
el.className = o.cls
}
if (o.style) {
this.element.setStyle(el, o.style)
}
if (o.attributes) {
for (key in o.attributes) {
el.setAttribute(key, o.attributes[key])
}
}
if (rt.what(o.value) != "undefined") {
el.value = o.value
}
if (rt.what(o.innerHTML) != "undefined") {
el.innerHTML = o.innerHTML
}
if (o.events) {
for (key in o.events) {
rt.event.dom.bind(el, {
event: key,
listener: o.events[key]
})
}
}
} else {
if (o.isTextNode && rt.what(o.value) != "undefined") {
el = document.createTextNode(o.value)
} else {
return null
}
}
if (o.isChild) {
el = o.parent.appendChild(el)
}
if (o.tag && o.children) {
if (rt.what(o.children) != "array") {
o.children = [o.children]
}
for (i = 0, leni = o.children.length; i < leni; i++) {
child = o.children[i];
rt.utils.object.extend(child, {
isChild: true,
parent: el
});
this.createDOMFragment(child)
}
} else {
if (o.tag && o.childNodes) {
for (i = 0, leni = o.childNodes.length; i < leni; i++) {
el.appendChild(o.childNodes[i])
}
}
}
if (!o.isChild && o.parent) {
var parent = rt.what(o.parent) == "string" ? this.element.$(o.parent) : o.parent;
if (o.overwrite) {
parent.innerHTML = ""
}
o.before ? parent.insertBefore(el, o.before) : o.after ? this.element.insertAfter(el, o.after) : parent.appendChild(el)
}
return el
},
filterByClass: function(cls, tag, elm) {
if (!this._filterByClass) {
if (document.getElementsByClassName) {
this._filterByClass = function(cls, tag, elm) {
var elements = (elm ? (elm.getElementsByClassName ? elm : document) : document).getElementsByClassName(cls),
els = [];
tag = tag ? tag.toLowerCase() : null;
for (var i = 0, leni = elements.length; i < leni; i++) {
if (!tag || elements[i].tagName.toLowerCase() == tag) {
els[els.length] = elements[i]
}
}
return els
}
} else {
if (document.evaluate) {
this._filterByClass = function(cls, tag, elm) {
tag = tag || "*";
elm = elm || document;
var classes = cls.split(" "),
classesToCheck = "",
xhtmlNamespace = "http://www.w3.org/1999/xhtml",
namespaceResolver = (document.documentElement.namespaceURI === xhtmlNamespace) ? xhtmlNamespace : null,
els = [],
elements, node;
for (var j = 0, jl = classes.length; j < jl; j++) {
classesToCheck += "[contains(concat(' ', @class, ' '), ' " + classes[j] + " ')]"
}
try {
elements = document.evaluate(".//" + tag + classesToCheck, elm, namespaceResolver, 0, null)
} catch (e) {
elements = document.evaluate(".//" + tag + classesToCheck, elm, null, 0, null)
}
while ((node = elements.iterateNext())) {
els[els.length] = node
}
return els
}
} else {
this._filterByClass = function(cls, tag, elm) {
tag = tag || "*";
elm = elm || document;
var classes = cls.split(" "),
classesToCheck = [],
elements = (tag === "*" && elm.all) ? elm.all : elm.getElementsByTagName(tag),
current, els = [],
match;
for (var k = 0, kl = classes.length; k < kl; k++) {
classesToCheck[classesToCheck.length] = new RegExp("(^|\\s)" + classes[k] + "(\\s|$)")
}
for (var l = 0, ll = elements.length; l < ll; l++) {
current = elements[l];
match = false;
for (var m = 0, ml = classesToCheck.length; m < ml; m++) {
match = classesToCheck[m].test(current.className);
if (!match) {
break
}
}
if (match) {
els[els.length] = current
}
}
return els
}
}
}
}
return this._filterByClass(cls, tag, elm)
},
findWidestNode: function() {
var bd = document.body,
i, leni, rt = this.$root,
dm = rt.utils.dom,
dmel = dm.element,
node, widestNode, width, maxWidth = 0,
height, minHeight = 50,
widest = null;
for (i = 0, leni = bd.childNodes.length; i < leni; i++) {
node = bd.childNodes[i];
if (node.nodeType != rt.settings.nodeTypes.ELEMENT || !dmel.isVisible(node)) {
continue
}
width = dmel.getActualWidth(node);
height = dmel.getActualHeight(node);
if (width > maxWidth && height > minHeight) {
maxWidth = width;
widest = {
node: node,
width: width,
height: height
}
}
}
if (!widest) {
widestNode = bd;
widest = {
node: bd,
width: dm.document.getWidth(),
height: dm.document.getHeight()
}
}
return widest
}
});
utils.dom.$create("element", {
$: function(id) {
return document.getElementById(id)
},
getActualWidth: function(el) {
var cssWidth = this.getStyle(el, "width");
var width = parseInt(cssWidth, 10);
return !isNaN(width) && (width > 0) && (cssWidth.match(/px/)) ? width : el.clientWidth || el.offsetWidth
},
getActualHeight: function(el) {
var cssHeight = this.getStyle(el, "height");
var height = parseInt(cssHeight, 10);
return !isNaN(height) && (height > 0) && (cssHeight.match(/px/)) ? height : el.clientHeight || el.offsetHeight
},
getStyle: function(node, prop) {
var dfv = document.defaultView,
style = node.currentStyle || (dfv && dfv.getComputedStyle ? dfv.getComputedStyle(node, null) : null) || node.style;
return prop && style ? style[prop] : style
},
inHierarchy: function(low, high) {
do {
if (low == high) {
return true
}
low = low.parentNode
} while (low);
return false
},
insertAfter: function(newNode, refNode) {
var parent = refNode.parentNode;
return refNode.nextSibling ? parent.insertBefore(newNode, refNode.nextSibling) : parent.appendChild(newNode)
},
isOnViewport: function(node) {
if (!this.isVisible(node)) {
return false
}
return (this.offset(node).top < this.$parent.viewport.getHeight())
},
isVisible: function(node) {
if (!node) {
return false
}
while (node && node.tagName && node.tagName.toLowerCase() != "body") {
var cs = this.getStyle(node);
if (cs["display"] == "none" || cs["visibility"] == "hidden") {
return false
}
node = node.parentNode
}
return true
},
offset: function(node, ancestor) {
var x = 0,
y = 0,
rt = this.$root,
dm = rt.utils.dom,
dmel = dm.element,
b = rt.browser,
parent, body = document.body || document.documentElement;
var pos = "position",
abs = "absolute",
blw = "borderLeftWidth",
btw = "borderTopWidth";
if (!ancestor) {
ancestor = body
}
if (node == ancestor) {
return {
left: 0,
top: 0
}
}
if (node.getBoundingClientRect && !ancestor) {
var box = node.getBoundingClientRect();
var scrollTop = dm.document.getScrollTop();
var scrollLeft = dm.document.getScrollLeft();
return {
left: parseInt(box.left + scrollLeft, 10),
top: parseInt(box.top + scrollTop, 10)
}
}
var hasAbsolute = dmel.getStyle(node, pos) == abs;
parent = node;
while (parent && parent != ancestor) {
x += parent.offsetLeft;
y += parent.offsetTop;
if (!hasAbsolute && dmel.getStyle(parent, pos) == abs) {
hasAbsolute = true
}
if (b.Firefox) {
var bl = parseInt(dmel.getStyle(parent, blw), 10) || 0;
var bt = parseInt(dmel.getStyle(parent, btw), 10) || 0;
x += bl;
y += bt;
if (parent != node && dmel.getStyle(parent, "overflow") != "visible") {
x += bl;
y += bt
}
}
parent = parent.offsetParent
}
if (b.Safari && hasAbsolute) {
x -= body.offsetLeft;
y -= body.offsetTop
}
if (b.Firefox && !hasAbsolute) {
x += parseInt(dmel.getStyle(body, blw), 10) || 0;
y += parseInt(dmel.getStyle(body, btw), 10) || 0
}
parent = node.parentNode;
while (parent && parent != ancestor) {
if (!b.Opera || (parent.tagName.toLowerCase() != "tr" && dmel.getStyle(parent, "display") != "inline")) {
x -= parent.scrollLeft;
y -= parent.scrollTop
}
parent = parent.parentNode
}
var bs = dmel.getStyle(body);
if (ancestor == body && bs.position == abs && bs.left) {
x -= parseInt(bs.left, 10) || 0
}
return {
left: parseInt(x, 10),
top: parseInt(y, 10)
}
},
setStyle: function(node, styles) {
var b = this.$root.browser,
key;
if (!node) {
return null
}
if (!styles) {
styles = {}
}
for (key in styles) {
if (styles[key] != null) {
if ((key == "opacity" || key == "cssFloat") && b.IE) {
if (key == "opacity") {
node.style["filter"] = "alpha(opacity=" + Math.ceil(parseFloat(styles[key]) * 100) + ")"
}
if (key == "cssFloat") {
node.style["styleFloat"] = styles[key]
}
} else {
node.style[key] = styles[key]
}
}
}
return node
},
getData: function(node, dataId) {
return node.dataset ? node.dataset[dataId] : node.getAttribute("data-" + dataId)
},
setData: function(node, dataId, val) {
node.dataset ? (node.dataset[dataId] = val) : node.setAttribute("data-" + dataId, val)
}
});
utils.dom.$create("document", {
getHeight: function() {
var body = document.body,
html = document.documentElement;
return Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight)
},
getWidth: function() {
var d = document,
m = "clientWidth";
return Math.max(d.documentElement[m], d.body[m]) || 0
},
getScrollTop: function() {
var d = document,
m = "scrollTop";
return window.pageYOffset || d.documentElement[m] || d.body[m] || 0
},
getScrollLeft: function() {
var d = document,
m = "scrollLeft";
return window.pageXOffset || d.documentElement[m] || d.body[m] || 0
}
});
utils.dom.$create("viewport", {
getHeight: function() {
var d = document,
de = d.documentElement,
m = "clientHeight";
return window.innerHeight || (de ? (de[m] || d.body[m] || 0) : 0)
},
getWidth: function() {
var d = document,
de = d.documentElement,
m = "clientWidth";
return window.innerWidth || (de ? (de[m] || d.body[m] || 0) : 0)
}
});
utils.dom.$create("style", {
getStylesheet: function() {
var st = this.$root.settings;
if (st.stylesheet) {
return st.stylesheet
}
var cont = document.getElementsByTagName("head");
cont = cont.length ? cont[0] : document.body;
var style = document.createElement("style");
style.type = "text/css";
return (st.stylesheet = cont.appendChild(style))
},
addRule: function(selector, css) {
var stylesheet = this.getStylesheet();
if (stylesheet.styleSheet && stylesheet.styleSheet.addRule) {
stylesheet.styleSheet.addRule(selector, css)
} else {
if (stylesheet.sheet && stylesheet.sheet.insertRule) {
stylesheet.sheet.insertRule([selector, "{", css, "}"].join(""), stylesheet.sheet.cssRules ? stylesheet.sheet.cssRules.length : 0)
}
}
},
addClass: function(el, cls) {
var uta = this.$root.utils.array,
classes = el.className.split(/\s+/);
if (uta.indexOf(classes, cls) == -1) {
uta.push(classes, cls)
}
el.className = classes.join(" ")
},
removeClass: function(el, cls) {
var classes = el.className.split(/\s+/);
this.$root.utils.array.discard(classes, cls);
el.className = classes.join(" ")
},
buildHookUnderlineCSS: function(type, color, imp) {
var bb = "border-bottom:",
td = "text-decoration:",
n = "none",
u = "underline",
i = imp ? " !important;" : ";";
switch (type) {
case "single":
return [bb, "0 ", n, i, td, u, i].join("");
case "dotted":
return [bb, "1px dotted ", color, i, td, n, i].join("");
case "dashed":
return [bb, "1px dashed ", color, i, td, n, i].join("");
case "none":
return [bb, "0 ", n, i, td, n, i].join("");
default:
return [bb, "1px solid ", color, i, td, u, i].join("")
}
},
buildBorderRadius: function(val) {
var what = this.$root.what,
dbs = document.body.style,
css = "border-radius:" + val + ";";
if (what(dbs.borderRadius) == "string") {
return css
} else {
if (what(dbs.MozBorderRadius) == "string") {
return "-moz-" + css
} else {
if (what(dbs.WebkitBorderRadius) == "string") {
return "-webkit-" + css
} else {
return ""
}
}
}
},
buildBoxShadow: function(val) {
var rt = this.$root,
what = rt.what,
b = rt.browser,
dbs = document.body.style,
css = "box-shadow:" + val + ";";
if (what(dbs.boxShadow) == "string") {
return css
} else {
if (what(dbs.MozBoxShadow) == "string") {
return "-moz-" + css
} else {
if (what(dbs.WebkitBoxShadow) == "string" && (!b.Safari || parseFloat(b.AppleWebKit >= 533))) {
return "-webkit-" + css
} else {
return ""
}
}
}
},
buildTextShadow: function(val) {
var what = this.$root.what,
dbs = document.body.style,
css = "text-shadow:" + val + ";";
if (what(dbs.textShadow) == "string") {
return css
} else {
if (what(dbs.MozTextShadow) == "string") {
return "-moz-" + css
} else {
if (what(dbs.WebkitTextShadow) == "string") {
return "-webkit-" + css
} else {
return ""
}
}
}
},
buildLinearGradient: function(start, end, startColor, endColor) {
var b = this.$root.browser,
css = "background-image:";
if (parseFloat(b.Firefox) >= 3.6) {
return [css, "-moz-linear-gradient(", start, ", ", startColor, ", ", endColor, " ", end, "px);"].join("")
} else {
if (parseFloat(b.AppleWebKit) >= 530) {
return [css, "-webkit-gradient(linear, left ", start, ", left ", end, ", from(", startColor, "), to(", endColor, "));"].join("")
} else {
return ""
}
}
},
supports: function(prop) {
var wh = this.$root.what,
dbs = document.body.style,
b = this.$root.browser,
s = "string",
M = "Moz",
W = "Webkit",
cprop = prop.charAt(0).toUpperCase() + prop.substr(1);
switch (prop) {
case "borderRadius":
case "textShadow":
return wh(dbs[prop]) == s ? prop : (wh(dbs[M + cprop]) == s ? M + cprop : (wh(dbs[W + cprop]) == s ? W + cprop : false));
case "boxShadow":
return wh(dbs[prop]) == s ? prop : (wh(dbs[M + cprop]) == s ? M + cprop : ((wh(dbs[W + cprop]) == s && (!b.Safari || parseFloat(b.AppleWebKit >= 533))) ? W + cprop : false));
case "linearGradient":
return (parseFloat(b.Firefox) >= 3.6 || parseFloat(b.AppleWebKit) >= 530) ? prop : false;
default:
return false
}
}
});
utils.dom.$create("event", {
disableEventBubbling: function(element, event) {
if (element.addEventListener) {
element.addEventListener(event, this.stop, false)
} else {
if (element.attachEvent) {
element.attachEvent("on" + event, this.stop)
}
}
},
stop: function(domEvt) {
domEvt.cancelBubble = true;
domEvt.returnValue = false;
if (domEvt.preventDefault) {
domEvt.preventDefault()
}
if (domEvt.stopPropagation) {
domEvt.stopPropagation()
}
}
});
$root.$create("helpers", {
getVar: function(v, context) {
var wl = this.$root.settings.white_label,
s1 = "infolink",
s2 = s1 + "s",
undef = "undefined",
what = this.$root.what;
s1 += "_";
s2 += "_";
var val = wl && what(window[wl + "_" + v]) != undef ? window[wl + "_" + v] : what(window[s2 + v]) != undef ? window[s2 + v] : what(window[s1 + v]) != undef ? window[s1 + v] : null;
if (context) {
context[v] = val
}
return val
},
chanceIntegration: function() {
var percentage = this.getVar("percentage");
if (percentage) {
percentage = percentage > 100 ? 100 : percentage < 0 ? 0 : percentage;
var rnd = Math.random() * 100;
if (rnd > percentage) {
var integrationNode;
try {
integrationNode = this.searchForIntegrationComment(document.body)
} catch (ex) {
integrationNode = null
}
if (integrationNode) {
var js = integrationNode.data;
if (document.readyState != "complete" && !this.getVar("ddw")) {
document.write(js.substring(14, js.length))
}
}
this.$root.logger.log("Stopping on unlucky chance integration.", this.chanceIntegration);
return true
}
}
return false
},
searchForIntegrationComment: function(node) {
switch (node.nodeType) {
case 1:
case 9:
for (var i = 0, leni = node.childNodes.length; i < leni; i++) {
var resultNode = this.searchForIntegrationComment(node.childNodes[i]);
if (resultNode) {
return resultNode
}
}
return null;
case 8:
return node.data.length > 15 && node.data.substr(0, 14) == "IL_INTEGRATION" ? node : null;
default:
return null
}
},
isSupportedClient: function() {
var rt = this.$root,
b = rt.browser,
sv = rt.settings.supportedClients[b.getName()];
return sv && b.getVersion(true) >= sv
},
setHosts: function() {
var rt = this.$root,
host, url, ver, path = "",
re, st = rt.settings,
hosts = st.hosts;
var scripts = document.getElementsByTagName("script"),
resources = rt.helpers.getVar("resources");
if (window.INFOLINKS && window.INFOLINKS._boot) {
st.boot = window.INFOLINKS._boot;
ver = rt.version = st.boot.version;
re = /\/infolinks_main\.js$/
} else {
if (window.$iceboot) {
st.boot = window.$iceboot;
ver = rt.version = st.boot.version;
re = /\/infolinks_main\.js$/
} else {
re = new RegExp(versionFile + ".js$")
}
}
if (resources) {
resources = resources.replace(/^\w+:\/\//, "");
host = resources.substring(0, resources.indexOf("/"));
path = resources.substring(resources.indexOf("/")) + "/"
} else {
for (var i = 0, leni = scripts.length; i < leni; i++) {
if (scripts[i].src.match(re) != null) {
url = scripts[i].src.replace(/^\w+:\/\//, "");
host = url.replace(/\/.*/, "");
path = url.substring(url.indexOf("/"), url.lastIndexOf("/") + 1);
if (!ver) {
var parts = path.split("/");
rt.version = parts[parts.length - 2]
}
break
}
}
}
if (host) {
hosts.resources = host
} else {
hosts.resources = hosts.resourcesDefault;
path = hosts.scriptDefaultPath
}
hosts.router = rt.utils.string.toObject(location.search, "il.mt") || rt.helpers.getVar("metro_server") || hosts.resources.replace(/\bresources\b/, "router");
hosts.thumbnails = hosts.resources.replace(/\bresources\b/, "thumbnails");
if (ver) {
path += ver
}
if (path && path.charAt(path.length - 1) != "/") {
path += "/"
}
hosts.scriptPath = path;
if (path.indexOf("/src/") != -1) {
hosts.src = true
}
},
getCustomerId: function() {
var rt = this.$root,
hp = rt.helpers;
rt.settings.$extend({
customerId: hp.getVar("cid") || hp.getVar("pid") || "null",
websiteId: hp.getVar("wsid") || 0,
customerUrl: document.location.href
})
},
setDefaultWebsiteDirectives: function(data) {
var rt = this.$root,
key, dwd = {
ht: true,
qmin: 1,
ha: null,
hd: null
};
if (!data.wd) {
data.wd = {}
}
for (key in dwd) {
if (rt.what(data.wd[key]) == "undefined") {
data.wd[key] = dwd[key]
}
}
},
getReferrer: function() {
var rt = this.$root,
docRef = document.referrer,
res = {
ref: "",
refq: ""
},
refqIndex, ut = rt.utils,
uts = ut.string,
hasRefc = ut.cookie.has("refc"),
simQuery = ut.string.toObject(location.search, "il.sq");
if (simQuery) {
res = {
refq: decodeURIComponent(simQuery),
ref: ut.base64.decodeBase64("d3d3Lmdvb2dsZS5jb20=")
};
ut.object.extend(rt.settings, res);
return res
}
if (docRef) {
refqIndex = docRef.indexOf("?");
if (refqIndex != -1) {
try {
var queryObj = uts.toObject(docRef.substring(refqIndex + 1));
res.refq = uts.truncate(uts.trim(decodeURIComponent((queryObj.q || queryObj.p || "").replace(/\+/g, " "))), 100, "");
res.ref = docRef.substring(0, refqIndex)
} catch (ex) {
rt.logger.error("Error reading referrer.", this.getReferrer)
}
if (!rt.browser.isMobile() && docRef.indexOf(ut.base64.decodeBase64("Lmdvb2dsZS4=")) != -1 && /\/(url|imgres|search|cse)/.test(docRef.substring(docRef.indexOf("/"))) && (!queryObj || !queryObj["adurl"])) {
res.ose = 1
}
} else {
if (!hasRefc) {
res.ref = docRef
}
}
res.ref = uts.truncate(res.ref.replace(/^\w+:\/\//, ""), 100, "");
if (res.refq && !hasRefc) {
ut.cookie.set("refc", ut.object.toQueryString(res), 60)
}
}
if (!res.refq && hasRefc) {
ut.object.extend(res, uts.toObject(ut.cookie.get("refc") || ""))
}
ut.object.extend(rt.settings, res);
return res
},
normalizeText: function(text) {
var delimiter = "|";
text = text.replace(/\.|:|;|<|>|=|\?|\(|\)|\[|\]|\{|\}|,|"|\x201C|\x201D|\x96|\x97|\\|\//g, delimiter);
text = text.replace(/['`\-]\W/g, delimiter).replace(/\W['`\-]/g, delimiter);
var re1 = new RegExp("\\s*\\" + delimiter + "+\\s*", "g");
var re2 = new RegExp("\\" + delimiter + "{2,}", "g");
text = text.replace(re1, delimiter).replace(re2, delimiter);
text = text.toLowerCase().replace(/\|/g, "P").replace(/\s/g, "S").replace(/\./g, "D").replace(/'/g, "Q").replace(/\$/g, "M").replace(/\+/g, "A");
return text
},
countWords: function(text) {
var re = new RegExp("P|S", "g");
var matched = text.match(re);
return (matched != null) ? matched.length + 1 : 0
},
getMetaContent: function(name, limit) {
var metas = document.getElementsByTagName("meta");
for (var i = 0, leni = metas.length; i < leni; i++) {
if (metas[i].name && metas[i].name.toLowerCase() == name && metas[i].content) {
return this.normalizeText(this.$root.utils.string.truncateToChar(metas[i].content, limit * 1024, " "))
}
}
return ""
},
getSilverlightVersion: function() {
var plugin = navigator.plugins["Silverlight Plug-In"],
version = -1;
if (plugin) {
version = plugin.description
} else {
try {
var control = new ActiveXObject("AgControl.AgControl");
var checkVersion = 2;
while (control.IsVersionSupported(checkVersion + ".0")) {
checkVersion++
}
checkVersion--;
version = (checkVersion == 1) ? -1 : checkVersion
} catch (ex) {}
}
return version
},
getTagTexts: function(tags, prop, param) {
var rt = this.$root,
ut = rt.utils,
uts = ut.string,
uta = ut.array,
nodes, res = [],
i, leni, j, lenj, val, end = false,
charCount = 0,
tlm = rt.settings.textLimits.merged,
nodesCount = 0,
maxNodes = 20;
if (rt.what(tags) != "array") {
tags = [tags]
}
for (i = 0, leni = tags.length; i < leni; i++) {
nodes = document.getElementsByTagName(tags[i]);
for (j = 0, lenj = nodes.length; j < lenj; j++) {
val = prop == "text" ? (nodes[j].textContent || nodes[j].innerText || "") : prop == "alt" ? nodes[j].alt : "";
if (!val) {
continue
}
val = uts.truncateToChar(val, tlm[param].i, " ");
nodesCount++;
if (charCount + val.length > tlm[param].t * 1024 || nodesCount >= maxNodes) {
end = true;
break
}
uta.push(res, val);
charCount += val.length
}
if (end) {
break
}
}
return this.normalizeText(res.join("|"))
},
processImpressionResponse: function(response) {
var rt = this.$root,
hp = rt.helpers,
component;
if (rt.what(response) != "object") {
return null
}
if (response.components) {
response.prs = {};
for (component in response.components) {
response.prs[component.charAt(0)] = response.components[component]
}
delete response.components
}
hp.normalizeSentenceLists(response);
if (response.messages) {
hp.findMaxBidCount(response)
}
return response
},
findMaxBidCount: function(response) {
var prod, msg, i, maxBDC = 0;
for (prod in response.prs) {
msg = response.prs[prod].messages;
if (!msg) {
continue
}
for (i in msg) {
if (msg[i].bdc > maxBDC) {
maxBDC = msg[i].bdc
}
}
}
this.$root.settings.bdc = maxBDC
},
normalizeSentenceLists: function(response) {
var prs = response.prs,
prod, ut = this.$root.utils,
numOfSentences = ut.object.keys(response.sentences).length;
for (prod in prs) {
if (numOfSentences && prs[prod].sentences.length == 1 && prs[prod].sentences[0] == "ALL") {
prs[prod].sentences = ut.array.range(0, numOfSentences - 1)
}
}
},
getCustomerBehavior: function(str) {
var rt = this.$root,
v, key, i, leni, res = {};
function uc() {
return arguments[1].toUpperCase()
}
var arr = rt.utils.string.qw(str);
for (i = 0, leni = arr.length; i < leni; i++) {
v = rt.helpers.getVar(arr[i]);
if (v != null) {
key = arr[i].replace(/_(\w)/g, uc);
res[key] = v
}
}
return res
},
getImpressionBehavior: function() {
var rt = this.$root,
st = rt.settings,
uto = rt.utils.object,
bi = rt.comm.settings.responses.impression.behavior_imp || {};
uto.renamePorpery(bi, "lc", "linkColor");
uto.renamePorpery(bi, "st", "bubbleShowDelay");
uto.renamePorpery(bi, "rw", "adsReuseWindow");
uto.renamePorpery(bi, "bd", "bubbleDirection");
st.behavior.impression = bi
},
renameBehaviorProperties: function(o) {
var rt = this.$root,
uto = rt.utils.object;
uto.renamePorpery(o, "hc", "highlightCount");
uto.renamePorpery(o, "lc", "linkColor");
uto.renamePorpery(o, "du", "doubleUnderline");
uto.renamePorpery(o, "st", "bubbleShowDelay");
uto.renamePorpery(o, "rw", "adsReuseWindow");
uto.renamePorpery(o, "si", "simanitIcon");
uto.renamePorpery(o, "bd", "bubbleDirection");
uto.renamePorpery(o, "t", "theme");
uto.renamePorpery(o, "ln", "lines");
return o
},
sanitize: function(data, sanitizer, strict) {
var rt = this.$root;
for (var key in data) {
if (strict && rt.what(sanitizer[key]) == "undefined") {
delete data[key];
continue
}
switch (sanitizer[key]) {
case "int":
data[key] = parseInt(data[key], 10) || 0;
break;
case "bool":
data[key] = data[key] == "false" ? false : !! data[key];
break;
case "color":
data[key] = this.validateColorValue(data[key] || "");
break;
case "str":
data[key] = data[key] && data[key].toString ? data[key].toString() : data[key];
break;
case "node":
data[key] = data[key] && data[key].tagName ? data[key] : null;
break;
default:
if (rt.what(sanitizer[key]) == "array") {
if (rt.utils.array.indexOf(sanitizer[key], data[key]) == -1) {
data[key] = sanitizer[key][0]
}
}
}
}
return data
},
validateColorValue: function(color) {
return (color && color.match(/^#?[0-9a-fA-F]{6}$/) != null) ? color.charAt(0) == "#" ? color : "#" + color : "#000000"
},
createBaseClasses: function() {
var rt = this.$root,
dmst = rt.utils.dom.style,
baseClass = rt.settings.baseClass;
var baseCSS = "margin:0;padding:0;border:0;outline:0;font:normal normal normal 13px trebuchet MS,Arial,sans-serif;vertical-align:baseline;background:transparent;list-style:none;text-decoration:none;text-align:left;float:none;";
dmst.addRule("." + baseClass, baseCSS);
dmst.addRule("." + baseClass + " *", baseCSS);
dmst.addRule("a." + baseClass + ":hover", "background-color:transparent !important;")
},
getHookData: function(hookId) {
var data = this.$root.comm.settings.responses.getads;
return data ? data[hookId] || null : null
},
setHookData: function(hookId, data) {
var res = this.$root.comm.settings.responses;
if (!res.getads) {
res.getads = {}
}
res.getads[hookId] = data
},
clearHookData: function(hookId) {
var data = this.$root.comm.settings.responses.getads;
if (data && data[hookId]) {
data[hookId] = null
}
},
createHook: function(hookId, sentence, node, fontSize, context, prodCode, prodName, hasBubble, instance) {
var rt = this.$root,
st = rt.settings,
sn = context.settings.sentences;
var hook = {
id: hookId,
fontSize: fontSize,
node: node,
parentNode: node.parentNode,
rendered: true,
sentence: sentence,
prod: prodCode,
type: prodName,
hovered: false,
currentAdIndex: 0,
instance: instance
};
st.hooksMap[hook.id] = hook;
if (!sn[sentence]) {
sn[sentence] = {
hooks: [],
rendered: 0
}
}
rt.utils.array.push(sn[sentence].hooks, hook);
sn[sentence].rendered++;
if (hasBubble) {
hook.bubble = rt.utils.object.clone(rt.bubble.settings.base);
rt.helpers.bindHookEvents(hook)
}
return hook
},
getHookBehavior: function(hookId) {
return this.$root.products[this.$root.settings.hooksMap[hookId].type].settings.behavior.merged
},
bindHookEvents: function(hook) {
var rt = this.$root,
ed = rt.event.dom,
rtb = rt.bubble,
node = hook.node,
data = {
hookId: hook.id
};
ed.bind(node, {
event: "dblclick",
listener: rtb.hookDblClick
});
ed.bind(node, {
event: "mouseenter",
data: data,
listener: rtb.hookMouseover
});
ed.bind(node, {
event: "mouseleave",
data: data,
listener: rtb.hookMouseout
});
ed.bind(node, {
event: "click",
data: data,
listener: rtb.hookClick
})
},
getHookSD: function(hookId) {
var rt = this.$root,
st = rt.settings,
hook = st.hooksMap[hookId],
imp;
if (!hook) {
return {}
}
imp = hook.updater ? hook.updater.impression : rt.comm.settings.responses.impression;
return rt.utils.object.extend({
sdata: hook.sentence,
scs: imp.sentences[hook.sentence]
}, imp.rauth)
},
setAdThumbnail: function(ad) {
if (ad.template == "text" && !ad.thumbURL) {
ad.thumbURL = ["http://", this.$root.settings.hosts.thumbnails, "/thumbnail.jpg?domain=", ad.displayedURL].join("")
}
},
hitTrackerURL: function(trackerURL) {
var rt = this.$root;
if (rt.what(trackerURL) != "array") {
trackerURL = [trackerURL]
}
for (var i = 0; i < trackerURL.length; i++) {
rt.utils.dom.createDOMFragment({
tag: "img",
parent: document.body,
attributes: {
src: trackerURL[i]
},
style: {
display: "none"
}
})
}
},
mapUnhoverableAreas: function() {
var rt = this.$root,
st = rt.settings,
ut = rt.utils,
dmel = ut.dom.element,
b = rt.browser;
var embeds = document.getElementsByTagName("embed");
var objects = document.getElementsByTagName("object");
var arr = ut.array.concat(embeds, objects);
st.unhoverableAreas = [];
for (var i = 0; i < arr.length; i++) {
if (!dmel.isVisible(arr[i])) {
continue
}
if (arr[i].tagName.toLowerCase() == "embed") {
if ((arr[i].getAttribute("wmode") || "").toLowerCase() == "transparent") {
continue
}
} else {
var params = arr[i].getElementsByTagName("param"),
hasWmode = false;
for (var j = 0, lenj = params.length; j < lenj; j++) {
if (params[j].name == "wmode" && params[j].value.toLowerCase() == "transparent") {
hasWmode = true;
break
}
}
if (hasWmode) {
continue
}
}
if (arr[i].tagName.toLowerCase() == "embed" && arr[i].parentNode.tagName.toLowerCase() == "object") {
if (b.IE) {
continue
} else {
ut.array.discard(arr, arr[i].parentNode)
}
}
var width = parseInt(arr[i].width, 10) || arr[i].offsetWidth || 0;
var height = parseInt(arr[i].height, 10) || arr[i].offsetHeight || 0;
if (!width || !height) {
continue
}
var pos = dmel.offset(arr[i]);
ut.array.push(st.unhoverableAreas, [pos.left, pos.top, pos.left + width, pos.top + height])
}
},
hasSpecialTags: function(content, tags) {
content = content.toLowerCase();
if ((tags == "all" || tags == "script") && (content.indexOf("<scr") != -1 || content.indexOf("document.write") != -1)) {
return true
}
return (tags == "all" || tags == "iframe") && content.indexOf("<ifr") != -1
},
parseTokens: function(hook, content) {
var rt = this.$root,
data = this.getHookData(hook.id),
ad = data.ads[hook.currentAdIndex];
if (!content) {
content = ad.content
}
if (ad.template == "html" || ad.template == "external") {
var re = /@start@.*?@end@/,
match, matchUrl, url, redirectUrl, encoded;
while ((match = content.match(re)) != null) {
matchUrl = match[0];
url = matchUrl.substring(7, matchUrl.length - 5);
redirectUrl = rt.comm.getRedirectUrl(hook, url, "onWin");
content = content.replace(re, redirectUrl)
}
re = /@encode@.*?@encode@/;
while ((match = content.match(re)) != null) {
encoded = encodeURIComponent(match[0].substring(8, match[0].length - 8));
content = content.replace(re, encoded)
}
}
if (ad.contentType == "javascript") {
content = ['<script type="text/javascript">', content, "<\/script>"].join("")
}
return content
},
setActualTemplate: function(ad) {
ad.actualTemplate = (ad.echo || (ad.template == "html" || ad.template == "external") && ad.content && this.hasSpecialTags(ad.content, "script")) ? "iframe" : ad.template
},
getPlatform: function() {
var rt = this.$root,
gen = document.getElementsByName("generator"),
i, leni, val, undef = "undefined";
for (i = 0, leni = gen.length; i < leni; i++) {
val = gen[i].getAttribute("content");
if (!val) {
continue
}
if (val.indexOf("WordPress") > -1) {
return "wdp"
}
if (val.indexOf("Joomla") > -1) {
return "jml"
}
if (val.indexOf("blogger") > -1) {
return "bsp"
}
if (val.indexOf("vBulletin") > -1) {
return "vbt"
}
if (val.indexOf("phpBB") > -1) {
return "pbb"
}
if (val.indexOf("weebly") > -1) {
return "wbl"
}
if (val.indexOf("tumblr") > -1) {
return "tbr"
}
}
if (rt.what(window["Drupal"]) != undef) {
return "drl"
}
if (rt.what(window["Joomla"]) != undef) {
return "jml"
}
if (rt.what(window["blogger"]) != undef) {
return "jml"
}
if (rt.what(window["blogger_blog_id"]) != undef) {
return "jml"
}
if (rt.utils.dom.filterByClass("contentpaneopen").length) {
return "jml"
}
if (rt.what(window["vBulletin"]) != undef) {
return "vbt"
}
if (rt.what(window["phpbb"]) != undef) {
return "pbb"
}
if (rt.what(window["positionWeeblyFooter"]) != undef) {
return "wbl"
}
if (rt.what(window["Tumblr"]) != undef) {
return "tbr"
}
if (rt.what(window["ipb"]) != undef) {
return "ipb"
}
var links = document.getElementsByTagName("link"),
href;
for (i = 0, leni = links.length; i < leni; i++) {
href = links[i].getAttribute("href");
if (!href) {
continue
}
if (href.indexOf("wp-content") > -1) {
return "wdp"
}
if (href.indexOf("support-files") > -1) {
return "sbi"
}
}
return ""
},
getSiteLanguage: function() {
if (this.getSiteLanguage.lang) {
return this.getSiteLanguage.lang
}
var lang = "en";
return this.getSiteLanguage.lang = lang
},
translate: function(key) {
var tr = this.$root.settings.translations;
return tr[key] ? tr[key][this.getSiteLanguage()] : key
},
getEchoForm: function(content, iframeName, formId, formCls) {
var rt = this.$root,
st = rt.settings,
echo = "http://" + st.hosts.router + "/echo.htm";
var html = '<form <% if (formId){ %>id="<%= formId %>"<% } %> <% if (formCls){ %>class="<%= formCls %>"<% } %> method="post" action="<%= echo %>" target="<%= iframeName %>" accept-charset="utf-8" style="display:none;"> <input type="hidden" name="echo" value="<%= content %>" /> <input type="hidden" name="pid" value="<%= cid %>" /> <input type="hidden" name="wsid" value="<%= wsid %>" /> <input type="hidden" name="jsv" value="<%= jsv %>" /> </form>';
return rt.utils.VeST(html, {
echo: echo,
content: encodeURIComponent(content.split("").reverse().join("")),
iframeName: iframeName,
formId: formId,
formCls: formCls,
cid: st.customerId,
wsid: st.websiteId,
jsv: rt.version,
nocache: rt.utils.number.next("echo")
})
}
});
var comm = $root.$create("comm", {
loadScript: function(url, params, event, data) {
var $comm = this,
rt = this.$root,
qstr = "",
qarr = [],
cbfunc;
if (rt.what(params) == "object") {
for (var key in params) {
rt.utils.array.push(qarr, (qarr.length || url.indexOf("?") != -1) ? "&" : "?", encodeURIComponent(key), "=", encodeURIComponent(params[key]))
}
qstr = qarr.join("")
} else {
if (rt.what(params) == "string") {
qstr = params
}
}
url += qstr;
if (url.match(/^\w+:\/\//) == null) {
url = "http://" + url
}
if (event) {
cbfunc = function(url) {
var rt = $comm.$root,
ls = $comm.loadedScripts;
if (ls[url]) {
return true
}
ls[url] = true;
if (rt.what(data) == "undefined") {
rt.event.fire(event)
} else {
rt.event.fire(event, data)
}
}
} else {
cbfunc = function() {
$comm.loadedScripts[url] = true
}
}
if (this.loadedScripts[url]) {
cbfunc()
} else {
this.loadedScripts[url] = false;
var script = document.createElement("script");
script.type = "text/javascript";
script.charset = "UTF-8";
script.onreadystatechange = function() {
if (/complete|loaded/.test(this.readyState) && !$comm.loadedScripts[url]) {
cbfunc(url)
}
};
script.onload = function() {
cbfunc(url)
};
script.src = url;
var container = document.getElementsByTagName("head");
container = container[0] || document.body;
script = container.appendChild(script);
return true
}
},
supportsCORS: function() {
var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : null;
return this.settings.cors = (xhr && "withCredentials" in xhr)
},
sendRequest: function(options, beforeSend) {
var rt = this.$root,
b = rt.browser,
st = rt.settings,
cst = this.settings,
uta = rt.utils.array,
hasBeforeSend = rt.what(beforeSend) == "function",
ptxt, removeParams, totalLength, ptxtMaxLength, i, leni;
var urlCharLimit = {
IE: 2048,
Other: 8192
};
if (b.iPhone || b.iPad) {
var inputs = [],
formContainer;
if (hasBeforeSend) {
beforeSend.call(rt, "i")
}
for (var key in options.params) {
uta.push(inputs, {
tag: "input",
type: "hidden",
attributes: {
name: key
},
value: options.params[key]
})
}
formContainer = document.getElementById("IL_FORM_CONT");
if (formContainer) {
var parent = formContainer.parentNode;
parent.removeChild(formContainer)
}
formContainer = rt.utils.dom.createDOMFragment({
tag: "div",
parent: document.body,
id: "IL_FORM_CONT",
style: {
display: "none"
},
children: [{
tag: "form",
id: "IL_FORM",
children: inputs,
attributes: {
method: options.method,
action: options.url,
target: "IL_FRAME"
}
}, {
tag: "div",
id: "IL_FRAME_CONT",
innerHTML: '<iframe id="IL_FRAME" name="IL_FRAME" src="' + st.blankURL + '" width="1" height="1" frameborder="0" scrolling="no"></iframe>'
}]
});
if (formContainer) {
document.getElementById("IL_FORM").submit()
}
} else {
if (cst.mode == "cors") {
if (hasBeforeSend) {
beforeSend.call(rt, "a")
}
this.sendAjaxRequest(options)
} else {
if (cst.mode == "messaging") {
if (cst.messagingReady) {
if (hasBeforeSend) {
beforeSend.call(rt, "a")
}
var message = rt.utils.object.stringify({
action: "ajax",
data: options
});
this.sendMessage(message)
} else {
rt.utils.array.push(this.pendingRequests, [options, beforeSend])
}
} else {
if (cst.mode == "flash") {
if (b.IE) {
if (hasBeforeSend) {
beforeSend.call(rt, "f")
}
this.flash.embedIE(options)
} else {
if (this.flash.flashLoadAmount == 10 && this.flash.flashElement) {
if (hasBeforeSend) {
beforeSend.call(rt, "f")
}
this.flash.sendURLRequest(options.url, options.method, options.params, options.onSuccess, options.onSuccess, 1)
} else {
rt.utils.array.push(this.pendingRequests, [options, beforeSend])
}
}
} else {
if (hasBeforeSend) {
beforeSend.call(rt, "s")
}
ptxt = options.params.ptxt;
removeParams = rt.utils.string.qw("ptxt plinks pimgs phdrs pdesc page_keyw ptitle"), i, leni = removeParams.length;
for (i = 0, leni = removeParams.length; i < leni; i++) {
options.params[removeParams[i]] = ""
}
rt.utils.object.clean(options.params);
totalLength = rt.utils.object.toQueryString(options.params).length + options.url.length + document.location.href.length + navigator.userAgent.length + document.cookie.length + 400;
ptxtMaxLength = urlCharLimit[b.IE ? "IE" : "Other"] - totalLength;
if (ptxtMaxLength < 0) {
rt.logger.error("Request too long for GET.", this.sendRequest);
return
}
options.params.ptxt = (ptxtMaxLength > 0) ? ptxt.substring(0, ptxtMaxLength) : "";
options.params.twnum = rt.helpers.countWords(options.params.ptxt);
this.loadScript(options.url, options.params)
}
}
}
}
},
sendMessage: function(message) {
var rt = this.$root,
commFrame = rt.utils.dom.element.$("iceCommFrame");
if (commFrame && commFrame.contentWindow) {
commFrame.contentWindow.postMessage(message, "*")
} else {
rt.logger.error("Could not get comm frame.", this.sendMessage)
}
},
receiveMessage: function(event) {
var de = event.domEvent,
message = de.data,
data, rt = this.$root,
lg = rt.logger;
var origin = (de.origin || de.domain).replace("http://", "");
if (origin.indexOf(this.settings.responses.gsd.rs) != 0) {
return
}
if (message.charAt(0) == "(" && message.charAt(message.length - 1) == ")") {
message = message.substring(1, message.length - 1)
}
try {
data = rt.what(window.JSON) != "undefined" && window.JSON.parse ? window.JSON.parse(message) : eval("(" + message + ")")
} catch (ex) {
lg.error("Data parsing failed: " + ex.message + ". message:" + message + " ", this.receiveMessage);
return
}
if (data.action == "error") {
lg.error(data.data, this.receiveMessage)
} else {
if (data.action == "event") {
rt.event.fire(data.type, data.data)
} else {
if (!data.action) {
rt.event.fire("afterImpression", data)
}
}
}
},
sendAjaxRequest: function(o) {
var rt = this.$root,
xhr, xdr, xhrc = window.XMLHttpRequest ? new XMLHttpRequest() : null;
if (rt.what(o) != "object") {
return null
}
if (xhrc && "withCredentials" in xhrc) {
xhr = xhrc
} else {
if (window.XDomainRequest) {
xdr = new XDomainRequest()
}
}
if (!xhr && !xdr) {
return null
}
if (xhr) {
xhr.onreadystatechange = function() {
if (!req || !req.xhr) {
return
}
if (req.xhr.readyState == 4) {
reqComplete(req)
}
}
} else {
xdr.onload = function() {
reqComplete(req)
}
}
function reqComplete(req) {
if (req.done || req.aborted) {
return
}
var o = req.xhr || req.xdr;
req.done = true;
if (req.xdr || req.xhr.status == 200) {
if (req.onSuccess) {
rt.comm.handleAjaxResponse({
action: "event",
type: req.onSuccess,
data: o.responseText
})
}
} else {
if (req.xdr || req.xhr.status != 0) {
rt.comm.handleAjaxResponse({
action: "error",
data: "Ajax request failed."
})
}
}
}
function reqTimeout() {
if (!req || req.done) {
return
}
var o = req.xhr || req.xdr;
req.aborted = true;
o.abort();
rt.comm.handleAjaxResponse({
action: "error",
data: "Ajax request timed out."
});
if (req.xhr) {
delete req.xhr["onreadystatechange"]
}
}
function process() {
var o = req.xhr || req.xdr,
params = req.params || {},
method = req.method || "GET",
url = req.url || window.location.href;
req.queryString = (req.queryString ? req.queryString + "&" : "") + rt.utils.object.toQueryString(params, true).substr(1);
if (req.method == "GET" && req.queryString) {
req.url += ((req.url.indexOf("?") > -1) ? "&" : "?") + req.queryString
}
if (req.timeout > 0) {
setTimeout(reqTimeout, req.timeout)
}
if (req.xhr) {
req.xhr.open(method, url, true)
} else {
req.xdr.open(method, url)
}
if (method == "POST") {
if (req.xhr && rt.what(req.xhr.setRequestHeader) == "function") {
req.xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
}
o.send(req.queryString)
} else {
o.send()
}
}
var req = rt.utils.object.extend({
xhr: xhr,
xdr: xdr,
process: process
}, o);
req.process();
return req
},
handleAjaxResponse: function(response) {
var rt = this.$root,
data;
if (response.action == "error") {
rt.logger.error(response.data, this.handleAjaxResponse)
} else {
if (response.action == "event") {
try {
data = rt.what(window.JSON) != "undefined" && window.JSON.parse ? window.JSON.parse(response.data) : eval("(" + response.data + ")")
} catch (ex) {
rt.logger.error("Data parsing failed: " + ex.message, this.handleAjaxResponse);
return
}
rt.event.fire(response.type, data)
}
}
},
getRedirectUrl: function(hook, url, clickedOn) {
var rt = this.$root,
st = rt.settings,
ut = rt.utils,
uto = ut.object,
data = rt.helpers.getHookData(hook.id),
ad = data.ads[hook.currentAdIndex];
if (ad.noClickPrefix) {
return url || ad.redirectURL
}
var now = ut.date.now();
var params = uto.clean(uto.extend({
rid: this.settings.responses.gsd.rid,
bdc: hook.bdc,
midx: hook.midx || hook.currentAdIndex,
rts: now,
vt: ut.timer.poll("adView" + hook.id),
clk_t: clickedOn,
jsv: rt.version,
prod_t: hook.prod || "",
tcln: hook.tcln || "",
pst: hook.pst || "",
cv: hook.viewed ? 1 : 0,
refq: st.impression.params.refq || "",
ifip: st.ifip || ""
}, rt.helpers.getHookSD(hook.id)));
params.rurl = url || ad.redirectURL || "";
var serverClickUrl = ["http://", this.settings.responses.gsd.rs, "/action/clk.htm"].join("");
return serverClickUrl + uto.toQueryString(params, true)
}
}, {
settings: {
responses: {},
errorReportingUrl: "http://cel.infolinks.com/"
},
loadedScripts: {},
pendingRequests: []
}, true);
comm.$create("flash", {
getSwfUrl: function() {
return ["http://", this.$root.settings.hosts.resources, "/flash/ic5.swf"].join("")
},
embed: function() {
var rt = this.$root,
swf = this.getSwfUrl();
rt.utils.timer.start("tmr_fsh");
rt.utils.dom.createDOMFragment({
tag: "div",
parent: document.body,
style: {
display: "block",
position: "absolute",
top: "1px",
left: "1px",
width: "1px",
height: "1px"
},
innerHTML: ['<embed pluginspage="http://www.macromedia.com/go/getflashplayer" src="', swf, '" width="1" height="1" wmode="transparent" name="ilfc" allowScriptAccess="always" type="application/x-shockwave-flash"></embed>'].join("")
})
},
embedIE: function(options) {
var rt = this.$root,
st = rt.settings,
ut = rt.utils,
swf = this.getSwfUrl(),
id = "ilfc" + rt.utils.number.next("flashEmbedConter");
this.requests[options.url] = {
request: ut.object.extend(options, {
open: false,
complete: false
})
};
var flashVars = ut.object.toQueryString({
url: options.url,
method: options.method,
success: options.onSuccess,
error: options.onSuccess
}, true).substr(1);
if (options.params) {
flashVars += ["&", ut.object.toQueryString(options.params, true).substr(1)].join("")
}
window[id + "_DoFSCommand"] = function(command, args) {
var response, func;
try {
func = eval(command);
response = eval(decodeURIComponent(args))
} catch (ex) {
rt.logger.error("Error evaluating response.", this);
return
}
func.call(func.$parent, response)
};
rt.utils.timer.start("tmr_fsh");
ut.dom.createDOMFragment({
tag: "div",
parent: document.body,
style: {
display: "block",
position: "absolute",
top: "1px",
left: "1px",
width: "1px",
height: "1px"
},
innerHTML: ['<object id="', id, '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" width="1" height="1" align="middle">', '<param name="movie" value="', swf, '" />', '<param name="quality" value="high" />', '<param name="allowScriptAccess" value="always" />', '<param name="wmode" value="transparent" />', '<param name="flashvars" value="environment=IE&pcode=', st.impression.pcode, "&", flashVars, '" />', "</object>", "<sc", "ript event=FSCommand(command,args) for=", id, ">\n ", id, "_DoFSCommand(command, args)</sc", "ript>"].join("")
});
this.flashLoadComplete()
},
flashLoadUpdate: function(loaded) {
this.flashLoadAmount = loaded
},
flashLoadComplete: function() {
var rt = this.$root;
this.flashLoadAmount = 10;
this.flashElement = window["ilfc" + rt.utils.number.get("flashEmbedConter")] || document["ilfc"];
rt.utils.timer.stop("tmr_fsh");
while (this.$parent.pendingRequests.length) {
this.$parent.sendRequest.apply(this.$parent, rt.comm.pendingRequests.shift())
}
},
sendURLRequest: function(url, method, params, success, error, contextReferenceKey) {
this.requests[url] = {
request: {
url: url,
method: method,
params: params,
success: success,
error: error,
contextReferenceKey: contextReferenceKey,
open: false,
complete: false
}
};
this.flashElement.sendURLRequest(url, method, params, success, error, contextReferenceKey)
},
requestOpenHandler: function(responseObj) {
this.requests[responseObj.url].request.open = true
},
requestCompleteHandler: function(response) {
var rt = this.$root,
data, request = this.requests[response.url];
if (!request) {
rt.logger.error("Missing Request Object");
return
}
request.request.complete = true;
request.response = response;
if (response.success) {
var event = response.success;
try {
data = eval(response.data.replace(/^data=/, ""))
} catch (e) {
rt.logger.error("Error Evaluating Response.");
return
}
rt.event.fire(event, data)
}
},
requestError: function(response) {
this.requests[response.url].response = response;
if (response.error) {
var event = response.error;
this.$root.event.fire(event, response)
}
},
getFlashVersion: function() {
var flashVer = -1,
swStr = "Shockwave Flash",
np = navigator.plugins,
swp, b = this.$root.browser;
if (np && np.length) {
swp = np[swStr + " 2.0"] || np[swStr];
if (swp) {
flashVer = parseFloat(swp.description.replace(/[a-z ]+([0-9\.]+)[a-z ]+/i, "$1."))
}
}
if (flashVer == -1 && b.IE && b.Windows) {
var axo, vnum = [".9", ".7", ".6", ".3", ".3", ""],
vstr = [null, null, "WIN 6,0,21,0", null, "WIN 3,0,18,0", "WIN 2,0,0,11"];
for (var i = 0, leni = vnum.length; i < leni; i++) {
try {
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash" + vnum[i]);
flashVer = vstr[i] ? vstr[i] : axo.GetVariable("$version")
} catch (e) {}
if (flashVer != -1) {
break
}
}
if (flashVer != -1) {
flashVer = parseFloat(flashVer.replace(/^[a-z ]+/i, "").replace(/,/g, "."))
}
}
return flashVer
}
}, {
requests: {}
}, false);
comm.bind({
event: "initComm",
listener: {
init: function() {
var rt = this.$root,
cst = this.settings,
b = rt.browser;
cst.flashVersion = this.flash.getFlashVersion();
if ((b.iPhone || b.iPad) && window.postMessage) {
cst.mode = "formsubmit";
rt.event.dom.bind(window, {
event: "message",
listener: this.receiveMessage
})
} else {
if (this.supportsCORS()) {
cst.mode = "cors"
} else {
if (window.postMessage) {
cst.mode = "messaging";
cst.messagingReady = false;
rt.event.dom.bind(window, {
event: "message",
listener: this.receiveMessage
});
rt.utils.dom.createDOMFragment({
tag: "div",
style: {
display: "none"
},
parent: document.body,
innerHTML: ['<iframe id="iceCommFrame" src="http://', cst.responses.gsd.rs, '/comm2.htm" width="1" height="1" frameborder="0" scrolling="no"></iframe>'].join("")
})
} else {
if (cst.flashVersion >= 9) {
cst.mode = "flash";
if (!rt.browser.IE) {
this.flash.embed()
}
} else {
cst.mode = "unsupported";
rt.logger.error("Unsupported comm mode", this.init)
}
}
}
}
}
}
});
comm.bind({
event: "getAds",
listener: {
getAds: function(event) {
var rt = this.$root,
uto = rt.utils.object,
et = rt.externalTags,
hook = rt.settings.hooksMap[event.data.hookId];
if (uto.keys(et.settings.tags).length) {
hook.externalBidsTimeout = rt.event.fire("sendGetAds", uto.extend({
timeout: true
}, event.data), event.data.bidRequestTimeout || et.settings.bidRequestTimeout);
rt.event.fire("sendBids", event.data)
} else {
rt.event.fire("sendGetAds", event.data)
}
}
}
});
comm.bind({
event: "sendGetAds",
listener: {
sendGetAds: function(event) {
var rt = this.$root,
hookId = event.data.hookId,
st = rt.settings,
ut = rt.utils,
hook = st.hooksMap[hookId],
gsd = rt.comm.settings.responses.gsd;
if (event.data.timeout) {
hook.killBids = true
} else {
clearTimeout(hook.externalBidsTimeout)
}
if (!rt.helpers.getHookData(hookId)) {
rt.helpers.setHookData(hookId, "pending")
}
hook.bdc = ++st.bdc;
var params = ut.object.clean(ut.object.extend({
lid: hookId,
rid: gsd.rid,
jsv: rt.version,
rts: ut.date.now(),
bdc: hook.bdc,
prod_t: hook.prod,
cfv: rt.comm.settings.flashVersion,
ifip: st.ifip,
cb: event.data.callback || "getadsResponse",
tcln: hook.tcln,
pst: hook.pst,
purl: st.customerUrl,
ref: st.impression.params.ref,
refq: st.impression.params.refq,
ose: st.ose || ""
}, event.data.params || {}, rt.helpers.getHookSD(hookId), rt.externalTags.getBidData(hook.externalTag), rt.externalTags.getViewedTagsParam()));
if ("irt".indexOf(hook.prod) == -1) {
if (hook.prod == "s" || hook.prod == "o") {
params.as = "728*90"
}
}
if (rt.what(window["x1"]) != "undefined" && rt.what(window["x2"]) != "undefined") {
params[window["x1"]] = window["x2"]
}
rt.comm.loadScript(gsd.rs + "/action/getads.htm", params)
}
}
});
comm.bind({
event: "sendAdView",
listener: {
sendAdView: function(event) {
var rt = this.$root,
gsd = this.settings.responses.gsd,
ut = rt.utils,
uta = ut.array,
p = event.data.params,
hook = rt.settings.hooksMap[event.data.hookId],
data = rt.helpers.getHookData(hook.id),
undef = "undefined";
var params = ut.object.extend({
rid: gsd.rid,
bdc: rt.what(p.bdc) != undef ? p.bdc : uta.times(hook.bdc, data.ads.length).join("~"),
midx: rt.what(p.midx) != undef ? p.midx : uta.range(0, data.ads.length - 1).join("~"),
emd: data.ads[hook.currentAdIndex].emd || "",
rts: ut.date.now(),
prod_t: "unknown",
jsv: rt.version
}, rt.helpers.getHookSD(hook.id), p);
this.loadScript([gsd.rs, "/action/adview.htm"].join(""), params, "adViewed", event.data)
}
}
});
comm.bind({
event: "adViewed",
listener: {
adViewed: function(event) {
var rt = this.$root,
hook = rt.settings.hooksMap[event.data.hookId];
hook.viewed = true
}
}
});
comm.bind({
event: "doRedirect",
listener: {
doRedirect: function(event) {
var result = event.data;
var rt = this.$root,
st = rt.settings,
b = rt.browser,
ut = rt.utils,
hook = result.hook,
reuseWindow = rt.helpers.getHookBehavior(hook.id).adsReuseWindow,
winName;
if (st.clickStatus == "complete") {
return
}
if (!result.maxLength) {
result.maxLength = b.IE ? 2048 : 8192
}
var data = rt.helpers.getHookData(hook.id);
var url = result.url || data.ads[hook.currentAdIndex].redirectURL;
rt.event.fire(hook.type + "HookMouseout", {
hookId: hook.id
});
var hookNodeId = hook.node.id;
st.clickStatus = "complete";
if (hook.bubble) {
rt.event.fire("hideBubble", {
hookId: hook.id
})
}
hook = null;
if (url.length < result.maxLength) {
winName = hookNodeId;
try {
winName = st.adWin.name
} catch (ex) {}
if (b.IE && b.getVersion(true) < 9) {
var anchor = rt.utils.dom.createDOMFragment({
tag: "a",
parent: document.body,
attributes: {
href: url
},
style: {
display: "none"
}
});
if (!reuseWindow && st.adWin && winName == hookNodeId) {
anchor.target = winName
}
anchor.click()
} else {
if (!reuseWindow && st.adWin && winName == hookNodeId) {
try {
st.adWin.location = url
} catch (ex) {
window.location = url;
st.adWin.close();
st.adWin = null
}
} else {
window.location = url
}
}
} else {
var action = url,
inputs = null,
urlParamsIndex = url.indexOf("?");
if (urlParamsIndex != -1) {
action = url.substring(0, urlParamsIndex);
var params = ut.string.toObject(url.substring(urlParamsIndex + 1), null, true);
inputs = [];
for (var key in params) {
ut.array.push(inputs, {
tag: "input",
type: "hidden",
value: params[key],
attributes: {
name: key
}
})
}
}
var redirectForm = ut.dom.createDOMFragment({
tag: "form",
parent: document.body,
style: {
display: "none"
},
children: inputs,
attributes: ut.object.extend({
action: action,
method: "post"
}, reuseWindow ? {} : {
target: hookNodeId
})
});
redirectForm.submit()
}
}
}
});
comm.bind({
event: "productClick",
listener: {
productClick: function(event) {
var rt = this.$root,
st = rt.settings,
hookId = event.data.hookId,
hook = st.hooksMap[hookId],
data = rt.helpers.getHookData(hookId),
clickType = event.data.clickType || hook.clickType;
if (st.clickStatus == "complete") {
return
}
if ((clickType == "onLink" || clickType == "onLinkAfterWinOpen") && data && data.ads[hook.currentAdIndex].redirectURL == "") {
st.clickStatus = "none";
if (st.adWin) {
rt.event.fire("hideBubble", {
hookId: hookId
});
st.adWin.close();
st.adWin = null
}
return
}
var url = this.getRedirectUrl(hook, event.data.url || null, clickType);
rt.event.fire("startClick", {
url: url,
hook: hook
})
}
}
});
comm.bind({
event: "startClick",
listener: {
updateClickCookie: function(event) {
var rt = this.$root,
st = rt.settings,
ut = rt.utils,
uto = ut.object,
now = rt.utils.date.now(),
data = event.data,
hook = data.hook;
var params = uto.clean(uto.extend({
rid: this.settings.responses.gsd.rid,
bdc: hook.bdc,
midx: hook.midx || hook.currentAdIndex,
rts: now,
vt: ut.timer.poll("adView" + hook.id),
clk_t: hook.clickType,
jsv: rt.version,
prod_t: hook.prod || "",
tcln: hook.tcln || "",
pst: hook.pst || "",
ifip: st.ifip || ""
}, rt.helpers.getHookSD(hook.id)));
var url = ["http://", this.settings.responses.gsd.rs, "/", now, "/ck.js"].join("");
this.loadScript(url, params, "doRedirect", data)
}
}
});
comm.bind({
event: "commRemoteReady",
listener: {
commRemoteReady: function() {
var rt = this.$root,
uto = rt.utils.object,
st = this.settings,
key, data = [];
st.messagingReady = true;
var gsd = st.responses.gsd;
if (gsd.cks) {
for (key in gsd.cks) {
rt.utils.array.push(data, {
name: key,
value: gsd.cks[key],
expiration: "2y"
})
}
var message = uto.stringify({
action: "setcookie",
data: data
});
this.sendMessage(message)
}
while (this.pendingRequests.length) {
this.sendRequest.apply(this, this.pendingRequests.shift())
}
}
}
});
comm.bind({
event: "sendErrorReport",
listener: {
sendErrorReport: function(event) {
var rt = this.$root,
st = rt.settings,
gsd = rt.comm.settings.responses.gsd,
evt = null,
cbdata = null;
if (event.data.cbdata) {
evt = event.data.cbdata.evt;
cbdata = event.data.cbdata.data;
delete event.data.cbdata
}
this.loadScript(this.settings.errorReportingUrl, rt.utils.object.extend({
pid: st.customerId,
wsid: st.websiteId,
jsv: rt.version,
rid: gsd ? gsd.rid : ""
}, event.data || {}), evt, cbdata)
}
}
});
$root.$create("settings", {}, {
svntest: "yes",
supportedClients: {
IE: 6,
Firefox: 1.5,
Safari: 3,
MobileSafari: 4,
Opera: 10,
Chrome: 1,
AppleWebKit: 533,
ucweb: 7
},
hosts: {
resourcesDefault: "resources.infolinks.com",
scriptDefaultPath: "/js/"
},
productCodes: {
i: "intext",
t: "intag",
s: "insearch",
o: "insearch",
f: "inframe"
},
nodeTypes: {
ELEMENT: 1,
DOCUMENT: 9,
TEXT: 3,
COMMENT: 8
},
baseZIndex: 9999999,
bdc: 0,
behavior: {
def: {
linkColor: "009900",
bubbleShowDelay: 200,
bubbleHideDelay: 1000,
adsReuseWindow: true,
hoverRequestDelay: 20
},
sanitizer: {
linkColor: "color",
linkHoverColor: "color",
linkHoverBgColor: "color",
bubbleShowDelay: "int",
bubbleHideDelay: "int",
adsReuseWindow: "bool",
hoverRequestDelay: "int"
}
},
hooksMap: {},
hooksCount: 0,
baseClass: "IL_BASE",
clickStatus: "none",
defaultLabel: "infolinks",
defaultHomeUrl: "http://www.infolinks.com/?kid=bb&trackerid=101",
defaultHelpUrl: "http://www.infolinks.com/opt-out.html?pid=<%= cid %>&wsid=<%= wsid %>",
yourAdHereUrl: "http://www.infolinks.com/ads",
white_labelLoaded: false,
textLimits: {
def: {
plinks: {
t: 2,
i: 100
},
pimgs: {
t: 2,
i: 100
},
phdrs: {
t: 2,
i: 100
},
pdesc: 1,
page_keyw: 2
}
},
translations: {
advertisement: {
en: "Advertisement",
es: "Aviso Publicitario"
},
yourAdHere: {
en: "Your Ad Here",
es: "Publique Aqu??"
},
clickHere: {
en: "Click here",
es: "Presione Aqu??"
},
searchingFor: {
en: "Searching for",
es: "Buscando"
},
nextSearchResultFor: {
en: "Next search result for",
es: "Nueva b??squeda para"
},
learnMore: {
en: "Learn More",
es: "Saber m??s"
},
adsBy: {
en: "Ads by",
es: "Anuncios"
}
}
});
$root.$create("harvest", {
createInstance: function() {
var o = {};
o.texts = [];
o.nodes = [];
o.stopped = false;
o.harvesting = false;
o.firstNode = null;
o.charCount = 0;
o.insideAllowedNode = null;
o.useAllowSettings = false;
return o
},
setConditionalTags: function() {
var rt = this.$root,
st = rt.settings,
hs = this.settings,
label = (st.white_label || st.defaultLabel).toUpperCase();
hs.tagGenericOff = "INTEXT_OFF";
hs.tagGenericOn = "INTEXT_ON";
hs.tagGenericStop = "INTEXT_STOP";
hs.tagGenericToggle = "INTEXT_TOGGLE";
hs.tagOff = label + "_OFF";
hs.tagOn = label + "_ON";
hs.tagStop = label + "_STOP";
hs.tagToggle = label + "_TOGGLE"
},
setHarvestEnabled: function() {
var hs = this.settings;
var bodyHtml = document.body.innerHTML;
var indexOfCommentTag = function(tag) {
return bodyHtml.indexOf(["<!--", tag, "-->"].join(""))
};
var onIndexGeneric = indexOfCommentTag(hs.tagGenericOn);
var onIndexWL = indexOfCommentTag(hs.tagOn);
var onIndex = (onIndexGeneric == -1 || onIndexWL == -1) ? Math.max(onIndexGeneric, onIndexWL) : Math.min(onIndexGeneric, onIndexWL);
var offIndexGeneric = indexOfCommentTag(hs.tagGenericOff);
var offIndexWL = indexOfCommentTag(hs.tagOff);
var offIndex = (offIndexGeneric == -1 || offIndexWL == -1) ? Math.max(offIndexGeneric, offIndexWL) : Math.min(offIndexGeneric, offIndexWL);
hs.enabled = (onIndex == -1 || (offIndex != -1 && onIndex > offIndex))
},
getHarvestedText: function(container) {
var rt = this.$root,
st = rt.settings,
hs = this.settings,
hp = rt.helpers,
ut = rt.utils,
uta = ut.array,
hd = st.highlightDeny,
ha = st.highlightAllow,
instance = this.createInstance();
hs.instances[hs.instances.length] = instance;
if (hs.instances.length == 1) {
ut.timer.start("tmr_har")
}
if (ha) {
hs.allowedTags = uta.toObject(ha.tags, {}, 1);
hs.allowedIds = uta.toObject(ha.ids, {}, 1);
hs.allowedCls = uta.toObject(ha.cls, {}, 1);
for (var key in hs.allowedTags) {
if (hs.deniedTags[key]) {
delete hs.deniedTags[key]
}
}
if (!ha.min) {
ha.min = 1
}
instance.useAllowSettings = true
}
if (hd) {
hs.deniedTags = uta.toObject(hd.tags, hs.deniedTags, 1);
hs.deniedIds = uta.toObject(hd.ids, hs.deniedIds, 1);
hs.deniedCls = uta.toObject(hd.cls, hs.deniedCls, 1)
}
this.setConditionalTags();
this.setHarvestEnabled();
hs.allowOnclick = hp.getVar("allow_onclick");
this.harvestText(container || document.body);
var text = instance.texts.join("|");
text = hp.normalizeText(text);
var twnum = hp.countWords(text);
if (instance.useAllowSettings && twnum < ha.min) {
instance.useAllowSettings = false;
this.harvestText(container || document.body);
text = instance.texts.join("|");
text = hp.normalizeText(text);
twnum = hp.countWords(text)
}
if (hs.instances.length == 1) {
ut.timer.stop("tmr_har")
}
instance.text = text;
return instance
},
isHarvestableNode: function(node) {
var hs = this.settings,
ut = this.$root.utils;
return !((node.getAttribute("onclick") != null && node != document.body && !hs.allowOnclick) || hs.deniedTags[node.tagName.toLowerCase()] || (node.id && hs.deniedIds[node.id]) || (node.className && ut.object.hasKey(hs.deniedCls, node.className.split(/\s+/))) || (!this.$root.comm.settings.responses.gsd.wd.ht && !ut.dom.element.isVisible(node)))
},
harvestText: function(node) {
var rt = this.$root,
hs = this.settings,
nodeType = null,
ut = rt.utils,
uto = ut.object,
tm = ut.timer,
nt = rt.settings.nodeTypes,
i, leni, text, instanceNum = hs.instances.length - 1,
instance = hs.instances[instanceNum];
if (!instance.harvesting) {
instance.harvesting = true;
instance.stopped = false;
tm.start("harvest" + instanceNum);
instance.nodes = [];
instance.texts = [];
instance.charCount = 0;
instance.firstNode = node;
if (!instance.useAllowSettings) {
instance.insideAllowedNode = node
}
}
if (instance.stopped || hs.timeLimit != -1 && tm.poll("harvest" + instanceNum) >= hs.timeLimit) {
instance.stopped = true
} else {
nodeType = node.nodeType
}
var hasAllowedIds = uto.keys(hs.allowedIds).length > 0,
hasAllowedCls = uto.keys(hs.allowedCls).length > 0;
switch (nodeType) {
case nt.DOCUMENT:
case nt.ELEMENT:
if (this.isHarvestableNode(node)) {
if (instance.useAllowSettings && !instance.insideAllowedNode && !hs.deniedTags[node.tagName.toLowerCase()] && ((!hasAllowedIds && !hasAllowedCls) || (hasAllowedIds && node.id && hs.allowedIds[node.id]) || (hasAllowedCls && node.className && uto.hasKey(hs.allowedCls, node.className.split(/\s+/))))) {
instance.insideAllowedNode = node
}
for (i = 0, leni = node.childNodes.length; i < leni; i++) {
if (instance.stopped) {
break
}
this.harvestText(node.childNodes[i])
}
if (instance.insideAllowedNode == node) {
instance.insideAllowedNode = null
}
}
break;
case nt.TEXT:
if (hs.enabled && instance.insideAllowedNode) {
text = ut.string.trim(node.data).replace(/\s+/g, " ");
if (text.length > 3) {
if (hs.charLimit != -1 && instance.charCount + text.length > hs.charLimit) {
instance.stopped = true;
text = text.substring(0, hs.charLimit - instance.charCount).replace(/\S+$/, "")
}
ut.array.push(instance.nodes, node);
ut.array.push(instance.texts, text);
instance.charCount += text.length
}
}
break;
case nt.COMMENT:
this.checkConditionalTags(ut.string.trim(node.data), hs)
}
if (instance.firstNode == node) {
instance.harvesting = false;
tm.stop("harvest" + instanceNum)
}
},
checkConditionalTags: function(value, st) {
var c = this.settings;
switch (value) {
case c.tagOff:
case c.tagGenericOff:
st.enabled = false;
break;
case c.tagOn:
case c.tagGenericOn:
st.enabled = true;
break;
case c.tagToggle:
case c.tagGenericToggle:
st.enabled = !st.enabled;
break;
case c.tagStop:
case c.tagGenericStop:
st.stopped = true
}
}
}, {
settings: {
allowedCls: null,
allowedIds: null,
charLimit: 8000,
deniedCls: {
footer: 1,
wibiyaToolbar_window: 1
},
deniedIds: {
footer: 1,
wibiyaToolbar: 1,
wibiyaToolbar_window_template: 1
},
deniedTags: {
a: 1,
acronym: 1,
address: 1,
br: 1,
dd: 1,
dl: 1,
dt: 1,
embed: 1,
fieldset: 1,
h1: 1,
h2: 1,
h3: 1,
h4: 1,
h5: 1,
h6: 1,
iframe: 1,
input: 1,
label: 1,
legend: 1,
noscript: 1,
object: 1,
param: 1,
script: 1,
select: 1,
style: 1,
textarea: 1,
th: 1,
title: 1,
m: 1
},
enabled: true,
timeLimit: 1000,
instances: []
}
});
var shared = $root.$create("shared", {}, null, true);
shared.bind({
event: "main",
listener: {
main: function() {
var rt = this.$root,
ut = rt.utils,
st = rt.settings;
st.cconf = ut.string.toObject(ut.cookie.get("$ice-conf")) || {};
if (st.cconf.logto) {
rt.logger.output = st.cconf.logto
}
if (st.cconf.er) {
rt.logger.errorReporting = parseInt(st.cconf.er, 10)
}
rt.utils.timer.start("tmr_wait");
rt.settings.boot = (window["INFOLINKS"] && window["INFOLINKS"]._boot) ? window["INFOLINKS"]._boot : window.$iceboot ? window.$iceboot : null;
var $this = this;
rt.helpers.getVar("white_label", rt.settings);
if (rt.helpers.chanceIntegration()) {
return
}
if (document.readyState && /complete|interactive/i.test(document.readyState)) {
$this.$root.event.fire("domready");
return
}
if (this.$root.what(document.addEventListener) == "function") {
document.addEventListener("DOMContentLoaded", function() {
$this.$root.event.fire("domready")
}, false)
} else {
document.onreadystatechange = function() {
if (/complete|interactive/i.test(document.readyState)) {
document.onreadystatechange = null;
$this.$root.event.fire("domready")
}
}
}
}
}
});
shared.bind({
event: "domready",
listener: {
domready: function() {
var rt = this.$root,
hp = rt.helpers,
msg, i, leni, pluginUrl, src;
rt.utils.timer.stop("tmr_wait");
rt.utils.timer.start("tmr_all");
if (rt.settings._initialized) {
msg = "Trying to re-run an application that has already been initialized."
} else {
if (!hp.isSupportedClient()) {
msg = "Client is not supported: " + rt.browser.toString()
}
}
if (msg) {
rt.logger.error(msg, this.domready);
return
}
rt.settings._initialized = true;
hp.setHosts();
if (rt.demo.isDemo()) {
rt.event.fire("demo");
return
}
rt.event.fire("loadPlugins")
}
}
});
shared.bind({
event: "loadPlugins",
listener: {
loadPlugins: function() {
var rt = this.$root,
st = rt.settings,
hs = st.hosts,
src, i, leni, pluginUrl;
if (rt.settings.white_label && !rt.settings.white_labelLoaded) {
rt.settings.white_labelLoaded = true;
rt.comm.loadScript([hs.resources, hs.scriptDefaultPath, "0/wl/", st.white_label, ".js"].join(""), null, "loadPlugins");
return
}
var plugins = rt.helpers.getVar("plugins");
if (plugins) {
src = rt.settings.hosts.src ? "/src" : "";
if (rt.what(plugins) == "string") {
plugins = [plugins]
}
rt.settings.plugins = {};
for (i = 0, leni = plugins.length; i < leni; i++) {
pluginUrl = (plugins[i].match(/https?:\/\//)) ? plugins[i] : [rt.settings.hosts.resources, "/js", src, "/0/plugins/", plugins[i], ".js"].join("");
rt.settings.plugins[pluginUrl] = false;
rt.comm.loadScript(pluginUrl, null, "pluginLoaded", {
plugin: pluginUrl
})
}
} else {
rt.event.fire("beforeGSD")
}
}
}
});
shared.bind({
event: "pluginLoaded",
listener: {
pluginLoaded: function(event) {
var rt = this.$root,
st = rt.settings,
key;
st.plugins[event.data.plugin] = true;
if (rt.utils.array.indexOf(rt.utils.object.values(st.plugins), false) == -1) {
for (key in rt.plugins) {
if (rt.plugins[key] && rt.what(rt.plugins[key].init) == "function") {
rt.plugins[key].init()
}
}
rt.event.fire("beforeGSD")
}
}
}
});
shared.bind({
event: "beforeGSD",
listener: {
prepareGSD: function() {
var rt = this.$root,
st = rt.settings,
hp = rt.helpers;
hp.getCustomerId();
var docRef = hp.getReferrer();
var params = {
evt: "afterGSD",
pid: st.customerId,
wsid: st.websiteId,
pdom: location.hostname,
purl: st.customerUrl,
jsv: rt.version
};
if (docRef.ref.length) {
params.ref = docRef.ref
}
if (docRef.refq.length) {
params.refq = docRef.refq
}
rt.utils.timer.start("tmr_gsd");
rt.comm.loadScript([st.hosts.router, "/gsd/", rt.utils.date.now(), rt.utils.number.next("nocache")].join(""), params)
}
}
});
shared.bind({
event: "afterGSD",
listener: {
gsdCallback: function(evt) {
var rt = this.$root,
data = evt.data,
tl = rt.settings.textLimits;
rt.utils.timer.stop("tmr_gsd");
data.rs = rt.utils.string.toObject(location.search, "il.rt") || rt.helpers.getVar("runtime_server") || data.rs || null;
var msg = "";
if (!data.rs) {
msg = "GSD Response is missing `rs`."
}
if (!data.prs) {
msg = "GSD Response is missing `prs`."
}
if (msg) {
rt.logger.error(msg, this.gsdCallback, true);
return
}
data.rs = data.rs.toLowerCase();
if (!data.makey) {
data.makey = ""
}
rt.helpers.setDefaultWebsiteDirectives(data);
tl.merged = rt.utils.object.extend(tl.def, data.wd || {});
if (data.prs.indexOf("r") != -1) {
if (data.prs.indexOf("t") == -1) {
data.prs += ",t"
} else {
data.wd.rtm = "b"
}
}
rt.comm.settings.responses.gsd = data;
rt.event.fire("initComm");
if (/i|t/.test(data.prs)) {
rt.event.fire("beforeHarvest")
} else {
rt.event.fire("beforeImpression")
}
}
}
});
shared.bind({
event: "beforeHarvest",
listener: {
prepareHarvest: function() {
var rt = this.$root,
hp = rt.helpers,
st = rt.settings,
hd = null,
gsd = rt.comm.settings.responses.gsd;
hd = hp.getVar("highlight_deny") || gsd.wd.hd || {};
if (rt.what(window["vBulletin"]) != "undefined") {
if (!hd.cls) {
hd.cls = []
}
rt.utils.array.push(hd.cls, "thead", "tcat", "navbar", "tfoot", "alt2")
}
st.$extend({
highlightDeny: hd,
highlightAllow: hp.getVar("highlight_allow") || gsd.wd.ha
});
rt.updater.settings.className = rt.what(window["blogger"]) != "undefined" ? "hentry" : (hp.getVar("updater_class") || hp.getVar("refreshed_container"));
var harvested = rt.harvest.getHarvestedText();
rt.event.fire("beforeImpression", {
ptxt: harvested.text
})
}
}
});
shared.bind({
event: "beforeImpression",
listener: {
prepareImpression: function(event) {
var rt = this.$root,
ut = rt.utils,
hp = rt.helpers,
st = rt.settings,
prs, prods = rt.products,
cm = rt.comm,
gsd = cm.settings.responses.gsd,
tgst = prods.intag.settings,
crt = document.getElementsByName(tgst.relatedTags).length || "",
ctc = document.getElementsByName(tgst.prodId).length || "";
if (!st.impression) {
st.impression = {
params: {}
}
}
var imp = st.impression;
var impp = imp.params;
prs = ut.array.toObject(gsd.prs.split(","), {}, true);
if (event.data && event.data.updater) {
prs = {
i: true
}
}
impp.ptxt = event.data && gsd.prs != "s" ? event.data.ptxt : "";
impp.twnum = hp.countWords(impp.ptxt);
if (prs["i"] && impp.twnum < gsd.wd.qmin) {
delete prs["i"]
}
if (prs["t"] && gsd.wd.rtm == "m" && !crt && !ctc) {
delete prs["t"]
}
if (rt.helpers.getVar("inframe_disable") === true) {
delete prs["f"]
}
if (prs["f"]) {
var gpmp = prods.inframe.buildImpPageMarginsParam();
if (gpmp) {
impp.ifs = gpmp
} else {
delete prs["f"]
}
}
impp.prs = ut.object.keys(prs).join(",");
if (impp.prs == "") {
impp.prs = ".";
impp.ptxt = ""
}
if (!event.data || !event.data.updater) {
impp.pid = st.customerId;
impp.wsid = st.websiteId;
impp.makey = gsd.makey;
impp.anow = hp.getVar("anow") || "";
impp.rid = gsd.rid || "";
impp.purl = st.customerUrl;
impp.jsv = rt.version;
impp.ms = gsd.ms || "";
impp.gid = gsd.wd.gid || "";
impp.rh = hp.getVar("require_highlight") || "";
impp.by = "u";
impp.crt = crt;
impp.ctc = ctc;
impp.cfv = cm.settings.flashVersion;
st.ifip = hp.getVar("ifip") || "";
st.blankURL = ["http://", st.hosts.resources, "/static/blank.html"].join("");
impp.ifip = st.ifip;
impp.pf = hp.getPlatform();
impp.ptitle = hp.normalizeText(document.title);
impp.ref = st.ref;
impp.refq = st.refq;
if (st.ose) {
impp.ose = st.ose
}
impp.csilv = hp.getSilverlightVersion();
if (impp.prs.match(/[^so,\.]/) != null) {
impp.plinks = hp.getTagTexts("a", "text", "plinks");
impp.pimgs = hp.getTagTexts("img", "alt", "pimgs");
impp.phdrs = hp.getTagTexts(ut.string.qw("h1 h2 h3 h4 h5 h6"), "text", "phdrs");
impp.pdesc = hp.getMetaContent("description", st.textLimits.merged.pdesc);
impp.page_keyw = hp.getMetaContent("keywords", st.textLimits.merged.page_keyw)
}
imp.pcode = (hp.getVar("encoding") || document.characterSet || document.charset || "").toLowerCase();
imp.url = ["http://", gsd.rs, "/action/doq.htm", "?pcode=", imp.pcode, "&r=", ut.date.now(), ut.number.next("nocache")].join("");
if (rt.browser.IE && cm.settings.mode == "cors") {
imp.url += "&oct=1"
}
imp.method = "POST";
imp.onSuccess = "afterImpression"
}
ut.object.extend(impp, gsd.cks || {});
impp.rts = ut.date.now();
imp.params = ut.object.clean(impp);
cm.sendRequest(imp, function(sendBy) {
imp.params.by = sendBy;
if (!ut.timer.poll("tmr_imp")) {
ut.timer.start("tmr_imp")
}
})
}
}
});
shared.bind({
event: "afterImpression",
listener: {
handleImpressionResponse: function(event) {
var rt = this.$root,
utt = rt.utils.timer,
response, prs;
if (!utt.delta("tmr_imp")) {
utt.stop("tmr_imp")
}
response = rt.helpers.processImpressionResponse(event.data);
if (rt.what(response) != "object") {
rt.logger.error("Bad Impression response.", true);
return
}
prs = response.prs;
if (prs.r) {
if (prs.t) {
prs.t.sentences = rt.utils.array.uniq(rt.utils.array.concat(prs.t.sentences, prs.r.sentences));
rt.utils.object.extend(prs.t.behavior, prs.r.behavior)
} else {
prs.t = prs.r;
delete prs.r
}
}
rt.comm.settings.responses.impression = response;
rt.externalTags.init();
rt.event.fire("preRenderProducts")
}
}
});
shared.bind({
event: "preRenderProducts",
listener: {
preRenderProducts: function() {
var rt = this.$root,
hp = rt.helpers,
st = rt.settings,
bh = st.behavior,
ut = rt.utils;
bh.customer = hp.getCustomerBehavior("link_color link_hover_color link_hover_bg_color ads_reuse_window bubble_direction bubble_logo_url bubble_logo_url_downgrade bubble_logo_width bubble_logo_height bubble_logo_link bubble_help_link");
bh.impression = hp.renameBehaviorProperties(rt.comm.settings.responses.impression.behavior_imp || {});
hp.createBaseClasses();
st.homeUrl = bh.customer.bubbleLogoLink || st.defaultHomeUrl;
st.helpUrl = rt.utils.VeST(bh.customer.bubbleHelpLink || bh.customer.bubbleLogoLink || st.defaultHelpUrl, {
cid: st.customerId,
wsid: st.websiteId
});
st.productRenderStatus = ut.array.toObject(ut.object.keys(st.productCodes), {}, "before");
this.$root.event.fire("renderProduct")
}
}
});
shared.bind({
event: "productRenderStatus",
listener: {
productRenderStatus: function(event) {
var rt = this.$root,
st = rt.settings,
ut = rt.utils,
ps = st.productRenderStatus,
data = event.data;
ps[data.prod] = data.status;
if (data.status == "failed") {
rt.logger.error([st.productCodes[data.prod], " failed. reason: ", data.reason].join(""), this.productRenderStatus)
}
if (!/before|during/.test(ut.object.values(ps).join(","))) {
this.$root.event.fire("afterRenderProducts")
}
}
}
});
shared.bind({
event: "afterRenderProducts",
listener: {
productsRendedred: function() {
var rt = this.$root,
st = rt.settings,
gsd = rt.comm.settings.responses.gsd,
i, len, cb, src = st.hosts.src ? "/src" : "";
if (/i|r|t/.test(gsd.prs)) {
rt.helpers.mapUnhoverableAreas()
}
if (rt.what(gsd.incs) != "undefined") {
for (i = 0, len = gsd.incs.length; i < len; ++i) {
var func = function(name, params) {
return function() {
if (rt.plugins[name] && rt.what(rt.plugins[name].init) == "function") {
rt.plugins[name].init(params)
}
}
};
cb = func(gsd.incs[i].s, gsd.incs[i].p);
rt.comm.loadScript([st.hosts.resources, "/js", src, "/0/plugins/", gsd.incs[i].s, ".js"].join(""), null, cb)
}
}
if (rt.updater.settings.className) {
rt.event.fire("initUpdater")
}
rt.utils.timer.stop("tmr_all");
rt.event.fire("sendImpressionLog")
}
}
});
shared.bind({
event: "sendImpressionLog",
listener: {
sendImpressionLog: function() {
var rt = this.$root,
st = rt.settings,
ut = rt.utils,
uta = ut.array,
tmr = ut.timer,
res = rt.comm.settings.responses,
gsd = res.gsd;
st.sendClientLog = rt.helpers.getVar("send_client_log") || gsd.scl || false;
if (!st.sendClientLog) {
return
}
var prods = rt.products,
ist = prods.intext.settings,
tst = prods.intag.settings,
sentence, i, leni, hook, intxt_sen = [];
var params = {
rid: gsd.rid,
makey: gsd.makey,
tmr_scr: st.boot && st.boot.tmr_scr ? ut.date.now() - st.boot.tmr_scr : -1,
tmr_wait: tmr.delta("tmr_wait") || -1,
tmr_gsd: tmr.delta("tmr_gsd") || -1,
tmr_har: tmr.delta("tmr_har") || -1,
tmr_imp: tmr.delta("tmr_imp") || -1,
tmr_dwq: tmr.delta("tmr_imp") || -1,
tmr_hi: tmr.delta("tmr_hi") || -1,
tmr_fsh: tmr.delta("tmr_fsh") || -1,
tmr_all: tmr.delta("tmr_all") || -1
};
if (gsd.prs.indexOf(ist.prodCode) != -1) {
params.intxt_num = [ist.rendered, ut.object.keys(ist.sentences).length].join("*");
for (sentence in ist.sentences) {
for (i = 0, leni = ist.sentences[sentence].hooks.length; i < leni; i++) {
hook = ist.sentences[sentence].hooks[i];
uta.push(intxt_sen, [sentence, hook.visible ? 1 : 0, hook.pos.left, hook.pos.top].join("_"))
}
}
params.intxt_sen = intxt_sen.join("*")
}
if (gsd.prs.indexOf(tst.prodCode) != -1) {
var tCldSent = (res.impression.prs[tst.prodCode] || {
sentences: []
}).sentences.length;
params.tCld_num = [uta.sum(uta.map(tst.instances, function(instance) {
return instance.hooksCount
})), tCldSent].join("*");
if (tst.instances.length) {
params.tCld_pos = [tst.instances[0].pos.left, tst.instances[0].pos.top].join("*")
}
}
rt.comm.loadScript(gsd.rs + "/action/dcil.htm", params)
}
}
});
$root.event.dom.bind(document, {
event: "keyup",
listener: {
keyboardShortcuts: function(event) {
var evt = event.domEvent,
rt = event.$root,
logger = rt.logger;
if (evt.keyCode == 76 && evt.ctrlKey && evt.altKey) {
logger.output = logger.output == "console" ? "none" : "console";
if (rt.what(window.console) != "undefined") {
console.info("Logging to console turned " + (logger.output == "console" ? "on." : "off."))
}
} else {
if (evt.keyCode == 67 && evt.ctrlKey && evt.altKey) {
if (rt.what(window.console) != "undefined") {
console.clear()
}
}
}
}
}
});
var products = $root.$create("products", {}, null, true);
var intext = products.$create("intext", {
createCandidate: function(node, parentNode, sentence) {
var rt = this.$root,
ut = rt.utils,
dm = ut.dom,
o = {};
o.sentence = sentence;
o.node = node;
o.parentNode = parentNode;
o.rendered = false;
o.type = "intext";
o.prod = "i";
o.bubble = ut.object.clone(rt.bubble.settings.base);
o.fontSize = (node.nodeType == 1 ? parseInt(dm.element.getStyle(node, "lineHeight"), 10) : parseInt(dm.element.getStyle(parentNode, "fontSize"), 10)) || 0;
o.visible = dm.element.isVisible(parentNode);
o.onViewPort = dm.element.isOnViewport(parentNode);
o.wordCount = (parentNode.innerText || parentNode.textContent).replace(/\s+/g, " ").length;
o.importance = parentNode.offsetWidth / dm.viewport.getWidth();
return o
},
estimateCandidatesFontSizeIE: function(candidates) {
var rt = this.$root,
b = rt.browser,
c;
if (!b.IE || b.getVersion(true) >= 9) {
return
}
for (var i = 0, leni = candidates.length; i < leni; i++) {
c = candidates[i];
c.fontSize = c.node.firstChild.offsetHeight || 0
}
},
scoreFactorsCalc: {
fontSize: function(v) {
return !v || v > 16 || v < 10 ? 0 : 1
},
wordCount: function(v) {
return v < 10 ? 0 : v < 20 ? 0.3 : v < 30 ? 0.6 : 1
},
importance: function(v) {
return v > 0.4 ? 1 : v > 0.2 ? 0.5 : v
}
},
scoreCandidates: function(candidates) {
var sf = this.settings.scoreFactors,
calc = this.scoreFactorsCalc,
c, i, leni;
for (i = 0, leni = candidates.length; i < leni; i++) {
c = candidates[i];
c.score = calc.fontSize(c.fontSize) * sf.fontSize + (c.visible ? 1 : 0) * sf.visible + (c.onViewPort ? 1 : 0) * sf.onViewPort + calc.wordCount(c.wordCount) * sf.wordCount + calc.importance(c.importance) * sf.importance
}
},
createStyleSheet: function() {
var rt = this.$root,
ist = this.settings,
bh = ist.behavior.merged,
b = rt.browser,
dm = rt.utils.dom,
dmst = dm.style;
var cs = dm.element.getStyle(document.body);
if (cs && cs.position == "relative" && cs.width && parseInt(cs.width, 10) < dm.document.getWidth()) {
document.body.style.position = "static"
}
var underline = dmst.buildHookUnderlineCSS(bh.underline, bh.linkColor, true);
dmst.addRule("." + ist.hookClass, [underline, "color:", bh.linkColor, " !important; background:transparent none repeat scroll 0% !important;cursor:pointer !important;position:static;display:inline !important;padding:0 0 1px 0 !important;float:none !important;"].join(""));
if (bh.linkHoverColor) {
dmst.addRule("." + ist.hookClass + "_HOVER", ["color:", bh.linkHoverColor, " !important;border-bottom-color:", bh.linkHoverColor, " !important;"].join(""))
}
if (bh.simanitIcon) {
if (b.IE && b.getVersion(true) <= 7) {
dmst.addRule("." + ist.hookClass + "_ICON", ["display:inline-block !important; position:static !important;cursor:pointer !important;margin:0 !important;padding:0 !important;background:transparent url(", bh.simanitIcon, ") no-repeat scroll ", bh.simanitPosition, " center; width:", bh.simanitWidth, "px !important;float:none !important;"].join(""))
} else {
dmst.addRule("." + ist.hookClass + "_ICON", ["display:inline !important;position:static !important;cursor:pointer !important;margin:0 !important;padding:0 !important;background:transparent url(", bh.simanitIcon, ") no-repeat scroll ", bh.simanitPosition, " center;padding-", bh.simanitPosition, ":", bh.simanitWidth, "px !important; float:none !important;", b.IE ? "height:1%;" : ""].join(""))
}
if (bh.simanitOver) {
dmst.addRule("." + ist.hookClass + "_ICON_OVER", ["background-image:url(", bh.simanitOver, ");"].join(""))
}
}
},
createHook: function(hook, textNode, updater) {
var rt = this.$root,
ist = this.settings,
st = rt.settings,
bh = ist.behavior.merged,
b = rt.browser,
node;
node = hook.node = document.createElement("span");
hook.id = ++st.hooksCount;
ist.hooksCount++;
node.id = ist.hookClass + hook.id;
if (updater) {
hook.updater = updater
}
st.hooksMap[hook.id] = hook;
node.className = ist.hookClass;
var text = textNode.data || textNode.innerHTML.replace(/<\/?span>/ig, "");
if (bh.simanitIcon) {
var simanitTag = ['<span class="', ist.hookClass, '_ICON"></span>'].join("");
node.innerHTML = bh.simanitPosition == "left" ? simanitTag + text : text + simanitTag
} else {
node.innerHTML = text
}
var ps = rt.utils.dom.element.getStyle(hook.parentNode),
css = [],
push = rt.utils.array.push;
if (ps["fontFamily"]) {
push(css, "font-family:", ps["fontFamily"], " !important;")
}
if (ps["fontWeight"]) {
push(css, "font-weight:", ps["fontWeight"], " !important;")
}
if (ps["fontStyle"]) {
push(css, "font-style:", ps["fontStyle"], " !important;")
}
if ((!b.IE || (b.getVersion(true) > 8)) && !b.Opera && ps["fontSize"] && ps["fontSize"].match(/px$/) != null) {
push(css, "font-size:", ps["fontSize"], " !important;")
}
if (textNode.nodeType == 1 || b.IE) {
push(css, this.fixIEAdNodeStyle(textNode))
}
rt.utils.dom.style.addRule("#" + node.id, css.join(""));
hook.currentAdIndex = 0;
rt.helpers.bindHookEvents(hook);
return node
},
fixIEAdNodeStyle: function(node) {
var rt = this.$root,
bh = this.settings.behavior.merged,
b = rt.browser,
ut = rt.utils,
dmel = ut.dom.element,
push = ut.array.push,
css = [];
if (node.nodeType != 1) {
node = node.parentNode
}
if (b.getVersion() >= 7 && bh.underline == "double") {
push(css, "border:1px solid transparent; border-bottom:1px solid ", bh.linkColor, ";")
}
if (bh.underline != "single" && bh.underline != "none") {
push(css, "padding-bottom:2px;")
}
var parent = node.offsetParent,
nodePos = dmel.offset(node);
if (parent && parent.tagName.toLowerCase().match(/^(?:li|td)$/) != null) {
if (nodePos.top + node.offsetHeight >= dmel.offset(parent).top + parent.offsetHeight) {
dmel.setStyle(parent, {
paddingBottom: "3px"
})
}
}
if (nodePos.top + node.offsetHeight > document.body.clientHeight) {
dmel.setStyle(document.body, {
paddingBottom: "3px"
})
}
parent = node.parentNode;
if (bh.underline == "double" && dmel.getStyle(parent, "styleFloat") && parseInt(dmel.getStyle(parent, "paddingBottom")) < 2 && parent.offsetHeight < 18) {
dmel.setStyle(parent, {
paddingBottom: "2px"
})
}
return css.join("")
},
revertCandidateNodesIE: function(updater) {
var rt = this.$root,
candidates, sentence, i, leni, textNode, node, parentNode;
var sentenceObjects;
if (!rt.browser.IE) {
return
}
if (updater) {
sentenceObjects = updater.impression.sentences
} else {
sentenceObjects = rt.comm.settings.responses.impression.sentences
}
for (sentence in sentenceObjects) {
candidates = sentenceObjects[sentence].candidates;
if (!candidates) {
continue
}
for (i = 0, leni = candidates.length; i < leni; i++) {
node = candidates[i].node;
textNode = document.createTextNode(node.innerText);
parentNode = node.parentNode;
parentNode.insertBefore(textNode, node);
parentNode.removeChild(node);
candidates[i].node = textNode
}
}
}
}, {
settings: {
prodCode: "i",
prodName: "intext",
behavior: {
def: {
skin: "brand",
theme: "def",
highlightCount: 1,
underline: "double",
favicon: false,
simanitIcon: null,
simanitOver: null,
simanitWidth: 16,
simanitPosition: "right"
},
sanitizer: {
highlightCount: "int",
underline: ["double", "single", "dotted", "dashed", "none"],
favicon: "bool",
simanitIcon: "str",
simanitOver: "str",
simanitWidth: "int",
simanitPosition: ["right", "left"]
}
},
themes: {
color: {
def: "#003366",
lightBlue: "#1b8ede",
green: "#67b045",
orange: "#f3933b",
red: "#dd3c42",
pink: "#d84189",
purple: "#5939aa"
}
},
hookClass: "IL_AD",
hooksCount: 0,
maxCandidates: 50,
scoreFactors: {
fontSize: 10,
visible: 10,
onViewPort: 50,
wordCount: 30,
importance: 0
},
rendered: 0
}
}, true);
intext.bind({
event: "renderProduct",
listener: {
renderIntext: function() {
var rt = this.$root,
prod = "i";
if (!rt.comm.settings.responses.impression.prs[prod]) {
rt.event.fire("productRenderStatus", {
prod: prod,
status: "none"
});
return
}
rt.event.fire("productRenderStatus", {
prod: prod,
status: "during"
});
rt.utils.timer.start("tmr_hi");
rt.event.fire("initIntext")
}
}
});
intext.bind({
event: "initIntext",
listener: {
init: function(event) {
var rt = this.$root,
st = rt.settings,
bh = st.behavior,
bhi = this.settings.behavior,
prod = "i",
imp = rt.comm.settings.responses.impression,
prodImp = imp.prs[prod],
uto = rt.utils.object;
function convertDoubleUnderline() {
for (var i = 0; i < arguments.length; i++) {
if (rt.what(arguments[i].underline) == "undefined" && rt.what(arguments[i].doubleUnderline) != "undefined") {
arguments[i].underline = arguments[i].doubleUnderline.toString() == "false" ? "dotted" : "double"
}
}
}
bhi.customer = rt.helpers.getCustomerBehavior("link_color highlight_count underline simanit_icon simanit_over simanit_width simanit_position");
bhi.impression = rt.helpers.renameBehaviorProperties(prodImp.behavior || {});
convertDoubleUnderline(bh.impression, bhi.impression, bhi.customer);
bhi.merged = rt.utils.object.extend({}, bh.def, bhi.def, bh.impression, bhi.impression, bh.customer, bhi.customer);
rt.helpers.sanitize(bhi.merged, uto.extend({}, bh.sanitizer, bhi.sanitizer));
if (!rt.bubble.initialized) {
rt.event.fire("initBubble", this.settings.prodName)
}
rt.event.fire("setIntextMarkers", event.data)
}
}
});
intext.bind({
event: "setIntextMarkers",
listener: {
setCandidates: function(event) {
var rt = this.$root,
hs = rt.harvest.settings,
ist = this.settings,
updater = event.data && event.data.updater ? event.data.updater : null,
nodes, context, sentencesKeys, sentenceIndexes, sentences, sentenceObjects, sentence, normalizedSentence, re, k, lenk, i, leni, node, text, sentenceObj, match, newNode, parentNode, harvested = hs.instances[hs.instances.length - 1],
matchText, textNode, candidateNode, hadMatches, textFollowingMatch, allCandidates = [];
if (updater) {
context = updater;
sentenceObjects = context.sentences = {}
} else {
context = rt.comm.settings.responses;
sentenceObjects = ist.sentences = {}
}
nodes = harvested.nodes;
sentences = context.impression.sentences;
sentenceIndexes = context.impression.prs.i.sentences || [];
sentencesKeys = rt.utils.object.keys(sentences);
for (k = 0, lenk = sentenceIndexes.length; k < lenk; k++) {
sentence = sentencesKeys[sentenceIndexes[k]];
normalizedSentence = sentence.replace(/([\+\.\?\(\)\[\]\*])/g, "\\$1").replace(/(\w+)/g, "\\b$1\\b").replace(/\s+/g, "\\s+");
re = new RegExp(normalizedSentence, "i");
sentenceObj = sentenceObjects[sentence] = {
candidates: [],
hooks: [],
rendered: 0
};
for (i = 0, leni = nodes.length; i < leni; i++) {
if (sentenceObj.candidates.length >= ist.maxCandidates) {
break
}
node = nodes[i];
if (!node.parentNode || rt.what(node.data) == "undefined" || rt.utils.array.indexOf(allCandidates, node) != -1) {
continue
}
text = node.data;
match = re.exec(text);
if (!match || node.parentNode.className == ist.hookClass) {
continue
}
textFollowingMatch = text.substr(match.index + match[0].length);
if (textFollowingMatch.match(/^[\u2019']s/) != null) {
continue
}
hadMatches = false;
newNode = document.createDocumentFragment();
parentNode = node.parentNode;
nodes.splice(i, 1);
while (match && sentenceObj.candidates.length < ist.maxCandidates) {
matchText = match[0];
if ((match.index == 0 || text.charAt(match.index - 1).match(/\w/) == null) && (text.length <= match.index + matchText.length || text.charAt(match.index + matchText.length).match(/\w/) == null)) {
hadMatches = true;
if (match.index > 0) {
textNode = document.createTextNode(text.substr(0, match.index));
newNode.appendChild(textNode);
nodes.splice(i++, 0, textNode)
}
if (rt.browser.IE && rt.browser.getVersion(true) < 9) {
candidateNode = document.createElement("span");
candidateNode.innerHTML = ["<span>", matchText.charAt(0), "</span>", matchText.substring(1)].join("")
} else {
candidateNode = document.createTextNode(matchText)
}
rt.utils.array.push(allCandidates, candidateNode);
candidateNode = newNode.appendChild(candidateNode);
rt.utils.array.push(sentenceObj.candidates, this.createCandidate(candidateNode, parentNode, sentence))
}
text = text.substr(match.index + matchText.length);
match = re.exec(text)
}
if (!hadMatches) {
continue
}
if (text != "") {
textNode = document.createTextNode(text);
newNode.appendChild(textNode);
nodes.splice(i, 0, textNode)
}
parentNode.insertBefore(newNode, node);
parentNode.removeChild(node);
node.data = "";
leni = nodes.length
}
this.estimateCandidatesFontSizeIE(sentenceObj.candidates);
this.scoreCandidates(sentenceObj.candidates);
rt.utils.array.insertionSort(sentenceObj.candidates, "score", false);
for (i = ist.behavior.merged.highlightCount, leni = sentenceObj.candidates.length; i < leni; i++) {
rt.utils.array.push(nodes, sentenceObj.candidates[i].node)
}
}
rt.event.fire("createIntextHooks", {
updater: updater
})
}
}
});
intext.bind({
event: "createIntextHooks",
listener: {
createIntextHooks: function(event) {
var rt = this.$root,
ist = this.settings,
bh = ist.behavior.merged,
updater = event.data && event.data.updater ? event.data.updater : null,
context, sentences, sentenceIndexes, sentencesKeys, sentenceObjects, sentence, sentenceObj, candidate, textNode, parentNode, hook, k, lenk;
if (updater) {
context = updater;
sentenceObjects = context.sentences
} else {
context = rt.comm.settings.responses;
sentenceObjects = ist.sentences;
this.createStyleSheet()
}
sentences = context.impression.sentences;
sentenceIndexes = context.impression.prs.i.sentences;
sentencesKeys = rt.utils.object.keys(sentences);
for (k = 0, lenk = sentenceIndexes.length; k < lenk; k++) {
sentence = sentencesKeys[sentenceIndexes[k]];
sentenceObj = sentenceObjects[sentence];
while (sentenceObj.candidates.length && sentenceObj.rendered < bh.highlightCount) {
candidate = sentenceObj.candidates[0];
textNode = candidate.node;
parentNode = textNode.parentNode || candidate.parentNode;
if (!parentNode) {
continue
}
hook = this.createHook(candidate, textNode, updater);
parentNode.insertBefore(hook, textNode);
parentNode.removeChild(textNode);
candidate.rendered = true;
sentenceObj.rendered++;
if (sentenceObj.hooks.length == 0 && !updater) {
ist.rendered++
}
rt.utils.array.push(sentenceObj.hooks, sentenceObj.candidates.shift());
candidate.pos = rt.utils.dom.element.offset(hook)
}
}
this.revertCandidateNodesIE(updater);
rt.utils.timer.stop("tmr_hi");
if (!updater) {
rt.event.fire("productRenderStatus", {
prod: "i",
status: "after"
})
}
}
}
});
intext.bind({
event: "intextHookMouseover",
listener: {
intextHookMouseover: function(event) {
var rt = this.$root,
st = rt.settings,
bh = this.settings.behavior.merged,
hook = st.hooksMap[event.data.hookId];
if (st.clickStatus != "none") {
return
}
var cls = this.settings.hookClass;
if (bh.linkHoverColor) {
hook.node.className = [cls, " ", cls, "_HOVER"].join("")
}
if (bh.simanitIcon && bh.simanitOver) {
var iconSpan = hook.node.getElementsByTagName("span");
if (iconSpan.length) {
iconSpan[0].className = [cls, "_ICON ", cls, "_ICON_OVER"].join("")
}
}
}
}
});
intext.bind({
event: "intextHookMouseout",
listener: {
hookMouseout: function(event) {
var rt = this.$root,
st = rt.settings,
ist = this.settings,
bh = ist.behavior.merged,
hook = st.hooksMap[event.data.hookId],
cls = this.settings.hookClass;
if (bh.linkHoverColor) {
hook.node.className = cls
}
if (bh.simanitIcon && bh.simanitOver) {
var iconSpan = hook.node.getElementsByTagName("span");
if (iconSpan.length) {
iconSpan[0].className = cls + "_ICON "
}
}
}
}
});
var autoPlacement = $root.$create("autoPlacement", {
createMarker: function(prodId, val) {
var rt = this.$root,
apst = this.settings,
dmel = rt.utils.dom.element,
resNodeHeight, node, result;
if (rt.what(prodId) == "array") {
prodId = prodId[0]
}
node = rt.utils.dom.createDOMFragment({
tag: "input",
type: "hidden",
attributes: {
name: prodId,
value: val
}
});
if (apst.result) {
result = apst.result
} else {
apst.result = result = this.findPlacement()
}
if (result.placement != "before" && (resNodeHeight = dmel.getStyle(result.node, "height"))) {
if (resNodeHeight.indexOf("px") != -1) {
dmel.setStyle(result.node, {
minHeight: parseInt(resNodeHeight, 10) + 45 + "px"
})
}
}
if (result.placement == "append") {
result.node.appendChild(node)
} else {
if (result.placement == "prepend") {
result.node.insertBefore(node, result.node.firstChild)
} else {
result.node.parentNode.insertBefore(node, result.node)
}
}
return [node]
},
findPlacement: function() {
var rt = this.$root,
ut = rt.utils,
dmel = ut.dom.element,
el, i, leni;
var ids = ut.string.qw("pageContent content_body contentBody contentWrapper main_content_section main-content bodyarea content-wrap Blog1 content");
var commentsId = ut.string.qw("commentlist comments respond commentpost commentform disqus_thread idc-container-parent");
for (i = 0, leni = commentsId.length; i < leni; i++) {
if (el = dmel.$(commentsId[i])) {
if (dmel.isVisible(el)) {
return {
node: el,
placement: (/respond|commentform|disqus_thread/.test(commentsId[i])) ? "before" : "prepend"
}
}
}
}
for (i = 0, leni = ids.length; i < leni; i++) {
if (el = dmel.$(ids[i])) {
if (dmel.isVisible(el)) {
return {
node: el,
placement: "append"
}
}
}
}
return {
node: this.findBestContainer(),
placement: "append"
}
},
findBestContainer: function() {
var rt = this.$root,
hs = this.settings,
ut = rt.utils,
i, leni, candidate, winner = null,
maxScore = -1000,
score, node, dm = ut.dom,
dmel = dm.element,
docHeight, docWidth, iceapw;
var forbiddenTags = ut.array.toObject(ut.string.qw("body tbody table tr ul dl ol p span embed marquee"), {}, 1);
var wrapper = dm.findWidestNode();
if (wrapper.node == document.body) {
docWidth = dm.document.getWidth();
docHeight = dm.document.getHeight()
} else {
docWidth = wrapper.width;
docHeight = wrapper.height
}
this.harvest(document.body);
for (i = 0, leni = hs.candidates.length; i < leni; i++) {
candidate = hs.candidates[i];
node = candidate.node;
if (forbiddenTags[node.tagName.toLowerCase()]) {
continue
}
candidate.wordsCount = parseInt(dmel.getData(node, "iceapw"), 10) || 0;
candidate.childrenCount = parseInt(dmel.getData(node, "iceapc"), 10) || 0;
if (!candidate.wordsCount || !candidate.childrenCount) {
continue
}
score = candidate.score = (candidate.width / (docWidth || 1) + candidate.height / (docHeight || 1)) / 4 + candidate.wordsCount / (hs.totalWordsCount || 1) - candidate.childrenCount / (hs.totalValidNodes || 1);
if (rt.what(score) == "number" && score > maxScore) {
maxScore = score;
winner = candidate
}
}
if (winner) {
for (i = 0, leni = hs.candidates.length; i < leni; i++) {
candidate = hs.candidates[i];
if (candidate.wordsCount == winner.wordsCount && candidate.node != winner.node && dmel.inHierarchy(candidate.node, winner.node)) {
winner = candidate
}
}
}
hs.winner = winner;
return winner ? winner.node : document.body
},
harvest: function(node) {
var rt = this.$root,
hs = this.settings,
nodeType, ut = rt.utils,
dmel = ut.dom.element,
tm = ut.timer,
nt = rt.settings.nodeTypes,
i, leni, wordsCount, text, parent, iceapw, iceapc;
if (!hs.harvesting) {
hs.harvesting = true;
hs.stopped = false;
tm.start("apHarvest");
hs.candidates = [];
hs.firstNode = node;
hs.enabled = true;
hs.timeLimit = 1000;
hs.totalWordsCount = 0;
hs.totalValidNodes = 0
}
if (hs.stopped || hs.timeLimit != -1 && tm.poll("apHarvest") >= hs.timeLimit) {
hs.stopped = true
} else {
nodeType = node.nodeType
}
switch (nodeType) {
case nt.DOCUMENT:
case nt.ELEMENT:
if (node.className.indexOf(rt.settings.baseClass) == -1 && node.className.indexOf(rt.products.intext.settings.hookClass) == -1 && dmel.isVisible(node) && rt.harvest.isHarvestableNode(node)) {
for (i = 0, leni = node.childNodes.length; i < leni; i++) {
if (hs.stopped) {
break
}
this.harvest(node.childNodes[i])
}
hs.totalValidNodes++;
parent = node.parentNode;
while (parent && parent != document && parent.tagName.toLowerCase() != "html") {
iceapc = (parseInt(dmel.getData(parent, "iceapc"), 10) || 0) + 1;
dmel.setData(parent, "iceapc", iceapc);
parent = parent.parentNode
}
ut.array.push(hs.candidates, {
node: node,
parent: node.parentNode,
width: dmel.getActualWidth(node),
height: dmel.getActualHeight(node)
})
}
break;
case nt.TEXT:
if (hs.enabled) {
text = ut.string.trim(node.data).replace(/\s+/g, " ");
if (text.match(/\S/)) {
wordsCount = text.split(/\s+/).length;
hs.totalWordsCount += wordsCount;
parent = node.parentNode;
while (parent && parent != document && parent.tagName.toLowerCase() != "html") {
iceapw = (parseInt(dmel.getData(parent, "iceapw"), 10) || 0) + wordsCount;
dmel.setData(parent, "iceapw", iceapw);
parent = parent.parentNode
}
}
}
break;
case nt.COMMENT:
rt.harvest.checkConditionalTags(ut.string.trim(node.data), hs)
}
if (hs.firstNode == node) {
hs.harvesting = false;
tm.stop("apHarvest")
}
}
}, {
settings: {}
}, false);
var intag = products.$create("intag", {
locateMarkers: function(prodId, lines) {
var rt = this.$root,
b = rt.browser,
i, leni, markers, autoMarker = [];
if (rt.what(prodId) != "array") {
prodId = [prodId]
}
for (i = 0, leni = prodId.length; i < leni; i++) {
markers = document.getElementsByName(prodId[i]);
if (markers.length) {
break
}
}
if ((rt.comm.settings.responses.gsd.wd.rtm == "b" || !markers.length) && (!b.IE || b.getVersion(true) > 6)) {
autoMarker = rt.autoPlacement.createMarker(prodId, lines);
if (autoMarker.length) {
this.settings.autoPlacement = true
}
}
return rt.utils.array.concat([], markers, autoMarker)
},
renderUnit: function(instanceIndex) {
var rt = this.$root,
st = rt.settings,
stit = this.settings,
instance = stit.instances[instanceIndex],
i, leni, html = "";
for (i = 0, leni = instance.lines; i < leni; i++) {
html += this.renderUnitLine(instanceIndex, i, i == leni - 1)
}
return rt.utils.dom.createDOMFragment({
tag: "div",
parent: instance.container,
after: instance.marker,
cls: st.baseClass,
style: {
margin: "0 auto",
padding: "10px 0",
width: instance.width + "px"
},
innerHTML: html
})
},
renderUnitLine: function(instanceIndex, line, withLogo) {
var rt = this.$root,
st = rt.settings,
stit = this.settings,
b = rt.browser,
instance = stit.instances[instanceIndex],
bh = stit.behavior.merged,
skinPath = this.getSkinPath();
var tpl = '<% if (withLogo){ %><div id="<%= prodId %>_LOGO_<%= instanceIndex %>" class="<%= baseCls %>" style="float:right; margin-right:15px; margin-top:8px; width:53px; height:12px; cursor:pointer; font-size:1px; <% if (oldIE || oldFF){ %>background:url(<%= skinPath %>logo<%= bh.darkBg ? \'-gray\' : \'\' %>.png) no-repeat scroll 0 0 transparent;<% } %>"> <% if (!(oldIE || oldFF)){ %> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="53px" height="12px" viewBox="0 0 636 144" enable-background="new 0 0 636 144" xml:space="preserve"> <g> <%-- dot (first) --%> <path id="<%= prodId %>_LOGO_<%= instanceIndex %>_DOT1" fill="<%= bh.theme == \'def\' ? \'#208CE5\' : themeColor %>" d="M16.918,24.865c5.848,0,10.57-4.735,10.57-10.583s-4.722-10.57-10.57-10.57 S6.334,8.434,6.334,14.282S11.07,24.865,16.918,24.865"/> <%-- in --%> <path fill="<%= logoColor %>" d="M88.085,43.784H77.024c-17.149,0-31.181,14.031-31.181,31.182v34.796 c0,0.218,0.016,0.415,0.027,0.618v5.185c0,5.71-4.672,10.382-10.382,10.382h-0.467c-5.71,0-10.382-4.672-10.382-10.382V92.608 h0.015V45.889v-0.025c0-1.124-0.885-2.033-2.01-2.08h-11.49c-1.09,0.047-1.949,0.907-1.986,1.996v46.828h0.04 c-0.015,0.355-0.04,0.707-0.04,1.066v22.246c0,14.031,11.479,25.512,25.511,25.512h1.151c14.031,0,25.511-11.48,25.511-25.512 v-5.466v-4.62v-28.89c0.082-9.872,8.159-17.948,18.031-17.948h6.366c9.871,0,17.948,8.076,18.042,17.948v28.89v4.62v28.873 c0.013,0.023,0.013,0.034,0.013,0.048c0,1.111,0.883,2.008,1.983,2.057h11.505c1.077-0.036,1.936-0.887,1.985-1.973v-27.966v-5.659 V74.966C119.267,57.815,105.234,43.784,88.085,43.784"/> <%-- f (part) --%> <path fill="<%= logoColor %>" d="M155.069,56.972v82.643c-0.072,0.992-0.886,1.78-1.903,1.818h-11.014 c-1.062-0.038-1.912-0.897-1.912-1.962c0-0.024,0-0.048-0.023-0.073V34.456c0.716-17.064,14.923-30.744,32.179-30.744h8.536 c0.025,0,0.038,0.011,0.06,0.011c1.053,0,1.915,0.849,1.974,1.901v11.037c-0.035,1.016-0.85,1.844-1.878,1.889h-8.692 c-9.509,0-17.327,7.75-17.327,17.268v6.301V56.972z"/> <%-- f (part) --%> <path fill="<%= logoColor %>" d="M151.99,59.104h28.873c0.023-0.012,0.034-0.012,0.047-0.012 c1.111,0,2.008-0.884,2.057-1.984V45.604c-0.036-1.078-0.887-1.938-1.973-1.986h-27.965"/> <%-- o --%> <path fill="<%= logoColor %>" d="M276.24,107.925h0.158V76.608c-0.37-18.164-15.248-32.825-33.494-32.825 h-16.756v0.022c-17.875,0.431-32.322,14.924-32.679,32.803h-0.026v31.316c0,18.213,14.601,33.064,32.705,33.496v0.012h16.589h0.021 h0.146C261.304,141.349,276.24,126.354,276.24,107.925 M208.93,107.925L208.93,107.925V77.289c0-9.914,8.096-18.02,18.021-18.02 h15.953c9.946,0,18.02,8.106,18.02,18.02v30.636h-0.167c0,9.949-8.074,18.021-17.999,18.021h-15.807 C217.026,125.946,208.93,117.874,208.93,107.925"/> <%-- l --%> <path fill="<%= logoColor %>" d="M312.844,139.376L312.844,139.376c0,1.064-0.798,1.938-1.829,2.045h-11.816 c-1.027-0.107-1.837-0.98-1.837-2.045h-0.013V5.769h0.013c0-1.135,0.908-2.033,2.031-2.057h11.432 c1.124,0.024,2.019,0.922,2.019,2.057V139.376z"/> <%-- dot (second) --%> <path id="<%= prodId %>_LOGO_<%= instanceIndex %>_DOT2" fill="<%= bh.theme == \'def\' ? \'#208CE5\' : themeColor %>" d="M341.662,24.865c5.848,0,10.57-4.735,10.57-10.583s-4.723-10.57-10.57-10.57 s-10.584,4.722-10.584,10.57S335.814,24.865,341.662,24.865"/> <%-- in (second) --%> <path fill="<%= logoColor %>" d="M412.829,43.784h-11.061c-17.149,0-31.181,14.031-31.181,31.182v34.796 c0,0.218,0.016,0.415,0.026,0.618v5.185c0,5.71-4.672,10.382-10.382,10.382h-0.468c-5.71,0-10.382-4.672-10.382-10.382V92.608 h0.016V45.723v-0.025c0-1.123-0.885-2.033-2.01-2.08h-11.49c-1.091,0.047-1.949,0.908-1.986,1.996v46.994h0.04 c-0.015,0.355-0.04,0.707-0.04,1.066v22.246c0,14.031,11.479,25.512,25.512,25.512h1.15c14.031,0,25.512-11.48,25.512-25.512 v-5.466v-4.62v-28.89c0.082-9.872,8.158-17.948,18.029-17.948h6.367c9.871,0,17.947,8.076,18.041,17.948v28.89v4.62v28.873 c0.014,0.023,0.014,0.034,0.014,0.048c0,1.111,0.883,2.008,1.982,2.057h11.506c1.076-0.036,1.936-0.887,1.984-1.973v-27.966v-5.659 V74.966C444.01,57.815,429.979,43.784,412.829,43.784"/> <%-- k --%> <path fill="<%= logoColor %>" d="M480.277,139.376L480.277,139.376V91.735h0.146h9.255l40.656,48.766 c0.599,0.549,1.15,0.906,1.841,0.932h16.073c0.882-0.025,2.869-0.322,1.794-2.056l-0.013-0.024l-47.58-56.777l44.599-36.815 c0.015-0.049,0.015-0.049,0.036-0.073c1.066-1.734-0.886-2.032-1.78-2.069H527.08c-0.621,0.024-1.15,0.324-1.666,0.791 l-36.812,31.075h-8.325V5.769c0-1.135-0.896-2.033-2.02-2.057h-11.422c-1.124,0.024-2.033,0.922-2.033,2.057v133.607 c0,1.064,0.803,1.938,1.844,2.045h11.802C479.476,141.313,480.277,140.44,480.277,139.376"/> <%-- s --%> <path fill="<%= logoColor %>" d="M603.208,84.782H577.99c-6.91-0.114-12.508-5.785-12.508-12.783 c0-6.996,5.598-12.895,12.508-12.895h39.271c1.146,0,2.08-0.959,2.08-2.111v0.191V45.752v-0.037c0-1.164-0.935-2.097-2.08-2.097 H577.99c-15.451,0-28.008,12.73-28.008,28.381c0,15.651,12.557,28.381,28.008,28.27h24.252c6.911,0.111,12.508,5.812,12.508,12.795 c0,6.996-5.597,12.896-12.508,12.896H591.56l0.001-0.014h-28.874c-0.022,0.014-0.034,0.014-0.047,0.014 c-1.11,0-2.007,0.896-2.056,2.01v11.449c0.035,1.092,0.886,1.963,1.973,2.014h0.225h27.74h12.224 c15.209-0.279,27.491-12.9,27.491-28.369C630.236,97.737,618.191,85.202,603.208,84.782"/> </g> </svg> <% } %> </div><% } %> <ul id="<%= prodId %>_LIST_<%= instanceIndex %>_<%= line %>" class="<%= baseCls %>" style="display:block; width:<%= instance.width - bh.logoWidth -30 %>px; height:<%= bh.tagHeight %>px; text-align:center; padding:0; margin:6px 0 0 0; font-size:0; overflow:hidden;"></ul>';
return rt.utils.VeST(tpl, {
prodId: stit.prodId,
baseCls: st.baseClass,
st: st,
bh: bh,
themeColor: stit.themes.color[bh.theme],
instance: instance,
instanceIndex: instanceIndex,
oldIE: stit.oldIE,
oldFF: b.Firefox && b.getVersion(true) < 4,
skinPath: skinPath,
line: line,
withLogo: withLogo,
logoColor: bh.darkBg ? "#888888" : "#003366"
})
},
getSkinPath: function() {
var stit = this.settings;
return ["http:/", this.$root.settings.hosts.resources, "static", "skins", stit.behavior.merged.skin, stit.prodName, stit.rv, ""].join("/")
},
hookMouseStateChange: function(event) {
var el = event.element,
key;
for (key in event.data) {
el.style[key] = event.data[key]
}
}
}, {
settings: {
prodId: "IL_IN_TAG",
tagCloud: "IL_TAG_CLOUD",
relatedTags: "IL_RELATED_TAGS",
prodCode: "t",
prodName: "intag",
rv: 1,
instances: [],
containerMinWidth: 200,
sentences: {},
oldIE: (function() {
var b = $root.browser;
return (b.IE && (document.compatMode == "BackCompat" || b.getVersion(true) < 9))
}()),
behavior: {
def: {
skin: "brand",
theme: "def",
fontFamily: "Arial,sans-serif",
fontWeight: "normal",
fontSize: 13,
underline: "single",
logoHeight: 11,
logoWidth: 48,
height: 60,
hookMargin: 15,
lines: 1,
darkBg: false
},
sanitizer: {
fontFamily: "str",
fontWeight: ["normal", "bold"],
fontSize: "int",
underline: ["double", "single", "dotted", "dashed", "none"],
logoHeight: "int",
logoWidth: "int",
height: "int",
hookMargin: "int",
lines: "int",
darkBg: "bool"
}
},
themes: {
color: {
def: "#003366",
lightBlue: "#1b8ede",
green: "#67b045",
orange: "#f3933b",
red: "#dd3c42",
pink: "#d84189",
purple: "#5939aa"
}
}
}
}, true);
intag.bind({
event: "renderProduct",
listener: {
renderIntag: function() {
var rt = this.$root,
prod = this.settings.prodCode;
if (!rt.comm.settings.responses.impression.prs[prod]) {
rt.event.fire("productRenderStatus", {
prod: prod,
status: "none"
});
return
}
rt.event.fire("productRenderStatus", {
prod: prod,
status: "during"
});
rt.event.fire("initIntag")
}
}
});
intag.bind({
event: "initIntag",
listener: {
init: function() {
var rt = this.$root,
st = rt.settings,
bh = st.behavior,
stit = this.settings,
prod = stit.prodCode,
uto = rt.utils.object,
prodImp = rt.comm.settings.responses.impression.prs[prod],
bhr = stit.behavior,
i, leni;
var cbh = rt.helpers.getVar("related_tags") || {};
bhr.impression = rt.helpers.renameBehaviorProperties(prodImp.behavior || {});
bhr.merged = uto.extend({}, bh.def, bhr.def, bh.impression, bhr.impression, bh.customer, cbh);
bhr.merged.tagHeight = Math.max(Math.ceil(bhr.merged.fontSize * 1.3) + 2, 17);
rt.helpers.sanitize(bhr.merged, uto.extend({}, bh.sanitizer, bhr.sanitizer));
if (!stit.themes.color[bhr.merged.theme]) {
bhr.merged.theme = "def"
}
if (!rt.bubble.initialized) {
rt.event.fire("initBubble", stit.prodName)
}
var markers = this.locateMarkers([stit.prodId, stit.relatedTags], bhr.merged.lines);
if (markers.length) {
for (i = 0, leni = markers.length; i < leni; i++) {
var o = {
marker: markers[i],
container: markers[i].parentNode,
lines: parseInt(markers[i].value, 10) || 1,
hooksCount: 0
};
o.width = rt.utils.dom.element.getActualWidth(o.container);
if (o.width < stit.containerMinWidth) {
rt.logger.warn("Warning: In-Tag instance does not have minimum required width.", this.init);
continue
}
rt.utils.array.push(stit.instances, o)
}
}
rt.event.fire("createIntagUnits")
}
}
});
intag.bind({
event: "createIntagUnits",
listener: {
createIntagUnits: function() {
var rt = this.$root,
st = rt.settings,
stit = this.settings,
bh = stit.behavior.merged,
ut = rt.utils,
dm = ut.dom,
dmel = dm.element,
i, leni, k, lenk, instance, sentence, liNode, hook, baseCls = st.baseClass,
hookId, j, lenj, lines, currentLine, logo, adNode, ps, b = rt.browser;
var underline = dm.style.buildHookUnderlineCSS(bh.underline, bh.linkColor, true);
dm.style.addRule("." + stit.prodId + "_AD", [underline, "display:inline; color:", bh.linkColor, " !important; cursor:pointer !important; font-family:", bh.fontFamily, "; font-weight:", bh.fontWeight, "; font-size:", bh.fontSize, "px !important; white-space:nowrap !important; float:none !important;"].join(""));
var liStyle = {
display: "inline",
margin: 0,
padding: 0,
background: "none"
};
var currentSentenceIndex = 0,
imp = rt.comm.settings.responses.impression,
sentenceIndexes = imp.prs[stit.prodCode].sentences,
el, ul, computedWidth, availWidth, sentenceLoopCount, sentencesKeys = ut.object.keys(imp.sentences);
for (i = 0, leni = stit.instances.length; i < leni; i++) {
instance = stit.instances[i];
currentLine = 0;
el = instance.node = this.renderUnit(i);
ps = el.previousSibling;
while (ps) {
if (ps.nodeType == st.nodeTypes.ELEMENT && ps.tagName.toLowerCase() != "input") {
if (/left|right/.test(dmel.getStyle(ps, b.IE ? "styleFloat" : "cssFloat"))) {
dmel.setStyle(el, {
clear: "left"
})
}
break
}
ps = ps.previousSibling
}
instance.pos = dmel.offset(el);
lines = [];
for (j = 0, lenj = instance.lines; j < lenj; j++) {
ul = dmel.$([stit.prodId, "LIST", i, j].join("_"));
if (ul) {
ut.array.push(lines, ul)
}
}
if (!lines.length) {
rt.logger.warn("Error: In-Tag UL element not found.", this.createIntagUnits);
rt.event.fire("productRenderStatus", {
prod: stit.prodCode,
status: "none"
});
return
}
logo = dmel.$([stit.prodId, "LOGO", i].join("_"));
if (logo) {
rt.event.dom.bind(logo, {
event: "click",
listener: function(event) {
rt.utils.dom.event.stop(event.domEvent);
if (st.homeUrl) {
window.open(st.homeUrl, "_blank")
}
}
})
}
computedWidth = 0;
availWidth = instance.width - bh.logoWidth - 30;
sentenceLoopCount = 0;
for (k = currentSentenceIndex, lenk = sentenceIndexes.length; k < lenk; k++) {
sentence = sentencesKeys[sentenceIndexes[k]];
hookId = ++st.hooksCount;
liNode = dm.createDOMFragment({
tag: "li",
parent: lines[currentLine],
cls: baseCls,
style: liStyle,
children: {
tag: "span",
cls: [baseCls, " ", stit.prodId, "_AD"].join(""),
style: {
padding: ["0 ", bh.hookMargin, "px"].join(""),
fontWeight: "normal"
},
id: [stit.prodId, "_AD", hookId].join(""),
innerHTML: ut.string.capitalize(sentence)
}
});
adNode = liNode.getElementsByTagName("span")[0];
rt.event.dom.bind(adNode, {
event: "mouseover",
data: {
fontWeight: "bold",
padding: ["0 ", bh.hookMargin - 2, "px"].join("")
},
listener: this.hookMouseStateChange
});
rt.event.dom.bind(adNode, {
event: "mouseout",
data: {
fontWeight: "normal",
padding: ["0 ", bh.hookMargin, "px"].join("")
},
listener: this.hookMouseStateChange
});
computedWidth += liNode.offsetWidth;
if ((computedWidth > availWidth) || (sentenceLoopCount >= 3 && currentLine >= lines.length - 1)) {
if (currentLine < lines.length - 1) {
lines[++currentLine].appendChild(liNode);
computedWidth = bh.hookMargin * 2 + liNode.offsetWidth
} else {
lines[currentLine].removeChild(liNode);
currentSentenceIndex = k;
st.hooksCount--;
break
}
}
instance.hooksCount++;
hook = rt.helpers.createHook(hookId, sentence, liNode.firstChild, bh.fontSize, this, stit.prodCode, stit.prodName, true, instance);
if (stit.autoPlacement) {
hook.pst = "auto"
}
dm.createDOMFragment({
isTextNode: true,
value: "\n",
parent: lines[currentLine]
});
if (k == lenk - 1) {
k = -1;
++sentenceLoopCount
}
}
}
this.$root.event.fire("productRenderStatus", {
prod: stit.prodCode,
status: "after"
})
}
}
});
var insearch = products.$create("insearch", {
getSkinPath: function() {
var stsr = this.settings,
bh = stsr.behavior.merged;
return ["http:/", this.$root.settings.hosts.resources, "static", "skins", bh.skin, stsr.prodName, stsr.rv, ""].join("/")
},
setEventHandlers: function(hook) {
var rt = this.$root,
b = rt.browser,
st = rt.settings,
ut = rt.utils,
node = hook.node,
stsr = this.settings,
dm = ut.dom,
dmel = dm.element,
evdm = rt.event.dom,
sr = this,
ns = "IL_SR_",
xBtn = dmel.$(ns + "X"),
helpBtn = dmel.$(ns + "HELP"),
clickBtn = dmel.$(ns + "BTN"),
srLogo = dmel.$(ns + "LOGO");
if (b.IE) {
stsr.initialBannerShowTime = 20
}
this.closeBanner(stsr.initialBannerShowTime);
evdm.bind(window, {
event: "resize",
listener: function() {
var left = Math.ceil((dm.viewport.getWidth() / 2) - (parseInt(node.style.width) / 2));
stsr.instance.left = left;
node.style.left = left + "px"
}
});
if (stsr.oldIE) {
evdm.bind(window, {
event: "scroll",
listener: this.updateTopPosition
});
evdm.bind(window, {
event: "resize",
listener: this.updateTopPosition
})
}
evdm.bind(window, {
event: "scroll",
listener: this.scrollHandler
});
if (xBtn) {
evdm.bind(xBtn, {
event: "click",
listener: function(event) {
rt.utils.dom.event.stop(event.domEvent);
rt.event.stop("SRAnimateUp");
rt.event.disable("SRAnimateUp");
rt.event.stop("SRAnimateDown");
rt.event.disable("SRAnimateDown");
rt.event.dom.unbind(window, "scroll", sr.scrollHandler);
node.parentNode.removeChild(node)
}
});
evdm.bind(xBtn, {
event: "mouseover",
data: {
el: xBtn,
pos: "-15px -15px"
},
listener: this.setBackgroundPosition
});
evdm.bind(xBtn, {
event: "mouseout",
data: {
el: xBtn,
pos: "-15px 0"
},
listener: this.setBackgroundPosition
})
}
if (srLogo) {
evdm.bind(srLogo, {
event: "click",
listener: function(event) {
rt.utils.dom.event.stop(event.domEvent);
if (st.homeUrl) {
window.open(st.homeUrl, "_blank")
}
}
})
}
if (clickBtn) {
evdm.bind(clickBtn, {
event: "mouseover",
data: {
el: clickBtn
},
listener: function(event) {
event.data.el.style.backgroundPosition = "0 -24px"
}
});
evdm.bind(clickBtn, {
event: "mouseout",
data: {
el: clickBtn
},
listener: function(event) {
event.data.el.style.backgroundPosition = "0 0"
}
})
}
if (helpBtn) {
evdm.bind(helpBtn, {
event: "click",
listener: function(event) {
rt.utils.dom.event.stop(event.domEvent);
if (st.helpUrl) {
window.open(st.helpUrl, "_blank")
}
}
});
evdm.bind(helpBtn, {
event: "mouseover",
data: {
el: helpBtn,
pos: "0 -15px"
},
listener: this.setBackgroundPosition
});
evdm.bind(helpBtn, {
event: "mouseout",
data: {
el: helpBtn,
pos: "0 0"
},
listener: this.setBackgroundPosition
})
}
var bh = stsr.behavior;
evdm.bind(node, {
event: "click",
listener: this[bh.skins.click[bh.merged.skin] || "insearchClick"]
});
evdm.bind(node, {
event: "mouseenter",
listener: function() {
stsr.animating.mouseover = true;
stsr.animating.mouseout = false;
if (!stsr.animating.up) {
rt.event.repeat("SRAnimateUp", stsr.animationInterval)
}
}
});
evdm.bind(node, {
event: "mouseleave",
listener: function() {
stsr.animating.mouseover = false;
stsr.animating.mouseout = true;
sr.closeBanner(stsr.oldIE ? 5 : 2)
}
})
},
setBackgroundPosition: function(event) {
event.data.el.style.backgroundPosition = event.data.pos
},
updateTopPosition: function() {
var rt = window[appNamespace],
dm = rt.utils.dom,
stsr = rt.products.insearch.settings,
node = stsr.instance.hook.node;
var currentHeight = parseInt(rt.utils.dom.element.getStyle(node, "height"));
node.style.top = (dm.viewport.getHeight() + dm.document.getScrollTop() - currentHeight) + "px"
},
scrollHandler: function() {
var rt = this.$root,
dm = rt.utils.dom,
docHeight = dm.document.getHeight(),
currentScroll = dm.document.getScrollTop() + dm.viewport.getHeight(),
stsr = this.settings;
if (currentScroll == 0) {
currentScroll = window.pageYOffset || (document.body.parentElement ? document.body.parentElement.scrollTop : 0)
}
if (docHeight <= currentScroll) {
if (stsr.state == "open") {
return
}
this.closeBanner(stsr.oldIE ? 5 : 4);
if (!stsr.animating.up) {
rt.event.repeat("SRAnimateUp", stsr.animationInterval)
}
}
},
closeBanner: function(delay) {
this.$root.event.repeat("SRAnimateDown", this.settings.animationInterval, null, delay * 1000)
},
setInsearchStylesheet: function() {
var rt = this.$root,
b = rt.browser,
dms = rt.utils.dom.style,
hdrCss, btnCss, hdrCls = "IL_SR_BG",
skinPath = this.getSkinPath();
if (b.IE && b.getVersion(true) < 8) {
hdrCss = skinPath + "hdr-btns.png";
btnCss = skinPath + "btn.png"
} else {
hdrCss = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAB+hJREFUeNrEV3tMm9cVP7Y/29gY/MBvg3klgFJGAnFeBUpok03NOhJeaVcSdVvGEu2fbdqmNm23bkmqRk1bbVm0PiKtTaVtSkLTh9SQlLY0CWSDpkugy8MmCY+AwRiwzbDBYJudc+FzP0e0+W+70pG/ex733Hvuub9zLPr9/gPAj/n5edDr9TA2NmbG6fJF9i3kuZEHIpEorvvbZ59hv7y9WCyGWCwGJpMJPB5PBrKykWJITp1O652Y8DE9fg0OEscGpIOl999fbjQaUEMEXq8Xbjid7ch/Guk8fPP4DtKBB8rLHXp9Gm5knjYRc7qcnyD/KaR/8YpCx3vWrllzZN26tRIJ7p4fmfYMKCkuLv380qXWf3Z0/AxZR77G6TMPlJftL161SiSMTFamXby6pGRz+8WLFZevXPkRsv4qdFyBix9ZuXKlZGYmzBh+v5+FXqvVsnlhYaE4Eo0cvnTpCydOW+5yWrdhw/oD+fkFEJqeWXJXDodDFolE/vLvq1ev08m55ORkkMvkLxcUFEimF40+bvkYOjo62HdJSQk8vOVh9p2fly/q6+v/QzAYvE+wpsRisbycnZUDZD/q8YA8SQ5qtYYJMdSQtDgvLPyWrH9g4EWplNtEMc2z2qyrZ2dnIRyewcTyQmdnJzz51K9h794nobu7G0ZGRpgsHA6D1WpdgTZFvFeZTFaabrPZF+Qz4Ha74bXXXofhYTc4nTfg6BtHYXJykskikTmyfxDNzFw0EimkU/Mhlkg42LZtKwSD00CbofuibOXlqmQV8Urws3vBsdQhtF+etxzm5ubg2Ftvo6MI7NjRwE7Ly1FX1NMTyOPkSUkKUiAn/DAYjeByuqC19VNYsWIFyOXyuBzvGRQKhSoeZwknj0SicTn9yBVJbJ6UlASRWJRFih9R1MWDiLg0ne5OIDAJKSkpCckQDE1BUVERONY4YCb8VcIEAgFIVipd/BxP0OsP+EEqk7I5hfps81loaHic8ABOHj8J1TXVkJK6sH4Aw45ZPinChy1veueUJzc3Vy10HJ5ZcIYRSdjQzVs3p6q3VlkMBsMUzZ0ul+n8hbaB3JxcGXM8NIQRM4AMo8ThtY16RhAOxOx1zKP89q2b7sYf78qg5Aqr1al/HB4exjBG4xSbj7GwCnkjuAjqvoo2U4K9eJRKxTEvno50bOnpIEaHc3MRmMbNa7Q6JC2TDQ4OEjK+RIgmordKBzt+sukTVC4lyFxqjI+PI6bGOhoe/34lTqd5/sxCZNRo34a5UKjRaJe0p2elUinP1lZXf5eumnfMEvZ085lXh9zuBsw3kVKpBAKgUCjEFjebTccf2bJlN12TcMFFx5Tp+rMftbzpGR19hGwVCiUCUAxfRwgTLRyzZ6Qf/fbmzT8nk7shk8K389H6ukNd3d31Pp+/gJho4EIYbDp34cLle+D0GNL36mtr1l3p6qqZnPxPLpaOWG5O1tXiVcXH29rbbgiVhSf+nw4x/J8Gt+/A8wn1eHEzhEz5FBF6MUhfUCbyNZfGc795NqEecxzHkIowBWkt0jJKIqRrSF20/DfV49qUlNRDaWm6bEoQGqHQNExMjPcj3u7F6d/vcZBdGo1mn1arsyoQvegcWFDI3jk1NfULlDcvVY9/l5WV9ZzRaEpYSaVKAaPRmInF4299fX1UHPYu4ZCO8edly5bv0el0CQJCRLPZnI848eGdOwO/QtYrwjveSk7NZgtrYYgI7sa8Y/E5bSg7O5u6iMeWcLwbkW8PYQCvfzfZbDaR3W4n8KhkJ0bAB6lU9qLVaouvcrG9HaFulBmkYQtTWlbG+LSx8fGJF/x+34nFfoqBT1qafr9eb2ATQkCZVMbsaAwhWimxehFkpqdniHw+30EspevoxEWIu3lSTA6iWawkg3cG4Qc/fAJ27twBHqzFM9Mh4OXYi2WhoYPfJKJVhclk1PPyZKUCmk+fhglEut7bt+H8ufNYSpOZTCaVgj5NT4mXyeHl5KtTU+PVRSvTwqOP1cMs1lRKDCpvKrwnXq7B2orO6K47aS6VSldiQsXlVpsNtm+vgxMnmjDTJdDYuCseGnbnWKX6B/qzOKwiHMd2I4sL1WotuFwuONN8BjZteghSMMF4oCFddBxXxrlEykkT7Cd8fqzTEpZz3rFxwNYIBPpMJraYzX2hUJAVeyHRm9y4cSOsdjiovYnzg6ir0aivfZW1KmdQYN/X18t6tp/sboR6PPmpd06xGs7LQxhF7GbHCDIlb751bKi0tNQkbEspuQgszBZzAsBgm+rbVlVl0Wo1rK3o7x/QII67N6xfr6B5b28vqFPVoEvTMbCg+sxhRKhGx6IxaP9H+217hj2XkiuKz+BgT08PKLDo84QlDFiVEfBoUa1Gc4hquODa/Cg7TLWWdKhVstms7DsJT5iTkwP2TDubX8fmz2K27KeejC8S4nffe78J25hqbEsS/qrwJ73cdYV67Q/qampqFqFQOOQnTjY149+XysLC+/BmE+0pch2fd0I0Gn0b8+GJu6sT99m5c/uwk/glprwMn8hCAR8dBe+odxb/kvzpwcpK+hsz+zVwqfyopeUlfyDQaDaZOYNBzxyOYAMwMT4xjfX8+fKyshf49y+ETEL4p+traw9fvXatyu0ezqONWSzmm5UVFe9/2trqvgdOh5B+ur2u7mD3l19WDQ25cygyGRnp1x+qrPzgQlvbmFD5vwIMAAZsT2nNzBrxAAAAAElFTkSuQmCC";
btnCss = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF0AAABICAYAAACUavnrAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4JJREFUeNrsnL9u01AUxs+xbxOS1LQVBQkGJBgQMPUNGCshMiB1zgqoOwMViBfoxMYGqjqwMIBgYqC8AQsStAyVaAmllDZN4j+xL/fGdsgD9J4I8X1SFDvZfv70+dxzj60eP3119vXGx9V6rXLzdP2U0gSdtNh8umEct/ePXn7ebt9nutZ6dvHyhdZsUKcsA3JX8n2mvV/HtLN38ET5Qb1prgJ1+xHIuHS7sXuSZvagqcy5l//IIOMYOudB4ivSpG2seGDuVgZ4kd5a2TOtNSHO3d9MM51DHlYrWZYRjC5gdp3l0K3t7QWA0SWgF06nwumQ80inEvMwXlINn0soG3e6xl1UyO3j8QKnyzrdhvsgRaaLBfsoXuB0UXlAAOiADgE6oEOA/s9B94FBVL6p03mLmBfAQmqBpDcVZ/EKJ701s0CaAxHHseJxW081HilD/c1sw1vu9JMl4/qGbREAz8nzZtKdoF5Z/51kGyqhynxXBYtXrp+7MV2rKrQETl52U7obJtGX7fbPOI7e2UxfNb+3dvcO0YNxCt5uiOq75iBR7FEzihMKowRkBBxvZOde2GNDHmMvAtDNJ6XUloykAVy2aFTlFYDkpP6GPCSSLyV0DzN1MrlScFcMp8tSHzkd0OWYs4XOebxgWSRBvRjBGMaLgc6gLpQubOOFTbyYxRG2MwSMXk54FfGCWBdLlzxefEOcUTYKOt3Gi4/ei6jT82hntALkynRMA0xCgA7o/w90zL3Iylea9JapFxfQCnCr4WPq8cAebqo0Dh909neeK6XmCRvTTqn3++Gu1pWHitL47XHv6B771dvmn4Aw9+IoxvWhTsMXVJ35oGiqMR/MnLl19dL5xelaBe97cWJytm8ZiT993e12euF7uzhaNaBb334c5I/cgbob8Pk98445ipU5afbjhHphDDIC4M3SP597sQ0v7aMR4Bw62bkXKude0HsRlMYIhiTt4luVhTskFzFw+gSsnm9MI9FFrZ47Hb1GWadb8ogXWeqj7TpILl+KWUagkBRKxslA5+Gd1EOjSyDRxzLdQwUzieoFETOBTEf9Ig+dMEAqCr18/AXQ3cc5jznd57wBg4hxuiQa7fj7SmvaYs/OvaB8cQ3dzr2YsnFTZYNopXfwfc1An8OutFtFcdJmXbXve0nfVDlZPu4NlgxyvO/FjTyPdSeoVdbTRG/8EWAAta8y0OqpUAcAAAAASUVORK5CYII="
}
dms.addRule("." + hdrCls, ['background-image : url("', hdrCss, '")'].join(""));
dms.addRule("#IL_SR_BTN", ['background-image : url("', btnCss, '")'].join(""))
},
insearchClick: function(event) {
var rt = this.$root,
stsr = this.settings,
hook = stsr.instance.hook,
hookId = hook.id,
node = hook.node,
dmel = rt.utils.dom.element,
adArea = dmel.$("AD_AREA"),
data = rt.helpers.getHookData(hook.id),
ad = data.ads[0];
if (ad.template != "text" && adArea && dmel.inHierarchy(event.element, adArea) && ad.content && ad.content.match(/<object |<embed /i) && ad.content.match(/clicktag/i)) {
return
}
if (ad.template == "external") {
return
}
rt.event.stop("SRAnimateUp");
rt.event.disable("SRAnimateUp");
rt.event.stop("SRAnimateDown");
rt.event.disable("SRAnimateDown");
rt.event.dom.unbind(window, "scroll", this.scrollHandler);
var parent = node.parentNode;
parent.removeChild(node);
rt.utils.timer.stop("adView" + hookId);
var reuseWindow = rt.helpers.getHookBehavior(hookId).adsReuseWindow;
if (!reuseWindow) {
try {
rt.settings.adWin = window.open("", hookId)
} catch (ex) {
rt.settings.adWin = null;
rt.logger.error("insearch click: Unable to open new window", this.insearchClick)
}
}
rt.event.fire("productClick", {
hookId: hookId,
clickType: "onWin"
})
},
yahooClick: function(event) {
this.insearchClick(event)
}
}, {
settings: {
prodId: "IL_INSEARCH",
prodCode: "s",
prodName: "insearch",
instance: null,
sentences: {},
oldIE: (function() {
var b = $root.browser;
return (b.IE && (document.compatMode == "BackCompat" || b.getVersion(true) < 9))
}()),
animationInterval: $root.browser.IE ? 7 : 10,
initialBannerShowTime: 15,
rv: "1",
bannerTimeoutClose: null,
state: "closed",
animating: {
down: false,
up: false,
mouseover: false,
mouseout: false
},
behavior: {
def: {
skin: "brand",
theme: "def",
heightOpen: 155,
heightClose: 55,
tb: "white",
tp: "searchingFor",
bt: "clickHere",
thumb: false,
favicon: false,
titlePrefixColor: "#4E4E4E",
titleTermColor: "#4E4E4E"
},
skins: {
click: {
brand: "insearchClick",
yahoo: "yahooClick"
}
}
},
themes: {
color: {
def: "#003366",
lightBlue: "#1b8ede",
green: "#67b045",
orange: "#f3933b",
red: "#dd3c42",
pink: "#d84189",
purple: "#5939aa"
},
tb: {
gray: "height:55px; background-color:#F1F1F2;",
white: "height:55px; background-color:#FFFFFF;",
grayLine: "height:53px; border-bottom:2px solid #F1F1F2; background-color:#FFFFFF;"
}
}
}
}, true);
insearch.bind({
event: "renderProduct",
listener: {
renderInsearch: function() {
var rt = this.$root,
imp = rt.comm.settings.responses.impression,
srst = this.settings,
prodCode;
if (imp.prs["s"]) {
delete imp.prs["o"];
delete rt.settings.productRenderStatus["o"];
prodCode = srst.prodCode
} else {
if (imp.prs["o"]) {
prodCode = srst.prodCode = "o";
delete rt.settings.productRenderStatus["s"]
}
}
var prod = imp.prs[prodCode];
if (!prod || !prod.sentences || !prod.sentences.length) {
rt.event.fire("productRenderStatus", {
prod: "s",
status: "none"
});
rt.event.fire("productRenderStatus", {
prod: "o",
status: "none"
});
return
}
rt.event.fire("productRenderStatus", {
prod: prodCode,
status: "during"
});
rt.event.fire("initInsearch")
}
}
});
insearch.bind({
event: "initInsearch",
listener: {
init: function() {
var rt = this.$root,
ut = rt.utils,
stsr = this.settings,
instance, resImp = rt.comm.settings.responses.impression,
bh = rt.settings.behavior,
senteceIndex = resImp.prs[stsr.prodCode].sentences[0],
bhsr = stsr.behavior,
getadsDelay = 0;
bhsr.impression = rt.helpers.renameBehaviorProperties(resImp.prs[stsr.prodCode].behavior || {});
bhsr.merged = rt.helpers.sanitize(ut.object.extend({}, bh.def, bhsr.def, bh.impression, bhsr.impression, bh.customer), bh.sanitizer);
if (!this.skins[bhsr.merged.skin]) {
bhsr.merged.skin = bhsr.def.skin
}
instance = stsr.instance = {
sentence: ut.object.keys(resImp.sentences)[senteceIndex],
node: ut.dom.createDOMFragment({
tag: "div",
id: stsr.prodId,
cls: rt.settings.baseClass,
parent: document.body
})
};
var hook = instance.hook = rt.helpers.createHook(stsr.prodId, instance.sentence, instance.node, 0, this, stsr.prodCode, stsr.prodName, false, instance);
rt.event.fire("getAds", {
hookId: hook.id,
callback: "getadsResponseInsearch"
}, getadsDelay)
}
}
});
insearch.bind({
event: "getadsResponseInsearch",
listener: {
setAdData: function(event) {
var rt = this.$root,
st = rt.settings,
data = event.data,
hookId = data.lid,
hook = st.hooksMap[hookId],
ad;
if (!hook) {
rt.logger.error("Error: Misssing hook.", this.setAdData);
return false
}
ad = data.ads[hook.currentAdIndex];
if (ad && ad.template == "external") {
data = rt.externalTags.setExternalTagData(hook, data)
}
if (data.ads.length) {
ad = data.ads[0];
rt.helpers.setAdThumbnail(ad);
if (ad.trackerURL) {
rt.helpers.hitTrackerURL(ad.trackerURL)
}
}
rt.helpers.setHookData(hookId, data);
if (hook.externalTag) {
rt.externalTags.updateViewedTags(hook.id)
}
rt.event.fire("createInsearchUnit", {
hookId: hookId
})
}
}
});
insearch.bind({
event: "createInsearchUnit",
listener: {
createInsearchUnit: function(event) {
var rt = this.$root,
st = rt.settings,
hookId = event.data.hookId,
hook = st.hooksMap[hookId],
msg = "",
stsr = this.settings,
data = rt.helpers.getHookData(hookId),
bh = stsr.behavior.merged;
if (!data.ads.length) {
msg = "received no ad."
}
if (msg) {
rt.event.fire("productRenderStatus", {
prod: stsr.prodCode,
status: "failed",
reason: msg
});
return
}
if (data.skin) {
bh.skin = data.skin
}
if (data.theme) {
bh.theme = data.theme
}
this.skins[bh.skin](hookId);
this.setEventHandlers(hook);
rt.event.repeat("SRAnimateUp", stsr.animationInterval);
rt.event.fire("productRenderStatus", {
prod: stsr.prodCode,
status: "after"
})
}
}
});
insearch.bind({
event: "SRAnimateUp",
listener: {
animateUp: function() {
var rt = this.$root,
stsr = this.settings,
ut = rt.utils,
dmel = ut.dom.element,
hook = stsr.instance.hook,
node = hook.node,
anim = stsr.animating,
b = rt.browser;
var heightOpen = stsr.behavior.merged.heightOpen;
if (stsr.state == "open") {
rt.event.stop("SRAnimateUp");
return
}
var currentHeight = parseInt(dmel.getStyle(node, "height"));
if (currentHeight >= heightOpen) {
rt.event.stop("SRAnimateUp");
rt.utils.timer.stop("inSearchAnimateUp");
rt.utils.timer.start("adView" + hook.id);
stsr.state = "open";
anim.up = false;
rt.utils.cookie.remove("refc");
if (stsr.oldIE) {
this.updateTopPosition()
}
rt.event.fire("sendAdView", {
hookId: hook.id,
params: {
prod_t: hook.prod
}
});
return
}
if (!anim.up) {
anim.up = true;
stsr.state = "animating";
rt.utils.timer.start("inSearchAnimateUp")
}
var newHeight, newTop, step, utd = ut.dom.document,
vpHeight = ut.dom.viewport.getHeight(),
docScroll = utd.getScrollTop();
newTop = vpHeight + docScroll - currentHeight;
if (b.IE && b.getVersion(true) > 6) {
step = 3;
if (b.getVersion() >= 9) {
newTop = false
}
} else {
if (stsr.oldIE) {
step = null;
newHeight = heightOpen;
newTop = vpHeight + docScroll - heightOpen
} else {
step = 2;
newTop = false
}
}
if (step) {
newHeight = Math.min(currentHeight + step, heightOpen)
}
if (newTop) {
dmel.setStyle(node, {
top: newTop + "px"
})
}
dmel.setStyle(node, {
height: newHeight + "px"
})
}
}
});
insearch.bind({
event: "SRAnimateDown",
listener: {
animateDown: function() {
var rt = this.$root,
dmel = rt.utils.dom.element,
stsr = this.settings,
hook = stsr.instance.hook,
node = hook.node,
anim = stsr.animating,
b = rt.browser;
var heightClose = stsr.behavior.merged.heightClose;
if (stsr.state == "closed") {
rt.event.stop("SRAnimateDown");
return
}
var currentHeight = parseInt(dmel.getStyle(node, "height"));
if (currentHeight <= heightClose || anim.up || anim.mouseover) {
anim.down = false;
rt.event.stop("SRAnimateDown");
stsr.state = currentHeight <= heightClose ? "closed" : "animating";
rt.utils.timer.clear("adView" + hook.id);
return
}
if (!anim.down) {
anim.down = true;
stsr.state = "animating"
}
var dm = rt.utils.dom,
vpHeight = dm.viewport.getHeight(),
docScroll = dm.document.getScrollTop(),
newHeight, currentTop = parseInt(dmel.getStyle(node, "top")),
step = 1,
newTop;
if (!stsr.oldIE) {
newTop = false
} else {
if (b.IE && b.getVersion(true) > 6 && b.getVersion(true) < 9) {
step = 2;
newTop = currentTop + step
} else {
if (stsr.oldIE) {
step = false;
newHeight = heightClose;
newTop = vpHeight + docScroll - heightClose
}
}
}
if (step) {
newHeight = Math.max(currentHeight - step, heightClose)
}
dmel.setStyle(node, {
height: newHeight + "px"
});
if (newTop) {
dmel.setStyle(node, {
top: newTop + "px"
})
}
}
}
});
insearch.$create("skins", {
brand: function(hookId) {
var rt = this.$root,
b = rt.browser,
ut = rt.utils,
dm = ut.dom,
st = rt.settings,
stsr = this.$parent.settings,
data = rt.helpers.getHookData(hookId),
instance = stsr.instance,
hdrCls = "IL_SR_BG",
srPos = "",
srIEStyle = {},
skinPath = this.$parent.getSkinPath(),
sentence, content, tpl, html, nodeStyle, so = window.orientation,
ibh = stsr.behavior.merged,
hook = st.hooksMap[hookId],
themeColor;
var ad = data.ads[0];
rt.helpers.setActualTemplate(ad);
if (ad.template == "text") {
var textLength = (ad.thumbURL && ad.thumbURL != "no-image") ? 145 : 180;
var pos = ad.displayedURL.indexOf("/");
if (pos != -1) {
ad.displayedURL = ad.displayedURL.substr(0, pos)
}
ad.title = ut.string.truncateToChar(ad.title, 52, " ", "...");
ad.text = ut.string.truncateToChar(ad.text, textLength, " ", "...");
ad.thumbURL = (ad.thumbURL != "no-image") ? ad.thumbURL : false
}
if (ad.contentUrl) {
content = rt.bubble.templates.external(hook, 0)
} else {
content = rt.helpers.parseTokens(hook)
}
this.$parent.setInsearchStylesheet();
instance.height = ibh.heightClose;
if (ad.template == "text") {
instance.fullWidth = 722
} else {
instance.fullWidth = data.width > 0 ? data.width : 722;
ibh.heightOpen = (data.height > 0 ? data.height : 90) + 55
}
instance.left = Math.ceil((dm.viewport.getWidth() - instance.fullWidth) / 2);
sentence = ((stsr.prodCode == "o") ? data.sentence : st.impression.params.refq).replace(/</g, "<");
var sentenceTruncated = ut.string.truncate(sentence, 38, "...");
if (stsr.oldIE) {
srPos = "absolute";
srIEStyle = {
top: (dm.viewport.getHeight() + dm.document.getScrollTop() - ibh.heightClose) + "px",
overflow: "hidden"
}
} else {
srPos = "fixed";
srIEStyle = {
bottom: 0
}
}
if (b.Firefox && b.getVersion(true) < 4) {
rt.utils.object.extend(srIEStyle, {
overflow: "hidden"
})
}
themeColor = stsr.themes.color[ibh.theme];
tpl = '<% if (oldIE || oldFF){ %> <img src="<%= skinPath %>in-search-shadow.png" alt="" width="<%= instance.fullWidth+20 %>" height="<%= ibh.heightOpen+10 %>" class="<%= baseCls %>" style="position:absolute; top:-10px; left:-10px; width:<%= instance.fullWidth+20 %>px; height=<%= ibh.heightOpen+10 %>px; overflow:hidden;" /> <% } %> <%-- Header --%> <div class="<%= baseCls %>" style="position:absolute; top:0; left:0; width:<%= instance.fullWidth %>px; <%= titleBase %>; cursor: pointer;"> <% if (ibh.favicon){ %><div class="<%= baseCls %>" style="position:absolute; left:15px; width:16px; height:16px; top:12px; background:url(<%= ibh.favicon %>) no-repeat scroll 0 0 transparent;"></div><% } %> <div class="<%= baseCls %>" style="position:absolute; width:<%= instance.fullWidth - 181 %>px; height:24px; left:<%= ibh.favicon ? 35 : 15 %>px; top:10px; color:<%= ibh.titlePrefixColor %>; font-family: Trebuchet MS,Arial,sans-serif; font-size:15pt; font-weight:normal; font-style:normal;"><%= titlePrefix %> <span class="<%= baseCls %>" title="<%= sentence %>" style="color:<%= ibh.titleTermColor %>; font-weight: bold; font-size:15pt;"><%= sentenceTruncated %></span>?</div> <div id="IL_SR_LOGO" class="<%= baseCls %>" style="position:absolute; top:10px; right:47px; width:48px; height:11px; cursor:pointer; font-size:1px; <% if (oldIE || oldFF){ %>background:url(<%= skinPath %>logo11.png) no-repeat scroll 0 0 transparent;<% } %>"> <% if (!(oldIE || oldFF)){ %> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="48px" height="11px" viewBox="0 0 636 144" enable-background="new 0 0 636 144" xml:space="preserve"> <g> <%-- dot (first) --%> <path id="IL_SR_LOGO_DOT1" fill="<%= ibh.theme == \'def\' ? \'#208CE5\' : themeColor %>" d="M16.918,24.865c5.848,0,10.57-4.735,10.57-10.583s-4.722-10.57-10.57-10.57 S6.334,8.434,6.334,14.282S11.07,24.865,16.918,24.865"/> <%-- in --%> <path fill="<%= themeColor %>" d="M88.085,43.784H77.024c-17.149,0-31.181,14.031-31.181,31.182v34.796 c0,0.218,0.016,0.415,0.027,0.618v5.185c0,5.71-4.672,10.382-10.382,10.382h-0.467c-5.71,0-10.382-4.672-10.382-10.382V92.608 h0.015V45.889v-0.025c0-1.124-0.885-2.033-2.01-2.08h-11.49c-1.09,0.047-1.949,0.907-1.986,1.996v46.828h0.04 c-0.015,0.355-0.04,0.707-0.04,1.066v22.246c0,14.031,11.479,25.512,25.511,25.512h1.151c14.031,0,25.511-11.48,25.511-25.512 v-5.466v-4.62v-28.89c0.082-9.872,8.159-17.948,18.031-17.948h6.366c9.871,0,17.948,8.076,18.042,17.948v28.89v4.62v28.873 c0.013,0.023,0.013,0.034,0.013,0.048c0,1.111,0.883,2.008,1.983,2.057h11.505c1.077-0.036,1.936-0.887,1.985-1.973v-27.966v-5.659 V74.966C119.267,57.815,105.234,43.784,88.085,43.784"/> <%-- f (part) --%> <path fill="<%= themeColor %>" d="M155.069,56.972v82.643c-0.072,0.992-0.886,1.78-1.903,1.818h-11.014 c-1.062-0.038-1.912-0.897-1.912-1.962c0-0.024,0-0.048-0.023-0.073V34.456c0.716-17.064,14.923-30.744,32.179-30.744h8.536 c0.025,0,0.038,0.011,0.06,0.011c1.053,0,1.915,0.849,1.974,1.901v11.037c-0.035,1.016-0.85,1.844-1.878,1.889h-8.692 c-9.509,0-17.327,7.75-17.327,17.268v6.301V56.972z"/> <%-- f (part) --%> <path fill="<%= themeColor %>" d="M151.99,59.104h28.873c0.023-0.012,0.034-0.012,0.047-0.012 c1.111,0,2.008-0.884,2.057-1.984V45.604c-0.036-1.078-0.887-1.938-1.973-1.986h-27.965"/> <%-- o --%> <path fill="<%= themeColor %>" d="M276.24,107.925h0.158V76.608c-0.37-18.164-15.248-32.825-33.494-32.825 h-16.756v0.022c-17.875,0.431-32.322,14.924-32.679,32.803h-0.026v31.316c0,18.213,14.601,33.064,32.705,33.496v0.012h16.589h0.021 h0.146C261.304,141.349,276.24,126.354,276.24,107.925 M208.93,107.925L208.93,107.925V77.289c0-9.914,8.096-18.02,18.021-18.02 h15.953c9.946,0,18.02,8.106,18.02,18.02v30.636h-0.167c0,9.949-8.074,18.021-17.999,18.021h-15.807 C217.026,125.946,208.93,117.874,208.93,107.925"/> <%-- l --%> <path fill="<%= themeColor %>" d="M312.844,139.376L312.844,139.376c0,1.064-0.798,1.938-1.829,2.045h-11.816 c-1.027-0.107-1.837-0.98-1.837-2.045h-0.013V5.769h0.013c0-1.135,0.908-2.033,2.031-2.057h11.432 c1.124,0.024,2.019,0.922,2.019,2.057V139.376z"/> <%-- dot (second) --%> <path id="IL_SR_LOGO_DOT2" fill="<%= ibh.theme == \'def\' ? \'#208CE5\' : themeColor %>" d="M341.662,24.865c5.848,0,10.57-4.735,10.57-10.583s-4.723-10.57-10.57-10.57 s-10.584,4.722-10.584,10.57S335.814,24.865,341.662,24.865"/> <%-- in (second) --%> <path fill="<%= themeColor %>" d="M412.829,43.784h-11.061c-17.149,0-31.181,14.031-31.181,31.182v34.796 c0,0.218,0.016,0.415,0.026,0.618v5.185c0,5.71-4.672,10.382-10.382,10.382h-0.468c-5.71,0-10.382-4.672-10.382-10.382V92.608 h0.016V45.723v-0.025c0-1.123-0.885-2.033-2.01-2.08h-11.49c-1.091,0.047-1.949,0.908-1.986,1.996v46.994h0.04 c-0.015,0.355-0.04,0.707-0.04,1.066v22.246c0,14.031,11.479,25.512,25.512,25.512h1.15c14.031,0,25.512-11.48,25.512-25.512 v-5.466v-4.62v-28.89c0.082-9.872,8.158-17.948,18.029-17.948h6.367c9.871,0,17.947,8.076,18.041,17.948v28.89v4.62v28.873 c0.014,0.023,0.014,0.034,0.014,0.048c0,1.111,0.883,2.008,1.982,2.057h11.506c1.076-0.036,1.936-0.887,1.984-1.973v-27.966v-5.659 V74.966C444.01,57.815,429.979,43.784,412.829,43.784"/> <%-- k --%> <path fill="<%= themeColor %>" d="M480.277,139.376L480.277,139.376V91.735h0.146h9.255l40.656,48.766 c0.599,0.549,1.15,0.906,1.841,0.932h16.073c0.882-0.025,2.869-0.322,1.794-2.056l-0.013-0.024l-47.58-56.777l44.599-36.815 c0.015-0.049,0.015-0.049,0.036-0.073c1.066-1.734-0.886-2.032-1.78-2.069H527.08c-0.621,0.024-1.15,0.324-1.666,0.791 l-36.812,31.075h-8.325V5.769c0-1.135-0.896-2.033-2.02-2.057h-11.422c-1.124,0.024-2.033,0.922-2.033,2.057v133.607 c0,1.064,0.803,1.938,1.844,2.045h11.802C479.476,141.313,480.277,140.44,480.277,139.376"/> <%-- s --%> <path fill="<%= themeColor %>" d="M603.208,84.782H577.99c-6.91-0.114-12.508-5.785-12.508-12.783 c0-6.996,5.598-12.895,12.508-12.895h39.271c1.146,0,2.08-0.959,2.08-2.111v0.191V45.752v-0.037c0-1.164-0.935-2.097-2.08-2.097 H577.99c-15.451,0-28.008,12.73-28.008,28.381c0,15.651,12.557,28.381,28.008,28.27h24.252c6.911,0.111,12.508,5.812,12.508,12.795 c0,6.996-5.597,12.896-12.508,12.896H591.56l0.001-0.014h-28.874c-0.022,0.014-0.034,0.014-0.047,0.014 c-1.11,0-2.007,0.896-2.056,2.01v11.449c0.035,1.092,0.886,1.963,1.973,2.014h0.225h27.74h12.224 c15.209-0.279,27.491-12.9,27.491-28.369C630.236,97.737,618.191,85.202,603.208,84.782"/> </g> </svg> <% } %> </div> <div class="<%= baseCls %> <%= hdrCls %>" id="IL_SR_HELP" style="position:absolute; right:26px; top:9px; width:15px; height:15px; background-position:0 0; cursor:pointer; font-size:1px;"></div> <div class="<%= baseCls %> <%= hdrCls %>" id="IL_SR_X" style="position:absolute; right:10px; top:9px; width:15px; height:15px; background-position:-15px 0; cursor:pointer; font-size:1px;"></div> </div> <%-- Body --%> <div id="IL_SR_AD_AREA" class="<%= baseCls %>" style="position:absolute; top:55px; left:0; width:<%= instance.fullWidth %>px; height:<%= ad.template == \'text\' ? 125 : data.height %>px; background-color:#ffffff; cursor: pointer;"> <% if (ad.template == \'text\'){ %> <% if (ibh.thumb && ad.thumbURL){ %> <div class="<%= baseCls %>" style="margin-left:15px; float:left; width:110px; background-color:#e8e8e8; -moz-box-shadow:2px 2px 5px #888; -webkit-box-shadow:2px 2px 5px #888; box-shadow:2px 2px 5px #888;"> <img class="<%= baseCls %>" src="<%= ad.thumbURL %>" width="110" height="82"> </div> <% } %> <div class="<%= baseCls %>" style="width:<%= instance.fullWidth - (ibh.thumb && ad.thumbURL ? 307 : 182) %>px; float:left; margin-left:30px;"> <div class="<%= baseCls %>" style="color:#1122CC; font-family:Trebuchet MS,Arial,sans-serif; font-size:12pt; font-weight:normal; text-decoration:none;"><%= ad.title %></div> <div class="<%= baseCls %>" style="color:#222222; font-family:Trebuchet MS,Arial,sans-serif; font-size:10pt; font-weight:normal; padding-top:4px;"><%= ad.text %></div> <div class="<%= baseCls %>" style="color:#009933; font-family:Trebuchet MS,Arial,sans-serif; font-size:10pt; font-weight:normal; padding-top:4px; overflow:hidden;"><%= ad.displayedURL %></div> </div> <div id="IL_SR_BTN" class="<%= baseCls %>" style="position:absolute; right:24px; font-family:Trebuchet MS,Arial,sans-serif; font-size:10pt; font-weight:bold; cursor:pointer; text-align:center; width:93px; height:24px; top:59px; line-height:24px; color:#ffffff;"><%= btnText %></div> <% } else { %> <% if (ad.actualTemplate == "iframe"){ %> <iframe name="IL_SR_FRAME" class="<%= baseCls %>" src="<%= st.blankURL %>" width="<%= data.width %>" height="<%= data.height %>" frameborder="0" scrolling="no"></iframe> <%= rt.helpers.getEchoForm(content, "IL_SR_FRAME", "IL_SR_FORM") %> <% } else { %> <%= content %> <% } %> <% } %> </div>';
html = ut.VeST(tpl, {
rt: rt,
st: st,
baseCls: st.baseClass,
hdrCls: hdrCls,
ibh: ibh,
instance: instance,
data: data,
ad: ad,
content: content,
sentence: sentence,
sentenceTruncated: sentenceTruncated,
skinPath: skinPath,
oldIE: stsr.oldIE,
oldFF: b.Firefox && b.getVersion(true) < 4,
themeColor: themeColor,
titleBase: stsr.themes.tb[ibh.tb],
titlePrefix: rt.helpers.translate(data.tp || ibh.tp),
btnText: rt.helpers.translate(data.bt || ibh.bt)
});
var boxShadow = "0 2px 6px 2px rgba(0, 0, 0, 0.5)";
nodeStyle = ut.object.extend({
position: srPos,
zIndex: st.baseZIndex,
width: instance.fullWidth + "px",
height: instance.height + "px",
left: instance.left + "px",
borderTop: "2px solid " + themeColor,
borderLeft: "1px solid #a7a9ab",
borderRight: "1px solid #a7a9ab",
backgroundColor: "#FFFFFF",
boxShadow: boxShadow,
MozBoxShadow: boxShadow,
WebkitBoxShadow: boxShadow,
oBoxShadow: boxShadow,
msBoxShadow: boxShadow
}, srIEStyle);
dm.element.setStyle(hook.node, nodeStyle);
hook.node.innerHTML = html;
if (ad.actualTemplate == "iframe") {
var form = dm.element.$("IL_SR_FORM");
if (form) {
form.submit()
}
}
},
yahoo: function(hookId) {
var rt = this.$root,
b = rt.browser,
ut = rt.utils,
dm = ut.dom,
st = rt.settings,
stsr = this.$parent.settings,
data = rt.helpers.getHookData(hookId),
instance = stsr.instance,
hdrCls = "IL_SR_BG",
srPos = "",
srIEStyle = {},
skinPath = this.$parent.getSkinPath(),
sentence, content, tpl, html, nodeStyle, so = window.orientation,
ibh = stsr.behavior.merged,
hook = st.hooksMap[hookId],
themeColor, i;
for (i = 0; i < data.ads.length; i++) {
var pos = data.ads[i].displayedURL.indexOf("/");
if (pos != -1) {
data.ads[i].displayedURL = data.ads[i].displayedURL.substr(0, pos)
}
data.ads[i].title = ut.string.truncateToChar(data.ads[i].title, 52, " ", "...");
data.ads[i].text = ut.string.truncateToChar(data.ads[i].text, 110, " ", "...");
data.ads[i].displayedURL = ut.string.truncate(data.ads[i].displayedURL, 25, "...")
}
content = rt.helpers.parseTokens(hook);
this.$parent.setInsearchStylesheet();
instance.height = ibh.heightClose;
instance.fullWidth = 722;
instance.left = Math.ceil((dm.viewport.getWidth() - instance.fullWidth) / 2);
sentence = ((stsr.prodCode == "o") ? data.sentence : st.impression.params.refq).replace(/</g, "<");
var sentenceTruncated = ut.string.truncate(sentence, 23, "...");
if (stsr.oldIE) {
srPos = "absolute";
srIEStyle = {
top: (dm.viewport.getHeight() + dm.document.getScrollTop() - ibh.heightClose) + "px",
overflow: "hidden"
}
} else {
srPos = "fixed";
srIEStyle = {
bottom: 0
}
}
if (b.Firefox && b.getVersion(true) < 4) {
rt.utils.object.extend(srIEStyle, {
overflow: "hidden"
})
}
themeColor = stsr.themes.color[ibh.theme];
tpl = '<% if (oldIE || oldFF){ %> <img src="<%= skinPath %>in-search-shadow.png" alt="" width="<%= instance.fullWidth+20 %>" height="<%= ibh.heightOpen+10 %>" class="<%= baseCls %>" style="position:absolute; top:-10px; left:-10px; width:<%= instance.fullWidth+20 %>px; height=<%= ibh.heightOpen+10 %>px; overflow:hidden;" /> <% } %> <%-- Header --%> <div id="IL_SR_YAHOO_HEADER" class="<%= baseCls %>" style="position:absolute; top:0; left:0; width:<%= instance.fullWidth %>px; height:34px; background-color:#f0f1f5; cursor: default; border-bottom:1px solid <%= themeColor %>;"> <!-- Results Tab --> <div id="IL_SR_YAHOO_RESULTS_TAB" class="<%= baseCls %>" style="position:absolute; width:450px; height:30px; left:0; top:4px; cursor:pointer; font-size:1px; background-color:#ffffff; border-top:1px solid <%= themeColor %>; border-right:1px solid <%= themeColor %>;"> <div class="<%= baseCls %>" style="padding-left:15px; padding-top:3px; color:<%= ibh.titlePrefixColor %>; font-family: Trebuchet MS,Arial,sans-serif; font-size:13pt; font-weight:normal; font-style:normal; "><%= titlePrefix %> <span class="<%= baseCls %>" title="<%= sentence %>" style="color:<%= ibh.titleTermColor %>; font-weight: bold; font-size:13pt;"><%= sentenceTruncated %></span>?</div> </div> <%-- Search Tab --%> <div id="IL_SR_YAHOO_SEARCH_TAB" class="<%= baseCls %>" style="position:absolute; width:100px; height:29px; left:454px; top:4px; cursor:pointer; font-size:1px; background-color:#ffffff; border-top:1px solid <%= themeColor %>; border-right:1px solid <%= themeColor %>; border-left:1px solid <%= themeColor %>;"> <div class="<%= baseCls %>" style="padding-left:30px; padding-top:3px; color:#4E4E4E; font-family: Trebuchet MS,Arial,sans-serif; font-size:12pt; font-weight:normal; font-style:normal; background:url(<%= skinPath %>search.png) no-repeat scroll 12px 6px transparent;">Search</div> </div> <div class="<%= baseCls %>" style="position:absolute; top:8px; right:44px; width:30px; height:16px; cursor:default; font-size:10pt; color:#4E4E4E;">Ads</div> <div id="IL_SR_YAHOO_HELP" class="<%= baseCls %> IL_SR_BG" style="position:absolute; right:26px; top:9px; width:15px; height:15px; background-position:0 0; cursor:pointer; font-size:1px;"></div> <div id="IL_SR_X" class="<%= baseCls %> IL_SR_BG" style="position:absolute; right:10px; top:9px; width:15px; height:15px; background-position:-15px 0; cursor:pointer; font-size:1px;"></div> </div> <%-- BODY --%> <div style="position:absolute; top:35px; left:0; width:722px; height:125px; background-color:#ffffff; cursor: pointer;" class="<%= baseCls %>" id="IL_SR_AD_AREA"> <div id="IL_SR_YAHOO_RESULTS_CONTENT" class="<%= baseCls %>" style="position:absolute; top:0px; left:0; width:722px; height:125px; "> <div class="<%= baseCls %>" style="margin-left:15px; margin-right:15px; padding-bottom:2px; font-family:Trebuchet MS,Arial,sans-serif; font-size:9pt; color:#99a7c9;">2 results found:</div> <%-- Result 1 --%> <div style="position:relative; padding-bottom:10px; border-bottom:1px solid #eeeeee; margin-left:15px; margin-right:15px;" class="<%= baseCls %>"> <span class="<%= baseCls %>" style="display:inline; color:#1122CC; font-family:Trebuchet MS,Arial,sans-serif; font-size:12pt; font-weight:normal; text-decoration:none;"><%= ads[0].title %></span> <span class="<%= baseCls %>" style="display:inline; color:#222222; font-family:Trebuchet MS,Arial,sans-serif; font-size:11pt; font-weight:normal; text-decoration:none; padding-left:8px;"><%= ads[0].text %></span> <div style="position:absolute; bottom:10px; right:30px; color:#009933; font-family:Trebuchet MS,Arial,sans-serif; font-size:10pt; font-weight:normal; overflow:hidden;" class="<%= baseCls %>"><%= ads[0].displayedURL %></div> </div> <%-- Result 2 --%> <div id="IL_SR_YAHOO_RESULT2" style="position:relative; padding-bottom:10px; padding-left:15px; padding-right:15px;" class="<%= baseCls %>"> <span class="<%= baseCls %>" style="display:inline; color:#1122CC; font-family:Trebuchet MS,Arial,sans-serif; font-size:12pt; font-weight:normal; text-decoration:none;"><%= ads[1].title %></span> <span class="<%= baseCls %>" style="display:inline; color:#222222; font-family:Trebuchet MS,Arial,sans-serif; font-size:11pt; font-weight:normal; text-decoration:none; padding-left:8px;"><%= ads[1].text %></span> <div style="position:absolute; bottom:10px; right:30px; color:#009933; font-family:Trebuchet MS,Arial,sans-serif; font-size:10pt; font-weight:normal; overflow:hidden;" class="<%= baseCls %>"><%= ads[1].displayedURL %></div> </div> </div> <div id="IL_SR_YAHOO_SEARCH_CONTENT" class="<%= baseCls %>" style="display:none; position:absolute; top:0; left:0; width:722px; height:125px; cursor:default;"> <form id="IL_SR_YAHOO_SEARCH_FORM" action="http://search.yahoo.com/search" class="<%= baseCls %>" method="get" name="sf1" role="search"> <img src="<%= skinPath %>yahoo_logo_us_20120910.png" width="202" height="50" alt="" class="<%= baseCls %>" style="position:absolute; display:block; top: 35px; left: 80px;"/> <div class="<%= baseCls %>" style="position:absolute; top:40px; left: 290px; height:30px; padding:4px 6px; border:1px solid #b5bfca; border-radius:7px; background-color:#d8dae2;"> <input type="text" id="IL_SR_YAHOO_QUERY" autocomplete="off" value="" title="Search" name="p" class="<%= baseCls %>" style="float:left; border:1px inset #cccccc; font-family:Trebuchet MS,Arial,sans-serif; font-size:12pt; height:26px; line-height:26px; width:200px; background-color:#ffffff;"/> <span class="<%= baseCls %>" style="background-color:#FFE572; border:1px solid #DD9715; padding:0; float:left; margin-left:3px; overflow:hidden;"> <button id="IL_SR_YAHOO_SUBMIT_BTN" type="submit" value="Search" class="<%= baseCls %>" style="background-color:transparent; border-style:none; font-family:Trebuchet MS,Arial,sans-serif; font-size:12pt; padding:0; width:100px; cursor:pointer; font-weight:bold; height:26px; line-height:26px; text-align:center; overflow:visible;">Search</button> </span> </div> </form> </div> </div>';
html = ut.VeST(tpl, {
rt: rt,
st: st,
baseCls: st.baseClass,
hdrCls: hdrCls,
ibh: ibh,
instance: instance,
data: data,
ads: data.ads,
content: content,
sentence: sentence,
sentenceTruncated: sentenceTruncated,
skinPath: skinPath,
oldIE: stsr.oldIE,
oldFF: b.Firefox && b.getVersion(true) < 4,
themeColor: themeColor,
titleBase: stsr.themes.tb[ibh.tb],
titlePrefix: rt.helpers.translate(data.tp || ibh.tp),
btnText: rt.helpers.translate(data.bt || ibh.bt)
});
var boxShadow = "0 2px 6px 2px rgba(0, 0, 0, 0.5)";
nodeStyle = ut.object.extend({
position: srPos,
zIndex: st.baseZIndex,
width: instance.fullWidth + "px",
height: instance.height + "px",
left: instance.left + "px",
borderTop: "2px solid " + themeColor,
borderLeft: "1px solid #a7a9ab",
borderRight: "1px solid #a7a9ab",
boxShadow: boxShadow,
MozBoxShadow: boxShadow,
WebkitBoxShadow: boxShadow,
oBoxShadow: boxShadow,
msBoxShadow: boxShadow
}, srIEStyle);
dm.element.setStyle(hook.node, nodeStyle);
hook.node.innerHTML = html;
stsr.selectedTab = "results";
var dmel = rt.utils.dom.element,
prefix = "IL_SR_YAHOO_",
resultsTabId = prefix + "RESULTS_TAB",
searchTabId = prefix + "SEARCH_TAB",
resultsContent = dmel.$(prefix + "RESULTS_CONTENT"),
searchContent = dmel.$(prefix + "SEARCH_CONTENT"),
resultsTab = dmel.$(resultsTabId),
searchTab = dmel.$(searchTabId);
var yahooHelp = dmel.$("IL_SR_YAHOO_HELP");
rt.event.dom.bind(yahooHelp, {
event: "click",
listener: function(event) {
rt.utils.dom.event.stop(event.domEvent);
window.open("http://www.infolinks.com/", "_blank")
}
});
rt.event.dom.bind(yahooHelp, {
event: "mouseover",
data: {
el: yahooHelp,
pos: "0 -15px"
},
listener: this.$parent.setBackgroundPosition
});
rt.event.dom.bind(yahooHelp, {
event: "mouseout",
data: {
el: yahooHelp,
pos: "0 0"
},
listener: this.$parent.setBackgroundPosition
});
rt.event.dom.bind(resultsTab, {
event: "click",
listener: function(event) {
if (stsr.selectedTab == "results") {
rt.utils.dom.event.stop(event.domEvent);
event.$root.products.insearch.yahooClick(event);
return
}
rt.utils.dom.event.stop(event.domEvent);
stsr.selectedTab = "results";
resultsTab.style.height = "30px";
searchTab.style.height = "29px";
searchContent.style.display = "none";
resultsContent.style.display = "block"
}
});
rt.event.dom.bind(searchTab, {
event: "click",
listener: function(event) {
rt.utils.dom.event.stop(event.domEvent);
stsr.selectedTab = "search";
resultsTab.style.height = "29px";
searchTab.style.height = "30px";
resultsContent.style.display = "none";
searchContent.style.display = "block"
}
});
rt.event.dom.bind(dmel.$("IL_SR_YAHOO_HEADER"), {
event: "click",
listener: function(event) {
rt.utils.dom.event.stop(event.domEvent)
}
});
rt.event.dom.bind(dmel.$("IL_SR_YAHOO_SEARCH_CONTENT"), {
event: "click",
listener: function(event) {
rt.utils.dom.event.stop(event.domEvent)
}
});
rt.event.dom.bind(dmel.$("IL_SR_YAHOO_RESULT2"), {
event: "click",
listener: function() {
hook.currentAdIndex = 1
}
});
rt.event.dom.bind(dmel.$("IL_SR_YAHOO_SUBMIT_BTN"), {
event: "click",
listener: function() {
var form = dmel.$("IL_SR_YAHOO_SEARCH_FORM"),
query = dmel.$("IL_SR_YAHOO_QUERY");
if (query.value != "") {
query.name = "p";
form.action = "http://search.yahoo.com/search"
} else {
query.name = "";
form.action = "http://www.yahoo.com/"
}
dmel.$("IL_SR_YAHOO_SEARCH_FORM").submit()
}
})
}
}, {});
var inframe = products.$create("inframe", {
getPageMargins: function() {
var rt = this.$root,
stif = this.settings,
dm = rt.utils.dom,
wrapper = dm.findWidestNode(),
result = {
left: 0,
right: 0
};
if (wrapper && wrapper.node != document.body) {
var offset = dm.element.offset(wrapper.node);
var width = dm.element.getActualWidth(wrapper.node);
var docWidth = dm.document.getWidth();
result = {
left: offset.left - stif.buffer,
right: docWidth - width - offset.left - 2 * stif.buffer
}
}
return result
},
buildImpPageMarginsParam: function() {
var stif = this.settings,
stifw = stif.width,
margins = stif.margins = this.getPageMargins();
return [margins.left > stifw.thin ? margins.left > stifw.wide ? "w" : "t" : "", margins.right > stifw.thin ? margins.right > stifw.wide ? "w" : "t" : ""].join("*").replace(/^\*$/, "")
},
buildGetadsPageMarginsParam: function(bs) {
var uta = this.$root.utils.array,
stif = this.settings,
instance = stif.instance,
arr = [];
if (/THIN|AUTO/.test(bs)) {
uta.push(arr, stif.width.thin, "*", stif.height)
}
if ((instance.left || instance.right).width >= stif.width.wide && /WIDE|AUTO/.test(bs)) {
uta.push(arr, arr.length ? "~" : "", stif.width.wide, "*", stif.height)
}
return arr.join("")
},
renderUnit: function(side) {
var rt = this.$root,
ut = rt.utils,
dm = ut.dom,
dms = dm.style,
dmel = dm.element,
st = rt.settings,
stif = this.settings,
b = rt.browser,
instance = stif.instance,
html, bh = stif.behavior.merged,
skinPath = this.getSkinPath(),
bgCss, bgCls = "IL_IF_BG",
hook = instance[side].hook,
hookId = hook.id,
data = rt.helpers.getHookData(hookId),
ad, content, node = dmel.$("IL_IF_" + side.toUpperCase());
ad = data.ads[hook.currentAdIndex];
rt.helpers.setActualTemplate(ad);
if (ad.contentUrl) {
content = rt.bubble.templates.external(hook, hook.currentAdIndex)
} else {
content = rt.helpers.parseTokens(hook)
}
if (b.IE && b.getVersion(true) < 8) {
bgCss = skinPath + "hdr-btns.png"
} else {
bgCss = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAB+hJREFUeNrEV3tMm9cVP7Y/29gY/MBvg3klgFJGAnFeBUpok03NOhJeaVcSdVvGEu2fbdqmNm23bkmqRk1bbVm0PiKtTaVtSkLTh9SQlLY0CWSDpkugy8MmCY+AwRiwzbDBYJudc+FzP0e0+W+70pG/ex733Hvuub9zLPr9/gPAj/n5edDr9TA2NmbG6fJF9i3kuZEHIpEorvvbZ59hv7y9WCyGWCwGJpMJPB5PBrKykWJITp1O652Y8DE9fg0OEscGpIOl999fbjQaUEMEXq8Xbjid7ch/Guk8fPP4DtKBB8rLHXp9Gm5knjYRc7qcnyD/KaR/8YpCx3vWrllzZN26tRIJ7p4fmfYMKCkuLv380qXWf3Z0/AxZR77G6TMPlJftL161SiSMTFamXby6pGRz+8WLFZevXPkRsv4qdFyBix9ZuXKlZGYmzBh+v5+FXqvVsnlhYaE4Eo0cvnTpCydOW+5yWrdhw/oD+fkFEJqeWXJXDodDFolE/vLvq1ev08m55ORkkMvkLxcUFEimF40+bvkYOjo62HdJSQk8vOVh9p2fly/q6+v/QzAYvE+wpsRisbycnZUDZD/q8YA8SQ5qtYYJMdSQtDgvLPyWrH9g4EWplNtEMc2z2qyrZ2dnIRyewcTyQmdnJzz51K9h794nobu7G0ZGRpgsHA6D1WpdgTZFvFeZTFaabrPZF+Qz4Ha74bXXXofhYTc4nTfg6BtHYXJykskikTmyfxDNzFw0EimkU/Mhlkg42LZtKwSD00CbofuibOXlqmQV8Urws3vBsdQhtF+etxzm5ubg2Ftvo6MI7NjRwE7Ly1FX1NMTyOPkSUkKUiAn/DAYjeByuqC19VNYsWIFyOXyuBzvGRQKhSoeZwknj0SicTn9yBVJbJ6UlASRWJRFih9R1MWDiLg0ne5OIDAJKSkpCckQDE1BUVERONY4YCb8VcIEAgFIVipd/BxP0OsP+EEqk7I5hfps81loaHic8ABOHj8J1TXVkJK6sH4Aw45ZPinChy1veueUJzc3Vy10HJ5ZcIYRSdjQzVs3p6q3VlkMBsMUzZ0ul+n8hbaB3JxcGXM8NIQRM4AMo8ThtY16RhAOxOx1zKP89q2b7sYf78qg5Aqr1al/HB4exjBG4xSbj7GwCnkjuAjqvoo2U4K9eJRKxTEvno50bOnpIEaHc3MRmMbNa7Q6JC2TDQ4OEjK+RIgmordKBzt+sukTVC4lyFxqjI+PI6bGOhoe/34lTqd5/sxCZNRo34a5UKjRaJe0p2elUinP1lZXf5eumnfMEvZ085lXh9zuBsw3kVKpBAKgUCjEFjebTccf2bJlN12TcMFFx5Tp+rMftbzpGR19hGwVCiUCUAxfRwgTLRyzZ6Qf/fbmzT8nk7shk8K389H6ukNd3d31Pp+/gJho4EIYbDp34cLle+D0GNL36mtr1l3p6qqZnPxPLpaOWG5O1tXiVcXH29rbbgiVhSf+nw4x/J8Gt+/A8wn1eHEzhEz5FBF6MUhfUCbyNZfGc795NqEecxzHkIowBWkt0jJKIqRrSF20/DfV49qUlNRDaWm6bEoQGqHQNExMjPcj3u7F6d/vcZBdGo1mn1arsyoQvegcWFDI3jk1NfULlDcvVY9/l5WV9ZzRaEpYSaVKAaPRmInF4299fX1UHPYu4ZCO8edly5bv0el0CQJCRLPZnI848eGdOwO/QtYrwjveSk7NZgtrYYgI7sa8Y/E5bSg7O5u6iMeWcLwbkW8PYQCvfzfZbDaR3W4n8KhkJ0bAB6lU9qLVaouvcrG9HaFulBmkYQtTWlbG+LSx8fGJF/x+34nFfoqBT1qafr9eb2ATQkCZVMbsaAwhWimxehFkpqdniHw+30EspevoxEWIu3lSTA6iWawkg3cG4Qc/fAJ27twBHqzFM9Mh4OXYi2WhoYPfJKJVhclk1PPyZKUCmk+fhglEut7bt+H8ufNYSpOZTCaVgj5NT4mXyeHl5KtTU+PVRSvTwqOP1cMs1lRKDCpvKrwnXq7B2orO6K47aS6VSldiQsXlVpsNtm+vgxMnmjDTJdDYuCseGnbnWKX6B/qzOKwiHMd2I4sL1WotuFwuONN8BjZteghSMMF4oCFddBxXxrlEykkT7Cd8fqzTEpZz3rFxwNYIBPpMJraYzX2hUJAVeyHRm9y4cSOsdjiovYnzg6ir0aivfZW1KmdQYN/X18t6tp/sboR6PPmpd06xGs7LQxhF7GbHCDIlb751bKi0tNQkbEspuQgszBZzAsBgm+rbVlVl0Wo1rK3o7x/QII67N6xfr6B5b28vqFPVoEvTMbCg+sxhRKhGx6IxaP9H+217hj2XkiuKz+BgT08PKLDo84QlDFiVEfBoUa1Gc4hquODa/Cg7TLWWdKhVstms7DsJT5iTkwP2TDubX8fmz2K27KeejC8S4nffe78J25hqbEsS/qrwJ73cdYV67Q/qampqFqFQOOQnTjY149+XysLC+/BmE+0pch2fd0I0Gn0b8+GJu6sT99m5c/uwk/glprwMn8hCAR8dBe+odxb/kvzpwcpK+hsz+zVwqfyopeUlfyDQaDaZOYNBzxyOYAMwMT4xjfX8+fKyshf49y+ETEL4p+traw9fvXatyu0ezqONWSzmm5UVFe9/2trqvgdOh5B+ur2u7mD3l19WDQ25cygyGRnp1x+qrPzgQlvbmFD5vwIMAAZsT2nNzBrxAAAAAElFTkSuQmCC"
}
dms.addRule("." + bgCls, ['background-image : url("', bgCss, '")'].join(""));
var otherSide = (side == "left") ? "right" : "left";
var themeColor = stif.themes.color[bh.theme];
var tpl = '<div class="<%= baseCls %>" style="position:absolute; top:0; <%= otherSide %>: 0; width:<%= width %>; height:632px; border-bottom: 2px solid <%= themeColor %>;"> <%-- unit --%> <div class="<%= baseCls %> IL_IF_AD_AREA" style="position:absolute; top:0; left:0; width:<%= width %>; height:600px; text-align:center;"> <% if (ad.actualTemplate == "iframe"){ %> <iframe name="IL_IF_FRAME_<%= sideUpper %>" class="<%= baseCls %>" src="<%= st.blankURL %>" width="<%= width %>" height="<%= height %>" frameborder="0" scrolling="no"></iframe> <%= rt.helpers.getEchoForm(content, "IL_IF_FRAME_" + sideUpper, "IL_IF_FORM_" + sideUpper) %> <% } else { %> <%= content %> <% } %> </div> <%-- footer --%> <div class="<%= baseCls %> IL_IF_FOOTER" style="position:absolute; bottom:0; left:0; width:<%= width %>; height:32px; cursor: pointer; background-color:#f1f1f2;"> <div id="IL_IF_LOGO_<%= sideUpper %>" class="<%= baseCls %>" style="position:absolute; width:53px; height:12px; top:9px; <%= side %>:10px; cursor:pointer; font-size:1px; <% if (oldIE || oldFF){ %>background:url(<%= skinPath %>logo.png) no-repeat scroll 0 0 transparent;<% } %>"> <% if (!oldIE && !oldFF){ %> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="53px" height="12px" viewBox="0 0 636 144" enable-background="new 0 0 636 144" xml:space="preserve"> <g> <!-- dot (first) --> <path id="IL_IF_LOGO_<%= sideUpper %>_LOGO_DOT_1" fill="<%= bh.theme == \'def\' ? \'#208CE5\' : themeColor %>" d="M16.918,24.865c5.848,0,10.57-4.735,10.57-10.583s-4.722-10.57-10.57-10.57 S6.334,8.434,6.334,14.282S11.07,24.865,16.918,24.865"/> <!-- in --> <path fill="#003366" d="M88.085,43.784H77.024c-17.149,0-31.181,14.031-31.181,31.182v34.796 c0,0.218,0.016,0.415,0.027,0.618v5.185c0,5.71-4.672,10.382-10.382,10.382h-0.467c-5.71,0-10.382-4.672-10.382-10.382V92.608 h0.015V45.889v-0.025c0-1.124-0.885-2.033-2.01-2.08h-11.49c-1.09,0.047-1.949,0.907-1.986,1.996v46.828h0.04 c-0.015,0.355-0.04,0.707-0.04,1.066v22.246c0,14.031,11.479,25.512,25.511,25.512h1.151c14.031,0,25.511-11.48,25.511-25.512 v-5.466v-4.62v-28.89c0.082-9.872,8.159-17.948,18.031-17.948h6.366c9.871,0,17.948,8.076,18.042,17.948v28.89v4.62v28.873 c0.013,0.023,0.013,0.034,0.013,0.048c0,1.111,0.883,2.008,1.983,2.057h11.505c1.077-0.036,1.936-0.887,1.985-1.973v-27.966v-5.659 V74.966C119.267,57.815,105.234,43.784,88.085,43.784"/> <!-- f (part) --> <path fill="#003366" d="M155.069,56.972v82.643c-0.072,0.992-0.886,1.78-1.903,1.818h-11.014 c-1.062-0.038-1.912-0.897-1.912-1.962c0-0.024,0-0.048-0.023-0.073V34.456c0.716-17.064,14.923-30.744,32.179-30.744h8.536 c0.025,0,0.038,0.011,0.06,0.011c1.053,0,1.915,0.849,1.974,1.901v11.037c-0.035,1.016-0.85,1.844-1.878,1.889h-8.692 c-9.509,0-17.327,7.75-17.327,17.268v6.301V56.972z"/> <!-- f (part) --> <path fill="#003366" d="M151.99,59.104h28.873c0.023-0.012,0.034-0.012,0.047-0.012 c1.111,0,2.008-0.884,2.057-1.984V45.604c-0.036-1.078-0.887-1.938-1.973-1.986h-27.965"/> <!-- o --> <path fill="#003366" d="M276.24,107.925h0.158V76.608c-0.37-18.164-15.248-32.825-33.494-32.825 h-16.756v0.022c-17.875,0.431-32.322,14.924-32.679,32.803h-0.026v31.316c0,18.213,14.601,33.064,32.705,33.496v0.012h16.589h0.021 h0.146C261.304,141.349,276.24,126.354,276.24,107.925 M208.93,107.925L208.93,107.925V77.289c0-9.914,8.096-18.02,18.021-18.02 h15.953c9.946,0,18.02,8.106,18.02,18.02v30.636h-0.167c0,9.949-8.074,18.021-17.999,18.021h-15.807 C217.026,125.946,208.93,117.874,208.93,107.925"/> <!-- l --> <path fill="#003366" d="M312.844,139.376L312.844,139.376c0,1.064-0.798,1.938-1.829,2.045h-11.816 c-1.027-0.107-1.837-0.98-1.837-2.045h-0.013V5.769h0.013c0-1.135,0.908-2.033,2.031-2.057h11.432 c1.124,0.024,2.019,0.922,2.019,2.057V139.376z"/> <!-- dot (second) --> <path id="IL_IF_LOGO_<%= sideUpper %>_LOGO_DOT_2" fill="<%= bh.theme == \'def\' ? \'#208CE5\' : themeColor %>" d="M341.662,24.865c5.848,0,10.57-4.735,10.57-10.583s-4.723-10.57-10.57-10.57 s-10.584,4.722-10.584,10.57S335.814,24.865,341.662,24.865"/> <!-- in (second) --> <path fill="#003366" d="M412.829,43.784h-11.061c-17.149,0-31.181,14.031-31.181,31.182v34.796 c0,0.218,0.016,0.415,0.026,0.618v5.185c0,5.71-4.672,10.382-10.382,10.382h-0.468c-5.71,0-10.382-4.672-10.382-10.382V92.608 h0.016V45.723v-0.025c0-1.123-0.885-2.033-2.01-2.08h-11.49c-1.091,0.047-1.949,0.908-1.986,1.996v46.994h0.04 c-0.015,0.355-0.04,0.707-0.04,1.066v22.246c0,14.031,11.479,25.512,25.512,25.512h1.15c14.031,0,25.512-11.48,25.512-25.512 v-5.466v-4.62v-28.89c0.082-9.872,8.158-17.948,18.029-17.948h6.367c9.871,0,17.947,8.076,18.041,17.948v28.89v4.62v28.873 c0.014,0.023,0.014,0.034,0.014,0.048c0,1.111,0.883,2.008,1.982,2.057h11.506c1.076-0.036,1.936-0.887,1.984-1.973v-27.966v-5.659 V74.966C444.01,57.815,429.979,43.784,412.829,43.784"/> <!-- k --> <path fill="#003366" d="M480.277,139.376L480.277,139.376V91.735h0.146h9.255l40.656,48.766 c0.599,0.549,1.15,0.906,1.841,0.932h16.073c0.882-0.025,2.869-0.322,1.794-2.056l-0.013-0.024l-47.58-56.777l44.599-36.815 c0.015-0.049,0.015-0.049,0.036-0.073c1.066-1.734-0.886-2.032-1.78-2.069H527.08c-0.621,0.024-1.15,0.324-1.666,0.791 l-36.812,31.075h-8.325V5.769c0-1.135-0.896-2.033-2.02-2.057h-11.422c-1.124,0.024-2.033,0.922-2.033,2.057v133.607 c0,1.064,0.803,1.938,1.844,2.045h11.802C479.476,141.313,480.277,140.44,480.277,139.376"/> <!-- s --> <path fill="#003366" d="M603.208,84.782H577.99c-6.91-0.114-12.508-5.785-12.508-12.783 c0-6.996,5.598-12.895,12.508-12.895h39.271c1.146,0,2.08-0.959,2.08-2.111v0.191V45.752v-0.037c0-1.164-0.935-2.097-2.08-2.097 H577.99c-15.451,0-28.008,12.73-28.008,28.381c0,15.651,12.557,28.381,28.008,28.27h24.252c6.911,0.111,12.508,5.812,12.508,12.795 c0,6.996-5.597,12.896-12.508,12.896H591.56l0.001-0.014h-28.874c-0.022,0.014-0.034,0.014-0.047,0.014 c-1.11,0-2.007,0.896-2.056,2.01v11.449c0.035,1.092,0.886,1.963,1.973,2.014h0.225h27.74h12.224 c15.209-0.279,27.491-12.9,27.491-28.369C630.236,97.737,618.191,85.202,603.208,84.782"/> </g> </svg> <% } %> </div> <div id="IL_IF_HELP_<%= sideUpper %>" class="<%= baseCls %> <%= cls %>" style="width:15px; height:15px; position:absolute; top:9px; <%= otherSide %>:27px; background-position:0 0; cursor:pointer; font-size:1px;"></div> <div id="IL_IF_X_<%= sideUpper %>" class="<%= baseCls %> <%= cls %>" style="width:15px; height:15px; position:absolute; top:9px; <%= otherSide %>:9px; background-position:-15px 0; cursor:pointer; font-size:1px;"></div> </div> </div>';
html = ut.VeST(tpl, {
side: side,
sideUpper: side.toUpperCase(),
rt: rt,
st: st,
bh: bh,
baseCls: st.baseClass,
cls: bgCls,
otherSide: otherSide,
width: instance[side].width + "px",
height: stif.height,
ad: ad,
content: content,
themeColor: themeColor,
oldIE: stif.oldIE,
oldFF: b.Firefox && b.getVersion(true) < 4,
skinPath: skinPath
});
var nodeStyle = {
position: stif.oldIE ? "absolute" : "fixed",
top: stif.oldIE ? dm.document.getScrollTop() : 0,
width: 0,
height: stif.height + 34 + "px",
overflow: "hidden",
display: (stif.margins[side] < instance[side].width) ? "none" : "block",
cursor: "pointer"
};
nodeStyle[side] = 0;
dmel.setStyle(node, nodeStyle);
node.innerHTML = html;
if (ad.actualTemplate == "iframe") {
var form = dm.element.$("IL_IF_FORM_" + side.toUpperCase());
if (form) {
form.submit()
}
}
this.setUnitEventHandlers(side)
},
getSkinPath: function() {
var stif = this.settings;
return ["http:/", this.$root.settings.hosts.resources, "static", "skins", stif.skin, stif.prodName, stif.rv, ""].join("/")
},
setGeneralEventHandlers: function() {
var evdm = this.$root.event.dom;
evdm.bind(window, {
event: "scroll",
listener: this.scrollHandler
});
evdm.bind(window, {
event: "resize",
listener: this.resizeHandler
})
},
setUnitEventHandlers: function(side) {
var rt = this.$root,
st = rt.settings,
ut = rt.utils,
stif = this.settings,
dm = ut.dom,
dmel = dm.element,
evdm = rt.event.dom,
node = stif.instance[side].hook.node;
var xBtn = dmel.$(stif.prodId + "_X_" + side.toUpperCase());
if (xBtn) {
evdm.bind(xBtn, {
event: "click",
data: {
side: side
},
listener: function(event) {
rt.event.repeat("effectSlideClose", stif.animationInterval, event.data)
}
});
evdm.bind(xBtn, {
event: "mouseover",
data: {
el: xBtn,
pos: "-15px -15px"
},
listener: this.setBackgroundPosition
});
evdm.bind(xBtn, {
event: "mouseout",
data: {
el: xBtn,
pos: "-15px 0"
},
listener: this.setBackgroundPosition
})
}
var ifLogo = dmel.$(stif.prodId + "_LOGO_" + side.toUpperCase());
if (ifLogo) {
evdm.bind(ifLogo, {
event: "click",
listener: function(event) {
rt.utils.dom.event.stop(event.domEvent);
if (st.homeUrl) {
window.open(st.homeUrl, "_blank")
}
}
})
}
var helpBtn = dmel.$(stif.prodId + "_HELP_" + side.toUpperCase());
if (helpBtn) {
evdm.bind(helpBtn, {
event: "click",
listener: function(event) {
rt.utils.dom.event.stop(event.domEvent);
if (st.helpUrl) {
window.open(st.helpUrl, "_blank")
}
}
});
evdm.bind(helpBtn, {
event: "mouseover",
data: {
el: helpBtn,
pos: "0 -15px"
},
listener: this.setBackgroundPosition
});
evdm.bind(helpBtn, {
event: "mouseout",
data: {
el: helpBtn,
pos: "0 0"
},
listener: this.setBackgroundPosition
})
}
var adArea = ut.dom.filterByClass("IL_IF_AD_AREA", null, node);
evdm.bind(adArea.length ? adArea[0] : node, {
event: "click",
data: {
hookId: stif.instance[side].hook.id
},
listener: function(event) {
rt.event.stop("effectSlideOpen");
rt.event.disable("effectSlideOpen");
rt.event.stop("effectSlideClose");
rt.event.disable("effectSlideClose");
rt.event.dom.unbind(window, "scroll", this.scrollHandler);
rt.event.dom.unbind(window, "resize", this.resizeHandler);
var parent, side, node;
for (side in stif.instance) {
node = stif.instance[side].hook.node;
parent = node.parentNode;
parent.removeChild(node)
}
var hookId = event.data.hookId,
hook = st.hooksMap[hookId],
data = rt.helpers.getHookData(hookId),
ad = data.ads[hook.currentAdIndex];
if (ad.template != "text" && ad.content.match(/<object |<embed /i) && ad.content.match(/clicktag/i)) {
return
}
event.$root.products.inframe.bannerClick(hookId)
}
})
},
scrollHandler: function() {
var stif = this.settings,
dm = this.$root.utils.dom,
side, node;
var viewport = dm.viewport.getHeight();
var height = stif.height + 34;
var scroll = dm.document.getScrollTop();
for (side in stif.instance) {
node = stif.instance[side].hook.node;
if (viewport > height) {
if (stif.oldIE) {
node.style.position = "absolute";
node.style.top = scroll + "px"
} else {
node.style.position = "fixed";
node.style.top = 0
}
} else {
node.style.position = "absolute";
if (scroll == 0) {
node.style.top = "0"
} else {
if (scroll >= height - viewport) {
node.style.top = (scroll - height + viewport) + "px"
}
}
}
}
},
resizeHandler: function() {
var side, margins = this.getPageMargins(),
instance = this.settings.instance;
for (side in instance) {
instance[side].hook.node.style.display = margins[side] > instance[side].width ? "block" : "none"
}
},
setBackgroundPosition: function(event) {
event.data.el.style.backgroundPosition = event.data.pos
},
bannerClick: function(hookId) {
var rt = this.$root;
rt.utils.timer.stop("adView" + hookId);
var reuseWindow = rt.helpers.getHookBehavior(hookId).adsReuseWindow;
if (!reuseWindow) {
try {
rt.settings.adWin = window.open("", hookId)
} catch (ex) {
rt.settings.adWin = null
}
}
rt.event.fire("productClick", {
hookId: hookId,
clickType: "onWin"
})
}
}, {
settings: {
prodId: "IL_IF",
prodCode: "f",
prodName: "inframe",
width: {
thin: 120,
wide: 160
},
height: 600,
effect: "slide",
buffer: 15,
instance: {},
behavior: {
def: {
ifp: "DOUBLE",
bs: "AUTO",
theme: "def"
}
},
themes: {
color: {
def: "#003366",
lightBlue: "#1b8ede",
green: "#67b045",
orange: "#f3933b",
red: "#dd3c42",
pink: "#d84189",
purple: "#5939aa"
}
},
sentences: {},
oldIE: (function() {
var b = $root.browser;
return (b.IE && (document.compatMode == "BackCompat" || b.getVersion(true) < 9))
}()),
skin: "brand",
rv: "1",
animationInterval: $root.browser.IE ? 7 : 10,
bidRequestTimeout: 750
}
}, true);
inframe.bind({
event: "renderProduct",
listener: {
renderInframe: function() {
var rt = this.$root,
st = rt.settings,
imp = rt.comm.settings.responses.impression,
stif = this.settings,
stifw = stif.width,
bh = stif.behavior,
instance = stif.instance,
prodCode = stif.prodCode,
prod = imp.prs[prodCode];
if (!prod || !prod.sentences || !prod.sentences.length) {
rt.event.fire("productRenderStatus", {
prod: prodCode,
status: "none"
});
return
}
var margins = stif.margins,
side, result = {
left: 0,
right: 0
},
bhm = bh.merged = rt.utils.object.extend({}, st.behavior.def, bh.def, st.behavior.impression, imp.prs[prodCode].behavior, st.behavior.customer, {
adsReuseWindow: true
});
for (side in result) {
if ((new RegExp(side.toUpperCase() + "|DOUBLE")).test(bhm.ifp)) {
result[side] = /WIDE|AUTO/.test(bhm.bs) && margins[side] >= stifw.wide ? stifw.wide : /THIN|AUTO/.test(bhm.bs) && margins[side] >= stifw.thin ? stifw.thin : 0
}
}
if (bhm.ifp == "SINGLE") {
var sizes = {
thin: 1,
wide: 1
},
size;
for (size in sizes) {
if ((new RegExp(size.toUpperCase() + "|AUTO")).test(bhm.bs)) {
side = margins.left >= stifw[size] && margins.right >= stifw[size] ? ["left", "right"][Math.floor(Math.random() * 2)] : margins.left > stifw[size] ? "left" : margins.right > stifw[size] ? "right" : null;
if (side) {
result[side] = stifw[size]
}
}
}
if (result.left && result.right) {
if (result.left < result.right) {
result.left = 0
} else {
result.right = 0
}
}
}
if (Math.min(result.left, result.right) > 0 && result.left != result.right) {
result.left = result.right = Math.min(result.left, result.right)
}
for (side in result) {
if (result[side]) {
instance[side] = {
width: result[side]
}
}
}
if (!(instance.left || instance.right)) {
rt.event.fire("productRenderStatus", {
prod: prodCode,
status: "none"
})
} else {
rt.event.fire("productRenderStatus", {
prod: prodCode,
status: "during"
});
rt.event.fire("initInframe")
}
}
}
});
inframe.bind({
event: "initInframe",
listener: {
init: function() {
var rt = this.$root,
ut = rt.utils,
stif = this.settings,
resImp = rt.comm.settings.responses.impression,
sentenceIndex = resImp.prs[stif.prodCode].sentences[0],
instance = stif.instance,
side, node, id;
stif.sentence = ut.object.keys(resImp.sentences)[sentenceIndex];
for (side in instance) {
id = [stif.prodId, side.toUpperCase()].join("_");
node = ut.dom.createDOMFragment({
tag: "div",
id: id,
cls: [rt.settings.baseClass, stif.prodId].join(" "),
parent: document.body
});
instance[side].hook = rt.helpers.createHook(id, stif.sentence, node, 0, this, stif.prodCode, stif.prodName, false, instance[side])
}
rt.event.fire("getAds", {
hookId: (instance.left || instance.right).hook.id,
params: {
as: this.buildGetadsPageMarginsParam(stif.behavior.merged.bs),
nm: (instance.left && instance.right) ? 2 : 1
},
bidRequestTimeout: stif.bidRequestTimeout,
callback: "getadsResponseInframe"
})
}
}
});
inframe.bind({
event: "getadsResponseInframe",
listener: {
setAdData: function(event) {
var rt = this.$root,
response = event.data,
data = {},
hook, ad, stif = this.settings,
instance = stif.instance,
side, i, leni, undef;
if (!response.ads.length) {
rt.event.fire("productRenderStatus", {
prod: stif.prodCode,
status: "failed",
reason: "received no ads."
});
return false
} else {
for (i = 0, leni = response.ads.length; i < leni; i++) {
ad = response.ads[i];
if (ad.trackerURL) {
rt.helpers.hitTrackerURL(ad.trackerURL)
}
}
}
if (instance.left && instance.right) {
if (response.ads.length == 1) {
var selected = Math.floor(Math.random() * 2),
sides = ["left", "right"];
delete instance[sides[selected ^ 1]];
data[sides[selected]] = response
} else {
instance.right.hook.bdc = instance.left.hook.bdc;
instance.left.hook.currentAdIndex = 0;
instance.right.hook.currentAdIndex = 1;
if (instance.left.hook.externalTag) {
instance.right.hook.externalTag = instance.left.hook.externalTag
}
data.left = response;
data.right = rt.utils.object.clone(response, true);
data.left.ads = [data.left.ads[0]];
ad = data.right.ads[1];
data.right.ads = [];
data.right.ads[1] = ad
}
} else {
for (side in instance) {
data[side] = response
}
}
for (side in instance) {
hook = instance[side].hook;
ad = data[side].ads[hook.currentAdIndex];
if (ad && ad.template == "external") {
data[side] = rt.externalTags.setExternalTagData(hook, data[side])
}
rt.helpers.setHookData(hook.id, data[side]);
if (hook.externalTag) {
rt.externalTags.updateViewedTags(hook.id)
}
}
rt.event.fire("createInframe")
}
}
});
inframe.bind({
event: "createInframe",
listener: {
createInframe: function() {
var rt = this.$root,
stif = this.settings,
side;
for (side in stif.instance) {
this.renderUnit(side)
}
this.setGeneralEventHandlers();
rt.event.repeat("effectSlideOpen", stif.animationInterval);
rt.event.fire("productRenderStatus", {
prod: stif.prodCode,
status: "after"
})
}
}
});
inframe.bind({
event: "effectSlideOpen",
listener: {
effectSlideOpen: function() {
var rt = this.$root,
stif = this.settings,
ut = rt.utils,
dmel = ut.dom.element,
b = rt.browser,
instance = stif.instance,
newWidth, side, hook;
var currentWidth = parseInt(dmel.getStyle((instance.left || instance.right).hook.node, "width"));
var endWidth = (instance.left || instance.right).width;
if (currentWidth >= endWidth) {
rt.event.stop("effectSlideOpen");
for (side in instance) {
hook = instance[side].hook;
rt.utils.timer.start("adView" + hook.id);
rt.event.fire("sendAdView", {
hookId: hook.id,
params: {
prod_t: hook.prod,
bdc: hook.bdc,
midx: hook.currentAdIndex
}
})
}
return
}
newWidth = b.IE && b.getVersion(true) < 7 ? endWidth : Math.min(currentWidth + 2, endWidth);
for (side in instance) {
dmel.setStyle(instance[side].hook.node, {
width: newWidth + "px"
})
}
}
}
});
inframe.bind({
event: "effectSlideClose",
listener: {
effectSlideClose: function(event) {
var rt = this.$root,
stif = this.settings,
dmel = rt.utils.dom.element,
b = rt.browser,
side = event.data.side,
node = stif.instance[side].hook.node;
var current = parseInt(dmel.getStyle(node, "width"));
if (current <= 0) {
rt.event.stop("effectSlideClose");
node.parentNode.removeChild(node);
delete stif.instance[side];
return
}
var width = b.IE && b.getVersion(true) < 7 ? 0 : Math.max(current - 2, 0);
dmel.setStyle(node, {
width: width + "px"
})
}
}
});
var externalTags = $root.$create("externalTags", {
init: function() {
var rt = this.$root,
imp = rt.comm.settings.responses.impression,
i, leni, ut = rt.utils,
uta = ut.array,
uto = ut.object,
ad, etst = this.settings;
if (!imp.messages) {
return
}
if (rt.browser.isMobile()) {
delete imp.messages;
return
}
etst.bidCallbackVar = (rt.settings.white_label || "infolinks") + "_etag";
for (i = 0, leni = imp.messages.length; i < leni; i++) {
ad = imp.messages[i].ads[0];
ad.prs = uta.toObject(ad.prs ? ad.prs.split(",") : uta.discard(uta.discard(uto.keys(imp.prs), "s"), "o"), {}, true);
imp.messages[i].msg = i;
if (ad.emd) {
etst.tags[ad.emd] = imp.messages[i]
}
}
},
getProductAdSizes: function(prod, hook) {
switch (prod) {
case "i":
return [{
w: 300,
h: 250
}];
case "r":
return [{
w: 300,
h: 250
}];
case "t":
return [{
w: 300,
h: 250
}];
case "s":
return [{
w: 728,
h: 90
}];
case "o":
return [{
w: 728,
h: 90
}];
case "f":
return [{
w: hook.instance.width || 160,
h: 600
}]
}
},
setExternalTagData: function(hook, data) {
var uto = this.$root.utils.object,
cai = hook.currentAdIndex,
ad = data.ads[cai];
if (ad.content) {
ad.content = this.$root.utils.base64.decodeBase64(ad.content);
hook.externalTag = true
} else {
if (ad.url || ad.contentUrl) {
if (ad.url) {
ad.contentUrl = ad.url
}
hook.externalTag = true
} else {
var bidInvocation = hook.externalTag,
etst = this.settings,
emd = data.ads[cai].emd,
tag = etst.tags[emd],
i, leni, responses = etst.bidResponses[bidInvocation];
for (i = 0, leni = responses.length; i < leni; i++) {
if (responses[i].emd == emd) {
data.width = responses[i].size.w;
data.height = responses[i].size.h;
data.ads[cai].contentUrl = responses[i].result[tag.ads[0].jat];
uto.extend(data.ads[cai], tag.ads[0])
}
}
}
}
data.cacheOverride = true;
return data
},
getBidData: function(bidInvocation) {
var rt = this.$root,
etst = this.settings;
if (rt.what(bidInvocation) != "number") {
return {}
}
var bids = etst.bidResponses[bidInvocation];
var emd = rt.utils.array.map(bids, function(bid) {
return bid.emd || ""
});
var nj = rt.utils.array.map(bids, function(bid) {
var p = bid.result[etst.tags[bid.emd].ads[0].jpt];
return rt.utils.base64.encodeBase64((rt.what(p) == "number" ? p : -1).toString()).split("").reverse().join("") || ""
});
var jsd = rt.utils.array.map(bids, function(bid) {
return [bid.size.w, bid.size.h].join("*") || ""
});
return {
emd: emd.join("~"),
nj: nj.join("~"),
jsd: jsd.join("~")
}
},
updateViewedTags: function(hookId) {
var rt = this.$root,
hook = rt.settings.hooksMap[hookId],
data = rt.helpers.getHookData(hookId);
var emd = data.ads[hook.currentAdIndex].emd,
etst = rt.externalTags.settings;
if (emd) {
if (!etst.uemd[emd]) {
etst.uemd[emd] = {}
}
if (!etst.uemd[emd][hook.prod]) {
etst.uemd[emd][hook.prod] = 0
}
etst.uemd[emd][hook.prod]++
}
},
getViewedTagsParam: function() {
var rt = this.$root,
etst = this.settings,
uto = rt.utils.object,
emd, val = [],
prod;
if (!uto.keys(etst.uemd).length) {
return {}
}
for (emd in etst.uemd) {
for (prod in etst.uemd[emd]) {
rt.utils.array.push(val, [emd, prod, etst.uemd[emd][prod]].join("!"))
}
}
return {
uemd: val.join("~")
}
}
}, {
settings: {
bidInvocation: 0,
bidResponses: {},
bidCount: 0,
tags: {},
bidRequestTimeout: 300,
uemd: {}
}
}, true);
externalTags.bind({
event: "sendBids",
listener: {
sendBids: function(event) {
var rt = this.$root,
etst = this.settings,
emd, tag, ad, jsonUrl, i, leni, hook = rt.settings.hooksMap[event.data.hookId],
sizes = this.getProductAdSizes(hook.prod, hook);
rt.utils.timer.start("externalBid" + (++etst.bidInvocation));
etst.bidResponses[etst.bidInvocation] = [];
etst.bidResponses[etst.bidInvocation].bids = 0;
etst.bidResponses[etst.bidInvocation].responses = 0;
for (emd in etst.tags) {
tag = etst.tags[emd];
ad = tag.ads[0];
if (ad.prs && !ad.prs[hook.prod]) {
continue
}
if (!ad.jsonUrl) {
continue
}
if (!ad.jat) {
ad.jat = "ad"
}
if (!ad.jat) {
ad.jpt = "cpm"
}
for (i = 0, leni = sizes.length; i < leni; i++) {
jsonUrl = ad.jsonUrl.replace(/\{WIDTH\}/g, sizes[i].w).replace(/\{HEIGHT\}/g, sizes[i].h);
etst.bidCount++;
etst.bidResponses[etst.bidInvocation].bids++;
rt.comm.loadScript([jsonUrl, "&callback=", etst.bidCallbackVar, etst.bidCount].join(""), null, "setExternalBidResponse", rt.utils.object.extend({
emd: emd,
bidInvocation: etst.bidInvocation,
bidCount: etst.bidCount,
hookId: hook.id,
size: sizes[i]
}, event.data))
}
}
}
}
});
externalTags.bind({
event: "setExternalBidResponse",
listener: {
setExternalBidResponse: function(event) {
var rt = this.$root,
etst = this.settings,
bidCount = event.data.bidCount,
bidInvocation = event.data.bidInvocation,
tag = etst.tags[event.data.emd],
ad = tag.ads[0],
jct, response = window[etst.bidCallbackVar + bidCount],
hook = rt.settings.hooksMap[event.data.hookId],
bidResponses = etst.bidResponses[bidInvocation];
response.emd = event.data.emd;
response.size = event.data.size;
if (ad.jct) {
jct = new RegExp(ad.jct.replace(/([\[\]])/g, "\\$1"), "g");
response.result[ad.jat] = response.result[ad.jat].replace(jct, "@encode@@start@@end@@encode@")
}
rt.utils.array.push(bidResponses, response);
bidResponses.responses++;
if (bidResponses.responses >= bidResponses.bids) {
if (hook.killBids) {
delete hook.killBids
} else {
hook.externalTag = bidInvocation;
rt.event.fire("sendGetAds", event.data)
}
}
}
}
});
var updater = $root.$create("updater", {
handleUpdaterImpression: function(event) {
var rt = this.$root,
response, ust = this.settings,
instance = ust.instances[ust.instances.length - 1];
instance.complete = true;
response = rt.helpers.processImpressionResponse(event.data);
if (rt.what(response) != "object") {
rt.logger.error("Bad Impression response.", true);
return
}
instance.impression = response;
if (!instance.impression.prs[rt.products.intext.settings.prodCode]) {
return
}
rt.event.fire("initIntext", {
updater: instance
})
}
}, {
settings: {
def: {
interval: 10,
container: null,
tag: null
},
counter: 0,
instances: []
}
}, true);
updater.bind({
event: "initUpdater",
listener: {
init: function() {
var rt = this.$root,
ust = this.settings,
hp = rt.helpers,
cont = hp.getVar("updater_container");
ust.interval = hp.getVar("updater_interval") || ust.def.interval;
ust.container = cont ? rt.utils.dom.element.$(cont) : ust.def.container;
ust.tag = hp.getVar("updater_tag") || ust.def.tag;
rt.event.repeat("updaterContentChange", ust.interval * 1000)
}
}
});
updater.bind({
event: "updaterContentChange",
listener: {
updaterContentChange: function() {
var rt = this.$root,
ut = rt.utils,
ust = this.settings,
harvested, instance, i, leni, text = [],
nodes = [];
if (ust.instances.length && !ust.instances[ust.counter - 1].complete) {
return
}
var containers = rt.utils.dom.filterByClass(ust.className, ust.tag, ust.container);
for (i = 0, leni = containers.length; i < leni; i++) {
if (containers[i].getAttribute("iceupdated") == "true") {
continue
}
rt.harvest.settings.enabled = true;
harvested = rt.harvest.getHarvestedText(containers[i]);
if (harvested.text.length > 0) {
containers[i].setAttribute("iceupdated", "true");
ut.array.push(text, harvested.text);
nodes = ut.array.concat(nodes, harvested.nodes)
}
}
if (!text.length) {
return
}
instance = ust.instances[ust.counter++] = {
nodes: nodes,
text: text.join("P"),
complete: false
};
rt.event.unbind("afterImpression");
rt.event.bind({
event: "afterImpression",
listener: this.handleUpdaterImpression
});
rt.event.fire("beforeImpression", {
ptxt: instance.text,
updater: ust.counter
})
}
}
});
var demo = $root.$create("demo", {
isDemo: function() {
var rt = this.$root,
hp = rt.helpers,
std = this.settings;
std.demo = hp.getVar("demo");
std.custom = hp.getVar("custom");
return (std.demo || std.custom)
},
convertCustom: function(custom) {
var rt = this.$root,
uto = rt.utils.object,
prods = ["intext", "tagcloud"],
prod, i, leni, prs = {},
prodCode;
if (custom.related) {
if (!custom.tagcloud) {
custom.tagcloud = custom.related
}
delete custom.related
}
for (i = 0, leni = prods.length; i < leni; i++) {
prod = prods[i];
if (custom[prod]) {
prodCode = prod.charAt(0);
if (custom[prod] === true) {
prs[prodCode] = {
behavior: {},
sentences: ["ALL"]
}
} else {
if ((custom[prod].sentences && custom[prod].sentences.length) || custom[prod].marker) {
prs[prodCode] = uto.extend({}, custom[prod])
}
}
}
}
var data = {
containers: custom.hooks && custom.hooks.containers ? custom.hooks.containers : null,
responses: {
gsd: uto.extend(custom.verification ? custom.verification.response : {}, {
prs: uto.keys(prs).join(",")
}),
impression: {
rauth: {
rsd: "1",
rsk: "1",
rcs: "1"
},
sentences: custom.hooks && custom.hooks.sentences ? rt.utils.array.toObject(custom.hooks.sentences, {}, "1") : null,
prs: prs
},
getads: {
catchall: rt.what(custom.hover.response) == "array" ? custom.hover.response[0] : custom.hover.response[rt.utils.object.keys(custom.hover.response)[0]]
}
}
};
rt.event.fire("setDemoData", data)
},
reRouteEvents: function() {
var rt = this.$root,
ev = rt.event;
ev.unbind("beforeGSD");
ev.bind({
event: "beforeGSD",
listener: this.beforeGSD
});
ev.unbind("afterGSD");
ev.bind({
event: "afterGSD",
listener: this.afterGSD
});
ev.unbind("beforeImpression");
ev.bind({
event: "beforeImpression",
listener: this.beforeImpression
});
ev.unbind("afterImpression");
ev.unbind("getAds");
ev.bind({
event: "getAds",
listener: this.getAds
});
ev.unbind("sendAdView");
ev.unbind("sendImpressionLog");
ev.unbind("startClick");
ev.bind({
event: "startClick",
listener: rt.comm.doRedirect
})
},
beforeGSD: function() {
this.$root.event.fire("afterGSD")
},
afterGSD: function() {
var rt = this.$root;
if (/i|r|t/.test(rt.comm.settings.responses.gsd.prs)) {
rt.event.fire("beforeHarvest")
} else {
rt.event.fire("beforeImpression")
}
},
beforeImpression: function() {
var rt = this.$root,
prs = rt.utils.array.toObject(rt.comm.settings.responses.gsd.prs.split(","), {}, true);
if (rt.helpers.getVar("inframe_disable") === true) {
delete prs["f"]
}
if (prs["f"]) {
var gpmp = rt.products.inframe.buildImpPageMarginsParam();
if (!gpmp) {
delete prs["f"]
}
}
rt.event.fire("preRenderProducts")
},
getAds: function(event) {
var rt = this.$root,
hookId = event.data.hookId,
st = rt.settings,
hook = st.hooksMap[hookId],
getads = rt.comm.settings.responses.getads,
s2cm = this.settings.sentences2ContainersMap,
i, j, ad, cb;
var data = rt.helpers.getHookData(hookId);
if (!data) {
if (getads.sentences && getads.sentences[hook.sentence]) {
data = getads.sentences[hook.sentence]
} else {
if (getads.containers && getads.containers[s2cm[hook.sentence]]) {
data = getads.containers[s2cm[hook.sentence]]
} else {
if (getads.catchall) {
data = getads.catchall
}
}
}
}
data = data ? rt.utils.object.clone(data, true) : "pending";
data.lid = hook.id;
data.sentence = hook.sentence;
var props = ["redirectUrl", "title", "text"];
for (i = 0; i < data.ads.length; i++) {
ad = data.ads[0];
for (j = 0; j < props.length; j++) {
if (ad[props[j]]) {
ad[props[j]] = ad[props[j]].replace("@sentence@", hook.sentence)
}
}
}
hook.bdc = ++st.bdc;
switch (hook.prod) {
case "s":
cb = "getadsResponseInsearch";
break;
case "f":
cb = "getadsResponseInframe";
break;
default:
cb = "getadsResponse"
}
rt.event.fire(cb, data)
}
}, {
settings: {
custom: false,
demo: false,
sentences2ContainersMap: {}
}
}, true);
demo.bind({
event: "demo",
listener: {
init: function() {
var rt = this.$root,
std = this.settings;
this.reRouteEvents();
if (std.custom) {
this.convertCustom(std.custom)
} else {
if (std.demo) {
rt.comm.loadScript(std.demo)
}
}
}
}
});
demo.bind({
event: "setDemoData",
listener: {
setDemoData: function(event) {
var rt = this.$root,
st = rt.settings,
data = event.data,
imp, i, leni, dmel = rt.utils.dom.element,
el, sentence, dst = this.settings,
hp = rt.helpers;
rt.helpers.getCustomerId();
dst.data = data;
imp = st.impression = {
params: {}
};
if (data.ref) {
st.ref = imp.params.ref = data.ref
}
if (data.refq) {
st.refq = imp.params.refq = data.refq
}
hp.setDefaultWebsiteDirectives(data.responses.gsd);
if (!data.responses.impression.sentences) {
data.responses.impression.sentences = {}
}
if (data.containers) {
for (i = 0, leni = data.containers.length; i < leni; i++) {
el = dmel.$(data.containers[i]);
if (!el || !el.firstChild || el.firstChild.nodeType != st.nodeTypes.TEXT) {
continue
}
sentence = rt.utils.string.trim(el.firstChild.nodeValue.toLowerCase().replace(/\s+/g, ""));
data.responses.impression.sentences[sentence] = "1";
dst.sentences2ContainersMap[sentence] = data.containers[i]
}
}
hp.normalizeSentenceLists(data.responses.impression);
rt.comm.settings.responses = data.responses;
rt.event.fire("loadPlugins")
}
}
});
var bubble = $root.$create("bubble", {
hookDblClick: function(event) {
this.$root.utils.dom.event.stop(event.domEvent)
},
hookClick: function(event) {
var rt = this.$root,
st = rt.settings,
domEvt = event.domEvent,
sender = domEvt.target || domEvt.srcElement,
ut = rt.utils,
hookId = event.data.hookId,
hook = st.hooksMap[hookId],
bst = this.settings,
ad;
ut.dom.event.stop(domEvt);
if (st.clickStatus == "complete") {
return
}
if (hook.externalTag) {
st.clickStatus = "complete";
return
}
hook.clickType = (sender.className.indexOf(bst.cls + "_simlink") != -1 || ut.dom.element.inHierarchy(sender, hook.node)) ? hook.bubble.status == "open" ? "onLinkAfterWinOpen" : "onLink" : "onWin";
st.clickStatus = "pending";
ut.timer.stop("adView" + hookId);
var reuseWindow = rt.helpers.getHookBehavior(hookId).adsReuseWindow;
var data = rt.helpers.getHookData(hookId);
if (hook.bubble.status != "open" && (bst.dcbbs || (data && data.dcbbs))) {
st.clickStatus = "none";
delete hook.clickType;
return
}
if (rt.what(data) == "object") {
ad = data.ads[hook.currentAdIndex];
if (hook.clickType == "onWin" && ad.template == "html" && ad.content.match(/<object |<embed /i) && ad.content.match(/clicktag/i)) {
st.clickStatus = "complete";
return
}
if ((hook.clickType == "onLink" || hook.clickType == "onLinkAfterWinOpen") && ad.redirectURL == "") {
st.clickStatus = "none";
delete hook.clickType
} else {
if (hook.bubble.status == "open" || hook.clickType == "onWin" || !data.dcbbs) {
if (!reuseWindow) {
st.adWin = window.open("", hook.node.id)
}
rt.event.fire("productClick", {
hookId: hookId
})
}
}
} else {
if (!reuseWindow) {
st.adWin = window.open("", hook.node.id)
}
}
},
getSkinPath: function(skin) {
var rt = this.$root,
sk = this.skins,
rv = skin && sk[skin] && sk[skin].settings.rv ? sk[skin].settings.rv + "/" : "";
return ["http://", rt.settings.hosts.resources, "/static/skins/", skin ? skin + "/intext/" : "", rv].join("")
},
preloadImages: function(path, images) {
var loaderPath = this.getSkinPath(false);
var loaderImages = ["loader.gif", "loader-bg.png"];
for (i = 0, leni = loaderImages.length; i < leni; i++) {
img = new Image();
img.src = loaderPath + loaderImages[i]
}
if (!images) {
return
}
var rt = this.$root,
b = rt.browser,
img, i, leni;
images = rt.utils.string.qw(images);
for (i = 0, leni = images.length; i < leni; i++) {
img = new Image();
img.src = [path, images[i], ".png"].join("")
}
},
adjustBubblePosition: function(hook, dimensions) {
var rt = this.$root,
st = rt.settings,
ut = rt.utils,
dm = ut.dom,
dmel = dm.element,
b = rt.browser,
pos = hook.pos;
var node = hook.node;
var nodeHeight = node.offsetHeight;
hook.isMultiline = (hook.fontSize * 2 < nodeHeight);
var right, left, top, bottom, scrollTop = dm.document.getScrollTop(),
scrollLeft = dm.document.getScrollLeft();
var width = dimensions.width,
height = dimensions.height;
var bbldir = rt.helpers.getHookBehavior(hook.id).bubbleDirection;
if (hook.isMultiline) {
var linesCount = Math.floor(nodeHeight / (parseInt(dmel.getStyle(node, "lineHeight"), 10) || hook.fontSize + 2));
if (linesCount < 2) {
linesCount = 2
}
var lineHeight = Math.floor(nodeHeight / linesCount);
var mouseX = hook.domEvent.pageX || hook.domEvent.clientX + scrollLeft;
var mouseY = hook.domEvent.pageY || hook.domEvent.clientY + scrollTop;
right = mouseX > (pos.left + pos.left + node.offsetWidth) / 2 ? pos.left + node.offsetWidth - 20 : pos.left;
left = right + 20 - width;
top = pos.top - height;
if (mouseY - pos.top > lineHeight) {
top += lineHeight
}
bottom = top + lineHeight + height
} else {
right = pos.left;
left = pos.left - width + ((!b.IE || !node.offsetWidth) ? 20 : node.offsetWidth);
top = pos.top - height;
bottom = pos.top + (node.offsetHeight || 18)
}
var allpos = {
TR: {
rect: [right, top, right + width, top + height],
clear: true,
inBounds: true
},
TL: {
rect: [left, top, left + width, top + height],
clear: true,
inBounds: true
},
BR: {
rect: [right, bottom, right + width, bottom + height],
clear: true,
inBounds: true
},
BL: {
rect: [left, bottom, left + width, bottom + height],
clear: true,
inBounds: true
}
};
if ((right + width > dm.document.getWidth() + scrollLeft) || (bbldir && bbldir.indexOf("L") != -1)) {
allpos.TR.inBounds = allpos.BR.inBounds = false
}
if (left < 0 || (bbldir && bbldir.indexOf("R") != -1)) {
allpos.TL.inBounds = allpos.BL.inBounds = false
}
if ((bottom + height > dm.document.getHeight() + scrollTop) || (bbldir && bbldir.indexOf("T") != -1)) {
allpos.BR.inBounds = allpos.BL.inBounds = false
}
if (top < scrollTop || (bbldir && bbldir.indexOf("B") != -1)) {
allpos.TR.inBounds = allpos.TL.inBounds = false
}
if (st.unhoverableAreas) {
for (var key in allpos) {
if (!allpos[key].inBounds) {
continue
}
for (var i = 0, leni = st.unhoverableAreas.length; i < leni; i++) {
if (ut.doRectsOverlap(allpos[key].rect, st.unhoverableAreas[i])) {
allpos[key].clear = false;
break
}
}
}
}
for (key in allpos) {
if (!allpos[key].inBounds) {
continue
}
if (allpos[key].clear) {
hook.orientationY = key.charAt(0);
hook.orientationX = key.charAt(1);
return {
left: allpos[key].rect[0],
top: allpos[key].rect[1]
}
}
}
for (key in allpos) {
if (allpos[key].inBounds) {
hook.orientationY = key.charAt(0);
hook.orientationX = key.charAt(1);
return {
left: allpos[key].rect[0],
top: allpos[key].rect[1]
}
}
}
hook.orientationY = "T";
hook.orientationX = "R";
if (bbldir) {
if (bbldir.length == 2) {
hook.orientationY = bbldir.charAt(0);
hook.orientationX = bbldir.charAt(1)
} else {
if (bbldir == "T" || bbldir == "B") {
hook.orientationY = bbldir
}
if (bbldir == "R" || bbldir == "L") {
hook.orientationX = bbldir
}
}
}
return {
left: allpos[hook.orientationY + hook.orientationX].rect[0],
top: allpos[hook.orientationY + hook.orientationX].rect[1]
}
},
getPreloaderPosition: function(hook, dimensions) {
var pos = this.adjustBubblePosition(hook, dimensions);
if (hook.orientationY == "T") {
pos.top = pos.top + dimensions.height - 31
}
if (hook.orientationX == "L") {
pos.left = pos.left + dimensions.width - 31
}
return pos
},
renderAdsContent: function(hook, data) {
var rt = this.$root,
adsHTML = "",
ad;
for (var i = 0, leni = data.ads.length; i < leni; i++) {
ad = data.ads[i];
rt.helpers.setActualTemplate(ad);
adsHTML += this.templates[ad.actualTemplate](hook, i)
}
return adsHTML
},
afterBubbleRendered: function(container, data, hook) {
var rt = this.$root,
i, leni, form;
for (i = 0, leni = data.ads.length; i < leni; i++) {
if (data.ads[i].actualTemplate == "iframe") {
form = container.getElementsByTagName("form");
if (form.length && form[0].className.indexOf(this.settings.cls + "_ad_form") != -1) {
form[0].submit()
}
}
}
var anchors = container.getElementsByTagName("a"),
href;
for (i = 0, leni = anchors.length; i < leni; i++) {
if (anchors[i].href) {
href = anchors[i].href;
anchors[i].removeAttribute("href");
rt.event.dom.bind(anchors[i], {
event: "click",
listener: (function() {
return function(domEvt) {
rt.utils.dom.event.stop(domEvt.domEvent);
rt.event.fire("productClick", {
hookId: hook.id,
url: href,
clickType: "onWin"
})
}
})()
})
}
}
var objects = container.getElementsByTagName("object");
for (i = 0; i < objects.length; i++) {
rt.utils.dom.event.disableEventBubbling("click", objects[i])
}
var embeds = container.getElementsByTagName("embed");
for (i = 0; i < embeds.length; i++) {
rt.utils.dom.event.disableEventBubbling("click", embeds[i])
}
}
}, {
settings: {
initialized: false,
activeHook: null,
base: {
status: "closed",
node: null,
pos: null
},
def: {
width: 316,
height: 176
},
cls: "ice_it",
oldIE: (function() {
var b = $root.browser;
return b.IE && b.getVersion(true) < 9
})(),
oldFF: (function() {
var b = $root.browser;
return b.Firefox && b.getVersion(true) < 4
})()
}
}, true);
bubble.bind({
event: "initBubble",
listener: {
initBubble: function(event) {
var rt = this.$root,
hp = rt.helpers,
bst = rt.bubble.settings;
bst.initialized = true;
bst.dcbbs = hp.getVar("deny_click_before_bubble_show") || false;
this.skins[rt.products[event.data].settings.behavior.merged.skin].init()
}
}
});
bubble.bind({
event: "hookMouseover",
listener: {
hookMouseover: function(event) {
var rt = this.$root,
st = rt.settings,
hookId = event.data.hookId,
bh = rt.helpers.getHookBehavior(hookId),
hook = st.hooksMap[hookId],
hrd = bh.hoverRequestDelay;
delete hook.killHoverStart;
if (st.clickStatus != "none") {
return
}
if (hook.bubble.status.indexOf("open") == 0) {
hrd = 0
}
var de = event.data.domEvent || event.domEvent;
hook.domEvent = {
pageX: de.pageX,
pageY: de.pageY,
clientX: de.clientX,
clientY: de.clientY
};
rt.event.fire(hook.type + "HookMouseover", {
hookId: hookId
});
rt.event.fire("hookHoverStart", {
hookId: hookId
}, hrd)
}
}
});
bubble.bind({
event: "hookMouseout",
listener: {
hookMouseout: function(event) {
var rt = this.$root,
st = rt.settings,
hookId = event.data.hookId,
hook = st.hooksMap[hookId];
hook.killHoverStart = true;
rt.event.fire(hook.type + "HookMouseout", {
hookId: hook.id
});
rt.event.fire("hideBubble", {
hookId: hook.id
})
}
}
});
bubble.bind({
event: "hookHoverStart",
listener: {
hookHoverStart: function(event) {
var rt = this.$root,
bst = this.settings,
hookId = event.data.hookId,
hook = rt.settings.hooksMap[hookId],
activeHook;
if (hook.killHoverStart) {
delete hook.killHoverStart;
return
}
hook.hovered = true;
if (bst.activeHook && bst.activeHook != hookId) {
activeHook = bst.activeHook;
bst.activeHook = null;
rt.event.fire("closeBubble", {
hookId: activeHook
})
}
bst.activeHook = hookId;
if (hook.bubble.status.indexOf("open") != -1) {
return
}
hook.bubble.status = "opening";
var bubbleShowDelay = rt.helpers.getHookBehavior(hookId).bubbleShowDelay;
var data = rt.helpers.getHookData(hookId);
if (!data) {
rt.event.fire("getAds", event.data)
}
rt.event.fire("showBubble", event.data, bubbleShowDelay)
}
}
});
bubble.bind({
event: "getadsResponse",
listener: {
setAdData: function(event) {
var rt = this.$root,
st = rt.settings,
data = event.data,
hookId = data.lid,
bst = this.settings,
i, leni, ad, hook = st.hooksMap[hookId];
if (!hook) {
rt.logger.error("Error: Misssing hook.", this.setAdData);
return false
}
if (bst.activeHook == hookId && hook.bubble.status == "open") {
return
}
data.sentence = decodeURIComponent(data.sentence);
ad = data.ads[hook.currentAdIndex];
if (ad.template == "external") {
data = rt.externalTags.setExternalTagData(hook, data)
} else {
if (hook.externalTag) {
delete hook.externalTag
}
if (!data.width || data.width < 200) {
data.width = bst.def.width
}
if (!data.height || data.height < 60) {
data.height = bst.def.height
}
if (bst.dcbbs) {
data.dcbbs = bst.dcbbs
}
if (data.dcbbs && !rt.helpers.getHookBehavior(hookId).adsReuseWindow) {
data.dcbbs = false
}
if (data.dcbbs && st.clickStatus == "pending") {
st.clickStatus = "none";
st.hookClicked = null
}
}
rt.helpers.setHookData(hookId, data);
for (i = 0, leni = data.ads.length; i < leni; i++) {
ad = data.ads[i];
rt.helpers.setAdThumbnail(ad);
if (ad.trackerURL) {
rt.helpers.hitTrackerURL(ad.trackerURL)
}
}
if (bst.activeHook != hookId) {
rt.event.fire("closeBubble", {
hookId: hookId
});
return
}
rt.event.fire("showBubble", {
hookId: hookId
})
}
}
});
bubble.bind({
event: "showBubble",
listener: {
showBubble: function(event) {
var rt = this.$root,
st = rt.settings,
hookId = event.data.hookId,
hook = st.hooksMap[hookId],
dm = rt.utils.dom,
rtb = rt.bubble,
bst = rtb.settings;
if (hook.bubble.status == "open") {
return
}
var data = rt.helpers.getHookData(hookId);
hook.pos = dm.element.offset(hook.node);
var preloader = hook.bubble.preloader;
if (data && data != "pending") {
if (preloader) {
preloader.style.display = "none"
}
var skin = data.ads[hook.currentAdIndex].skin || rt.helpers.getHookBehavior(hookId).skin;
rtb.skins[skin].showBubble(hookId)
} else {
if (data == "pending") {
var pos = rtb.getPreloaderPosition(hook, {
width: bst.def.width,
height: bst.def.height
});
if (!preloader) {
var path = rtb.getSkinPath();
preloader = hook.bubble.preloader = dm.createDOMFragment({
tag: "div",
cls: st.baseClass,
parent: document.body,
style: {
position: "absolute",
display: "none",
width: "30px",
height: "30px",
top: "0px",
left: "0px",
zIndex: st.baseZIndex + 101,
background: ['transparent url("', path, 'loader-bg.png") no-repeat scroll 0 0'].join("")
},
children: {
tag: "img",
cls: st.baseClass,
attributes: {
width: 30,
height: 30,
alt: "",
src: path + "loader.gif"
}
}
})
}
dm.element.setStyle(preloader, {
top: pos.top + "px",
left: pos.left + "px",
display: "block"
})
}
}
}
}
});
bubble.bind({
event: "bubbleShowing",
listener: {
bubbleShowing: function(event) {
var rt = this.$root,
st = rt.settings,
hookId = event.data.hookId,
hook = st.hooksMap[hookId],
bh = rt.helpers.getHookBehavior(hookId),
time = bh.bubbleHideDelay,
data = rt.helpers.getHookData(hookId);
hook.bubble.status = "open";
if (hook.externalTag) {
rt.externalTags.updateViewedTags(hookId)
}
rt.event.fire("sendAdView", {
hookId: hookId,
params: {
prod_t: hook.prod
}
});
if (st.clickStatus == "pending") {
rt.event.fire("productClick", {
hookId: hookId
}, time);
return
}
rt.utils.timer.start("adView" + hookId);
if (!hook.hovered) {
rt.event.fire("hideBubble", {
hookId: hookId
})
}
}
}
});
bubble.bind({
event: "hideBubble",
listener: {
hideBubble: function(event) {
var rt = this.$root,
hookId = event.data.hookId,
hook = rt.settings.hooksMap[hookId],
viewTime = null;
hook.hovered = false;
if (hook.bubble.status == "closed") {
return
}
var data = rt.helpers.getHookData(hookId);
if (hook.externalTag && data) {
viewTime = data.ads[hook.currentAdIndex].vt
}
var delay = parseInt(event.data.xBtn ? 0 : (viewTime || rt.helpers.getHookBehavior(hookId).bubbleHideDelay));
rt.event.fire("closeBubble", event.data, delay)
}
}
});
bubble.bind({
event: "closeBubble",
listener: {
closeBubble: function(event) {
var rt = this.$root,
st = rt.settings,
bst = this.settings,
hookId = event.data.hookId,
hook = st.hooksMap[hookId],
data = rt.helpers.getHookData(hookId);
if (bst.activeHook == hookId) {
bst.activeHook = null
}
if (hook.hovered) {
return
}
if (hook.bubble.node) {
hook.bubble.node.style.display = "none"
}
if (hook.bubble.preloader) {
hook.bubble.preloader.style.display = "none"
}
if (st.clickStatus != "pending") {
if (data && data.cacheOverride) {
rt.helpers.clearHookData(hookId);
if (hook.externalTag) {
delete hook.externalTag
}
}
}
if (st.clickStatus == "none") {
rt.utils.timer.clear("adView" + hookId)
}
hook.bubble.status = "closed";
if (data && data != "pending" && data.ads[0].template == "html") {
rt.event.fire("clearBubbleDOM", {
hookId: hookId
}, 1000)
}
}
}
});
bubble.bind({
event: "clearBubbleDOM",
listener: {
clearBubbleDOM: function(event) {
var rt = this.$root,
st = rt.settings,
hookId = event.data.hookId,
hook = st.hooksMap[hookId],
el;
if (hook.bubble.status == "open") {
return
}
el = rt.utils.dom.filterByClass(this.settings.cls + "_bodyMain", null, hook.bubble.node);
if (el.length) {
el[0].innerHTML = ""
}
}
}
});
bubble.bind({
event: "bubbleMouseover",
listener: {
bubbleMouseover: function(event) {
var rt = this.$root,
hookId = event.data.hookId,
hook = rt.settings.hooksMap[hookId],
data = rt.helpers.getHookData(hook.id);
hook.hovered = true;
rt.event.fire((data.ads[hook.currentAdIndex].skin || rt.helpers.getHookBehavior(hookId).skin) + "BubbleMouseover", event.data)
}
}
});
bubble.bind({
event: "bubbleMouseout",
listener: {
bubbleMouseout: function(event) {
var rt = this.$root,
st = rt.settings,
hookId = event.data.hookId,
hook = st.hooksMap[hookId],
data = rt.helpers.getHookData(hook.id);
hook.hovered = false;
rt.event.fire((data.ads[hook.currentAdIndex].skin || rt.helpers.getHookBehavior(hookId).skin) + "BubbleMouseout", event.data);
if (st.clickStatus == "pending") {
return
}
rt.event.fire("hideBubble", event.data)
}
}
});
bubble.$create("templates", {
text: function(hook, adIndex) {
var rt = this.$root,
pr = this.$parent,
st = rt.settings,
b = rt.browser,
data = rt.helpers.getHookData(hook.id),
ad = data.ads[hook.currentAdIndex],
thumbURL = "",
hasThumb = false,
bst = pr.settings;
var skinPath = pr.getSkinPath(data.skin || rt.helpers.getHookBehavior(hook.id).skin);
if (ad.thumbURL != "no-image") {
thumbURL = ad.thumbURL;
hasThumb = true
}
var html = '<div class="<%= cls %>" style="color:#003366; font-family: Arial,sans-serif; font-size:11pt; font-weight:bold; line-height:11pt; margin-left:15px; margin-top:10px; margin-bottom:10px; margin-right:5px; max-height:22pt; overflow:hidden;"><%= ad.title %></div> <div class="<%= cls %>" style="position:absolute; height:88px; width:<%= data.width %>px;"> <%if (hasThumb){ %> <img class="<%= cls %>" width="110" height="82" style="position:absolute; top:0; left:15px; width:110px; height:82px; background-color:#e8e8e8; box-shadow:2px 2px 5px #888; -moz-box-shadow:2px 2px 5px #888; -webkit-box-shadow:2px 2px 5px #888;" src="<%= thumbURL %>"> <% } %> <div class="<%= cls %>" style="position:absolute; top:0; left:<%= hasThumb ? 140 : 15 %>px; width:168px; height:51px; overflow:hidden; color:#666666; font-family: Arial,sans-serif; font-size:10pt; font-weight:normal; line-height:17px;"><%= ad.text %></div> <div id="<%= intextCls %>_btn_<%= hookId %>" class="<%= cls %> <%= intextCls %>_btn" style="position:absolute; display:block; bottom:0px; right:13px; width:93px; height:24px; font-family:Arial,sans-serif; font-size:9pt; font-weight:bold; cursor:pointer; text-align:center; line-height:24px; color:#ffffff;"><%= rt.helpers.translate("clickHere") %></div> </div> <div class="<%= cls %>" style="position:absolute; bottom:12px; left:15px; width:280px; height:15px; color:#003366; font-family: Arial,sans-serif; font-size:9pt; font-weight:normal; text-decoration:underline; overflow:hidden;"><%= ad.displayedURL %></div>';
return rt.utils.VeST(html, {
rt: rt,
intextCls: bst.cls,
cls: st.baseClass,
btnCls: [st.baseClass, " ", bst.cls, "_bg ", bst.cls, "_btn"].join(""),
hookId: hook.id,
data: data,
ad: ad,
thumbURL: thumbURL,
hasThumb: hasThumb,
display: adIndex != hook.currentAdIndex ? "none" : "block",
skinPath: skinPath
})
},
html: function(hook, adIndex) {
var rt = this.$root,
st = rt.settings;
return rt.utils.VeST('<div class="<%= cls %>" style="height:<%= data.height %>px; position:relative; display:<%= display %>;"><%= content %></div>', {
cls: st.baseClass,
adIndex: adIndex,
data: rt.helpers.getHookData(hook.id),
display: adIndex != hook.currentAdIndex ? "none" : "block",
content: rt.helpers.parseTokens(hook)
})
},
iframe: function(hook, adIndex) {
var rt = this.$root,
st = rt.settings,
bst = this.$parent.settings;
var html = '<div class="<%= cls %>" style="display:<%= display %>;"><div cls="<%= cls %>" style="width:<%= data.width %>px; height:<%= data.height %>px;"> <iframe name="<%= iframeName %>" src="<%= st.blankURL %>" width="<%= data.width %>" height="<%= data.height %>" frameborder="0" scrolling="no"></iframe></div><%= rt.helpers.getEchoForm(content, iframeName, null, formCls) %></div>';
return rt.utils.VeST(html, {
rt: rt,
version: rt.version,
cls: st.baseClass,
adIndex: adIndex,
data: rt.helpers.getHookData(hook.id),
display: adIndex != hook.currentAdIndex ? "none" : "block",
content: rt.helpers.parseTokens(hook),
iframeName: bst.cls + "_ad_frame" + adIndex,
formCls: bst.cls + "_ad_form",
st: st
})
},
external: function(hook, adIndex) {
var rt = this.$root,
st = rt.settings,
data = rt.helpers.getHookData(hook.id);
var html = '<div class="<%= cls %>" style="display:<%= display %>; width:<%= data.width %>px; height:<%= data.height %>px;"> <iframe src="<%= contentUrl %>" width="<%= data.width %>" height="<%= data.height %>" frameborder="0" scrolling="no" allowtransparency="true" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"></iframe></div>';
return rt.utils.VeST(html, {
cls: st.baseClass,
data: data,
display: adIndex != hook.currentAdIndex ? "none" : "block",
contentUrl: rt.helpers.parseTokens(hook, data.ads[adIndex].contentUrl)
})
}
}, null, false);
var skins = bubble.$create("skins", {}, null, false);
skins.$create("brand", {
init: function() {
var rt = this.$root,
dms = rt.utils.dom.style,
bbl = rt.bubble,
bst = bbl.settings,
intextCls = bst.cls,
skinPath = bbl.getSkinPath(this.$id),
images = "";
if (rt.browser.IE || bst.oldFF) {
dms.addRule("." + intextCls + "_btn", ["background:url(", skinPath, "btn.png) no-repeat scroll 0 0 !important;"].join(""));
dms.addRule("." + intextCls + "_bg", ["background:url(", skinPath, "hdr-btns.png) no-repeat scroll 0 0;"].join(""));
images = "btn.png hdr-btns.png loading.gif"
} else {
dms.addRule("." + intextCls + "_btn", ["background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF0AAABICAYAAACUavnrAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4JJREFUeNrsnL9u01AUxs+xbxOS1LQVBQkGJBgQMPUNGCshMiB1zgqoOwMViBfoxMYGqjqwMIBgYqC8AQsStAyVaAmllDZN4j+xL/fGdsgD9J4I8X1SFDvZfv70+dxzj60eP3119vXGx9V6rXLzdP2U0gSdtNh8umEct/ePXn7ebt9nutZ6dvHyhdZsUKcsA3JX8n2mvV/HtLN38ET5Qb1prgJ1+xHIuHS7sXuSZvagqcy5l//IIOMYOudB4ivSpG2seGDuVgZ4kd5a2TOtNSHO3d9MM51DHlYrWZYRjC5gdp3l0K3t7QWA0SWgF06nwumQ80inEvMwXlINn0soG3e6xl1UyO3j8QKnyzrdhvsgRaaLBfsoXuB0UXlAAOiADgE6oEOA/s9B94FBVL6p03mLmBfAQmqBpDcVZ/EKJ701s0CaAxHHseJxW081HilD/c1sw1vu9JMl4/qGbREAz8nzZtKdoF5Z/51kGyqhynxXBYtXrp+7MV2rKrQETl52U7obJtGX7fbPOI7e2UxfNb+3dvcO0YNxCt5uiOq75iBR7FEzihMKowRkBBxvZOde2GNDHmMvAtDNJ6XUloykAVy2aFTlFYDkpP6GPCSSLyV0DzN1MrlScFcMp8tSHzkd0OWYs4XOebxgWSRBvRjBGMaLgc6gLpQubOOFTbyYxRG2MwSMXk54FfGCWBdLlzxefEOcUTYKOt3Gi4/ei6jT82hntALkynRMA0xCgA7o/w90zL3Iylea9JapFxfQCnCr4WPq8cAebqo0Dh909neeK6XmCRvTTqn3++Gu1pWHitL47XHv6B771dvmn4Aw9+IoxvWhTsMXVJ35oGiqMR/MnLl19dL5xelaBe97cWJytm8ZiT993e12euF7uzhaNaBb334c5I/cgbob8Pk98445ipU5afbjhHphDDIC4M3SP597sQ0v7aMR4Bw62bkXKude0HsRlMYIhiTt4luVhTskFzFw+gSsnm9MI9FFrZ47Hb1GWadb8ogXWeqj7TpILl+KWUagkBRKxslA5+Gd1EOjSyDRxzLdQwUzieoFETOBTEf9Ig+dMEAqCr18/AXQ3cc5jznd57wBg4hxuiQa7fj7SmvaYs/OvaB8cQ3dzr2YsnFTZYNopXfwfc1An8OutFtFcdJmXbXve0nfVDlZPu4NlgxyvO/FjTyPdSeoVdbTRG/8EWAAta8y0OqpUAcAAAAASUVORK5CYII=) no-repeat scroll 0 0 !important;"].join(""));
dms.addRule("." + intextCls + "_bg", ["background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAB+hJREFUeNrEV3tMm9cVP7Y/29gY/MBvg3klgFJGAnFeBUpok03NOhJeaVcSdVvGEu2fbdqmNm23bkmqRk1bbVm0PiKtTaVtSkLTh9SQlLY0CWSDpkugy8MmCY+AwRiwzbDBYJudc+FzP0e0+W+70pG/ex733Hvuub9zLPr9/gPAj/n5edDr9TA2NmbG6fJF9i3kuZEHIpEorvvbZ59hv7y9WCyGWCwGJpMJPB5PBrKykWJITp1O652Y8DE9fg0OEscGpIOl999fbjQaUEMEXq8Xbjid7ch/Guk8fPP4DtKBB8rLHXp9Gm5knjYRc7qcnyD/KaR/8YpCx3vWrllzZN26tRIJ7p4fmfYMKCkuLv380qXWf3Z0/AxZR77G6TMPlJftL161SiSMTFamXby6pGRz+8WLFZevXPkRsv4qdFyBix9ZuXKlZGYmzBh+v5+FXqvVsnlhYaE4Eo0cvnTpCydOW+5yWrdhw/oD+fkFEJqeWXJXDodDFolE/vLvq1ev08m55ORkkMvkLxcUFEimF40+bvkYOjo62HdJSQk8vOVh9p2fly/q6+v/QzAYvE+wpsRisbycnZUDZD/q8YA8SQ5qtYYJMdSQtDgvLPyWrH9g4EWplNtEMc2z2qyrZ2dnIRyewcTyQmdnJzz51K9h794nobu7G0ZGRpgsHA6D1WpdgTZFvFeZTFaabrPZF+Qz4Ha74bXXXofhYTc4nTfg6BtHYXJykskikTmyfxDNzFw0EimkU/Mhlkg42LZtKwSD00CbofuibOXlqmQV8Urws3vBsdQhtF+etxzm5ubg2Ftvo6MI7NjRwE7Ly1FX1NMTyOPkSUkKUiAn/DAYjeByuqC19VNYsWIFyOXyuBzvGRQKhSoeZwknj0SicTn9yBVJbJ6UlASRWJRFih9R1MWDiLg0ne5OIDAJKSkpCckQDE1BUVERONY4YCb8VcIEAgFIVipd/BxP0OsP+EEqk7I5hfps81loaHic8ABOHj8J1TXVkJK6sH4Aw45ZPinChy1veueUJzc3Vy10HJ5ZcIYRSdjQzVs3p6q3VlkMBsMUzZ0ul+n8hbaB3JxcGXM8NIQRM4AMo8ThtY16RhAOxOx1zKP89q2b7sYf78qg5Aqr1al/HB4exjBG4xSbj7GwCnkjuAjqvoo2U4K9eJRKxTEvno50bOnpIEaHc3MRmMbNa7Q6JC2TDQ4OEjK+RIgmordKBzt+sukTVC4lyFxqjI+PI6bGOhoe/34lTqd5/sxCZNRo34a5UKjRaJe0p2elUinP1lZXf5eumnfMEvZ085lXh9zuBsw3kVKpBAKgUCjEFjebTccf2bJlN12TcMFFx5Tp+rMftbzpGR19hGwVCiUCUAxfRwgTLRyzZ6Qf/fbmzT8nk7shk8K389H6ukNd3d31Pp+/gJho4EIYbDp34cLle+D0GNL36mtr1l3p6qqZnPxPLpaOWG5O1tXiVcXH29rbbgiVhSf+nw4x/J8Gt+/A8wn1eHEzhEz5FBF6MUhfUCbyNZfGc795NqEecxzHkIowBWkt0jJKIqRrSF20/DfV49qUlNRDaWm6bEoQGqHQNExMjPcj3u7F6d/vcZBdGo1mn1arsyoQvegcWFDI3jk1NfULlDcvVY9/l5WV9ZzRaEpYSaVKAaPRmInF4299fX1UHPYu4ZCO8edly5bv0el0CQJCRLPZnI848eGdOwO/QtYrwjveSk7NZgtrYYgI7sa8Y/E5bSg7O5u6iMeWcLwbkW8PYQCvfzfZbDaR3W4n8KhkJ0bAB6lU9qLVaouvcrG9HaFulBmkYQtTWlbG+LSx8fGJF/x+34nFfoqBT1qafr9eb2ATQkCZVMbsaAwhWimxehFkpqdniHw+30EspevoxEWIu3lSTA6iWawkg3cG4Qc/fAJ27twBHqzFM9Mh4OXYi2WhoYPfJKJVhclk1PPyZKUCmk+fhglEut7bt+H8ufNYSpOZTCaVgj5NT4mXyeHl5KtTU+PVRSvTwqOP1cMs1lRKDCpvKrwnXq7B2orO6K47aS6VSldiQsXlVpsNtm+vgxMnmjDTJdDYuCseGnbnWKX6B/qzOKwiHMd2I4sL1WotuFwuONN8BjZteghSMMF4oCFddBxXxrlEykkT7Cd8fqzTEpZz3rFxwNYIBPpMJraYzX2hUJAVeyHRm9y4cSOsdjiovYnzg6ir0aivfZW1KmdQYN/X18t6tp/sboR6PPmpd06xGs7LQxhF7GbHCDIlb751bKi0tNQkbEspuQgszBZzAsBgm+rbVlVl0Wo1rK3o7x/QII67N6xfr6B5b28vqFPVoEvTMbCg+sxhRKhGx6IxaP9H+217hj2XkiuKz+BgT08PKLDo84QlDFiVEfBoUa1Gc4hquODa/Cg7TLWWdKhVstms7DsJT5iTkwP2TDubX8fmz2K27KeejC8S4nffe78J25hqbEsS/qrwJ73cdYV67Q/qampqFqFQOOQnTjY149+XysLC+/BmE+0pch2fd0I0Gn0b8+GJu6sT99m5c/uwk/glprwMn8hCAR8dBe+odxb/kvzpwcpK+hsz+zVwqfyopeUlfyDQaDaZOYNBzxyOYAMwMT4xjfX8+fKyshf49y+ETEL4p+traw9fvXatyu0ezqONWSzmm5UVFe9/2trqvgdOh5B+ur2u7mD3l19WDQ25cygyGRnp1x+qrPzgQlvbmFD5vwIMAAZsT2nNzBrxAAAAAElFTkSuQmCC) no-repeat scroll 0 0;"].join(""))
}
dms.addRule("." + intextCls + "_btn_over", "background-position:0 -24px !important;");
bbl.preloadImages(skinPath, images)
},
showBubble: function(hookId) {
var rt = this.$root,
st = rt.settings,
hook = st.hooksMap[hookId],
hp = rt.helpers,
ed = rt.event.dom,
ut = rt.utils,
dmel = ut.dom.element,
node, rtb = rt.bubble,
cls = rtb.settings.cls,
b = rt.browser;
var data = hp.getHookData(hookId);
var pos = hook.bubble.pos = rt.bubble.adjustBubblePosition(hook, {
width: data.width + 2,
height: data.height + 41
});
if (hook.externalTag) {
pos.top += hook.orientationY == "T" ? 80 : -80;
var hookWidth = dmel.getActualWidth(hook.node);
pos.left += hook.orientationX == "L" ? hookWidth + 20 : -20
} else {
pos.top += hook.orientationY == "T" ? -5 : 5;
pos.left += hook.orientationX == "L" ? 30 : 0
}
if (hook.bubble.node && hook.bubble.node.parentNode) {
var parent = hook.bubble.node.parentNode;
parent.removeChild(hook.bubble.node)
}
node = hook.bubble.node = ut.dom.createDOMFragment({
tag: "div",
cls: st.baseClass,
parent: document.body,
style: {
display: "none"
},
innerHTML: this.renderBubble(data.width, data.height, hook)
});
var contentNode = dmel.$([cls, "content", hookId].join("_"));
if (contentNode) {
ed.bind(contentNode, {
event: "mouseenter",
data: {
hookId: hookId
},
listener: function(event) {
rt.event.fire("bubbleMouseover", {
hookId: hookId,
sender: event.domEvent.currentTarget || event.domEvent.srcElement
})
}
});
ed.bind(contentNode, {
event: "mouseleave",
data: {
hookId: hookId
},
listener: function(event) {
rt.event.fire("bubbleMouseout", {
hookId: hookId,
sender: event.domEvent.currentTarget || event.domEvent.srcElement
})
}
})
}
var bodyMain = dmel.$([cls, "body", hookId].join("_"));
if (bodyMain) {
ed.bind(bodyMain, {
event: "click",
data: {
hookId: hookId
},
listener: rtb.hookClick
})
}
var logoNode = dmel.$([cls, "logo", hookId].join("_"));
if (logoNode) {
ed.bind(logoNode, {
event: "click",
data: {
hookId: hookId
},
listener: function(event) {
rt.utils.dom.event.stop(event.domEvent);
if (st.homeUrl) {
window.open(st.homeUrl, "_blank")
}
}
})
}
var xBtn = dmel.$([cls, "x", hookId].join("_"));
if (xBtn) {
ed.bind(xBtn, {
event: "click",
data: {
hookId: hookId
},
listener: function() {
rt.event.fire("hideBubble", {
hookId: hookId,
xBtn: true
})
}
});
ed.bind(xBtn, {
event: "mouseover",
data: {
el: xBtn,
pos: "-15px -15px"
},
listener: this.setBackgroundPosition
});
ed.bind(xBtn, {
event: "mouseout",
data: {
el: xBtn,
pos: "-15px 0"
},
listener: this.setBackgroundPosition
})
}
var helpBtn = dmel.$([cls, "help", hookId].join("_"));
if (helpBtn) {
ed.bind(helpBtn, {
event: "click",
listener: function(event) {
rt.utils.dom.event.stop(event.domEvent);
if (st.helpUrl) {
window.open(st.helpUrl, "_blank")
}
}
});
ed.bind(helpBtn, {
event: "mouseover",
data: {
el: helpBtn,
pos: "0 -15px"
},
listener: this.setBackgroundPosition
});
ed.bind(helpBtn, {
event: "mouseout",
data: {
el: helpBtn,
pos: "0 0"
},
listener: this.setBackgroundPosition
})
}
var btnNode = dmel.$([cls, "btn", hookId].join("_"));
if (btnNode) {
ed.bind(btnNode, {
event: "mouseover",
listener: function(event) {
event.element.className = [st.baseClass, " ", cls, "_btn ", cls, "_btn_over"].join("")
}
});
ed.bind(btnNode, {
event: "mouseout",
listener: function(event) {
event.element.className = [st.baseClass, " ", cls, "_btn "].join("")
}
})
}
rt.bubble.afterBubbleRendered(bodyMain, data, hook);
hook.bubble.node.style.display = "block";
rt.event.fire("bubbleShowing", {
hookId: hookId
})
},
renderBubble: function(width, height, hook) {
var rt = this.$root,
hookId = hook.id,
st = rt.settings,
bh = rt.helpers.getHookBehavior(hookId),
data = rt.helpers.getHookData(hookId),
bst = rt.bubble.settings,
skst = this.settings;
var logo = {
url: bh.bubbleLogoUrl || false,
width: Math.min(bh.bubbleLogoWidth || 53, 120),
height: Math.min(bh.bubbleLogoHeight || 12, 25)
};
var html = '<div id="<%= intextCls %>_<%= hookId %>" class="<%= cls %>" style="position:absolute; top:<%= hook.bubble.pos.top %>px; left:<%= hook.bubble.pos.left %>px; width:<%= width+2 %>px; height:<%= height+41 %>px; z-index:<%= zIndex+3 %>;"> <%-- Box --%> <div id="<%= intextCls %>_content_<%= hookId %>" class="<%= cls %>" style="position:absolute; top:<%= oY == \'T\' ? 0 : 8 %>px; left:0; width:<%= width+2 %>px; height:<%= height+33 %>px; box-shadow:0 0 8px 0 rgba(0, 0, 0, 0.25); -moz-box-shadow:0 0 8px 0 rgba(0, 0, 0, 0.25); -webkit-box-shadow:0 0 8px 0 rgba(0, 0, 0, 0.25);"> <%-- Header --%> <div class="<%= cls %>" style="position:absolute; width:<%= width %>px; height:33px; left:0; <%= oY == \'T\' ? \'bottom\' : \'top\' %>:0; z-index:1; background-color:#f1f1f2; border-<%= oY == \'T\' ? \'bottom\' : \'top\' %>:2px solid <%= themeColor %>; border-left:1px solid #a7a9ab; border-right:1px solid #a7a9ab;"> <% if (bh.favicon){ %><div class="<%= cls %>" style="position:absolute; width:16px; height:16px; left:14px; <%= oY == \'T\' ? \'bottom\' : \'top\' %>:8px; background:url(<%= bh.favicon %>) no-repeat scroll 0 0 transparent;"></div><% } %> <% if (bh.bubbleLogoUrl){ %> <div id="<%= intextCls %>_logo_<%= hookId %>" class="<%= cls %>" style="position:absolute; width:<%= bh.bubbleLogoWidth %>px; height:<%= bh.bubbleLogoHeight %>px; right:56px; top:<%= parseInt((33 - bh.bubbleLogoHeight) / 2) %>px; cursor:pointer; font-size:1px; background-image:url(<%= bh.bubbleLogoUrl %>)"></div> <% } else { %> <div id="<%= intextCls %>_logo_<%= hookId %>" class="<%= cls %>" style="position:absolute; width:53px; height:12px; right:56px; <%= oY == \'T\' ? \'bottom\' : \'top\' %>:9px; cursor:pointer; font-size:1px; <% if (b.IE || bst.oldFF){ %>background:url(<%= skinPath %>logo.png) no-repeat scroll 0 0 transparent;<% } %>"> <% if (!b.IE && !bst.oldFF){ %> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="53px" height="12px" viewBox="0 0 636 144" enable-background="new 0 0 636 144" xml:space="preserve"> <g> <!-- dot (first) --> <path id="<%= intextCls %>_logo_dot_<%= hookId %>_1" fill="<%= bh.theme == \'def\' ? \'#208CE5\' : themeColor %>" d="M16.918,24.865c5.848,0,10.57-4.735,10.57-10.583s-4.722-10.57-10.57-10.57 S6.334,8.434,6.334,14.282S11.07,24.865,16.918,24.865"/> <!-- in --> <path fill="#003366" d="M88.085,43.784H77.024c-17.149,0-31.181,14.031-31.181,31.182v34.796 c0,0.218,0.016,0.415,0.027,0.618v5.185c0,5.71-4.672,10.382-10.382,10.382h-0.467c-5.71,0-10.382-4.672-10.382-10.382V92.608 h0.015V45.889v-0.025c0-1.124-0.885-2.033-2.01-2.08h-11.49c-1.09,0.047-1.949,0.907-1.986,1.996v46.828h0.04 c-0.015,0.355-0.04,0.707-0.04,1.066v22.246c0,14.031,11.479,25.512,25.511,25.512h1.151c14.031,0,25.511-11.48,25.511-25.512 v-5.466v-4.62v-28.89c0.082-9.872,8.159-17.948,18.031-17.948h6.366c9.871,0,17.948,8.076,18.042,17.948v28.89v4.62v28.873 c0.013,0.023,0.013,0.034,0.013,0.048c0,1.111,0.883,2.008,1.983,2.057h11.505c1.077-0.036,1.936-0.887,1.985-1.973v-27.966v-5.659 V74.966C119.267,57.815,105.234,43.784,88.085,43.784"/> <!-- f (part) --> <path fill="#003366" d="M155.069,56.972v82.643c-0.072,0.992-0.886,1.78-1.903,1.818h-11.014 c-1.062-0.038-1.912-0.897-1.912-1.962c0-0.024,0-0.048-0.023-0.073V34.456c0.716-17.064,14.923-30.744,32.179-30.744h8.536 c0.025,0,0.038,0.011,0.06,0.011c1.053,0,1.915,0.849,1.974,1.901v11.037c-0.035,1.016-0.85,1.844-1.878,1.889h-8.692 c-9.509,0-17.327,7.75-17.327,17.268v6.301V56.972z"/> <!-- f (part) --> <path fill="#003366" d="M151.99,59.104h28.873c0.023-0.012,0.034-0.012,0.047-0.012 c1.111,0,2.008-0.884,2.057-1.984V45.604c-0.036-1.078-0.887-1.938-1.973-1.986h-27.965"/> <!-- o --> <path fill="#003366" d="M276.24,107.925h0.158V76.608c-0.37-18.164-15.248-32.825-33.494-32.825 h-16.756v0.022c-17.875,0.431-32.322,14.924-32.679,32.803h-0.026v31.316c0,18.213,14.601,33.064,32.705,33.496v0.012h16.589h0.021 h0.146C261.304,141.349,276.24,126.354,276.24,107.925 M208.93,107.925L208.93,107.925V77.289c0-9.914,8.096-18.02,18.021-18.02 h15.953c9.946,0,18.02,8.106,18.02,18.02v30.636h-0.167c0,9.949-8.074,18.021-17.999,18.021h-15.807 C217.026,125.946,208.93,117.874,208.93,107.925"/> <!-- l --> <path fill="#003366" d="M312.844,139.376L312.844,139.376c0,1.064-0.798,1.938-1.829,2.045h-11.816 c-1.027-0.107-1.837-0.98-1.837-2.045h-0.013V5.769h0.013c0-1.135,0.908-2.033,2.031-2.057h11.432 c1.124,0.024,2.019,0.922,2.019,2.057V139.376z"/> <!-- dot (second) --> <path id="<%= intextCls %>_logo_dot_<%= hookId %>_2" fill="<%= bh.theme == \'def\' ? \'#208CE5\' : themeColor %>" d="M341.662,24.865c5.848,0,10.57-4.735,10.57-10.583s-4.723-10.57-10.57-10.57 s-10.584,4.722-10.584,10.57S335.814,24.865,341.662,24.865"/> <!-- in (second) --> <path fill="#003366" d="M412.829,43.784h-11.061c-17.149,0-31.181,14.031-31.181,31.182v34.796 c0,0.218,0.016,0.415,0.026,0.618v5.185c0,5.71-4.672,10.382-10.382,10.382h-0.468c-5.71,0-10.382-4.672-10.382-10.382V92.608 h0.016V45.723v-0.025c0-1.123-0.885-2.033-2.01-2.08h-11.49c-1.091,0.047-1.949,0.908-1.986,1.996v46.994h0.04 c-0.015,0.355-0.04,0.707-0.04,1.066v22.246c0,14.031,11.479,25.512,25.512,25.512h1.15c14.031,0,25.512-11.48,25.512-25.512 v-5.466v-4.62v-28.89c0.082-9.872,8.158-17.948,18.029-17.948h6.367c9.871,0,17.947,8.076,18.041,17.948v28.89v4.62v28.873 c0.014,0.023,0.014,0.034,0.014,0.048c0,1.111,0.883,2.008,1.982,2.057h11.506c1.076-0.036,1.936-0.887,1.984-1.973v-27.966v-5.659 V74.966C444.01,57.815,429.979,43.784,412.829,43.784"/> <!-- k --> <path fill="#003366" d="M480.277,139.376L480.277,139.376V91.735h0.146h9.255l40.656,48.766 c0.599,0.549,1.15,0.906,1.841,0.932h16.073c0.882-0.025,2.869-0.322,1.794-2.056l-0.013-0.024l-47.58-56.777l44.599-36.815 c0.015-0.049,0.015-0.049,0.036-0.073c1.066-1.734-0.886-2.032-1.78-2.069H527.08c-0.621,0.024-1.15,0.324-1.666,0.791 l-36.812,31.075h-8.325V5.769c0-1.135-0.896-2.033-2.02-2.057h-11.422c-1.124,0.024-2.033,0.922-2.033,2.057v133.607 c0,1.064,0.803,1.938,1.844,2.045h11.802C479.476,141.313,480.277,140.44,480.277,139.376"/> <!-- s --> <path fill="#003366" d="M603.208,84.782H577.99c-6.91-0.114-12.508-5.785-12.508-12.783 c0-6.996,5.598-12.895,12.508-12.895h39.271c1.146,0,2.08-0.959,2.08-2.111v0.191V45.752v-0.037c0-1.164-0.935-2.097-2.08-2.097 H577.99c-15.451,0-28.008,12.73-28.008,28.381c0,15.651,12.557,28.381,28.008,28.27h24.252c6.911,0.111,12.508,5.812,12.508,12.795 c0,6.996-5.597,12.896-12.508,12.896H591.56l0.001-0.014h-28.874c-0.022,0.014-0.034,0.014-0.047,0.014 c-1.11,0-2.007,0.896-2.056,2.01v11.449c0.035,1.092,0.886,1.963,1.973,2.014h0.225h27.74h12.224 c15.209-0.279,27.491-12.9,27.491-28.369C630.236,97.737,618.191,85.202,603.208,84.782"/> </g> </svg> <% } %> </div> <% } %> <div class="<%= cls %> <%= intextCls %>_bg" id="<%= intextCls %>_help_<%= hookId %>" style="position:absolute; width:15px; height:15px; right:29px; <%= oY == \'T\' ? \'bottom\' : \'top\' %>:7px; display:block; background-position:0 0; cursor:pointer; font-size:1px;"></div> <div class="<%= cls %> <%= intextCls %>_bg" id="<%= intextCls %>_x_<%= hookId %>" style="position:absolute; width:15px; height:15px; right:13px; <%= oY == \'T\' ? \'bottom\' : \'top\' %>:7px; background-position:-15px 0; cursor:pointer; font-size:1px;"></div> </div> <%-- Body --%> <div id="<%= intextCls %>_body_<%= hookId %>" class="<%= cls %> <%= intextCls %>_bodyMain" style="position:absolute; <%= oY == \'T\' ? \'top\' : \'bottom\' %>:0px; left:0; width:<%= width %>px; height:<%= height %>px; z-index:2; background-color:#ffffff; cursor: pointer; border-<%= oY == \'T\' ? \'top\' : \'bottom\' %>:1px solid #a7a9ab; border-left:1px solid #a7a9ab; border-right:1px solid #a7a9ab;"> <%= rt.bubble.renderAdsContent(hook, data) %> </div> </div> <% if (!hook.externalTag){ %> <%-- Tail --%> <div class="<%= cls %>" style="position:absolute; <%= oY == \'T\' ? \'bottom\' : \'top\' %>:0; <%= oX == \'L\' ? \'right\' : \'left\' %>:15px; width:15px; height:8px; font-size:1px; <% if (b.IE || bst.oldFF){ %>background:url(<%= skinPath %>tail.png) no-repeat scroll <%= tailBgLeft %>px <%= tailBgTop %>px transparent;<% } %>"> <% if (!b.IE && !bst.oldFF){ %> <svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="15px" height="8px" viewBox="0 0 30 16" preserveAspectRatio="xMidYMid meet" style="position:absolute; font-size:1px;"> <g transform="translate(0,16) scale(0.1,-0.1)" fill="<%= themeColor %>" stroke="none"> <% if (oY == \'T\'){ %> <path d="M37 138 c11 -13 30 -42 42 -65 22 -44 54 -73 81 -73 20 0 52 34 75 80 10 19 27 45 38 57 l20 23 -138 0 -138 0 20 -22z"/> <% } else { %> <path d="M109 143 c-9 -10 -31 -43 -49 -73 -18 -30 -38 -58 -44 -62 -6 -4 51 -8 126 -8 l137 0 -22 36 c-73 118 -114 147 -148 107z"/> <% } %> </g> </svg> <% } %> </div> <% } %></div>';
return rt.utils.VeST(html, {
rt: rt,
st: st,
bh: bh,
b: rt.browser,
hookId: hookId,
hook: hook,
data: data,
intextCls: bst.cls,
cls: st.baseClass,
bst: bst,
width: width,
height: height,
oX: hook.orientationX,
oY: hook.orientationY,
zIndex: st.baseZIndex + 100,
logo: logo,
themeColor: rt.products[hook.type].settings.themes.color[bh.theme],
skinPath: rt.bubble.getSkinPath(this.$id),
tailBgLeft: skst.tailMap[bh.theme],
tailBgTop: hook.orientationY == "T" ? -8 : 0
}, hookId + "brand", true)
},
setBackgroundPosition: function(event) {
event.data.el.style.backgroundPosition = event.data.pos
}
}, {
settings: {
rv: 1,
tailMap: {
def: 0,
lightBlue: -15,
green: -30,
orange: -45,
red: -60,
pink: -75,
purple: -90
}
}
}, true);
skins.brand.bind({
event: "brandBubbleMouseover",
listener: {
bubleMouseover: function(event) {
var boxShadow = this.$root.utils.dom.style.supports("boxShadow");
if (boxShadow) {
event.data.sender.style[boxShadow] = "0 0 8px 0 rgba(0, 0, 0, 0.5)"
}
}
}
});
skins.brand.bind({
event: "brandBubbleMouseout",
listener: {
bubleMouseout: function(event) {
var boxShadow = this.$root.utils.dom.style.supports("boxShadow");
if (boxShadow) {
event.data.sender.style[boxShadow] = "0 0 8px 0 rgba(0, 0, 0, 0.25)"
}
}
}
});
skins.$create("less", {
init: function() {
var rtb = this.$root.bubble,
skinPath = rtb.getSkinPath(this.$id);
rtb.preloadImages(skinPath, "x")
},
showBubble: function(hookId) {
var rt = this.$root,
ut = rt.utils,
dmel = ut.dom.element,
st = rt.settings,
hook = st.hooksMap[hookId],
data = rt.helpers.getHookData(hookId),
cls = rt.bubble.settings.cls,
ed = rt.event.dom;
var pos = hook.bubble.pos = rt.bubble.adjustBubblePosition(hook, {
width: data.width + 11,
height: data.height + 22
});
if (hook.externalTag) {
pos.top += hook.orientationY == "T" ? 60 : -60;
var hookWidth = dmel.getActualWidth(hook.node);
pos.left += hook.orientationX == "L" ? hookWidth + 20 : -20
}
if (hook.bubble.node && hook.bubble.node.parentNode) {
var parent = hook.bubble.node.parentNode;
parent.removeChild(hook.bubble.node)
}
hook.bubble.node = ut.dom.createDOMFragment({
tag: "div",
cls: st.baseClass,
parent: document.body,
style: {
display: "none"
},
innerHTML: this.renderBubble(data.width, data.height, hook)
});
var bubbleNode = ut.dom.element.$([cls, "content", hookId].join("_"));
if (bubbleNode) {
ed.bind(bubbleNode, {
event: "mouseenter",
data: {
hookId: hookId
},
listener: function(event) {
rt.event.fire("bubbleMouseover", {
hookId: hookId,
sender: event.domEvent.currentTarget || event.domEvent.srcElement
})
}
});
ed.bind(bubbleNode, {
event: "mouseleave",
data: {
hookId: hookId
},
listener: function(event) {
rt.event.fire("bubbleMouseout", {
hookId: hookId,
sender: event.domEvent.currentTarget || event.domEvent.srcElement
})
}
})
}
var bodyMain = ut.dom.element.$([cls, "body", hookId].join("_"));
if (bodyMain) {
ed.bind(bodyMain, {
event: "click",
data: {
hookId: hookId
},
listener: rt.bubble.hookClick
})
}
var xNode = ut.dom.element.$([cls, "x", hookId].join("_"));
if (xNode) {
ed.bind(xNode, {
event: "click",
data: {
hookId: hookId
},
listener: function() {
rt.event.fire("hideBubble", {
hookId: hookId,
xBtn: true
})
}
})
}
rt.bubble.afterBubbleRendered(bodyMain, data, hook);
hook.bubble.node.style.display = "block";
rt.event.fire("bubbleShowing", {
hookId: hookId
})
},
renderBubble: function(width, height, hook) {
var rt = this.$root,
st = rt.settings,
bst = rt.bubble.settings,
cls = st.baseClass,
hookId = hook.id,
b = rt.browser,
skinPath = rt.bubble.getSkinPath(this.$id),
data = rt.helpers.getHookData(hookId);
var html = '<div id="<%= intextCls %>_<%= hookId %>" class="<%= cls %>" style="<%= abs %> width:<%= width+11 %>px; height:<%= height+22 %>px; top:<%= hook.bubble.pos.top %>px; left:<%= hook.bubble.pos.left %>px; z-index:<%= zIndex+3 %>;"> <% if (!hook.externalTag){ %> <div class="<%= cls %> <%= intextCls %>_head" style="width:100%; height:22px; <%= abs %> left:0; z-index:<%= zIndex+4 %>; <%= (oY == \'T\') ? \'bottom:0;\' : \'top:0;\' %>" > <div id="<%= intextCls %>_x_<%= hookId %>" class="<%= cls %> <%= intextCls %>_x" style="<%= abs %> width:22px; height:22px; background:transparent url(<%= skinPath %>x.png) no-repeat scroll 0 0; cursor:pointer; top:<%= (oY == \'T\') ? \'2px\' : 0 %>; <%= (oX == \'L\') ? \'right:0\' : \'left:0\' %>;"></div> </div> <% } %> <div id="<%= intextCls %>_content_<%= hookId %>" class="<%= cls %> <%= intextCls %>_body" style="<%= abs%> width:<%= width %>px; height:<%= height %>px; zindex:<%= zIndex+3 %>; top:<%= (oY == \'T\') ? 0 : \'22px\' %>; <%= (oX == \'L\') ? \'left:0\' : \'left:11px;\' %>; "> <div id="<%= intextCls %>_body_<%= hookId %>" class="<%= cls %> <%= intextCls %>_bodyMain" style="<%= abs %> top:0; left:0; width:<%= width %>px; height:<%= height %>px; cursor:pointer; color:#000000;"> <%= rt.bubble.renderAdsContent(hook, data) %> </div> </div> </div>';
return rt.utils.VeST(html, {
rt: rt,
hookId: hookId,
hook: hook,
data: data,
intextCls: bst.cls,
cls: st.baseClass,
width: width,
height: height,
oX: hook.orientationX,
oY: hook.orientationY,
abs: "position:absolute;",
zIndex: st.baseZIndex + 100,
skinPath: skinPath
}, hookId + "less", true)
}
}, {
settings: {}
}, true);
event.fire("main")
} catch (ex) {
if (typeof $root == "object" && $root.logger && $root.logger.error) {
$root.logger.error("CatchAll. Exception: " + ex.message, window)
}
}
})() |
#3 JavaScript::Eval (size: 107415, repeated: 1) (function(a, b) {
function cy(a) {
return f.isWindow(a) ? a : a.nodeType === 9 ? a.defaultView || a.parentWindow : !1
}
function cv(a) {
if (!cj[a]) {
var b = f("<" + a + ">").appendTo("body"),
d = b.css("display");
b.remove();
if (d === "none" || d === "") {
ck || (ck = c.createElement("iframe"), ck.frameBorder = ck.width = ck.height = 0), c.body.appendChild(ck);
if (!cl || !ck.createElement) cl = (ck.contentWindow || ck.contentDocument).document, cl.write("<!doctype><html><body></body></html>");
b = cl.createElement(a), cl.body.appendChild(b), d = f.css(b, "display"), c.body.removeChild(ck)
}
cj[a] = d
}
return cj[a]
}
function cu(a, b) {
var c = {};
f.each(cp.concat.apply([], cp.slice(0, b)), function() {
c[this] = a
});
return c
}
function ct() {
cq = b
}
function cs() {
setTimeout(ct, 0);
return cq = f.now()
}
function ci() {
try {
return new a.ActiveXObject("Microsoft.XMLHTTP")
} catch (b) {}
}
function ch() {
try {
return new a.XMLHttpRequest
} catch (b) {}
}
function cb(a, c) {
a.dataFilter && (c = a.dataFilter(c, a.dataType));
var d = a.dataTypes,
e = {},
g, h, i = d.length,
j, k = d[0],
l, m, n, o, p;
for (g = 1; g < i; g++) {
if (g === 1) for (h in a.converters) typeof h == "string" && (e[h.toLowerCase()] = a.converters[h]);
l = k, k = d[g];
if (k === "*") k = l;
else if (l !== "*" && l !== k) {
m = l + " " + k, n = e[m] || e["* " + k];
if (!n) {
p = b;
for (o in e) {
j = o.split(" ");
if (j[0] === l || j[0] === "*") {
p = e[j[1] + " " + k];
if (p) {
o = e[o], o === !0 ? n = p : p === !0 && (n = o);
break
}
}
}
}!n && !p && f.error("No conversion from " + m.replace(" ", " to ")), n !== !0 && (c = n ? n(c) : p(o(c)))
}
}
return c
}
function ca(a, c, d) {
var e = a.contents,
f = a.dataTypes,
g = a.responseFields,
h, i, j, k;
for (i in g) i in d && (c[g[i]] = d[i]);
while (f[0] === "*") f.shift(), h === b && (h = a.mimeType || c.getResponseHeader("content-type"));
if (h) for (i in e) if (e[i] && e[i].test(h)) {
f.unshift(i);
break
}
if (f[0] in d) j = f[0];
else {
for (i in d) {
if (!f[0] || a.converters[i + " " + f[0]]) {
j = i;
break
}
k || (k = i)
}
j = j || k
}
if (j) {
j !== f[0] && f.unshift(j);
return d[j]
}
}
function b_(a, b, c, d) {
if (f.isArray(b)) f.each(b, function(b, e) {
c || bF.test(a) ? d(a, e) : b_(a + "[" + (typeof e == "object" || f.isArray(e) ? b : "") + "]", e, c, d)
});
else if (!c && b != null && typeof b == "object") for (var e in b) b_(a + "[" + e + "]", b[e], c, d);
else d(a, b)
}
function b$(a, c, d, e, f, g) {
f = f || c.dataTypes[0], g = g || {}, g[f] = !0;
var h = a[f],
i = 0,
j = h ? h.length : 0,
k = a === bU,
l;
for (; i < j && (k || !l); i++) l = h[i](c, d, e), typeof l == "string" && (!k || g[l] ? l = b : (c.dataTypes.unshift(l), l = b$(a, c, d, e, l, g)));
(k || !l) && !g["*"] && (l = b$(a, c, d, e, "*", g));
return l
}
function bZ(a) {
return function(b, c) {
typeof b != "string" && (c = b, b = "*");
if (f.isFunction(c)) {
var d = b.toLowerCase().split(bQ),
e = 0,
g = d.length,
h, i, j;
for (; e < g; e++) h = d[e], j = /^\+/.test(h), j && (h = h.substr(1) || "*"), i = a[h] = a[h] || [], i[j ? "unshift" : "push"](c)
}
}
}
function bD(a, b, c) {
var d = b === "width" ? bx : by,
e = b === "width" ? a.offsetWidth : a.offsetHeight;
if (c === "border") return e;
f.each(d, function() {
c || (e -= parseFloat(f.css(a, "padding" + this)) || 0), c === "margin" ? e += parseFloat(f.css(a, "margin" + this)) || 0 : e -= parseFloat(f.css(a, "border" + this + "Width")) || 0
});
return e
}
function bn(a, b) {
b.src ? f.ajax({
url: b.src,
async: !1,
dataType: "script"
}) : f.globalEval((b.text || b.textContent || b.innerHTML || "").replace(bf, "/*$0*/")), b.parentNode && b.parentNode.removeChild(b)
}
function bm(a) {
f.nodeName(a, "input") ? bl(a) : a.getElementsByTagName && f.grep(a.getElementsByTagName("input"), bl)
}
function bl(a) {
if (a.type === "checkbox" || a.type === "radio") a.defaultChecked = a.checked
}
function bk(a) {
return "getElementsByTagName" in a ? a.getElementsByTagName("*") : "querySelectorAll" in a ? a.querySelectorAll("*") : []
}
function bj(a, b) {
var c;
if (b.nodeType === 1) {
b.clearAttributes && b.clearAttributes(), b.mergeAttributes && b.mergeAttributes(a), c = b.nodeName.toLowerCase();
if (c === "object") b.outerHTML = a.outerHTML;
else if (c !== "input" || a.type !== "checkbox" && a.type !== "radio") {
if (c === "option") b.selected = a.defaultSelected;
else if (c === "input" || c === "textarea") b.defaultValue = a.defaultValue
} else a.checked && (b.defaultChecked = b.checked = a.checked), b.value !== a.value && (b.value = a.value);
b.removeAttribute(f.expando)
}
}
function bi(a, b) {
if (b.nodeType === 1 && !! f.hasData(a)) {
var c = f.expando,
d = f.data(a),
e = f.data(b, d);
if (d = d[c]) {
var g = d.events;
e = e[c] = f.extend({}, d);
if (g) {
delete e.handle, e.events = {};
for (var h in g) for (var i = 0, j = g[h].length; i < j; i++) f.event.add(b, h + (g[h][i].namespace ? "." : "") + g[h][i].namespace, g[h][i], g[h][i].data)
}
}
}
}
function bh(a, b) {
return f.nodeName(a, "table") ? a.getElementsByTagName("tbody")[0] || a.appendChild(a.ownerDocument.createElement("tbody")) : a
}
function X(a, b, c) {
b = b || 0;
if (f.isFunction(b)) return f.grep(a, function(a, d) {
var e = !! b.call(a, d, a);
return e === c
});
if (b.nodeType) return f.grep(a, function(a, d) {
return a === b === c
});
if (typeof b == "string") {
var d = f.grep(a, function(a) {
return a.nodeType === 1
});
if (S.test(b)) return f.filter(b, d, !c);
b = f.filter(b, d)
}
return f.grep(a, function(a, d) {
return f.inArray(a, b) >= 0 === c
})
}
function W(a) {
return !a || !a.parentNode || a.parentNode.nodeType === 11
}
function O(a, b) {
return (a && a !== "*" ? a + "." : "") + b.replace(A, "`").replace(B, "&")
}
function N(a) {
var b, c, d, e, g, h, i, j, k, l, m, n, o, p = [],
q = [],
r = f._data(this, "events");
if (!(a.liveFired === this || !r || !r.live || a.target.disabled || a.button && a.type === "click")) {
a.namespace && (n = new RegExp("(^|\\.)" + a.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)")), a.liveFired = this;
var s = r.live.slice(0);
for (i = 0; i < s.length; i++) g = s[i], g.origType.replace(y, "") === a.type ? q.push(g.selector) : s.splice(i--, 1);
e = f(a.target).closest(q, a.currentTarget);
for (j = 0, k = e.length; j < k; j++) {
m = e[j];
for (i = 0; i < s.length; i++) {
g = s[i];
if (m.selector === g.selector && (!n || n.test(g.namespace)) && !m.elem.disabled) {
h = m.elem, d = null;
if (g.preType === "mouseenter" || g.preType === "mouseleave") a.type = g.preType, d = f(a.relatedTarget).closest(g.selector)[0], d && f.contains(h, d) && (d = h);
(!d || d !== h) && p.push({
elem: h,
handleObj: g,
level: m.level
})
}
}
}
for (j = 0, k = p.length; j < k; j++) {
e = p[j];
if (c && e.level > c) break;
a.currentTarget = e.elem, a.data = e.handleObj.data, a.handleObj = e.handleObj, o = e.handleObj.origHandler.apply(e.elem, arguments);
if (o === !1 || a.isPropagationStopped()) {
c = e.level, o === !1 && (b = !1);
if (a.isImmediatePropagationStopped()) break
}
}
return b
}
}
function L(a, c, d) {
var e = f.extend({}, d[0]);
e.type = a, e.originalEvent = {}, e.liveFired = b, f.event.handle.call(c, e), e.isDefaultPrevented() && d[0].preventDefault()
}
function F() {
return !0
}
function E() {
return !1
}
function m(a, c, d) {
var e = c + "defer",
g = c + "queue",
h = c + "mark",
i = f.data(a, e, b, !0);
i && (d === "queue" || !f.data(a, g, b, !0)) && (d === "mark" || !f.data(a, h, b, !0)) && setTimeout(function() {
!f.data(a, g, b, !0) && !f.data(a, h, b, !0) && (f.removeData(a, e, !0), i.resolve())
}, 0)
}
function l(a) {
for (var b in a) if (b !== "toJSON") return !1;
return !0
}
function k(a, c, d) {
if (d === b && a.nodeType === 1) {
var e = "data-" + c.replace(j, "$1-$2").toLowerCase();
d = a.getAttribute(e);
if (typeof d == "string") {
try {
d = d === "true" ? !0 : d === "false" ? !1 : d === "null" ? null : f.isNaN(d) ? i.test(d) ? f.parseJSON(d) : d : parseFloat(d)
} catch (g) {}
f.data(a, c, d)
} else d = b
}
return d
}
var c = a.document,
d = a.navigator,
e = a.location,
f = function() {
function H() {
if (!e.isReady) {
try {
c.documentElement.doScroll("left")
} catch (a) {
setTimeout(H, 1);
return
}
e.ready()
}
}
var e = function(a, b) {
return new e.fn.init(a, b, h)
},
f = a.jQuery,
g = a.$,
h, i = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
j = /\S/,
k = /^\s+/,
l = /\s+$/,
m = /\d/,
n = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
o = /^[\],:{}\s]*$/,
p = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
q = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
r = /(?:^|:|,)(?:\s*\[)+/g,
s = /(webkit)[ \/]([\w.]+)/,
t = /(opera)(?:.*version)?[ \/]([\w.]+)/,
u = /(msie) ([\w.]+)/,
v = /(mozilla)(?:.*? rv:([\w.]+))?/,
w = d.userAgent,
x, y, z, A = Object.prototype.toString,
B = Object.prototype.hasOwnProperty,
C = Array.prototype.push,
D = Array.prototype.slice,
E = String.prototype.trim,
F = Array.prototype.indexOf,
G = {};
e.fn = e.prototype = {
constructor: e,
init: function(a, d, f) {
var g, h, j, k;
if (!a) return this;
if (a.nodeType) {
this.context = this[0] = a, this.length = 1;
return this
}
if (a === "body" && !d && c.body) {
this.context = c, this[0] = c.body, this.selector = a, this.length = 1;
return this
}
if (typeof a == "string") {
a.charAt(0) !== "<" || a.charAt(a.length - 1) !== ">" || a.length < 3 ? g = i.exec(a) : g = [null, a, null];
if (g && (g[1] || !d)) {
if (g[1]) {
d = d instanceof e ? d[0] : d, k = d ? d.ownerDocument || d : c, j = n.exec(a), j ? e.isPlainObject(d) ? (a = [c.createElement(j[1])], e.fn.attr.call(a, d, !0)) : a = [k.createElement(j[1])] : (j = e.buildFragment([g[1]], [k]), a = (j.cacheable ? e.clone(j.fragment) : j.fragment).childNodes);
return e.merge(this, a)
}
h = c.getElementById(g[2]);
if (h && h.parentNode) {
if (h.id !== g[2]) return f.find(a);
this.length = 1, this[0] = h
}
this.context = c, this.selector = a;
return this
}
return !d || d.jquery ? (d || f).find(a) : this.constructor(d).find(a)
}
if (e.isFunction(a)) return f.ready(a);
a.selector !== b && (this.selector = a.selector, this.context = a.context);
return e.makeArray(a, this)
},
selector: "",
jquery: "1.6.1",
length: 0,
size: function() {
return this.length
},
toArray: function() {
return D.call(this, 0)
},
get: function(a) {
return a == null ? this.toArray() : a < 0 ? this[this.length + a] : this[a]
},
pushStack: function(a, b, c) {
var d = this.constructor();
e.isArray(a) ? C.apply(d, a) : e.merge(d, a), d.prevObject = this, d.context = this.context, b === "find" ? d.selector = this.selector + (this.selector ? " " : "") + c : b && (d.selector = this.selector + "." + b + "(" + c + ")");
return d
},
each: function(a, b) {
return e.each(this, a, b)
},
ready: function(a) {
e.bindReady(), y.done(a);
return this
},
eq: function(a) {
return a === -1 ? this.slice(a) : this.slice(a, +a + 1)
},
first: function() {
return this.eq(0)
},
last: function() {
return this.eq(-1)
},
slice: function() {
return this.pushStack(D.apply(this, arguments), "slice", D.call(arguments).join(","))
},
map: function(a) {
return this.pushStack(e.map(this, function(b, c) {
return a.call(b, c, b)
}))
},
end: function() {
return this.prevObject || this.constructor(null)
},
push: C,
sort: [].sort,
splice: [].splice
}, e.fn.init.prototype = e.fn, e.extend = e.fn.extend = function() {
var a, c, d, f, g, h, i = arguments[0] || {},
j = 1,
k = arguments.length,
l = !1;
typeof i == "boolean" && (l = i, i = arguments[1] || {}, j = 2), typeof i != "object" && !e.isFunction(i) && (i = {}), k === j && (i = this, --j);
for (; j < k; j++) if ((a = arguments[j]) != null) for (c in a) {
d = i[c], f = a[c];
if (i === f) continue;
l && f && (e.isPlainObject(f) || (g = e.isArray(f))) ? (g ? (g = !1, h = d && e.isArray(d) ? d : []) : h = d && e.isPlainObject(d) ? d : {}, i[c] = e.extend(l, h, f)) : f !== b && (i[c] = f)
}
return i
}, e.extend({
noConflict: function(b) {
a.$ === e && (a.$ = g), b && a.jQuery === e && (a.jQuery = f);
return e
},
isReady: !1,
readyWait: 1,
holdReady: function(a) {
a ? e.readyWait++ : e.ready(!0)
},
ready: function(a) {
if (a === !0 && !--e.readyWait || a !== !0 && !e.isReady) {
if (!c.body) return setTimeout(e.ready, 1);
e.isReady = !0;
if (a !== !0 && --e.readyWait > 0) return;
y.resolveWith(c, [e]), e.fn.trigger && e(c).trigger("ready").unbind("ready")
}
},
bindReady: function() {
if (!y) {
y = e._Deferred();
if (c.readyState === "complete") return setTimeout(e.ready, 1);
if (c.addEventListener) c.addEventListener("DOMContentLoaded", z, !1), a.addEventListener("load", e.ready, !1);
else if (c.attachEvent) {
c.attachEvent("onreadystatechange", z), a.attachEvent("onload", e.ready);
var b = !1;
try {
b = a.frameElement == null
} catch (d) {}
c.documentElement.doScroll && b && H()
}
}
},
isFunction: function(a) {
return e.type(a) === "function"
},
isArray: Array.isArray ||
function(a) {
return e.type(a) === "array"
},
isWindow: function(a) {
return a && typeof a == "object" && "setInterval" in a
},
isNaN: function(a) {
return a == null || !m.test(a) || isNaN(a)
},
type: function(a) {
return a == null ? String(a) : G[A.call(a)] || "object"
},
isPlainObject: function(a) {
if (!a || e.type(a) !== "object" || a.nodeType || e.isWindow(a)) return !1;
if (a.constructor && !B.call(a, "constructor") && !B.call(a.constructor.prototype, "isPrototypeOf")) return !1;
var c;
for (c in a);
return c === b || B.call(a, c)
},
isEmptyObject: function(a) {
for (var b in a) return !1;
return !0
},
error: function(a) {
throw a
},
parseJSON: function(b) {
if (typeof b != "string" || !b) return null;
b = e.trim(b);
if (a.JSON && a.JSON.parse) return a.JSON.parse(b);
if (o.test(b.replace(p, "@").replace(q, "]").replace(r, ""))) return (new Function("return " + b))();
e.error("Invalid JSON: " + b)
},
parseXML: function(b, c, d) {
a.DOMParser ? (d = new DOMParser, c = d.parseFromString(b, "text/xml")) : (c = new ActiveXObject("Microsoft.XMLDOM"), c.async = "false", c.loadXML(b)), d = c.documentElement, (!d || !d.nodeName || d.nodeName === "parsererror") && e.error("Invalid XML: " + b);
return c
},
noop: function() {},
globalEval: function(b) {
b && j.test(b) && (a.execScript ||
function(b) {
a.eval.call(a, b)
})(b)
},
nodeName: function(a, b) {
return a.nodeName && a.nodeName.toUpperCase() === b.toUpperCase()
},
each: function(a, c, d) {
var f, g = 0,
h = a.length,
i = h === b || e.isFunction(a);
if (d) {
if (i) {
for (f in a) if (c.apply(a[f], d) === !1) break
} else for (; g < h;) if (c.apply(a[g++], d) === !1) break
} else if (i) {
for (f in a) if (c.call(a[f], f, a[f]) === !1) break
} else for (; g < h;) if (c.call(a[g], g, a[g++]) === !1) break;
return a
},
trim: E ?
function(a) {
return a == null ? "" : E.call(a)
} : function(a) {
return a == null ? "" : (a + "").replace(k, "").replace(l, "")
},
makeArray: function(a, b) {
var c = b || [];
if (a != null) {
var d = e.type(a);
a.length == null || d === "string" || d === "function" || d === "regexp" || e.isWindow(a) ? C.call(c, a) : e.merge(c, a)
}
return c
},
inArray: function(a, b) {
if (F) return F.call(b, a);
for (var c = 0, d = b.length; c < d; c++) if (b[c] === a) return c;
return -1
},
merge: function(a, c) {
var d = a.length,
e = 0;
if (typeof c.length == "number") for (var f = c.length; e < f; e++) a[d++] = c[e];
else while (c[e] !== b) a[d++] = c[e++];
a.length = d;
return a
},
grep: function(a, b, c) {
var d = [],
e;
c = !! c;
for (var f = 0, g = a.length; f < g; f++) e = !! b(a[f], f), c !== e && d.push(a[f]);
return d
},
map: function(a, c, d) {
var f, g, h = [],
i = 0,
j = a.length,
k = a instanceof e || j !== b && typeof j == "number" && (j > 0 && a[0] && a[j - 1] || j === 0 || e.isArray(a));
if (k) for (; i < j; i++) f = c(a[i], i, d), f != null && (h[h.length] = f);
else for (g in a) f = c(a[g], g, d), f != null && (h[h.length] = f);
return h.concat.apply([], h)
},
guid: 1,
proxy: function(a, c) {
if (typeof c == "string") {
var d = a[c];
c = a, a = d
}
if (!e.isFunction(a)) return b;
var f = D.call(arguments, 2),
g = function() {
return a.apply(c, f.concat(D.call(arguments)))
};
g.guid = a.guid = a.guid || g.guid || e.guid++;
return g
},
access: function(a, c, d, f, g, h) {
var i = a.length;
if (typeof c == "object") {
for (var j in c) e.access(a, j, c[j], f, g, d);
return a
}
if (d !== b) {
f = !h && f && e.isFunction(d);
for (var k = 0; k < i; k++) g(a[k], c, f ? d.call(a[k], k, g(a[k], c)) : d, h);
return a
}
return i ? g(a[0], c) : b
},
now: function() {
return (new Date).getTime()
},
uaMatch: function(a) {
a = a.toLowerCase();
var b = s.exec(a) || t.exec(a) || u.exec(a) || a.indexOf("compatible") < 0 && v.exec(a) || [];
return {
browser: b[1] || "",
version: b[2] || "0"
}
},
sub: function() {
function a(b, c) {
return new a.fn.init(b, c)
}
e.extend(!0, a, this), a.superclass = this, a.fn = a.prototype = this(), a.fn.constructor = a, a.sub = this.sub, a.fn.init = function(d, f) {
f && f instanceof e && !(f instanceof a) && (f = a(f));
return e.fn.init.call(this, d, f, b)
}, a.fn.init.prototype = a.fn;
var b = a(c);
return a
},
browser: {}
}), e.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(a, b) {
G["[object " + b + "]"] = b.toLowerCase()
}), x = e.uaMatch(w), x.browser && (e.browser[x.browser] = !0, e.browser.version = x.version), e.browser.webkit && (e.browser.safari = !0), j.test(" ") && (k = /^[\s\xA0]+/, l = /[\s\xA0]+$/), h = e(c), c.addEventListener ? z = function() {
c.removeEventListener("DOMContentLoaded", z, !1), e.ready()
} : c.attachEvent && (z = function() {
c.readyState === "complete" && (c.detachEvent("onreadystatechange", z), e.ready())
});
return e
}(),
g = "done fail isResolved isRejected promise then always pipe".split(" "),
h = [].slice;
f.extend({
_Deferred: function() {
var a = [],
b, c, d, e = {
done: function() {
if (!d) {
var c = arguments,
g, h, i, j, k;
b && (k = b, b = 0);
for (g = 0, h = c.length; g < h; g++) i = c[g], j = f.type(i), j === "array" ? e.done.apply(e, i) : j === "function" && a.push(i);
k && e.resolveWith(k[0], k[1])
}
return this
},
resolveWith: function(e, f) {
if (!d && !b && !c) {
f = f || [], c = 1;
try {
while (a[0]) a.shift().apply(e, f)
} finally {
b = [e, f], c = 0
}
}
return this
},
resolve: function() {
e.resolveWith(this, arguments);
return this
},
isResolved: function() {
return !!c || !! b
},
cancel: function() {
d = 1, a = [];
return this
}
};
return e
},
Deferred: function(a) {
var b = f._Deferred(),
c = f._Deferred(),
d;
f.extend(b, {
then: function(a, c) {
b.done(a).fail(c);
return this
},
always: function() {
return b.done.apply(b, arguments).fail.apply(this, arguments)
},
fail: c.done,
rejectWith: c.resolveWith,
reject: c.resolve,
isRejected: c.isResolved,
pipe: function(a, c) {
return f.Deferred(function(d) {
f.each({
done: [a, "resolve"],
fail: [c, "reject"]
}, function(a, c) {
var e = c[0],
g = c[1],
h;
f.isFunction(e) ? b[a](function() {
h = e.apply(this, arguments), h && f.isFunction(h.promise) ? h.promise().then(d.resolve, d.reject) : d[g](h)
}) : b[a](d[g])
})
}).promise()
},
promise: function(a) {
if (a == null) {
if (d) return d;
d = a = {}
}
var c = g.length;
while (c--) a[g[c]] = b[g[c]];
return a
}
}), b.done(c.cancel).fail(b.cancel), delete b.cancel, a && a.call(b, b);
return b
},
when: function(a) {
function i(a) {
return function(c) {
b[a] = arguments.length > 1 ? h.call(arguments, 0) : c, --e || g.resolveWith(g, h.call(b, 0))
}
}
var b = arguments,
c = 0,
d = b.length,
e = d,
g = d <= 1 && a && f.isFunction(a.promise) ? a : f.Deferred();
if (d > 1) {
for (; c < d; c++) b[c] && f.isFunction(b[c].promise) ? b[c].promise().then(i(c), g.reject) : --e;
e || g.resolveWith(g, b)
} else g !== a && g.resolveWith(g, d ? [a] : []);
return g.promise()
}
}), f.support = function() {
var a = c.createElement("div"),
b = c.documentElement,
d, e, f, g, h, i, j, k, l, m, n, o, p, q, r;
a.setAttribute("className", "t"), a.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>", d = a.getElementsByTagName("*"), e = a.getElementsByTagName("a")[0];
if (!d || !d.length || !e) return {};
f = c.createElement("select"), g = f.appendChild(c.createElement("option")), h = a.getElementsByTagName("input")[0], j = {
leadingWhitespace: a.firstChild.nodeType === 3,
tbody: !a.getElementsByTagName("tbody").length,
htmlSerialize: !! a.getElementsByTagName("link").length,
style: /top/.test(e.getAttribute("style")),
hrefNormalized: e.getAttribute("href") === "/a",
opacity: /^0.55$/.test(e.style.opacity),
cssFloat: !! e.style.cssFloat,
checkOn: h.value === "on",
optSelected: g.selected,
getSetAttribute: a.className !== "t",
submitBubbles: !0,
changeBubbles: !0,
focusinBubbles: !1,
deleteExpando: !0,
noCloneEvent: !0,
inlineBlockNeedsLayout: !1,
shrinkWrapBlocks: !1,
reliableMarginRight: !0
}, h.checked = !0, j.noCloneChecked = h.cloneNode(!0).checked, f.disabled = !0, j.optDisabled = !g.disabled;
try {
delete a.test
} catch (s) {
j.deleteExpando = !1
}!a.addEventListener && a.attachEvent && a.fireEvent && (a.attachEvent("onclick", function b() {
j.noCloneEvent = !1, a.detachEvent("onclick", b)
}), a.cloneNode(!0).fireEvent("onclick")), h = c.createElement("input"), h.value = "t", h.setAttribute("type", "radio"), j.radioValue = h.value === "t", h.setAttribute("checked", "checked"), a.appendChild(h), k = c.createDocumentFragment(), k.appendChild(a.firstChild), j.checkClone = k.cloneNode(!0).cloneNode(!0).lastChild.checked, a.innerHTML = "", a.style.width = a.style.paddingLeft = "1px", l = c.createElement("body"), m = {
visibility: "hidden",
width: 0,
height: 0,
border: 0,
margin: 0,
background: "none"
};
for (q in m) l.style[q] = m[q];
l.appendChild(a), b.insertBefore(l, b.firstChild), j.appendChecked = h.checked, j.boxModel = a.offsetWidth === 2, "zoom" in a.style && (a.style.display = "inline", a.style.zoom = 1, j.inlineBlockNeedsLayout = a.offsetWidth === 2, a.style.display = "", a.innerHTML = "<div style='width:4px;'></div>", j.shrinkWrapBlocks = a.offsetWidth !== 2), a.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>", n = a.getElementsByTagName("td"), r = n[0].offsetHeight === 0, n[0].style.display = "", n[1].style.display = "none", j.reliableHiddenOffsets = r && n[0].offsetHeight === 0, a.innerHTML = "", c.defaultView && c.defaultView.getComputedStyle && (i = c.createElement("div"), i.style.width = "0", i.style.marginRight = "0", a.appendChild(i), j.reliableMarginRight = (parseInt((c.defaultView.getComputedStyle(i, null) || {
marginRight: 0
}).marginRight, 10) || 0) === 0), l.innerHTML = "", b.removeChild(l);
if (a.attachEvent) for (q in {
submit: 1,
change: 1,
focusin: 1
}) p = "on" + q, r = p in a, r || (a.setAttribute(p, "return;"), r = typeof a[p] == "function"), j[q + "Bubbles"] = r;
return j
}(), f.boxModel = f.support.boxModel;
var i = /^(?:\{.*\}|\[.*\])$/,
j = /([a-z])([A-Z])/g;
f.extend({
cache: {},
uuid: 0,
expando: "jQuery" + (f.fn.jquery + Math.random()).replace(/\D/g, ""),
noData: {
embed: !0,
object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
applet: !0
},
hasData: function(a) {
a = a.nodeType ? f.cache[a[f.expando]] : a[f.expando];
return !!a && !l(a)
},
data: function(a, c, d, e) {
if ( !! f.acceptData(a)) {
var g = f.expando,
h = typeof c == "string",
i, j = a.nodeType,
k = j ? f.cache : a,
l = j ? a[f.expando] : a[f.expando] && f.expando;
if ((!l || e && l && !k[l][g]) && h && d === b) return;
l || (j ? a[f.expando] = l = ++f.uuid : l = f.expando), k[l] || (k[l] = {}, j || (k[l].toJSON = f.noop));
if (typeof c == "object" || typeof c == "function") e ? k[l][g] = f.extend(k[l][g], c) : k[l] = f.extend(k[l], c);
i = k[l], e && (i[g] || (i[g] = {}), i = i[g]), d !== b && (i[f.camelCase(c)] = d);
if (c === "events" && !i[c]) return i[g] && i[g].events;
return h ? i[f.camelCase(c)] : i
}
},
removeData: function(b, c, d) {
if ( !! f.acceptData(b)) {
var e = f.expando,
g = b.nodeType,
h = g ? f.cache : b,
i = g ? b[f.expando] : f.expando;
if (!h[i]) return;
if (c) {
var j = d ? h[i][e] : h[i];
if (j) {
delete j[c];
if (!l(j)) return
}
}
if (d) {
delete h[i][e];
if (!l(h[i])) return
}
var k = h[i][e];
f.support.deleteExpando || h != a ? delete h[i] : h[i] = null, k ? (h[i] = {}, g || (h[i].toJSON = f.noop), h[i][e] = k) : g && (f.support.deleteExpando ? delete b[f.expando] : b.removeAttribute ? b.removeAttribute(f.expando) : b[f.expando] = null)
}
},
_data: function(a, b, c) {
return f.data(a, b, c, !0)
},
acceptData: function(a) {
if (a.nodeName) {
var b = f.noData[a.nodeName.toLowerCase()];
if (b) return b !== !0 && a.getAttribute("classid") === b
}
return !0
}
}), f.fn.extend({
data: function(a, c) {
var d = null;
if (typeof a == "undefined") {
if (this.length) {
d = f.data(this[0]);
if (this[0].nodeType === 1) {
var e = this[0].attributes,
g;
for (var h = 0, i = e.length; h < i; h++) g = e[h].name, g.indexOf("data-") === 0 && (g = f.camelCase(g.substring(5)), k(this[0], g, d[g]))
}
}
return d
}
if (typeof a == "object") return this.each(function() {
f.data(this, a)
});
var j = a.split(".");
j[1] = j[1] ? "." + j[1] : "";
if (c === b) {
d = this.triggerHandler("getData" + j[1] + "!", [j[0]]), d === b && this.length && (d = f.data(this[0], a), d = k(this[0], a, d));
return d === b && j[1] ? this.data(j[0]) : d
}
return this.each(function() {
var b = f(this),
d = [j[0], c];
b.triggerHandler("setData" + j[1] + "!", d), f.data(this, a, c), b.triggerHandler("changeData" + j[1] + "!", d)
})
},
removeData: function(a) {
return this.each(function() {
f.removeData(this, a)
})
}
}), f.extend({
_mark: function(a, c) {
a && (c = (c || "fx") + "mark", f.data(a, c, (f.data(a, c, b, !0) || 0) + 1, !0))
},
_unmark: function(a, c, d) {
a !== !0 && (d = c, c = a, a = !1);
if (c) {
d = d || "fx";
var e = d + "mark",
g = a ? 0 : (f.data(c, e, b, !0) || 1) - 1;
g ? f.data(c, e, g, !0) : (f.removeData(c, e, !0), m(c, d, "mark"))
}
},
queue: function(a, c, d) {
if (a) {
c = (c || "fx") + "queue";
var e = f.data(a, c, b, !0);
d && (!e || f.isArray(d) ? e = f.data(a, c, f.makeArray(d), !0) : e.push(d));
return e || []
}
},
dequeue: function(a, b) {
b = b || "fx";
var c = f.queue(a, b),
d = c.shift(),
e;
d === "inprogress" && (d = c.shift()), d && (b === "fx" && c.unshift("inprogress"), d.call(a, function() {
f.dequeue(a, b)
})), c.length || (f.removeData(a, b + "queue", !0), m(a, b, "queue"))
}
}), f.fn.extend({
queue: function(a, c) {
typeof a != "string" && (c = a, a = "fx");
if (c === b) return f.queue(this[0], a);
return this.each(function() {
var b = f.queue(this, a, c);
a === "fx" && b[0] !== "inprogress" && f.dequeue(this, a)
})
},
dequeue: function(a) {
return this.each(function() {
f.dequeue(this, a)
})
},
delay: function(a, b) {
a = f.fx ? f.fx.speeds[a] || a : a, b = b || "fx";
return this.queue(b, function() {
var c = this;
setTimeout(function() {
f.dequeue(c, b)
}, a)
})
},
clearQueue: function(a) {
return this.queue(a || "fx", [])
},
promise: function(a, c) {
function m() {
--h || d.resolveWith(e, [e])
}
typeof a != "string" && (c = a, a = b), a = a || "fx";
var d = f.Deferred(),
e = this,
g = e.length,
h = 1,
i = a + "defer",
j = a + "queue",
k = a + "mark",
l;
while (g--) if (l = f.data(e[g], i, b, !0) || (f.data(e[g], j, b, !0) || f.data(e[g], k, b, !0)) && f.data(e[g], i, f._Deferred(), !0)) h++, l.done(m);
m();
return d.promise()
}
});
var n = /[\n\t\r]/g,
o = /\s+/,
p = /\r/g,
q = /^(?:button|input)$/i,
r = /^(?:button|input|object|select|textarea)$/i,
s = /^a(?:rea)?$/i,
t = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
u = /\:/,
v, w;
f.fn.extend({
attr: function(a, b) {
return f.access(this, a, b, !0, f.attr)
},
removeAttr: function(a) {
return this.each(function() {
f.removeAttr(this, a)
})
},
prop: function(a, b) {
return f.access(this, a, b, !0, f.prop)
},
removeProp: function(a) {
a = f.propFix[a] || a;
return this.each(function() {
try {
this[a] = b, delete this[a]
} catch (c) {}
})
},
addClass: function(a) {
if (f.isFunction(a)) return this.each(function(b) {
var c = f(this);
c.addClass(a.call(this, b, c.attr("class") || ""))
});
if (a && typeof a == "string") {
var b = (a || "").split(o);
for (var c = 0, d = this.length; c < d; c++) {
var e = this[c];
if (e.nodeType === 1) if (!e.className) e.className = a;
else {
var g = " " + e.className + " ",
h = e.className;
for (var i = 0, j = b.length; i < j; i++) g.indexOf(" " + b[i] + " ") < 0 && (h += " " + b[i]);
e.className = f.trim(h)
}
}
}
return this
},
removeClass: function(a) {
if (f.isFunction(a)) return this.each(function(b) {
var c = f(this);
c.removeClass(a.call(this, b, c.attr("class")))
});
if (a && typeof a == "string" || a === b) {
var c = (a || "").split(o);
for (var d = 0, e = this.length; d < e; d++) {
var g = this[d];
if (g.nodeType === 1 && g.className) if (a) {
var h = (" " + g.className + " ").replace(n, " ");
for (var i = 0, j = c.length; i < j; i++) h = h.replace(" " + c[i] + " ", " ");
g.className = f.trim(h)
} else g.className = ""
}
}
return this
},
toggleClass: function(a, b) {
var c = typeof a,
d = typeof b == "boolean";
if (f.isFunction(a)) return this.each(function(c) {
var d = f(this);
d.toggleClass(a.call(this, c, d.attr("class"), b), b)
});
return this.each(function() {
if (c === "string") {
var e, g = 0,
h = f(this),
i = b,
j = a.split(o);
while (e = j[g++]) i = d ? i : !h.hasClass(e), h[i ? "addClass" : "removeClass"](e)
} else if (c === "undefined" || c === "boolean") this.className && f._data(this, "__className__", this.className), this.className = this.className || a === !1 ? "" : f._data(this, "__className__") || ""
})
},
hasClass: function(a) {
var b = " " + a + " ";
for (var c = 0, d = this.length; c < d; c++) if ((" " + this[c].className + " ").replace(n, " ").indexOf(b) > -1) return !0;
return !1
},
val: function(a) {
var c, d, e = this[0];
if (!arguments.length) {
if (e) {
c = f.valHooks[e.nodeName.toLowerCase()] || f.valHooks[e.type];
if (c && "get" in c && (d = c.get(e, "value")) !== b) return d;
return (e.value || "").replace(p, "")
}
return b
}
var g = f.isFunction(a);
return this.each(function(d) {
var e = f(this),
h;
if (this.nodeType === 1) {
g ? h = a.call(this, d, e.val()) : h = a, h == null ? h = "" : typeof h == "number" ? h += "" : f.isArray(h) && (h = f.map(h, function(a) {
return a == null ? "" : a + ""
})), c = f.valHooks[this.nodeName.toLowerCase()] || f.valHooks[this.type];
if (!c || !("set" in c) || c.set(this, h, "value") === b) this.value = h
}
})
}
}), f.extend({
valHooks: {
option: {
get: function(a) {
var b = a.attributes.value;
return !b || b.specified ? a.value : a.text
}
},
select: {
get: function(a) {
var b, c = a.selectedIndex,
d = [],
e = a.options,
g = a.type === "select-one";
if (c < 0) return null;
for (var h = g ? c : 0, i = g ? c + 1 : e.length; h < i; h++) {
var j = e[h];
if (j.selected && (f.support.optDisabled ? !j.disabled : j.getAttribute("disabled") === null) && (!j.parentNode.disabled || !f.nodeName(j.parentNode, "optgroup"))) {
b = f(j).val();
if (g) return b;
d.push(b)
}
}
if (g && !d.length && e.length) return f(e[c]).val();
return d
},
set: function(a, b) {
var c = f.makeArray(b);
f(a).find("option").each(function() {
this.selected = f.inArray(f(this).val(), c) >= 0
}), c.length || (a.selectedIndex = -1);
return c
}
}
},
attrFn: {
val: !0,
css: !0,
html: !0,
text: !0,
data: !0,
width: !0,
height: !0,
offset: !0
},
attrFix: {
tabindex: "tabIndex"
},
attr: function(a, c, d, e) {
var g = a.nodeType;
if (!a || g === 3 || g === 8 || g === 2) return b;
if (e && c in f.attrFn) return f(a)[c](d);
if (!("getAttribute" in a)) return f.prop(a, c, d);
var h, i, j = g !== 1 || !f.isXMLDoc(a);
c = j && f.attrFix[c] || c, i = f.attrHooks[c], i || (!t.test(c) || typeof d != "boolean" && d !== b && d.toLowerCase() !== c.toLowerCase() ? v && (f.nodeName(a, "form") || u.test(c)) && (i = v) : i = w);
if (d !== b) {
if (d === null) {
f.removeAttr(a, c);
return b
}
if (i && "set" in i && j && (h = i.set(a, d, c)) !== b) return h;
a.setAttribute(c, "" + d);
return d
}
if (i && "get" in i && j) return i.get(a, c);
h = a.getAttribute(c);
return h === null ? b : h
},
removeAttr: function(a, b) {
var c;
a.nodeType === 1 && (b = f.attrFix[b] || b, f.support.getSetAttribute ? a.removeAttribute(b) : (f.attr(a, b, ""), a.removeAttributeNode(a.getAttributeNode(b))), t.test(b) && (c = f.propFix[b] || b) in a && (a[c] = !1))
},
attrHooks: {
type: {
set: function(a, b) {
if (q.test(a.nodeName) && a.parentNode) f.error("type property can't be changed");
else if (!f.support.radioValue && b === "radio" && f.nodeName(a, "input")) {
var c = a.value;
a.setAttribute("type", b), c && (a.value = c);
return b
}
}
},
tabIndex: {
get: function(a) {
var c = a.getAttributeNode("tabIndex");
return c && c.specified ? parseInt(c.value, 10) : r.test(a.nodeName) || s.test(a.nodeName) && a.href ? 0 : b
}
}
},
propFix: {
tabindex: "tabIndex",
readonly: "readOnly",
"for": "htmlFor",
"class": "className",
maxlength: "maxLength",
cellspacing: "cellSpacing",
cellpadding: "cellPadding",
rowspan: "rowSpan",
colspan: "colSpan",
usemap: "useMap",
frameborder: "frameBorder",
contenteditable: "contentEditable"
},
prop: function(a, c, d) {
var e = a.nodeType;
if (!a || e === 3 || e === 8 || e === 2) return b;
var g, h, i = e !== 1 || !f.isXMLDoc(a);
c = i && f.propFix[c] || c, h = f.propHooks[c];
return d !== b ? h && "set" in h && (g = h.set(a, d, c)) !== b ? g : a[c] = d : h && "get" in h && (g = h.get(a, c)) !== b ? g : a[c]
},
propHooks: {}
}), w = {
get: function(a, c) {
return a[f.propFix[c] || c] ? c.toLowerCase() : b
},
set: function(a, b, c) {
var d;
b === !1 ? f.removeAttr(a, c) : (d = f.propFix[c] || c, d in a && (a[d] = b), a.setAttribute(c, c.toLowerCase()));
return c
}
}, f.attrHooks.value = {
get: function(a, b) {
if (v && f.nodeName(a, "button")) return v.get(a, b);
return a.value
},
set: function(a, b, c) {
if (v && f.nodeName(a, "button")) return v.set(a, b, c);
a.value = b
}
}, f.support.getSetAttribute || (f.attrFix = f.propFix, v = f.attrHooks.name = f.valHooks.button = {
get: function(a, c) {
var d;
d = a.getAttributeNode(c);
return d && d.nodeValue !== "" ? d.nodeValue : b
},
set: function(a, b, c) {
var d = a.getAttributeNode(c);
if (d) {
d.nodeValue = b;
return b
}
}
}, f.each(["width", "height"], function(a, b) {
f.attrHooks[b] = f.extend(f.attrHooks[b], {
set: function(a, c) {
if (c === "") {
a.setAttribute(b, "auto");
return c
}
}
})
})), f.support.hrefNormalized || f.each(["href", "src", "width", "height"], function(a, c) {
f.attrHooks[c] = f.extend(f.attrHooks[c], {
get: function(a) {
var d = a.getAttribute(c, 2);
return d === null ? b : d
}
})
}), f.support.style || (f.attrHooks.style = {
get: function(a) {
return a.style.cssText.toLowerCase() || b
},
set: function(a, b) {
return a.style.cssText = "" + b
}
}), f.support.optSelected || (f.propHooks.selected = f.extend(f.propHooks.selected, {
get: function(a) {
var b = a.parentNode;
b && (b.selectedIndex, b.parentNode && b.parentNode.selectedIndex)
}
})), f.support.checkOn || f.each(["radio", "checkbox"], function() {
f.valHooks[this] = {
get: function(a) {
return a.getAttribute("value") === null ? "on" : a.value
}
}
}), f.each(["radio", "checkbox"], function() {
f.valHooks[this] = f.extend(f.valHooks[this], {
set: function(a, b) {
if (f.isArray(b)) return a.checked = f.inArray(f(a).val(), b) >= 0
}
})
});
var x = Object.prototype.hasOwnProperty,
y = /\.(.*)$/,
z = /^(?:textarea|input|select)$/i,
A = /\./g,
B = / /g,
C = /[^\w\s.|`]/g,
D = function(a) {
return a.replace(C, "\\$&")
};
f.event = {
add: function(a, c, d, e) {
if (a.nodeType !== 3 && a.nodeType !== 8) {
if (d === !1) d = E;
else if (!d) return;
var g, h;
d.handler && (g = d, d = g.handler), d.guid || (d.guid = f.guid++);
var i = f._data(a);
if (!i) return;
var j = i.events,
k = i.handle;
j || (i.events = j = {}), k || (i.handle = k = function(a) {
return typeof f != "undefined" && (!a || f.event.triggered !== a.type) ? f.event.handle.apply(k.elem, arguments) : b
}), k.elem = a, c = c.split(" ");
var l, m = 0,
n;
while (l = c[m++]) {
h = g ? f.extend({}, g) : {
handler: d,
data: e
}, l.indexOf(".") > -1 ? (n = l.split("."), l = n.shift(), h.namespace = n.slice(0).sort().join(".")) : (n = [], h.namespace = ""), h.type = l, h.guid || (h.guid = d.guid);
var o = j[l],
p = f.event.special[l] || {};
if (!o) {
o = j[l] = [];
if (!p.setup || p.setup.call(a, e, n, k) === !1) a.addEventListener ? a.addEventListener(l, k, !1) : a.attachEvent && a.attachEvent("on" + l, k)
}
p.add && (p.add.call(a, h), h.handler.guid || (h.handler.guid = d.guid)), o.push(h), f.event.global[l] = !0
}
a = null
}
},
global: {},
remove: function(a, c, d, e) {
if (a.nodeType !== 3 && a.nodeType !== 8) {
d === !1 && (d = E);
var g, h, i, j, k = 0,
l, m, n, o, p, q, r, s = f.hasData(a) && f._data(a),
t = s && s.events;
if (!s || !t) return;
c && c.type && (d = c.handler, c = c.type);
if (!c || typeof c == "string" && c.charAt(0) === ".") {
c = c || "";
for (h in t) f.event.remove(a, h + c);
return
}
c = c.split(" ");
while (h = c[k++]) {
r = h, q = null, l = h.indexOf(".") < 0, m = [], l || (m = h.split("."), h = m.shift(), n = new RegExp("(^|\\.)" + f.map(m.slice(0).sort(), D).join("\\.(?:.*\\.)?") + "(\\.|$)")), p = t[h];
if (!p) continue;
if (!d) {
for (j = 0; j < p.length; j++) {
q = p[j];
if (l || n.test(q.namespace)) f.event.remove(a, r, q.handler, j), p.splice(j--, 1)
}
continue
}
o = f.event.special[h] || {};
for (j = e || 0; j < p.length; j++) {
q = p[j];
if (d.guid === q.guid) {
if (l || n.test(q.namespace)) e == null && p.splice(j--, 1), o.remove && o.remove.call(a, q);
if (e != null) break
}
}
if (p.length === 0 || e != null && p.length === 1)(!o.teardown || o.teardown.call(a, m) === !1) && f.removeEvent(a, h, s.handle), g = null, delete t[h]
}
if (f.isEmptyObject(t)) {
var u = s.handle;
u && (u.elem = null), delete s.events, delete s.handle, f.isEmptyObject(s) && f.removeData(a, b, !0)
}
}
},
customEvent: {
getData: !0,
setData: !0,
changeData: !0
},
trigger: function(c, d, e, g) {
var h = c.type || c,
i = [],
j;
h.indexOf("!") >= 0 && (h = h.slice(0, -1), j = !0), h.indexOf(".") >= 0 && (i = h.split("."), h = i.shift(), i.sort());
if ( !! e && !f.event.customEvent[h] || !! f.event.global[h]) {
c = typeof c == "object" ? c[f.expando] ? c : new f.Event(h, c) : new f.Event(h), c.type = h, c.exclusive = j, c.namespace = i.join("."), c.namespace_re = new RegExp("(^|\\.)" + i.join("\\.(?:.*\\.)?") + "(\\.|$)");
if (g || !e) c.preventDefault(), c.stopPropagation();
if (!e) {
f.each(f.cache, function() {
var a = f.expando,
b = this[a];
b && b.events && b.events[h] && f.event.trigger(c, d, b.handle.elem)
});
return
}
if (e.nodeType === 3 || e.nodeType === 8) return;
c.result = b, c.target = e, d = d ? f.makeArray(d) : [], d.unshift(c);
var k = e,
l = h.indexOf(":") < 0 ? "on" + h : "";
do {
var m = f._data(k, "handle");
c.currentTarget = k, m && m.apply(k, d), l && f.acceptData(k) && k[l] && k[l].apply(k, d) === !1 && (c.result = !1, c.preventDefault()), k = k.parentNode || k.ownerDocument || k === c.target.ownerDocument && a
} while (k && !c.isPropagationStopped());
if (!c.isDefaultPrevented()) {
var n, o = f.event.special[h] || {};
if ((!o._default || o._default.call(e.ownerDocument, c) === !1) && (h !== "click" || !f.nodeName(e, "a")) && f.acceptData(e)) {
try {
l && e[h] && (n = e[l], n && (e[l] = null), f.event.triggered = h, e[h]())
} catch (p) {}
n && (e[l] = n), f.event.triggered = b
}
}
return c.result
}
},
handle: function(c) {
c = f.event.fix(c || a.event);
var d = ((f._data(this, "events") || {})[c.type] || []).slice(0),
e = !c.exclusive && !c.namespace,
g = Array.prototype.slice.call(arguments, 0);
g[0] = c, c.currentTarget = this;
for (var h = 0, i = d.length; h < i; h++) {
var j = d[h];
if (e || c.namespace_re.test(j.namespace)) {
c.handler = j.handler, c.data = j.data, c.handleObj = j;
var k = j.handler.apply(this, g);
k !== b && (c.result = k, k === !1 && (c.preventDefault(), c.stopPropagation()));
if (c.isImmediatePropagationStopped()) break
}
}
return c.result
},
props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
fix: function(a) {
if (a[f.expando]) return a;
var d = a;
a = f.Event(d);
for (var e = this.props.length, g; e;) g = this.props[--e], a[g] = d[g];
a.target || (a.target = a.srcElement || c), a.target.nodeType === 3 && (a.target = a.target.parentNode), !a.relatedTarget && a.fromElement && (a.relatedTarget = a.fromElement === a.target ? a.toElement : a.fromElement);
if (a.pageX == null && a.clientX != null) {
var h = a.target.ownerDocument || c,
i = h.documentElement,
j = h.body;
a.pageX = a.clientX + (i && i.scrollLeft || j && j.scrollLeft || 0) - (i && i.clientLeft || j && j.clientLeft || 0), a.pageY = a.clientY + (i && i.scrollTop || j && j.scrollTop || 0) - (i && i.clientTop || j && j.clientTop || 0)
}
a.which == null && (a.charCode != null || a.keyCode != null) && (a.which = a.charCode != null ? a.charCode : a.keyCode), !a.metaKey && a.ctrlKey && (a.metaKey = a.ctrlKey), !a.which && a.button !== b && (a.which = a.button & 1 ? 1 : a.button & 2 ? 3 : a.button & 4 ? 2 : 0);
return a
},
guid: 1e8,
proxy: f.proxy,
special: {
ready: {
setup: f.bindReady,
teardown: f.noop
},
live: {
add: function(a) {
f.event.add(this, O(a.origType, a.selector), f.extend({}, a, {
handler: N,
guid: a.handler.guid
}))
},
remove: function(a) {
f.event.remove(this, O(a.origType, a.selector), a)
}
},
beforeunload: {
setup: function(a, b, c) {
f.isWindow(this) && (this.onbeforeunload = c)
},
teardown: function(a, b) {
this.onbeforeunload === b && (this.onbeforeunload = null)
}
}
}
}, f.removeEvent = c.removeEventListener ?
function(a, b, c) {
a.removeEventListener && a.removeEventListener(b, c, !1)
} : function(a, b, c) {
a.detachEvent && a.detachEvent("on" + b, c)
}, f.Event = function(a, b) {
if (!this.preventDefault) return new f.Event(a, b);
a && a.type ? (this.originalEvent = a, this.type = a.type, this.isDefaultPrevented = a.defaultPrevented || a.returnValue === !1 || a.getPreventDefault && a.getPreventDefault() ? F : E) : this.type = a, b && f.extend(this, b), this.timeStamp = f.now(), this[f.expando] = !0
}, f.Event.prototype = {
preventDefault: function() {
this.isDefaultPrevented = F;
var a = this.originalEvent;
!a || (a.preventDefault ? a.preventDefault() : a.returnValue = !1)
},
stopPropagation: function() {
this.isPropagationStopped = F;
var a = this.originalEvent;
!a || (a.stopPropagation && a.stopPropagation(), a.cancelBubble = !0)
},
stopImmediatePropagation: function() {
this.isImmediatePropagationStopped = F, this.stopPropagation()
},
isDefaultPrevented: E,
isPropagationStopped: E,
isImmediatePropagationStopped: E
};
var G = function(a) {
var b = a.relatedTarget;
a.type = a.data;
try {
if (b && b !== c && !b.parentNode) return;
while (b && b !== this) b = b.parentNode;
b !== this && f.event.handle.apply(this, arguments)
} catch (d) {}
},
H = function(a) {
a.type = a.data, f.event.handle.apply(this, arguments)
};
f.each({
mouseenter: "mouseover",
mouseleave: "mouseout"
}, function(a, b) {
f.event.special[a] = {
setup: function(c) {
f.event.add(this, b, c && c.selector ? H : G, a)
},
teardown: function(a) {
f.event.remove(this, b, a && a.selector ? H : G)
}
}
}), f.support.submitBubbles || (f.event.special.submit = {
setup: function(a, b) {
if (!f.nodeName(this, "form")) f.event.add(this, "click.specialSubmit", function(a) {
var b = a.target,
c = b.type;
(c === "submit" || c === "image") && f(b).closest("form").length && L("submit", this, arguments)
}), f.event.add(this, "keypress.specialSubmit", function(a) {
var b = a.target,
c = b.type;
(c === "text" || c === "password") && f(b).closest("form").length && a.keyCode === 13 && L("submit", this, arguments)
});
else return !1
},
teardown: function(a) {
f.event.remove(this, ".specialSubmit")
}
});
if (!f.support.changeBubbles) {
var I, J = function(a) {
var b = a.type,
c = a.value;
b === "radio" || b === "checkbox" ? c = a.checked : b === "select-multiple" ? c = a.selectedIndex > -1 ? f.map(a.options, function(a) {
return a.selected
}).join("-") : "" : f.nodeName(a, "select") && (c = a.selectedIndex);
return c
},
K = function(c) {
var d = c.target,
e, g;
if ( !! z.test(d.nodeName) && !d.readOnly) {
e = f._data(d, "_change_data"), g = J(d), (c.type !== "focusout" || d.type !== "radio") && f._data(d, "_change_data", g);
if (e === b || g === e) return;
if (e != null || g) c.type = "change", c.liveFired = b, f.event.trigger(c, arguments[1], d)
}
};
f.event.special.change = {
filters: {
focusout: K,
beforedeactivate: K,
click: function(a) {
var b = a.target,
c = f.nodeName(b, "input") ? b.type : "";
(c === "radio" || c === "checkbox" || f.nodeName(b, "select")) && K.call(this, a)
},
keydown: function(a) {
var b = a.target,
c = f.nodeName(b, "input") ? b.type : "";
(a.keyCode === 13 && !f.nodeName(b, "textarea") || a.keyCode === 32 && (c === "checkbox" || c === "radio") || c === "select-multiple") && K.call(this, a)
},
beforeactivate: function(a) {
var b = a.target;
f._data(b, "_change_data", J(b))
}
},
setup: function(a, b) {
if (this.type === "file") return !1;
for (var c in I) f.event.add(this, c + ".specialChange", I[c]);
return z.test(this.nodeName)
},
teardown: function(a) {
f.event.remove(this, ".specialChange");
return z.test(this.nodeName)
}
}, I = f.event.special.change.filters, I.focus = I.beforeactivate
}
f.support.focusinBubbles || f.each({
focus: "focusin",
blur: "focusout"
}, function(a, b) {
function e(a) {
var c = f.event.fix(a);
c.type = b, c.originalEvent = {}, f.event.trigger(c, null, c.target), c.isDefaultPrevented() && a.preventDefault()
}
var d = 0;
f.event.special[b] = {
setup: function() {
d++ === 0 && c.addEventListener(a, e, !0)
},
teardown: function() {
--d === 0 && c.removeEventListener(a, e, !0)
}
}
}), f.each(["bind", "one"], function(a, c) {
f.fn[c] = function(a, d, e) {
var g;
if (typeof a == "object") {
for (var h in a) this[c](h, d, a[h], e);
return this
}
if (arguments.length === 2 || d === !1) e = d, d = b;
c === "one" ? (g = function(a) {
f(this).unbind(a, g);
return e.apply(this, arguments)
}, g.guid = e.guid || f.guid++) : g = e;
if (a === "unload" && c !== "one") this.one(a, d, e);
else for (var i = 0, j = this.length; i < j; i++) f.event.add(this[i], a, g, d);
return this
}
}), f.fn.extend({
unbind: function(a, b) {
if (typeof a == "object" && !a.preventDefault) for (var c in a) this.unbind(c, a[c]);
else for (var d = 0, e = this.length; d < e; d++) f.event.remove(this[d], a, b);
return this
},
delegate: function(a, b, c, d) {
return this.live(b, c, d, a)
},
undelegate: function(a, b, c) {
return arguments.length === 0 ? this.unbind("live") : this.die(b, null, c, a)
},
trigger: function(a, b) {
return this.each(function() {
f.event.trigger(a, b, this)
})
},
triggerHandler: function(a, b) {
if (this[0]) return f.event.trigger(a, b, this[0], !0)
},
toggle: function(a) {
var b = arguments,
c = a.guid || f.guid++,
d = 0,
e = function(c) {
var e = (f.data(this, "lastToggle" + a.guid) || 0) % d;
f.data(this, "lastToggle" + a.guid, e + 1), c.preventDefault();
return b[e].apply(this, arguments) || !1
};
e.guid = c;
while (d < b.length) b[d++].guid = c;
return this.click(e)
},
hover: function(a, b) {
return this.mouseenter(a).mouseleave(b || a)
}
});
var M = {
focus: "focusin",
blur: "focusout",
mouseenter: "mouseover",
mouseleave: "mouseout"
};
f.each(["live", "die"], function(a, c) {
f.fn[c] = function(a, d, e, g) {
var h, i = 0,
j, k, l, m = g || this.selector,
n = g ? this : f(this.context);
if (typeof a == "object" && !a.preventDefault) {
for (var o in a) n[c](o, d, a[o], m);
return this
}
if (c === "die" && !a && g && g.charAt(0) === ".") {
n.unbind(g);
return this
}
if (d === !1 || f.isFunction(d)) e = d || E, d = b;
a = (a || "").split(" ");
while ((h = a[i++]) != null) {
j = y.exec(h), k = "", j && (k = j[0], h = h.replace(y, ""));
if (h === "hover") {
a.push("mouseenter" + k, "mouseleave" + k);
continue
}
l = h, M[h] ? (a.push(M[h] + k), h = h + k) : h = (M[h] || h) + k;
if (c === "live") for (var p = 0, q = n.length; p < q; p++) f.event.add(n[p], "live." + O(h, m), {
data: d,
selector: m,
handler: e,
origType: h,
origHandler: e,
preType: l
});
else n.unbind("live." + O(h, m), e)
}
return this
}
}), f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "), function(a, b) {
f.fn[b] = function(a, c) {
c == null && (c = a, a = null);
return arguments.length > 0 ? this.bind(b, a, c) : this.trigger(b)
}, f.attrFn && (f.attrFn[b] = !0)
}), function() {
function u(a, b, c, d, e, f) {
for (var g = 0, h = d.length; g < h; g++) {
var i = d[g];
if (i) {
var j = !1;
i = i[a];
while (i) {
if (i.sizcache === c) {
j = d[i.sizset];
break
}
if (i.nodeType === 1) {
f || (i.sizcache = c, i.sizset = g);
if (typeof b != "string") {
if (i === b) {
j = !0;
break
}
} else if (k.filter(b, [i]).length > 0) {
j = i;
break
}
}
i = i[a]
}
d[g] = j
}
}
}
function t(a, b, c, d, e, f) {
for (var g = 0, h = d.length; g < h; g++) {
var i = d[g];
if (i) {
var j = !1;
i = i[a];
while (i) {
if (i.sizcache === c) {
j = d[i.sizset];
break
}
i.nodeType === 1 && !f && (i.sizcache = c, i.sizset = g);
if (i.nodeName.toLowerCase() === b) {
j = i;
break
}
i = i[a]
}
d[g] = j
}
}
}
var a = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
d = 0,
e = Object.prototype.toString,
g = !1,
h = !0,
i = /\\/g,
j = /\W/;
[0, 0].sort(function() {
h = !1;
return 0
});
var k = function(b, d, f, g) {
f = f || [], d = d || c;
var h = d;
if (d.nodeType !== 1 && d.nodeType !== 9) return [];
if (!b || typeof b != "string") return f;
var i, j, n, o, q, r, s, t, u = !0,
w = k.isXML(d),
x = [],
y = b;
do {
a.exec(""), i = a.exec(y);
if (i) {
y = i[3], x.push(i[1]);
if (i[2]) {
o = i[3];
break
}
}
} while (i);
if (x.length > 1 && m.exec(b)) if (x.length === 2 && l.relative[x[0]]) j = v(x[0] + x[1], d);
else {
j = l.relative[x[0]] ? [d] : k(x.shift(), d);
while (x.length) b = x.shift(), l.relative[b] && (b += x.shift()), j = v(b, j)
} else {
!g && x.length > 1 && d.nodeType === 9 && !w && l.match.ID.test(x[0]) && !l.match.ID.test(x[x.length - 1]) && (q = k.find(x.shift(), d, w), d = q.expr ? k.filter(q.expr, q.set)[0] : q.set[0]);
if (d) {
q = g ? {
expr: x.pop(),
set: p(g)
} : k.find(x.pop(), x.length === 1 && (x[0] === "~" || x[0] === "+") && d.parentNode ? d.parentNode : d, w), j = q.expr ? k.filter(q.expr, q.set) : q.set, x.length > 0 ? n = p(j) : u = !1;
while (x.length) r = x.pop(), s = r, l.relative[r] ? s = x.pop() : r = "", s == null && (s = d), l.relative[r](n, s, w)
} else n = x = []
}
n || (n = j), n || k.error(r || b);
if (e.call(n) === "[object Array]") if (!u) f.push.apply(f, n);
else if (d && d.nodeType === 1) for (t = 0; n[t] != null; t++) n[t] && (n[t] === !0 || n[t].nodeType === 1 && k.contains(d, n[t])) && f.push(j[t]);
else for (t = 0; n[t] != null; t++) n[t] && n[t].nodeType === 1 && f.push(j[t]);
else p(n, f);
o && (k(o, h, f, g), k.uniqueSort(f));
return f
};
k.uniqueSort = function(a) {
if (r) {
g = h, a.sort(r);
if (g) for (var b = 1; b < a.length; b++) a[b] === a[b - 1] && a.splice(b--, 1)
}
return a
}, k.matches = function(a, b) {
return k(a, null, null, b)
}, k.matchesSelector = function(a, b) {
return k(b, null, null, [a]).length > 0
}, k.find = function(a, b, c) {
var d;
if (!a) return [];
for (var e = 0, f = l.order.length; e < f; e++) {
var g, h = l.order[e];
if (g = l.leftMatch[h].exec(a)) {
var j = g[1];
g.splice(1, 1);
if (j.substr(j.length - 1) !== "\\") {
g[1] = (g[1] || "").replace(i, ""), d = l.find[h](g, b, c);
if (d != null) {
a = a.replace(l.match[h], "");
break
}
}
}
}
d || (d = typeof b.getElementsByTagName != "undefined" ? b.getElementsByTagName("*") : []);
return {
set: d,
expr: a
}
}, k.filter = function(a, c, d, e) {
var f, g, h = a,
i = [],
j = c,
m = c && c[0] && k.isXML(c[0]);
while (a && c.length) {
for (var n in l.filter) if ((f = l.leftMatch[n].exec(a)) != null && f[2]) {
var o, p, q = l.filter[n],
r = f[1];
g = !1, f.splice(1, 1);
if (r.substr(r.length - 1) === "\\") continue;
j === i && (i = []);
if (l.preFilter[n]) {
f = l.preFilter[n](f, j, d, i, e, m);
if (!f) g = o = !0;
else if (f === !0) continue
}
if (f) for (var s = 0;
(p = j[s]) != null; s++) if (p) {
o = q(p, f, s, j);
var t = e ^ !! o;
d && o != null ? t ? g = !0 : j[s] = !1 : t && (i.push(p), g = !0)
}
if (o !== b) {
d || (j = i), a = a.replace(l.match[n], "");
if (!g) return [];
break
}
}
if (a === h) if (g == null) k.error(a);
else break;
h = a
}
return j
}, k.error = function(a) {
throw "Syntax error, unrecognized expression: " + a
};
var l = k.selectors = {
order: ["ID", "NAME", "TAG"],
match: {
ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
},
leftMatch: {},
attrMap: {
"class": "className",
"for": "htmlFor"
},
attrHandle: {
href: function(a) {
return a.getAttribute("href")
},
type: function(a) {
return a.getAttribute("type")
}
},
relative: {
"+": function(a, b) {
var c = typeof b == "string",
d = c && !j.test(b),
e = c && !d;
d && (b = b.toLowerCase());
for (var f = 0, g = a.length, h; f < g; f++) if (h = a[f]) {
while ((h = h.previousSibling) && h.nodeType !== 1);
a[f] = e || h && h.nodeName.toLowerCase() === b ? h || !1 : h === b
}
e && k.filter(b, a, !0)
},
">": function(a, b) {
var c, d = typeof b == "string",
e = 0,
f = a.length;
if (d && !j.test(b)) {
b = b.toLowerCase();
for (; e < f; e++) {
c = a[e];
if (c) {
var g = c.parentNode;
a[e] = g.nodeName.toLowerCase() === b ? g : !1
}
}
} else {
for (; e < f; e++) c = a[e], c && (a[e] = d ? c.parentNode : c.parentNode === b);
d && k.filter(b, a, !0)
}
},
"": function(a, b, c) {
var e, f = d++,
g = u;
typeof b == "string" && !j.test(b) && (b = b.toLowerCase(), e = b, g = t), g("parentNode", b, f, a, e, c)
},
"~": function(a, b, c) {
var e, f = d++,
g = u;
typeof b == "string" && !j.test(b) && (b = b.toLowerCase(), e = b, g = t), g("previousSibling", b, f, a, e, c)
}
},
find: {
ID: function(a, b, c) {
if (typeof b.getElementById != "undefined" && !c) {
var d = b.getElementById(a[1]);
return d && d.parentNode ? [d] : []
}
},
NAME: function(a, b) {
if (typeof b.getElementsByName != "undefined") {
var c = [],
d = b.getElementsByName(a[1]);
for (var e = 0, f = d.length; e < f; e++) d[e].getAttribute("name") === a[1] && c.push(d[e]);
return c.length === 0 ? null : c
}
},
TAG: function(a, b) {
if (typeof b.getElementsByTagName != "undefined") return b.getElementsByTagName(a[1])
}
},
preFilter: {
CLASS: function(a, b, c, d, e, f) {
a = " " + a[1].replace(i, "") + " ";
if (f) return a;
for (var g = 0, h;
(h = b[g]) != null; g++) h && (e ^ (h.className && (" " + h.className + " ").replace(/[\t\n\r]/g, " ").indexOf(a) >= 0) ? c || d.push(h) : c && (b[g] = !1));
return !1
},
ID: function(a) {
return a[1].replace(i, "")
},
TAG: function(a, b) {
return a[1].replace(i, "").toLowerCase()
},
CHILD: function(a) {
if (a[1] === "nth") {
a[2] || k.error(a[0]), a[2] = a[2].replace(/^\+|\s*/g, "");
var b = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2] === "even" && "2n" || a[2] === "odd" && "2n+1" || !/\D/.test(a[2]) && "0n+" + a[2] || a[2]);
a[2] = b[1] + (b[2] || 1) - 0, a[3] = b[3] - 0
} else a[2] && k.error(a[0]);
a[0] = d++;
return a
},
ATTR: function(a, b, c, d, e, f) {
var g = a[1] = a[1].replace(i, "");
!f && l.attrMap[g] && (a[1] = l.attrMap[g]), a[4] = (a[4] || a[5] || "").replace(i, ""), a[2] === "~=" && (a[4] = " " + a[4] + " ");
return a
},
PSEUDO: function(b, c, d, e, f) {
if (b[1] === "not") if ((a.exec(b[3]) || "").length > 1 || /^\w/.test(b[3])) b[3] = k(b[3], null, null, c);
else {
var g = k.filter(b[3], c, d, !0 ^ f);
d || e.push.apply(e, g);
return !1
} else if (l.match.POS.test(b[0]) || l.match.CHILD.test(b[0])) return !0;
return b
},
POS: function(a) {
a.unshift(!0);
return a
}
},
filters: {
enabled: function(a) {
return a.disabled === !1 && a.type !== "hidden"
},
disabled: function(a) {
return a.disabled === !0
},
checked: function(a) {
return a.checked === !0
},
selected: function(a) {
a.parentNode && a.parentNode.selectedIndex;
return a.selected === !0
},
parent: function(a) {
return !!a.firstChild
},
empty: function(a) {
return !a.firstChild
},
has: function(a, b, c) {
return !!k(c[3], a).length
},
header: function(a) {
return /h\d/i.test(a.nodeName)
},
text: function(a) {
var b = a.getAttribute("type"),
c = a.type;
return a.nodeName.toLowerCase() === "input" && "text" === c && (b === c || b === null)
},
radio: function(a) {
return a.nodeName.toLowerCase() === "input" && "radio" === a.type
},
checkbox: function(a) {
return a.nodeName.toLowerCase() === "input" && "checkbox" === a.type
},
file: function(a) {
return a.nodeName.toLowerCase() === "input" && "file" === a.type
},
password: function(a) {
return a.nodeName.toLowerCase() === "input" && "password" === a.type
},
submit: function(a) {
var b = a.nodeName.toLowerCase();
return (b === "input" || b === "button") && "submit" === a.type
},
image: function(a) {
return a.nodeName.toLowerCase() === "input" && "image" === a.type
},
reset: function(a) {
var b = a.nodeName.toLowerCase();
return (b === "input" || b === "button") && "reset" === a.type
},
button: function(a) {
var b = a.nodeName.toLowerCase();
return b === "input" && "button" === a.type || b === "button"
},
input: function(a) {
return /input|select|textarea|button/i.test(a.nodeName)
},
focus: function(a) {
return a === a.ownerDocument.activeElement
}
},
setFilters: {
first: function(a, b) {
return b === 0
},
last: function(a, b, c, d) {
return b === d.length - 1
},
even: function(a, b) {
return b % 2 === 0
},
odd: function(a, b) {
return b % 2 === 1
},
lt: function(a, b, c) {
return b < c[3] - 0
},
gt: function(a, b, c) {
return b > c[3] - 0
},
nth: function(a, b, c) {
return c[3] - 0 === b
},
eq: function(a, b, c) {
return c[3] - 0 === b
}
},
filter: {
PSEUDO: function(a, b, c, d) {
var e = b[1],
f = l.filters[e];
if (f) return f(a, c, b, d);
if (e === "contains") return (a.textContent || a.innerText || k.getText([a]) || "").indexOf(b[3]) >= 0;
if (e === "not") {
var g = b[3];
for (var h = 0, i = g.length; h < i; h++) if (g[h] === a) return !1;
return !0
}
k.error(e)
},
CHILD: function(a, b) {
var c = b[1],
d = a;
switch (c) {
case "only":
case "first":
while (d = d.previousSibling) if (d.nodeType === 1) return !1;
if (c === "first") return !0;
d = a;
case "last":
while (d = d.nextSibling) if (d.nodeType === 1) return !1;
return !0;
case "nth":
var e = b[2],
f = b[3];
if (e === 1 && f === 0) return !0;
var g = b[0],
h = a.parentNode;
if (h && (h.sizcache !== g || !a.nodeIndex)) {
var i = 0;
for (d = h.firstChild; d; d = d.nextSibling) d.nodeType === 1 && (d.nodeIndex = ++i);
h.sizcache = g
}
var j = a.nodeIndex - f;
return e === 0 ? j === 0 : j % e === 0 && j / e >= 0
}
},
ID: function(a, b) {
return a.nodeType === 1 && a.getAttribute("id") === b
},
TAG: function(a, b) {
return b === "*" && a.nodeType === 1 || a.nodeName.toLowerCase() === b
},
CLASS: function(a, b) {
return (" " + (a.className || a.getAttribute("class")) + " ").indexOf(b) > -1
},
ATTR: function(a, b) {
var c = b[1],
d = l.attrHandle[c] ? l.attrHandle[c](a) : a[c] != null ? a[c] : a.getAttribute(c),
e = d + "",
f = b[2],
g = b[4];
return d == null ? f === "!=" : f === "=" ? e === g : f === "*=" ? e.indexOf(g) >= 0 : f === "~=" ? (" " + e + " ").indexOf(g) >= 0 : g ? f === "!=" ? e !== g : f === "^=" ? e.indexOf(g) === 0 : f === "$=" ? e.substr(e.length - g.length) === g : f === "|=" ? e === g || e.substr(0, g.length + 1) === g + "-" : !1 : e && d !== !1
},
POS: function(a, b, c, d) {
var e = b[2],
f = l.setFilters[e];
if (f) return f(a, c, b, d)
}
}
},
m = l.match.POS,
n = function(a, b) {
return "\\" + (b - 0 + 1)
};
for (var o in l.match) l.match[o] = new RegExp(l.match[o].source + /(?![^\[]*\])(?![^\(]*\))/.source), l.leftMatch[o] = new RegExp(/(^(?:.|\r|\n)*?)/.source + l.match[o].source.replace(/\\(\d+)/g, n));
var p = function(a, b) {
a = Array.prototype.slice.call(a, 0);
if (b) {
b.push.apply(b, a);
return b
}
return a
};
try {
Array.prototype.slice.call(c.documentElement.childNodes, 0)[0].nodeType
} catch (q) {
p = function(a, b) {
var c = 0,
d = b || [];
if (e.call(a) === "[object Array]") Array.prototype.push.apply(d, a);
else if (typeof a.length == "number") for (var f = a.length; c < f; c++) d.push(a[c]);
else for (; a[c]; c++) d.push(a[c]);
return d
}
}
var r, s;
c.documentElement.compareDocumentPosition ? r = function(a, b) {
if (a === b) {
g = !0;
return 0
}
if (!a.compareDocumentPosition || !b.compareDocumentPosition) return a.compareDocumentPosition ? -1 : 1;
return a.compareDocumentPosition(b) & 4 ? -1 : 1
} : (r = function(a, b) {
if (a === b) {
g = !0;
return 0
}
if (a.sourceIndex && b.sourceIndex) return a.sourceIndex - b.sourceIndex;
var c, d, e = [],
f = [],
h = a.parentNode,
i = b.parentNode,
j = h;
if (h === i) return s(a, b);
if (!h) return -1;
if (!i) return 1;
while (j) e.unshift(j), j = j.parentNode;
j = i;
while (j) f.unshift(j), j = j.parentNode;
c = e.length, d = f.length;
for (var k = 0; k < c && k < d; k++) if (e[k] !== f[k]) return s(e[k], f[k]);
return k === c ? s(a, f[k], -1) : s(e[k], b, 1)
}, s = function(a, b, c) {
if (a === b) return c;
var d = a.nextSibling;
while (d) {
if (d === b) return -1;
d = d.nextSibling
}
return 1
}), k.getText = function(a) {
var b = "",
c;
for (var d = 0; a[d]; d++) c = a[d], c.nodeType === 3 || c.nodeType === 4 ? b += c.nodeValue : c.nodeType !== 8 && (b += k.getText(c.childNodes));
return b
}, function() {
var a = c.createElement("div"),
d = "script" + (new Date).getTime(),
e = c.documentElement;
a.innerHTML = "<a name='" + d + "'/>", e.insertBefore(a, e.firstChild), c.getElementById(d) && (l.find.ID = function(a, c, d) {
if (typeof c.getElementById != "undefined" && !d) {
var e = c.getElementById(a[1]);
return e ? e.id === a[1] || typeof e.getAttributeNode != "undefined" && e.getAttributeNode("id").nodeValue === a[1] ? [e] : b : []
}
}, l.filter.ID = function(a, b) {
var c = typeof a.getAttributeNode != "undefined" && a.getAttributeNode("id");
return a.nodeType === 1 && c && c.nodeValue === b
}), e.removeChild(a), e = a = null
}(), function() {
var a = c.createElement("div");
a.appendChild(c.createComment("")), a.getElementsByTagName("*").length > 0 && (l.find.TAG = function(a, b) {
var c = b.getElementsByTagName(a[1]);
if (a[1] === "*") {
var d = [];
for (var e = 0; c[e]; e++) c[e].nodeType === 1 && d.push(c[e]);
c = d
}
return c
}), a.innerHTML = "<a href='#'></a>", a.firstChild && typeof a.firstChild.getAttribute != "undefined" && a.firstChild.getAttribute("href") !== "#" && (l.attrHandle.href = function(a) {
return a.getAttribute("href", 2)
}), a = null
}(), c.querySelectorAll &&
function() {
var a = k,
b = c.createElement("div"),
d = "__sizzle__";
b.innerHTML = "<p class='TEST'></p>";
if (!b.querySelectorAll || b.querySelectorAll(".TEST").length !== 0) {
k = function(b, e, f, g) {
e = e || c;
if (!g && !k.isXML(e)) {
var h = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);
if (h && (e.nodeType === 1 || e.nodeType === 9)) {
if (h[1]) return p(e.getElementsByTagName(b), f);
if (h[2] && l.find.CLASS && e.getElementsByClassName) return p(e.getElementsByClassName(h[2]), f)
}
if (e.nodeType === 9) {
if (b === "body" && e.body) return p([e.body], f);
if (h && h[3]) {
var i = e.getElementById(h[3]);
if (!i || !i.parentNode) return p([], f);
if (i.id === h[3]) return p([i], f)
}
try {
return p(e.querySelectorAll(b), f)
} catch (j) {}
} else if (e.nodeType === 1 && e.nodeName.toLowerCase() !== "object") {
var m = e,
n = e.getAttribute("id"),
o = n || d,
q = e.parentNode,
r = /^\s*[+~]/.test(b);
n ? o = o.replace(/'/g, "\\$&") : e.setAttribute("id", o), r && q && (e = e.parentNode);
try {
if (!r || q) return p(e.querySelectorAll("[id='" + o + "'] " + b), f)
} catch (s) {} finally {
n || m.removeAttribute("id")
}
}
}
return a(b, e, f, g)
};
for (var e in a) k[e] = a[e];
b = null
}
}(), function() {
var a = c.documentElement,
b = a.matchesSelector || a.mozMatchesSelector || a.webkitMatchesSelector || a.msMatchesSelector;
if (b) {
var d = !b.call(c.createElement("div"), "div"),
e = !1;
try {
b.call(c.documentElement, "[test!='']:sizzle")
} catch (f) {
e = !0
}
k.matchesSelector = function(a, c) {
c = c.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
if (!k.isXML(a)) try {
if (e || !l.match.PSEUDO.test(c) && !/!=/.test(c)) {
var f = b.call(a, c);
if (f || !d || a.document && a.document.nodeType !== 11) return f
}
} catch (g) {}
return k(c, null, null, [a]).length > 0
}
}
}(), function() {
var a = c.createElement("div");
a.innerHTML = "<div class='test e'></div><div class='test'></div>";
if ( !! a.getElementsByClassName && a.getElementsByClassName("e").length !== 0) {
a.lastChild.className = "e";
if (a.getElementsByClassName("e").length === 1) return;
l.order.splice(1, 0, "CLASS"), l.find.CLASS = function(a, b, c) {
if (typeof b.getElementsByClassName != "undefined" && !c) return b.getElementsByClassName(a[1])
}, a = null
}
}(), c.documentElement.contains ? k.contains = function(a, b) {
return a !== b && (a.contains ? a.contains(b) : !0)
} : c.documentElement.compareDocumentPosition ? k.contains = function(a, b) {
return !!(a.compareDocumentPosition(b) & 16)
} : k.contains = function() {
return !1
}, k.isXML = function(a) {
var b = (a ? a.ownerDocument || a : 0).documentElement;
return b ? b.nodeName !== "HTML" : !1
};
var v = function(a, b) {
var c, d = [],
e = "",
f = b.nodeType ? [b] : b;
while (c = l.match.PSEUDO.exec(a)) e += c[0], a = a.replace(l.match.PSEUDO, "");
a = l.relative[a] ? a + "*" : a;
for (var g = 0, h = f.length; g < h; g++) k(a, f[g], d);
return k.filter(e, d)
};
f.find = k, f.expr = k.selectors, f.expr[":"] = f.expr.filters, f.unique = k.uniqueSort, f.text = k.getText, f.isXMLDoc = k.isXML, f.contains = k.contains
}();
var P = /Until$/,
Q = /^(?:parents|prevUntil|prevAll)/,
R = /,/,
S = /^.[^:#\[\.,]*$/,
T = Array.prototype.slice,
U = f.expr.match.POS,
V = {
children: !0,
contents: !0,
next: !0,
prev: !0
};
f.fn.extend({
find: function(a) {
var b = this,
c, d;
if (typeof a != "string") return f(a).filter(function() {
for (c = 0, d = b.length; c < d; c++) if (f.contains(b[c], this)) return !0
});
var e = this.pushStack("", "find", a),
g, h, i;
for (c = 0, d = this.length; c < d; c++) {
g = e.length, f.find(a, this[c], e);
if (c > 0) for (h = g; h < e.length; h++) for (i = 0; i < g; i++) if (e[i] === e[h]) {
e.splice(h--, 1);
break
}
}
return e
},
has: function(a) {
var b = f(a);
return this.filter(function() {
for (var a = 0, c = b.length; a < c; a++) if (f.contains(this, b[a])) return !0
})
},
not: function(a) {
return this.pushStack(X(this, a, !1), "not", a)
},
filter: function(a) {
return this.pushStack(X(this, a, !0), "filter", a)
},
is: function(a) {
return !!a && (typeof a == "string" ? f.filter(a, this).length > 0 : this.filter(a).length > 0)
},
closest: function(a, b) {
var c = [],
d, e, g = this[0];
if (f.isArray(a)) {
var h, i, j = {},
k = 1;
if (g && a.length) {
for (d = 0, e = a.length; d < e; d++) i = a[d], j[i] || (j[i] = U.test(i) ? f(i, b || this.context) : i);
while (g && g.ownerDocument && g !== b) {
for (i in j) h = j[i], (h.jquery ? h.index(g) > -1 : f(g).is(h)) && c.push({
selector: i,
elem: g,
level: k
});
g = g.parentNode, k++
}
}
return c
}
var l = U.test(a) || typeof a != "string" ? f(a, b || this.context) : 0;
for (d = 0, e = this.length; d < e; d++) {
g = this[d];
while (g) {
if (l ? l.index(g) > -1 : f.find.matchesSelector(g, a)) {
c.push(g);
break
}
g = g.parentNode;
if (!g || !g.ownerDocument || g === b || g.nodeType === 11) break
}
}
c = c.length > 1 ? f.unique(c) : c;
return this.pushStack(c, "closest", a)
},
index: function(a) {
if (!a || typeof a == "string") return f.inArray(this[0], a ? f(a) : this.parent().children());
return f.inArray(a.jquery ? a[0] : a, this)
},
add: function(a, b) {
var c = typeof a == "string" ? f(a, b) : f.makeArray(a && a.nodeType ? [a] : a),
d = f.merge(this.get(), c);
return this.pushStack(W(c[0]) || W(d[0]) ? d : f.unique(d))
},
andSelf: function() {
return this.add(this.prevObject)
}
}), f.each({
parent: function(a) {
var b = a.parentNode;
return b && b.nodeType !== 11 ? b : null
},
parents: function(a) {
return f.dir(a, "parentNode")
},
parentsUntil: function(a, b, c) {
return f.dir(a, "parentNode", c)
},
next: function(a) {
return f.nth(a, 2, "nextSibling")
},
prev: function(a) {
return f.nth(a, 2, "previousSibling")
},
nextAll: function(a) {
return f.dir(a, "nextSibling")
},
prevAll: function(a) {
return f.dir(a, "previousSibling")
},
nextUntil: function(a, b, c) {
return f.dir(a, "nextSibling", c)
},
prevUntil: function(a, b, c) {
return f.dir(a, "previousSibling", c)
},
siblings: function(a) {
return f.sibling(a.parentNode.firstChild, a)
},
children: function(a) {
return f.sibling(a.firstChild)
},
contents: function(a) {
return f.nodeName(a, "iframe") ? a.contentDocument || a.contentWindow.document : f.makeArray(a.childNodes)
}
}, function(a, b) {
f.fn[a] = function(c, d) {
var e = f.map(this, b, c),
g = T.call(arguments);
P.test(a) || (d = c), d && typeof d == "string" && (e = f.filter(d, e)), e = this.length > 1 && !V[a] ? f.unique(e) : e, (this.length > 1 || R.test(d)) && Q.test(a) && (e = e.reverse());
return this.pushStack(e, a, g.join(","))
}
}), f.extend({
filter: function(a, b, c) {
c && (a = ":not(" + a + ")");
return b.length === 1 ? f.find.matchesSelector(b[0], a) ? [b[0]] : [] : f.find.matches(a, b)
},
dir: function(a, c, d) {
var e = [],
g = a[c];
while (g && g.nodeType !== 9 && (d === b || g.nodeType !== 1 || !f(g).is(d))) g.nodeType === 1 && e.push(g), g = g[c];
return e
},
nth: function(a, b, c, d) {
b = b || 1;
var e = 0;
for (; a; a = a[c]) if (a.nodeType === 1 && ++e === b) break;
return a
},
sibling: function(a, b) {
var c = [];
for (; a; a = a.nextSibling) a.nodeType === 1 && a !== b && c.push(a);
return c
}
});
var Y = / jQuery\d+="(?:\d+|null)"/g,
Z = /^\s+/,
$ = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
_ = /<([\w:]+)/,
ba = /<tbody/i,
bb = /<|&#?\w+;/,
bc = /<(?:script|object|embed|option|style)/i,
bd = /checked\s*(?:[^=]|=\s*.checked.)/i,
be = /\/(java|ecma)script/i,
bf = /^\s*<!(?:\[CDATA\[|\-\-)/,
bg = {
option: [1, "<select multiple='multiple'>", "</select>"],
legend: [1, "<fieldset>", "</fieldset>"],
thead: [1, "<table>", "</table>"],
tr: [2, "<table><tbody>", "</tbody></table>"],
td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"],
area: [1, "<map>", "</map>"],
_default: [0, "", ""]
};
bg.optgroup = bg.option, bg.tbody = bg.tfoot = bg.colgroup = bg.caption = bg.thead, bg.th = bg.td, f.support.htmlSerialize || (bg._default = [1, "div<div>", "</div>"]), f.fn.extend({
text: function(a) {
if (f.isFunction(a)) return this.each(function(b) {
var c = f(this);
c.text(a.call(this, b, c.text()))
});
if (typeof a != "object" && a !== b) return this.empty().append((this[0] && this[0].ownerDocument || c).createTextNode(a));
return f.text(this)
},
wrapAll: function(a) {
if (f.isFunction(a)) return this.each(function(b) {
f(this).wrapAll(a.call(this, b))
});
if (this[0]) {
var b = f(a, this[0].ownerDocument).eq(0).clone(!0);
this[0].parentNode && b.insertBefore(this[0]), b.map(function() {
var a = this;
while (a.firstChild && a.firstChild.nodeType === 1) a = a.firstChild;
return a
}).append(this)
}
return this
},
wrapInner: function(a) {
if (f.isFunction(a)) return this.each(function(b) {
f(this).wrapInner(a.call(this, b))
});
return this.each(function() {
var b = f(this),
c = b.contents();
c.length ? c.wrapAll(a) : b.append(a)
})
},
wrap: function(a) {
return this.each(function() {
f(this).wrapAll(a)
})
},
unwrap: function() {
return this.parent().each(function() {
f.nodeName(this, "body") || f(this).replaceWith(this.childNodes)
}).end()
},
append: function() {
return this.domManip(arguments, !0, function(a) {
this.nodeType === 1 && this.appendChild(a)
})
},
prepend: function() {
return this.domManip(arguments, !0, function(a) {
this.nodeType === 1 && this.insertBefore(a, this.firstChild)
})
},
before: function() {
if (this[0] && this[0].parentNode) return this.domManip(arguments, !1, function(a) {
this.parentNode.insertBefore(a, this)
});
if (arguments.length) {
var a = f(arguments[0]);
a.push.apply(a, this.toArray());
return this.pushStack(a, "before", arguments)
}
},
after: function() {
if (this[0] && this[0].parentNode) return this.domManip(arguments, !1, function(a) {
this.parentNode.insertBefore(a, this.nextSibling)
});
if (arguments.length) {
var a = this.pushStack(this, "after", arguments);
a.push.apply(a, f(arguments[0]).toArray());
return a
}
},
remove: function(a, b) {
for (var c = 0, d;
(d = this[c]) != null; c++) if (!a || f.filter(a, [d]).length)!b && d.nodeType === 1 && (f.cleanData(d.getElementsByTagName("*")), f.cleanData([d])), d.parentNode && d.parentNode.removeChild(d);
return this
},
empty: function() {
for (var a = 0, b;
(b = this[a]) != null; a++) {
b.nodeType === 1 && f.cleanData(b.getElementsByTagName("*"));
while (b.firstChild) b.removeChild(b.firstChild)
}
return this
},
clone: function(a, b) {
a = a == null ? !1 : a, b = b == null ? a : b;
return this.map(function() {
return f.clone(this, a, b)
})
},
html: function(a) {
if (a === b) return this[0] && this[0].nodeType === 1 ? this[0].innerHTML.replace(Y, "") : null;
if (typeof a == "string" && !bc.test(a) && (f.support.leadingWhitespace || !Z.test(a)) && !bg[(_.exec(a) || ["", ""])[1].toLowerCase()]) {
a = a.replace($, "<$1></$2>");
try {
for (var c = 0, d = this.length; c < d; c++) this[c].nodeType === 1 && (f.cleanData(this[c].getElementsByTagName("*")), this[c].innerHTML = a)
} catch (e) {
this.empty().append(a)
}
} else f.isFunction(a) ? this.each(function(b) {
var c = f(this);
c.html(a.call(this, b, c.html()))
}) : this.empty().append(a);
return this
},
replaceWith: function(a) {
if (this[0] && this[0].parentNode) {
if (f.isFunction(a)) return this.each(function(b) {
var c = f(this),
d = c.html();
c.replaceWith(a.call(this, b, d))
});
typeof a != "string" && (a = f(a).detach());
return this.each(function() {
var b = this.nextSibling,
c = this.parentNode;
f(this).remove(), b ? f(b).before(a) : f(c).append(a)
})
}
return this.length ? this.pushStack(f(f.isFunction(a) ? a() : a), "replaceWith", a) : this
},
detach: function(a) {
return this.remove(a, !0)
},
domManip: function(a, c, d) {
var e, g, h, i, j = a[0],
k = [];
if (!f.support.checkClone && arguments.length === 3 && typeof j == "string" && bd.test(j)) return this.each(function() {
f(this).domManip(a, c, d, !0)
});
if (f.isFunction(j)) return this.each(function(e) {
var g = f(this);
a[0] = j.call(this, e, c ? g.html() : b), g.domManip(a, c, d)
});
if (this[0]) {
i = j && j.parentNode, f.support.parentNode && i && i.nodeType === 11 && i.childNodes.length === this.length ? e = {
fragment: i
} : e = f.buildFragment(a, this, k), h = e.fragment, h.childNodes.length === 1 ? g = h = h.firstChild : g = h.firstChild;
if (g) {
c = c && f.nodeName(g, "tr");
for (var l = 0, m = this.length, n = m - 1; l < m; l++) d.call(c ? bh(this[l], g) : this[l], e.cacheable || m > 1 && l < n ? f.clone(h, !0, !0) : h)
}
k.length && f.each(k, bn)
}
return this
}
}), f.buildFragment = function(a, b, d) {
var e, g, h, i = b && b[0] ? b[0].ownerDocument || b[0] : c;
a.length === 1 && typeof a[0] == "string" && a[0].length < 512 && i === c && a[0].charAt(0) === "<" && !bc.test(a[0]) && (f.support.checkClone || !bd.test(a[0])) && (g = !0, h = f.fragments[a[0]], h && h !== 1 && (e = h)), e || (e = i.createDocumentFragment(), f.clean(a, i, e, d)), g && (f.fragments[a[0]] = h ? e : 1);
return {
fragment: e,
cacheable: g
}
}, f.fragments = {}, f.each({
appendTo: "append",
prependTo: "prepend",
insertBefore: "before",
insertAfter: "after",
replaceAll: "replaceWith"
}, function(a, b) {
f.fn[a] = function(c) {
var d = [],
e = f(c),
g = this.length === 1 && this[0].parentNode;
if (g && g.nodeType === 11 && g.childNodes.length === 1 && e.length === 1) {
e[b](this[0]);
return this
}
for (var h = 0, i = e.length; h < i; h++) {
var j = (h > 0 ? this.clone(!0) : this).get();
f(e[h])[b](j), d = d.concat(j)
}
return this.pushStack(d, a, e.selector)
}
}), f.extend({
clone: function(a, b, c) {
var d = a.cloneNode(!0),
e, g, h;
if ((!f.support.noCloneEvent || !f.support.noCloneChecked) && (a.nodeType === 1 || a.nodeType === 11) && !f.isXMLDoc(a)) {
bj(a, d), e = bk(a), g = bk(d);
for (h = 0; e[h]; ++h) bj(e[h], g[h])
}
if (b) {
bi(a, d);
if (c) {
e = bk(a), g = bk(d);
for (h = 0; e[h]; ++h) bi(e[h], g[h])
}
}
return d
},
clean: function(a, b, d, e) {
var g;
b = b || c, typeof b.createElement == "undefined" && (b = b.ownerDocument || b[0] && b[0].ownerDocument || c);
var h = [],
i;
for (var j = 0, k;
(k = a[j]) != null; j++) {
typeof k == "number" && (k += "");
if (!k) continue;
if (typeof k == "string") if (!bb.test(k)) k = b.createTextNode(k);
else {
k = k.replace($, "<$1></$2>");
var l = (_.exec(k) || ["", ""])[1].toLowerCase(),
m = bg[l] || bg._default,
n = m[0],
o = b.createElement("div");
o.innerHTML = m[1] + k + m[2];
while (n--) o = o.lastChild;
if (!f.support.tbody) {
var p = ba.test(k),
q = l === "table" && !p ? o.firstChild && o.firstChild.childNodes : m[1] === "<table>" && !p ? o.childNodes : [];
for (i = q.length - 1; i >= 0; --i) f.nodeName(q[i], "tbody") && !q[i].childNodes.length && q[i].parentNode.removeChild(q[i])
}!f.support.leadingWhitespace && Z.test(k) && o.insertBefore(b.createTextNode(Z.exec(k)[0]), o.firstChild), k = o.childNodes
}
var r;
if (!f.support.appendChecked) if (k[0] && typeof(r = k.length) == "number") for (i = 0; i < r; i++) bm(k[i]);
else bm(k);
k.nodeType ? h.push(k) : h = f.merge(h, k)
}
if (d) {
g = function(a) {
return !a.type || be.test(a.type)
};
for (j = 0; h[j]; j++) if (e && f.nodeName(h[j], "script") && (!h[j].type || h[j].type.toLowerCase() === "text/javascript")) e.push(h[j].parentNode ? h[j].parentNode.removeChild(h[j]) : h[j]);
else {
if (h[j].nodeType === 1) {
var s = f.grep(h[j].getElementsByTagName("script"), g);
h.splice.apply(h, [j + 1, 0].concat(s))
}
d.appendChild(h[j])
}
}
return h
},
cleanData: function(a) {
var b, c, d = f.cache,
e = f.expando,
g = f.event.special,
h = f.support.deleteExpando;
for (var i = 0, j;
(j = a[i]) != null; i++) {
if (j.nodeName && f.noData[j.nodeName.toLowerCase()]) continue;
c = j[f.expando];
if (c) {
b = d[c] && d[c][e];
if (b && b.events) {
for (var k in b.events) g[k] ? f.event.remove(j, k) : f.removeEvent(j, k, b.handle);
b.handle && (b.handle.elem = null)
}
h ? delete j[f.expando] : j.removeAttribute && j.removeAttribute(f.expando), delete d[c]
}
}
}
});
var bo = /alpha\([^)]*\)/i,
bp = /opacity=([^)]*)/,
bq = /-([a-z])/ig,
br = /([A-Z]|^ms)/g,
bs = /^-?\d+(?:px)?$/i,
bt = /^-?\d/,
bu = /^[+\-]=/,
bv = /[^+\-\.\de]+/g,
bw = {
position: "absolute",
visibility: "hidden",
display: "block"
},
bx = ["Left", "Right"],
by = ["Top", "Bottom"],
bz, bA, bB, bC = function(a, b) {
return b.toUpperCase()
};
f.fn.css = function(a, c) {
if (arguments.length === 2 && c === b) return this;
return f.access(this, a, c, !0, function(a, c, d) {
return d !== b ? f.style(a, c, d) : f.css(a, c)
})
}, f.extend({
cssHooks: {
opacity: {
get: function(a, b) {
if (b) {
var c = bz(a, "opacity", "opacity");
return c === "" ? "1" : c
}
return a.style.opacity
}
}
},
cssNumber: {
zIndex: !0,
fontWeight: !0,
opacity: !0,
zoom: !0,
lineHeight: !0,
widows: !0,
orphans: !0
},
cssProps: {
"float": f.support.cssFloat ? "cssFloat" : "styleFloat"
},
style: function(a, c, d, e) {
if ( !! a && a.nodeType !== 3 && a.nodeType !== 8 && !! a.style) {
var g, h, i = f.camelCase(c),
j = a.style,
k = f.cssHooks[i];
c = f.cssProps[i] || i;
if (d === b) {
if (k && "get" in k && (g = k.get(a, !1, e)) !== b) return g;
return j[c]
}
h = typeof d;
if (h === "number" && isNaN(d) || d == null) return;
h === "string" && bu.test(d) && (d = +d.replace(bv, "") + parseFloat(f.css(a, c))), h === "number" && !f.cssNumber[i] && (d += "px");
if (!k || !("set" in k) || (d = k.set(a, d)) !== b) try {
j[c] = d
} catch (l) {}
}
},
css: function(a, c, d) {
var e, g;
c = f.camelCase(c), g = f.cssHooks[c], c = f.cssProps[c] || c, c === "cssFloat" && (c = "float");
if (g && "get" in g && (e = g.get(a, !0, d)) !== b) return e;
if (bz) return bz(a, c)
},
swap: function(a, b, c) {
var d = {};
for (var e in b) d[e] = a.style[e], a.style[e] = b[e];
c.call(a);
for (e in b) a.style[e] = d[e]
},
camelCase: function(a) {
return a.replace(bq, bC)
}
}), f.curCSS = f.css, f.each(["height", "width"], function(a, b) {
f.cssHooks[b] = {
get: function(a, c, d) {
var e;
if (c) {
a.offsetWidth !== 0 ? e = bD(a, b, d) : f.swap(a, bw, function() {
e = bD(a, b, d)
});
if (e <= 0) {
e = bz(a, b, b), e === "0px" && bB && (e = bB(a, b, b));
if (e != null) return e === "" || e === "auto" ? "0px" : e
}
if (e < 0 || e == null) {
e = a.style[b];
return e === "" || e === "auto" ? "0px" : e
}
return typeof e == "string" ? e : e + "px"
}
},
set: function(a, b) {
if (!bs.test(b)) return b;
b = parseFloat(b);
if (b >= 0) return b + "px"
}
}
}), f.support.opacity || (f.cssHooks.opacity = {
get: function(a, b) {
return bp.test((b && a.currentStyle ? a.currentStyle.filter : a.style.filter) || "") ? parseFloat(RegExp.$1) / 100 + "" : b ? "1" : ""
},
set: function(a, b) {
var c = a.style,
d = a.currentStyle;
c.zoom = 1;
var e = f.isNaN(b) ? "" : "alpha(opacity=" + b * 100 + ")",
g = d && d.filter || c.filter || "";
c.filter = bo.test(g) ? g.replace(bo, e) : g + " " + e
}
}), f(function() {
f.support.reliableMarginRight || (f.cssHooks.marginRight = {
get: function(a, b) {
var c;
f.swap(a, {
display: "inline-block"
}, function() {
b ? c = bz(a, "margin-right", "marginRight") : c = a.style.marginRight
});
return c
}
})
}), c.defaultView && c.defaultView.getComputedStyle && (bA = function(a, c) {
var d, e, g;
c = c.replace(br, "-$1").toLowerCase();
if (!(e = a.ownerDocument.defaultView)) return b;
if (g = e.getComputedStyle(a, null)) d = g.getPropertyValue(c), d === "" && !f.contains(a.ownerDocument.documentElement, a) && (d = f.style(a, c));
return d
}), c.documentElement.currentStyle && (bB = function(a, b) {
var c, d = a.currentStyle && a.currentStyle[b],
e = a.runtimeStyle && a.runtimeStyle[b],
f = a.style;
!bs.test(d) && bt.test(d) && (c = f.left, e && (a.runtimeStyle.left = a.currentStyle.left), f.left = b === "fontSize" ? "1em" : d || 0, d = f.pixelLeft + "px", f.left = c, e && (a.runtimeStyle.left = e));
return d === "" ? "auto" : d
}), bz = bA || bB, f.expr && f.expr.filters && (f.expr.filters.hidden = function(a) {
var b = a.offsetWidth,
c = a.offsetHeight;
return b === 0 && c === 0 || !f.support.reliableHiddenOffsets && (a.style.display || f.css(a, "display")) === "none"
}, f.expr.filters.visible = function(a) {
return !f.expr.filters.hidden(a)
});
var bE = /%20/g,
bF = /\[\]$/,
bG = /\r?\n/g,
bH = /#.*$/,
bI = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg,
bJ = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
bK = /^(?:about|app|app\-storage|.+\-extension|file|widget):$/,
bL = /^(?:GET|HEAD)$/,
bM = /^\/\//,
bN = /\?/,
bO = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
bP = /^(?:select|textarea)/i,
bQ = /\s+/,
bR = /([?&])_=[^&]*/,
bS = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
bT = f.fn.load,
bU = {},
bV = {},
bW, bX;
try {
bW = e.href
} catch (bY) {
bW = c.createElement("a"), bW.href = "", bW = bW.href
}
bX = bS.exec(bW.toLowerCase()) || [], f.fn.extend({
load: function(a, c, d) {
if (typeof a != "string" && bT) return bT.apply(this, arguments);
if (!this.length) return this;
var e = a.indexOf(" ");
if (e >= 0) {
var g = a.slice(e, a.length);
a = a.slice(0, e)
}
var h = "GET";
c && (f.isFunction(c) ? (d = c, c = b) : typeof c == "object" && (c = f.param(c, f.ajaxSettings.traditional), h = "POST"));
var i = this;
f.ajax({
url: a,
type: h,
dataType: "html",
data: c,
complete: function(a, b, c) {
c = a.responseText, a.isResolved() && (a.done(function(a) {
c = a
}), i.html(g ? f("<div>").append(c.replace(bO, "")).find(g) : c)), d && i.each(d, [c, b, a])
}
});
return this
},
serialize: function() {
return f.param(this.serializeArray())
},
serializeArray: function() {
return this.map(function() {
return this.elements ? f.makeArray(this.elements) : this
}).filter(function() {
return this.name && !this.disabled && (this.checked || bP.test(this.nodeName) || bJ.test(this.type))
}).map(function(a, b) {
var c = f(this).val();
return c == null ? null : f.isArray(c) ? f.map(c, function(a, c) {
return {
name: b.name,
value: a.replace(bG, "\r\n")
}
}) : {
name: b.name,
value: c.replace(bG, "\r\n")
}
}).get()
}
}), f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function(a, b) {
f.fn[b] = function(a) {
return this.bind(b, a)
}
}), f.each(["get", "post"], function(a, c) {
f[c] = function(a, d, e, g) {
f.isFunction(d) && (g = g || e, e = d, d = b);
return f.ajax({
type: c,
url: a,
data: d,
success: e,
dataType: g
})
}
}), f.extend({
getScript: function(a, c) {
return f.get(a, b, c, "script")
},
getJSON: function(a, b, c) {
return f.get(a, b, c, "json")
},
ajaxSetup: function(a, b) {
b ? f.extend(!0, a, f.ajaxSettings, b) : (b = a, a = f.extend(!0, f.ajaxSettings, b));
for (var c in {
context: 1,
url: 1
}) c in b ? a[c] = b[c] : c in f.ajaxSettings && (a[c] = f.ajaxSettings[c]);
return a
},
ajaxSettings: {
url: bW,
isLocal: bK.test(bX[1]),
global: !0,
type: "GET",
contentType: "application/x-www-form-urlencoded",
processData: !0,
async: !0,
accepts: {
xml: "application/xml, text/xml",
html: "text/html",
text: "text/plain",
json: "application/json, text/javascript",
"*": "*/*"
},
contents: {
xml: /xml/,
html: /html/,
json: /json/
},
responseFields: {
xml: "responseXML",
text: "responseText"
},
converters: {
"* text": a.String,
"text html": !0,
"text json": f.parseJSON,
"text xml": f.parseXML
}
},
ajaxPrefilter: bZ(bU),
ajaxTransport: bZ(bV),
ajax: function(a, c) {
function w(a, c, l, m) {
if (s !== 2) {
s = 2, q && clearTimeout(q), p = b, n = m || "", v.readyState = a ? 4 : 0;
var o, r, u, w = l ? ca(d, v, l) : b,
x, y;
if (a >= 200 && a < 300 || a === 304) {
if (d.ifModified) {
if (x = v.getResponseHeader("Last-Modified")) f.lastModified[k] = x;
if (y = v.getResponseHeader("Etag")) f.etag[k] = y
}
if (a === 304) c = "notmodified", o = !0;
else try {
r = cb(d, w), c = "success", o = !0
} catch (z) {
c = "parsererror", u = z
}
} else {
u = c;
if (!c || a) c = "error", a < 0 && (a = 0)
}
v.status = a, v.statusText = c, o ? h.resolveWith(e, [r, c, v]) : h.rejectWith(e, [v, c, u]), v.statusCode(j), j = b, t && g.trigger("ajax" + (o ? "Success" : "Error"), [v, d, o ? r : u]), i.resolveWith(e, [v, c]), t && (g.trigger("ajaxComplete", [v, d]), --f.active || f.event.trigger("ajaxStop"))
}
}
typeof a == "object" && (c = a, a = b), c = c || {};
var d = f.ajaxSetup({}, c),
e = d.context || d,
g = e !== d && (e.nodeType || e instanceof f) ? f(e) : f.event,
h = f.Deferred(),
i = f._Deferred(),
j = d.statusCode || {},
k, l = {},
m = {},
n, o, p, q, r, s = 0,
t, u, v = {
readyState: 0,
setRequestHeader: function(a, b) {
if (!s) {
var c = a.toLowerCase();
a = m[c] = m[c] || a, l[a] = b
}
return this
},
getAllResponseHeaders: function() {
return s === 2 ? n : null
},
getResponseHeader: function(a) {
var c;
if (s === 2) {
if (!o) {
o = {};
while (c = bI.exec(n)) o[c[1].toLowerCase()] = c[2]
}
c = o[a.toLowerCase()]
}
return c === b ? null : c
},
overrideMimeType: function(a) {
s || (d.mimeType = a);
return this
},
abort: function(a) {
a = a || "abort", p && p.abort(a), w(0, a);
return this
}
};
h.promise(v), v.success = v.done, v.error = v.fail, v.complete = i.done, v.statusCode = function(a) {
if (a) {
var b;
if (s < 2) for (b in a) j[b] = [j[b], a[b]];
else b = a[v.status], v.then(b, b)
}
return this
}, d.url = ((a || d.url) + "").replace(bH, "").replace(bM, bX[1] + "//"), d.dataTypes = f.trim(d.dataType || "*").toLowerCase().split(bQ), d.crossDomain == null && (r = bS.exec(d.url.toLowerCase()), d.crossDomain = !(!r || r[1] == bX[1] && r[2] == bX[2] && (r[3] || (r[1] === "http:" ? 80 : 443)) == (bX[3] || (bX[1] === "http:" ? 80 : 443)))), d.data && d.processData && typeof d.data != "string" && (d.data = f.param(d.data, d.traditional)), b$(bU, d, c, v);
if (s === 2) return !1;
t = d.global, d.type = d.type.toUpperCase(), d.hasContent = !bL.test(d.type), t && f.active++ === 0 && f.event.trigger("ajaxStart");
if (!d.hasContent) {
d.data && (d.url += (bN.test(d.url) ? "&" : "?") + d.data), k = d.url;
if (d.cache === !1) {
var x = f.now(),
y = d.url.replace(bR, "$1_=" + x);
d.url = y + (y === d.url ? (bN.test(d.url) ? "&" : "?") + "_=" + x : "")
}
}(d.data && d.hasContent && d.contentType !== !1 || c.contentType) && v.setRequestHeader("Content-Type", d.contentType), d.ifModified && (k = k || d.url, f.lastModified[k] && v.setRequestHeader("If-Modified-Since", f.lastModified[k]), f.etag[k] && v.setRequestHeader("If-None-Match", f.etag[k])), v.setRequestHeader("Accept", d.dataTypes[0] && d.accepts[d.dataTypes[0]] ? d.accepts[d.dataTypes[0]] + (d.dataTypes[0] !== "*" ? ", */*; q=0.01" : "") : d.accepts["*"]);
for (u in d.headers) v.setRequestHeader(u, d.headers[u]);
if (d.beforeSend && (d.beforeSend.call(e, v, d) === !1 || s === 2)) {
v.abort();
return !1
}
for (u in {
success: 1,
error: 1,
complete: 1
}) v[u](d[u]);
p = b$(bV, d, c, v);
if (!p) w(-1, "No Transport");
else {
v.readyState = 1, t && g.trigger("ajaxSend", [v, d]), d.async && d.timeout > 0 && (q = setTimeout(function() {
v.abort("timeout")
}, d.timeout));
try {
s = 1, p.send(l, w)
} catch (z) {
status < 2 ? w(-1, z) : f.error(z)
}
}
return v
},
param: function(a, c) {
var d = [],
e = function(a, b) {
b = f.isFunction(b) ? b() : b, d[d.length] = encodeURIComponent(a) + "=" + encodeURIComponent(b)
};
c === b && (c = f.ajaxSettings.traditional);
if (f.isArray(a) || a.jquery && !f.isPlainObject(a)) f.each(a, function() {
e(this.name, this.value)
});
else for (var g in a) b_(g, a[g], c, e);
return d.join("&").replace(bE, "+")
}
}), f.extend({
active: 0,
lastModified: {},
etag: {}
});
var cc = f.now(),
cd = /(\=)\?(&|$)|\?\?/i;
f.ajaxSetup({
jsonp: "callback",
jsonpCallback: function() {
return f.expando + "_" + cc++
}
}), f.ajaxPrefilter("json jsonp", function(b, c, d) {
var e = b.contentType === "application/x-www-form-urlencoded" && typeof b.data == "string";
if (b.dataTypes[0] === "jsonp" || b.jsonp !== !1 && (cd.test(b.url) || e && cd.test(b.data))) {
var g, h = b.jsonpCallback = f.isFunction(b.jsonpCallback) ? b.jsonpCallback() : b.jsonpCallback,
i = a[h],
j = b.url,
k = b.data,
l = "$1" + h + "$2";
b.jsonp !== !1 && (j = j.replace(cd, l), b.url === j && (e && (k = k.replace(cd, l)), b.data === k && (j += (/\?/.test(j) ? "&" : "?") + b.jsonp + "=" + h))), b.url = j, b.data = k, a[h] = function(a) {
g = [a]
}, d.always(function() {
a[h] = i, g && f.isFunction(i) && a[h](g[0])
}), b.converters["script json"] = function() {
g || f.error(h + " was not called");
return g[0]
}, b.dataTypes[0] = "json";
return "script"
}
}), f.ajaxSetup({
accepts: {
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
},
contents: {
script: /javascript|ecmascript/
},
converters: {
"text script": function(a) {
f.globalEval(a);
return a
}
}
}), f.ajaxPrefilter("script", function(a) {
a.cache === b && (a.cache = !1), a.crossDomain && (a.type = "GET", a.global = !1)
}), f.ajaxTransport("script", function(a) {
if (a.crossDomain) {
var d, e = c.head || c.getElementsByTagName("head")[0] || c.documentElement;
return {
send: function(f, g) {
d = c.createElement("script"), d.async = "async", a.scriptCharset && (d.charset = a.scriptCharset), d.src = a.url, d.onload = d.onreadystatechange = function(a, c) {
if (c || !d.readyState || /loaded|complete/.test(d.readyState)) d.onload = d.onreadystatechange = null, e && d.parentNode && e.removeChild(d), d = b, c || g(200, "success")
}, e.insertBefore(d, e.firstChild)
},
abort: function() {
d && d.onload(0, 1)
}
}
}
});
var ce = a.ActiveXObject ?
function() {
for (var a in cg) cg[a](0, 1)
} : !1, cf = 0, cg;
f.ajaxSettings.xhr = a.ActiveXObject ?
function() {
return !this.isLocal && ch() || ci()
} : ch, function(a) {
f.extend(f.support, {
ajax: !! a,
cors: !! a && "withCredentials" in a
})
}(f.ajaxSettings.xhr()), f.support.ajax && f.ajaxTransport(function(c) {
if (!c.crossDomain || f.support.cors) {
var d;
return {
send: function(e, g) {
var h = c.xhr(),
i, j;
c.username ? h.open(c.type, c.url, c.async, c.username, c.password) : h.open(c.type, c.url, c.async);
if (c.xhrFields) for (j in c.xhrFields) h[j] = c.xhrFields[j];
c.mimeType && h.overrideMimeType && h.overrideMimeType(c.mimeType), !c.crossDomain && !e["X-Requested-With"] && (e["X-Requested-With"] = "XMLHttpRequest");
try {
for (j in e) h.setRequestHeader(j, e[j])
} catch (k) {}
h.send(c.hasContent && c.data || null), d = function(a, e) {
var j, k, l, m, n;
try {
if (d && (e || h.readyState === 4)) {
d = b, i && (h.onreadystatechange = f.noop, ce && delete cg[i]);
if (e) h.readyState !== 4 && h.abort();
else {
j = h.status, l = h.getAllResponseHeaders(), m = {}, n = h.responseXML, n && n.documentElement && (m.xml = n), m.text = h.responseText;
try {
k = h.statusText
} catch (o) {
k = ""
}!j && c.isLocal && !c.crossDomain ? j = m.text ? 200 : 404 : j === 1223 && (j = 204)
}
}
} catch (p) {
e || g(-1, p)
}
m && g(j, k, m, l)
}, !c.async || h.readyState === 4 ? d() : (i = ++cf, ce && (cg || (cg = {}, f(a).unload(ce)), cg[i] = d), h.onreadystatechange = d)
},
abort: function() {
d && d(0, 1)
}
}
}
});
var cj = {},
ck, cl, cm = /^(?:toggle|show|hide)$/,
cn = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
co, cp = [
["height", "marginTop", "marginBottom", "paddingTop", "paddingBottom"],
["width", "marginLeft", "marginRight", "paddingLeft", "paddingRight"],
["opacity"]
],
cq, cr = a.webkitRequestAnimationFrame || a.mozRequestAnimationFrame || a.oRequestAnimationFrame;
f.fn.extend({
show: function(a, b, c) {
var d, e;
if (a || a === 0) return this.animate(cu("show", 3), a, b, c);
for (var g = 0, h = this.length; g < h; g++) d = this[g], d.style && (e = d.style.display, !f._data(d, "olddisplay") && e === "none" && (e = d.style.display = ""), e === "" && f.css(d, "display") === "none" && f._data(d, "olddisplay", cv(d.nodeName)));
for (g = 0; g < h; g++) {
d = this[g];
if (d.style) {
e = d.style.display;
if (e === "" || e === "none") d.style.display = f._data(d, "olddisplay") || ""
}
}
return this
},
hide: function(a, b, c) {
if (a || a === 0) return this.animate(cu("hide", 3), a, b, c);
for (var d = 0, e = this.length; d < e; d++) if (this[d].style) {
var g = f.css(this[d], "display");
g !== "none" && !f._data(this[d], "olddisplay") && f._data(this[d], "olddisplay", g)
}
for (d = 0; d < e; d++) this[d].style && (this[d].style.display = "none");
return this
},
_toggle: f.fn.toggle,
toggle: function(a, b, c) {
var d = typeof a == "boolean";
f.isFunction(a) && f.isFunction(b) ? this._toggle.apply(this, arguments) : a == null || d ? this.each(function() {
var b = d ? a : f(this).is(":hidden");
f(this)[b ? "show" : "hide"]()
}) : this.animate(cu("toggle", 3), a, b, c);
return this
},
fadeTo: function(a, b, c, d) {
return this.filter(":hidden").css("opacity", 0).show().end().animate({
opacity: b
}, a, c, d)
},
animate: function(a, b, c, d) {
var e = f.speed(b, c, d);
if (f.isEmptyObject(a)) return this.each(e.complete, [!1]);
a = f.extend({}, a);
return this[e.queue === !1 ? "each" : "queue"](function() {
e.queue === !1 && f._mark(this);
var b = f.extend({}, e),
c = this.nodeType === 1,
d = c && f(this).is(":hidden"),
g, h, i, j, k, l, m, n, o;
b.animatedProperties = {};
for (i in a) {
g = f.camelCase(i), i !== g && (a[g] = a[i], delete a[i]), h = a[g], f.isArray(h) ? (b.animatedProperties[g] = h[1], h = a[g] = h[0]) : b.animatedProperties[g] = b.specialEasing && b.specialEasing[g] || b.easing || "swing";
if (h === "hide" && d || h === "show" && !d) return b.complete.call(this);
c && (g === "height" || g === "width") && (b.overflow = [this.style.overflow, this.style.overflowX, this.style.overflowY], f.css(this, "display") === "inline" && f.css(this, "float") === "none" && (f.support.inlineBlockNeedsLayout ? (j = cv(this.nodeName), j === "inline" ? this.style.display = "inline-block" : (this.style.display = "inline", this.style.zoom = 1)) : this.style.display = "inline-block"))
}
b.overflow != null && (this.style.overflow = "hidden");
for (i in a) k = new f.fx(this, b, i), h = a[i], cm.test(h) ? k[h === "toggle" ? d ? "show" : "hide" : h]() : (l = cn.exec(h), m = k.cur(), l ? (n = parseFloat(l[2]), o = l[3] || (f.cssNumber[i] ? "" : "px"), o !== "px" && (f.style(this, i, (n || 1) + o), m = (n || 1) / k.cur() * m, f.style(this, i, m + o)), l[1] && (n = (l[1] === "-=" ? -1 : 1) * n + m), k.custom(m, n, o)) : k.custom(m, h, ""));
return !0
})
},
stop: function(a, b) {
a && this.queue([]), this.each(function() {
var a = f.timers,
c = a.length;
b || f._unmark(!0, this);
while (c--) a[c].elem === this && (b && a[c](!0), a.splice(c, 1))
}), b || this.dequeue();
return this
}
}), f.each({
slideDown: cu("show", 1),
slideUp: cu("hide", 1),
slideToggle: cu("toggle", 1),
fadeIn: {
opacity: "show"
},
fadeOut: {
opacity: "hide"
},
fadeToggle: {
opacity: "toggle"
}
}, function(a, b) {
f.fn[a] = function(a, c, d) {
return this.animate(b, a, c, d)
}
}), f.extend({
speed: function(a, b, c) {
var d = a && typeof a == "object" ? f.extend({}, a) : {
complete: c || !c && b || f.isFunction(a) && a,
duration: a,
easing: c && b || b && !f.isFunction(b) && b
};
d.duration = f.fx.off ? 0 : typeof d.duration == "number" ? d.duration : d.duration in f.fx.speeds ? f.fx.speeds[d.duration] : f.fx.speeds._default, d.old = d.complete, d.complete = function(a) {
d.queue !== !1 ? f.dequeue(this) : a !== !1 && f._unmark(this), f.isFunction(d.old) && d.old.call(this)
};
return d
},
easing: {
linear: function(a, b, c, d) {
return c + d * a
},
swing: function(a, b, c, d) {
return (-Math.cos(a * Math.PI) / 2 + .5) * d + c
}
},
timers: [],
fx: function(a, b, c) {
this.options = b, this.elem = a, this.prop = c, b.orig = b.orig || {}
}
}), f.fx.prototype = {
update: function() {
this.options.step && this.options.step.call(this.elem, this.now, this), (f.fx.step[this.prop] || f.fx.step._default)(this)
},
cur: function() {
if (this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null)) return this.elem[this.prop];
var a, b = f.css(this.elem, this.prop);
return isNaN(a = parseFloat(b)) ? !b || b === "auto" ? 0 : b : a
},
custom: function(a, b, c) {
function h(a) {
return d.step(a)
}
var d = this,
e = f.fx,
g;
this.startTime = cq || cs(), this.start = a, this.end = b, this.unit = c || this.unit || (f.cssNumber[this.prop] ? "" : "px"), this.now = this.start, this.pos = this.state = 0, h.elem = this.elem, h() && f.timers.push(h) && !co && (cr ? (co = 1, g = function() {
co && (cr(g), e.tick())
}, cr(g)) : co = setInterval(e.tick, e.interval))
},
show: function() {
this.options.orig[this.prop] = f.style(this.elem, this.prop), this.options.show = !0, this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur()), f(this.elem).show()
},
hide: function() {
this.options.orig[this.prop] = f.style(this.elem, this.prop), this.options.hide = !0, this.custom(this.cur(), 0)
},
step: function(a) {
var b = cq || cs(),
c = !0,
d = this.elem,
e = this.options,
g, h;
if (a || b >= e.duration + this.startTime) {
this.now = this.end, this.pos = this.state = 1, this.update(), e.animatedProperties[this.prop] = !0;
for (g in e.animatedProperties) e.animatedProperties[g] !== !0 && (c = !1);
if (c) {
e.overflow != null && !f.support.shrinkWrapBlocks && f.each(["", "X", "Y"], function(a, b) {
d.style["overflow" + b] = e.overflow[a]
}), e.hide && f(d).hide();
if (e.hide || e.show) for (var i in e.animatedProperties) f.style(d, i, e.orig[i]);
e.complete.call(d)
}
return !1
}
e.duration == Infinity ? this.now = b : (h = b - this.startTime, this.state = h / e.duration, this.pos = f.easing[e.animatedProperties[this.prop]](this.state, h, 0, 1, e.duration), this.now = this.start + (this.end - this.start) * this.pos), this.update();
return !0
}
}, f.extend(f.fx, {
tick: function() {
for (var a = f.timers, b = 0; b < a.length; ++b) a[b]() || a.splice(b--, 1);
a.length || f.fx.stop()
},
interval: 13,
stop: function() {
clearInterval(co), co = null
},
speeds: {
slow: 600,
fast: 200,
_default: 400
},
step: {
opacity: function(a) {
f.style(a.elem, "opacity", a.now)
},
_default: function(a) {
a.elem.style && a.elem.style[a.prop] != null ? a.elem.style[a.prop] = (a.prop === "width" || a.prop === "height" ? Math.max(0, a.now) : a.now) + a.unit : a.elem[a.prop] = a.now
}
}
}), f.expr && f.expr.filters && (f.expr.filters.animated = function(a) {
return f.grep(f.timers, function(b) {
return a === b.elem
}).length
});
var cw = /^t(?:able|d|h)$/i,
cx = /^(?:body|html)$/i;
"getBoundingClientRect" in c.documentElement ? f.fn.offset = function(a) {
var b = this[0],
c;
if (a) return this.each(function(b) {
f.offset.setOffset(this, a, b)
});
if (!b || !b.ownerDocument) return null;
if (b === b.ownerDocument.body) return f.offset.bodyOffset(b);
try {
c = b.getBoundingClientRect()
} catch (d) {}
var e = b.ownerDocument,
g = e.documentElement;
if (!c || !f.contains(g, b)) return c ? {
top: c.top,
left: c.left
} : {
top: 0,
left: 0
};
var h = e.body,
i = cy(e),
j = g.clientTop || h.clientTop || 0,
k = g.clientLeft || h.clientLeft || 0,
l = i.pageYOffset || f.support.boxModel && g.scrollTop || h.scrollTop,
m = i.pageXOffset || f.support.boxModel && g.scrollLeft || h.scrollLeft,
n = c.top + l - j,
o = c.left + m - k;
return {
top: n,
left: o
}
} : f.fn.offset = function(a) {
var b = this[0];
if (a) return this.each(function(b) {
f.offset.setOffset(this, a, b)
});
if (!b || !b.ownerDocument) return null;
if (b === b.ownerDocument.body) return f.offset.bodyOffset(b);
f.offset.initialize();
var c, d = b.offsetParent,
e = b,
g = b.ownerDocument,
h = g.documentElement,
i = g.body,
j = g.defaultView,
k = j ? j.getComputedStyle(b, null) : b.currentStyle,
l = b.offsetTop,
m = b.offsetLeft;
while ((b = b.parentNode) && b !== i && b !== h) {
if (f.offset.supportsFixedPosition && k.position === "fixed") break;
c = j ? j.getComputedStyle(b, null) : b.currentStyle, l -= b.scrollTop, m -= b.scrollLeft, b === d && (l += b.offsetTop, m += b.offsetLeft, f.offset.doesNotAddBorder && (!f.offset.doesAddBorderForTableAndCells || !cw.test(b.nodeName)) && (l += parseFloat(c.borderTopWidth) || 0, m += parseFloat(c.borderLeftWidth) || 0), e = d, d = b.offsetParent), f.offset.subtractsBorderForOverflowNotVisible && c.overflow !== "visible" && (l += parseFloat(c.borderTopWidth) || 0, m += parseFloat(c.borderLeftWidth) || 0), k = c
}
if (k.position === "relative" || k.position === "static") l += i.offsetTop, m += i.offsetLeft;
f.offset.supportsFixedPosition && k.position === "fixed" && (l += Math.max(h.scrollTop, i.scrollTop), m += Math.max(h.scrollLeft, i.scrollLeft));
return {
top: l,
left: m
}
}, f.offset = {
initialize: function() {
var a = c.body,
b = c.createElement("div"),
d, e, g, h, i = parseFloat(f.css(a, "marginTop")) || 0,
j = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
f.extend(b.style, {
position: "absolute",
top: 0,
left: 0,
margin: 0,
border: 0,
width: "1px",
height: "1px",
visibility: "hidden"
}), b.innerHTML = j, a.insertBefore(b, a.firstChild), d = b.firstChild, e = d.firstChild, h = d.nextSibling.firstChild.firstChild, this.doesNotAddBorder = e.offsetTop !== 5, this.doesAddBorderForTableAndCells = h.offsetTop === 5, e.style.position = "fixed", e.style.top = "20px", this.supportsFixedPosition = e.offsetTop === 20 || e.offsetTop === 15, e.style.position = e.style.top = "", d.style.overflow = "hidden", d.style.position = "relative", this.subtractsBorderForOverflowNotVisible = e.offsetTop === -5, this.doesNotIncludeMarginInBodyOffset = a.offsetTop !== i, a.removeChild(b), f.offset.initialize = f.noop
},
bodyOffset: function(a) {
var b = a.offsetTop,
c = a.offsetLeft;
f.offset.initialize(), f.offset.doesNotIncludeMarginInBodyOffset && (b += parseFloat(f.css(a, "marginTop")) || 0, c += parseFloat(f.css(a, "marginLeft")) || 0);
return {
top: b,
left: c
}
},
setOffset: function(a, b, c) {
var d = f.css(a, "position");
d === "static" && (a.style.position = "relative");
var e = f(a),
g = e.offset(),
h = f.css(a, "top"),
i = f.css(a, "left"),
j = (d === "absolute" || d === "fixed") && f.inArray("auto", [h, i]) > -1,
k = {},
l = {},
m, n;
j ? (l = e.position(), m = l.top, n = l.left) : (m = parseFloat(h) || 0, n = parseFloat(i) || 0), f.isFunction(b) && (b = b.call(a, c, g)), b.top != null && (k.top = b.top - g.top + m), b.left != null && (k.left = b.left - g.left + n), "using" in b ? b.using.call(a, k) : e.css(k)
}
}, f.fn.extend({
position: function() {
if (!this[0]) return null;
var a = this[0],
b = this.offsetParent(),
c = this.offset(),
d = cx.test(b[0].nodeName) ? {
top: 0,
left: 0
} : b.offset();
c.top -= parseFloat(f.css(a, "marginTop")) || 0, c.left -= parseFloat(f.css(a, "marginLeft")) || 0, d.top += parseFloat(f.css(b[0], "borderTopWidth")) || 0, d.left += parseFloat(f.css(b[0], "borderLeftWidth")) || 0;
return {
top: c.top - d.top,
left: c.left - d.left
}
},
offsetParent: function() {
return this.map(function() {
var a = this.offsetParent || c.body;
while (a && !cx.test(a.nodeName) && f.css(a, "position") === "static") a = a.offsetParent;
return a
})
}
}), f.each(["Left", "Top"], function(a, c) {
var d = "scroll" + c;
f.fn[d] = function(c) {
var e, g;
if (c === b) {
e = this[0];
if (!e) return null;
g = cy(e);
return g ? "pageXOffset" in g ? g[a ? "pageYOffset" : "pageXOffset"] : f.support.boxModel && g.document.documentElement[d] || g.document.body[d] : e[d]
}
return this.each(function() {
g = cy(this), g ? g.scrollTo(a ? f(g).scrollLeft() : c, a ? c : f(g).scrollTop()) : this[d] = c
})
}
}), f.each(["Height", "Width"], function(a, c) {
var d = c.toLowerCase();
f.fn["inner" + c] = function() {
return this[0] ? parseFloat(f.css(this[0], d, "padding")) : null
}, f.fn["outer" + c] = function(a) {
return this[0] ? parseFloat(f.css(this[0], d, a ? "margin" : "border")) : null
}, f.fn[d] = function(a) {
var e = this[0];
if (!e) return a == null ? null : this;
if (f.isFunction(a)) return this.each(function(b) {
var c = f(this);
c[d](a.call(this, b, c[d]()))
});
if (f.isWindow(e)) {
var g = e.document.documentElement["client" + c];
return e.document.compatMode === "CSS1Compat" && g || e.document.body["client" + c] || g
}
if (e.nodeType === 9) return Math.max(e.documentElement["client" + c], e.body["scroll" + c], e.documentElement["scroll" + c], e.body["offset" + c], e.documentElement["offset" + c]);
if (a === b) {
var h = f.css(e, d),
i = parseFloat(h);
return f.isNaN(i) ? h : i
}
return this.css(d, typeof a == "string" ? a : a + "px")
}
}), a.jQuery = a.$ = f
})(window);
(function(b) {
var m, t, u, f, D, j, E, n, z, A, q = 0,
e = {},
o = [],
p = 0,
d = {},
l = [],
G = null,
v = new Image,
J = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,
W = /[^\.]\.(swf)\s*$/i,
K, L = 1,
y = 0,
s = "",
r, i, h = false,
B = b.extend(b("<div/>")[0], {
prop: 0
}),
M = b.browser.msie && b.browser.version < 7 && !window.XMLHttpRequest,
N = function() {
t.hide();
v.onerror = v.onload = null;
G && G.abort();
m.empty()
},
O = function() {
if (false === e.onError(o, q, e)) {
t.hide();
h = false
} else {
e.titleShow = false;
e.width = "auto";
e.height = "auto";
m.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');
F()
}
},
I = function() {
var a = o[q],
c, g, k, C, P, w;
N();
e = b.extend({}, b.fn.fancybox.defaults, typeof b(a).data("fancybox") == "undefined" ? e : b(a).data("fancybox"));
w = e.onStart(o, q, e);
if (w === false) h = false;
else {
if (typeof w == "object") e = b.extend(e, w);
k = e.title || (a.nodeName ? b(a).attr("title") : a.title) || "";
if (a.nodeName && !e.orig) e.orig = b(a).children("img:first").length ? b(a).children("img:first") : b(a);
if (k === "" && e.orig && e.titleFromAlt) k = e.orig.attr("alt");
c = e.href || (a.nodeName ? b(a).attr("href") : a.href) || null;
if (/^(?:javascript)/i.test(c) || c == "#") c = null;
if (e.type) {
g = e.type;
if (!c) c = e.content
} else if (e.content) g = "html";
else if (c) g = c.match(J) ? "image" : c.match(W) ? "swf" : b(a).hasClass("iframe") ? "iframe" : c.indexOf("#") === 0 ? "inline" : "ajax";
if (g) {
if (g == "inline") {
a = c.substr(c.indexOf("#"));
g = b(a).length > 0 ? "inline" : "ajax"
}
e.type = g;
e.href = c;
e.title = k;
if (e.autoDimensions) if (e.type == "html" || e.type == "inline" || e.type == "ajax") {
e.width = "auto";
e.height = "auto"
} else e.autoDimensions = false;
if (e.modal) {
e.overlayShow = true;
e.hideOnOverlayClick = false;
e.hideOnContentClick = false;
e.enableEscapeButton = false;
e.showCloseButton = false
}
e.padding = parseInt(e.padding, 10);
e.margin = parseInt(e.margin, 10);
m.css("padding", e.padding + e.margin);
b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change", function() {
b(this).replaceWith(j.children())
});
switch (g) {
case "html":
m.html(e.content);
F();
break;
case "inline":
if (b(a).parent().is("#fancybox-content") === true) {
h = false;
break
}
b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup", function() {
b(this).replaceWith(j.children())
}).bind("fancybox-cancel", function() {
b(this).replaceWith(m.children())
});
b(a).appendTo(m);
F();
break;
case "image":
h = false;
b.fancybox.showActivity();
v = new Image;
v.onerror = function() {
O()
};
v.onload = function() {
h = true;
v.onerror = v.onload = null;
e.width = v.width;
e.height = v.height;
b("<img />").attr({
id: "fancybox-img",
src: v.src,
alt: e.title
}).appendTo(m);
Q()
};
v.src = c;
break;
case "swf":
e.scrolling = "no";
C = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + e.width + '" height="' + e.height + '"><param name="movie" value="' + c + '"></param>';
P = "";
b.each(e.swf, function(x, H) {
C += '<param name="' + x + '" value="' + H + '"></param>';
P += " " + x + '="' + H + '"'
});
C += '<embed src="' + c + '" type="application/x-shockwave-flash" width="' + e.width + '" height="' + e.height + '"' + P + "></embed></object>";
m.html(C);
F();
break;
case "ajax":
h = false;
b.fancybox.showActivity();
e.ajax.win = e.ajax.success;
G = b.ajax(b.extend({}, e.ajax, {
url: c,
data: e.ajax.data || {},
error: function(x) {
x.status > 0 && O()
},
success: function(x, H, R) {
if ((typeof R == "object" ? R : G).status == 200) {
if (typeof e.ajax.win == "function") {
w = e.ajax.win(c, x, H, R);
if (w === false) {
t.hide();
return
} else if (typeof w == "string" || typeof w == "object") x = w
}
m.html(x);
F()
}
}
}));
break;
case "iframe":
Q()
}
} else O()
}
},
F = function() {
var a = e.width,
c = e.height;
a = a.toString().indexOf("%") > -1 ? parseInt((b(window).width() - e.margin * 2) * parseFloat(a) / 100, 10) + "px" : a == "auto" ? "auto" : a + "px";
c = c.toString().indexOf("%") > -1 ? parseInt((b(window).height() - e.margin * 2) * parseFloat(c) / 100, 10) + "px" : c == "auto" ? "auto" : c + "px";
m.wrapInner('<div style="width:' + a + ";height:" + c + ";overflow: " + (e.scrolling == "auto" ? "auto" : e.scrolling == "yes" ? "scroll" : "hidden") + ';position:relative;"></div>');
e.width = m.width();
e.height = m.height();
Q()
},
Q = function() {
var a, c;
t.hide();
if (f.is(":visible") && false === d.onCleanup(l, p, d)) {
b.event.trigger("fancybox-cancel");
h = false
} else {
h = true;
b(j.add(u)).unbind();
b(window).unbind("resize.fb scroll.fb");
b(document).unbind("keydown.fb");
f.is(":visible") && d.titlePosition !== "outside" && f.css("height", f.height());
l = o;
p = q;
d = e;
if (d.overlayShow) {
u.css({
"background-color": d.overlayColor,
opacity: d.overlayOpacity,
cursor: d.hideOnOverlayClick ? "pointer" : "auto",
height: b(document).height()
});
if (!u.is(":visible")) {
M && b("select:not(#fancybox-tmp select)").filter(function() {
return this.style.visibility !== "hidden"
}).css({
visibility: "hidden"
}).one("fancybox-cleanup", function() {
this.style.visibility = "inherit"
});
u.show()
}
} else u.hide();
i = X();
s = d.title || "";
y = 0;
n.empty().removeAttr("style").removeClass();
if (d.titleShow !== false) {
if (b.isFunction(d.titleFormat)) a = d.titleFormat(s, l, p, d);
else a = s && s.length ? d.titlePosition == "float" ? '<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">' + s + '</td><td id="fancybox-title-float-right"></td></tr></table>' : '<div id="fancybox-title-' + d.titlePosition + '">' + s + "</div>" : false;
s = a;
if (!(!s || s === "")) {
n.addClass("fancybox-title-" + d.titlePosition).html(s).appendTo("body").show();
switch (d.titlePosition) {
case "inside":
n.css({
width: i.width - d.padding * 2,
marginLeft: d.padding,
marginRight: d.padding
});
y = n.outerHeight(true);
n.appendTo(D);
i.height += y;
break;
case "over":
n.css({
marginLeft: d.padding,
width: i.width - d.padding * 2,
bottom: d.padding
}).appendTo(D);
break;
case "float":
n.css("left", parseInt((n.width() - i.width - 40) / 2, 10) * -1).appendTo(f);
break;
default:
n.css({
width: i.width - d.padding * 2,
paddingLeft: d.padding,
paddingRight: d.padding
}).appendTo(f)
}
}
}
n.hide();
if (f.is(":visible")) {
b(E.add(z).add(A)).hide();
a = f.position();
r = {
top: a.top,
left: a.left,
width: f.width(),
height: f.height()
};
c = r.width == i.width && r.height == i.height;
j.fadeTo(d.changeFade, 0.3, function() {
var g = function() {
j.html(m.contents()).fadeTo(d.changeFade, 1, S)
};
b.event.trigger("fancybox-change");
j.empty().removeAttr("filter").css({
"border-width": d.padding,
width: i.width - d.padding * 2,
height: e.autoDimensions ? "auto" : i.height - y - d.padding * 2
});
if (c) g();
else {
B.prop = 0;
b(B).animate({
prop: 1
}, {
duration: d.changeSpeed,
easing: d.easingChange,
step: T,
complete: g
})
}
})
} else {
f.removeAttr("style");
j.css("border-width", d.padding);
if (d.transitionIn == "elastic") {
r = V();
j.html(m.contents());
f.show();
if (d.opacity) i.opacity = 0;
B.prop = 0;
b(B).animate({
prop: 1
}, {
duration: d.speedIn,
easing: d.easingIn,
step: T,
complete: S
})
} else {
d.titlePosition == "inside" && y > 0 && n.show();
j.css({
width: i.width - d.padding * 2,
height: e.autoDimensions ? "auto" : i.height - y - d.padding * 2
}).html(m.contents());
f.css(i).fadeIn(d.transitionIn == "none" ? 0 : d.speedIn, S)
}
}
}
},
Y = function() {
if (d.enableEscapeButton || d.enableKeyboardNav) b(document).bind("keydown.fb", function(a) {
if (a.keyCode == 27 && d.enableEscapeButton) {
a.preventDefault();
b.fancybox.close()
} else if ((a.keyCode == 37 || a.keyCode == 39) && d.enableKeyboardNav && a.target.tagName !== "INPUT" && a.target.tagName !== "TEXTAREA" && a.target.tagName !== "SELECT") {
a.preventDefault();
b.fancybox[a.keyCode == 37 ? "prev" : "next"]()
}
});
if (d.showNavArrows) {
if (d.cyclic && l.length > 1 || p !== 0) z.show();
if (d.cyclic && l.length > 1 || p != l.length - 1) A.show()
} else {
z.hide();
A.hide()
}
},
S = function() {
if (!b.support.opacity) {
j.get(0).style.removeAttribute("filter");
f.get(0).style.removeAttribute("filter")
}
e.autoDimensions && j.css("height", "auto");
f.css("height", "auto");
s && s.length && n.show();
d.showCloseButton && E.show();
Y();
d.hideOnContentClick && j.bind("click", b.fancybox.close);
d.hideOnOverlayClick && u.bind("click", b.fancybox.close);
b(window).bind("resize.fb", b.fancybox.resize);
d.centerOnScroll && b(window).bind("scroll.fb", b.fancybox.center);
if (d.type == "iframe") b('<iframe id="fancybox-frame" name="fancybox-frame' + (new Date).getTime() + '" frameborder="0" hspace="0" ' + (b.browser.msie ? 'allowtransparency="true""' : "") + ' scrolling="' + e.scrolling + '" src="' + d.href + '"></iframe>').appendTo(j);
f.show();
h = false;
b.fancybox.center();
d.onComplete(l, p, d);
var a, c;
if (l.length - 1 > p) {
a = l[p + 1].href;
if (typeof a !== "undefined" && a.match(J)) {
c = new Image;
c.src = a
}
}
if (p > 0) {
a = l[p - 1].href;
if (typeof a !== "undefined" && a.match(J)) {
c = new Image;
c.src = a
}
}
},
T = function(a) {
var c = {
width: parseInt(r.width + (i.width - r.width) * a, 10),
height: parseInt(r.height + (i.height - r.height) * a, 10),
top: parseInt(r.top + (i.top - r.top) * a, 10),
left: parseInt(r.left + (i.left - r.left) * a, 10)
};
if (typeof i.opacity !== "undefined") c.opacity = a < 0.5 ? 0.5 : a;
f.css(c);
j.css({
width: c.width - d.padding * 2,
height: c.height - y * a - d.padding * 2
})
},
U = function() {
return [b(window).width() - d.margin * 2, b(window).height() - d.margin * 2, b(document).scrollLeft() + d.margin, b(document).scrollTop() + d.margin]
},
X = function() {
var a = U(),
c = {},
g = d.autoScale,
k = d.padding * 2;
c.width = d.width.toString().indexOf("%") > -1 ? parseInt(a[0] * parseFloat(d.width) / 100, 10) : d.width + k;
c.height = d.height.toString().indexOf("%") > -1 ? parseInt(a[1] * parseFloat(d.height) / 100, 10) : d.height + k;
if (g && (c.width > a[0] || c.height > a[1])) if (e.type == "image" || e.type == "swf") {
g = d.width / d.height;
if (c.width > a[0]) {
c.width = a[0];
c.height = parseInt((c.width - k) / g + k, 10)
}
if (c.height > a[1]) {
c.height = a[1];
c.width = parseInt((c.height - k) * g + k, 10)
}
} else {
c.width = Math.min(c.width, a[0]);
c.height = Math.min(c.height, a[1])
}
c.top = parseInt(Math.max(a[3] - 20, a[3] + (a[1] - c.height - 40) * 0.5), 10);
c.left = parseInt(Math.max(a[2] - 20, a[2] + (a[0] - c.width - 40) * 0.5), 10);
return c
},
V = function() {
var a = e.orig ? b(e.orig) : false,
c = {};
if (a && a.length) {
c = a.offset();
c.top += parseInt(a.css("paddingTop"), 10) || 0;
c.left += parseInt(a.css("paddingLeft"), 10) || 0;
c.top += parseInt(a.css("border-top-width"), 10) || 0;
c.left += parseInt(a.css("border-left-width"), 10) || 0;
c.width = a.width();
c.height = a.height();
c = {
width: c.width + d.padding * 2,
height: c.height + d.padding * 2,
top: c.top - d.padding - 20,
left: c.left - d.padding - 20
}
} else {
a = U();
c = {
width: d.padding * 2,
height: d.padding * 2,
top: parseInt(a[3] + a[1] * 0.5, 10),
left: parseInt(a[2] + a[0] * 0.5, 10)
}
}
return c
},
Z = function() {
if (t.is(":visible")) {
b("div", t).css("top", L * -40 + "px");
L = (L + 1) % 12
} else clearInterval(K)
};
b.fn.fancybox = function(a) {
if (!b(this).length) return this;
b(this).data("fancybox", b.extend({}, a, b.metadata ? b(this).metadata() : {})).unbind("click.fb").bind("click.fb", function(c) {
c.preventDefault();
if (!h) {
h = true;
b(this).blur();
o = [];
q = 0;
c = b(this).attr("rel") || "";
if (!c || c == "" || c === "nofollow") o.push(this);
else {
o = b("a[rel=" + c + "], area[rel=" + c + "]");
q = o.index(this)
}
I()
}
});
return this
};
b.fancybox = function(a, c) {
var g;
if (!h) {
h = true;
g = typeof c !== "undefined" ? c : {};
o = [];
q = parseInt(g.index, 10) || 0;
if (b.isArray(a)) {
for (var k = 0, C = a.length; k < C; k++) if (typeof a[k] == "object") b(a[k]).data("fancybox", b.extend({}, g, a[k]));
else a[k] = b({}).data("fancybox", b.extend({
content: a[k]
}, g));
o = jQuery.merge(o, a)
} else {
if (typeof a == "object") b(a).data("fancybox", b.extend({}, g, a));
else a = b({}).data("fancybox", b.extend({
content: a
}, g));
o.push(a)
}
if (q > o.length || q < 0) q = 0;
I()
}
};
b.fancybox.showActivity = function() {
clearInterval(K);
t.show();
K = setInterval(Z, 66)
};
b.fancybox.hideActivity = function() {
t.hide()
};
b.fancybox.next = function() {
return b.fancybox.pos(p + 1)
};
b.fancybox.prev = function() {
return b.fancybox.pos(p - 1)
};
b.fancybox.pos = function(a) {
if (!h) {
a = parseInt(a);
o = l;
if (a > -1 && a < l.length) {
q = a;
I()
} else if (d.cyclic && l.length > 1) {
q = a >= l.length ? 0 : l.length - 1;
I()
}
}
};
b.fancybox.cancel = function() {
if (!h) {
h = true;
b.event.trigger("fancybox-cancel");
N();
e.onCancel(o, q, e);
h = false
}
};
b.fancybox.close = function() {
function a() {
u.fadeOut("fast");
n.empty().hide();
f.hide();
b.event.trigger("fancybox-cleanup");
j.empty();
d.onClosed(l, p, d);
l = e = [];
p = q = 0;
d = e = {};
h = false
}
if (!(h || f.is(":hidden"))) {
h = true;
if (d && false === d.onCleanup(l, p, d)) h = false;
else {
N();
b(E.add(z).add(A)).hide();
b(j.add(u)).unbind();
b(window).unbind("resize.fb scroll.fb");
b(document).unbind("keydown.fb");
j.find("iframe").attr("src", M && /^https/i.test(window.location.href || "") ? "javascript:void(false)" : "about:blank");
d.titlePosition !== "inside" && n.empty();
f.stop();
if (d.transitionOut == "elastic") {
r = V();
var c = f.position();
i = {
top: c.top,
left: c.left,
width: f.width(),
height: f.height()
};
if (d.opacity) i.opacity = 1;
n.empty().hide();
B.prop = 1;
b(B).animate({
prop: 0
}, {
duration: d.speedOut,
easing: d.easingOut,
step: T,
complete: a
})
} else f.fadeOut(d.transitionOut == "none" ? 0 : d.speedOut, a)
}
}
};
b.fancybox.resize = function() {
u.is(":visible") && u.css("height", b(document).height());
b.fancybox.center(true)
};
b.fancybox.center = function(a) {
var c, g;
if (!h) {
g = a === true ? 1 : 0;
c = U();
!g && (f.width() > c[0] || f.height() > c[1]) || f.stop().animate({
top: parseInt(Math.max(c[3] - 20, c[3] + (c[1] - j.height() - 40) * 0.5 - d.padding)),
left: parseInt(Math.max(c[2] - 20, c[2] + (c[0] - j.width() - 40) * 0.5 - d.padding))
}, typeof a == "number" ? a : 200)
}
};
b.fancybox.init = function() {
if (!b("#fancybox-wrap").length) {
b("body").append(m = b('<div id="fancybox-tmp"></div>'), t = b('<div id="fancybox-loading"><div></div></div>'), u = b('<div id="fancybox-overlay"></div>'), f = b('<div id="fancybox-wrap"></div>'));
D = b('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(f);
D.append(j = b('<div id="fancybox-content"></div>'), E = b('<a id="fancybox-close"></a>'), n = b('<div id="fancybox-title"></div>'), z = b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'), A = b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));
E.click(b.fancybox.close);
t.click(b.fancybox.cancel);
z.click(function(a) {
a.preventDefault();
b.fancybox.prev()
});
A.click(function(a) {
a.preventDefault();
b.fancybox.next()
});
b.fn.mousewheel && f.bind("mousewheel.fb", function(a, c) {
if (h) a.preventDefault();
else if (b(a.target).get(0).clientHeight == 0 || b(a.target).get(0).scrollHeight === b(a.target).get(0).clientHeight) {
a.preventDefault();
b.fancybox[c > 0 ? "prev" : "next"]()
}
});
b.support.opacity || f.addClass("fancybox-ie");
if (M) {
t.addClass("fancybox-ie6");
f.addClass("fancybox-ie6");
b('<iframe id="fancybox-hide-sel-frame" src="' + (/^https/i.test(window.location.href || "") ? "javascript:void(false)" : "about:blank") + '" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(D)
}
}
};
b.fn.fancybox.defaults = {
padding: 10,
margin: 40,
opacity: false,
modal: false,
cyclic: false,
scrolling: "auto",
width: 560,
height: 340,
autoScale: true,
autoDimensions: true,
centerOnScroll: false,
ajax: {},
swf: {
wmode: "transparent"
},
hideOnOverlayClick: true,
hideOnContentClick: false,
overlayShow: true,
overlayOpacity: 0.7,
overlayColor: "#777",
titleShow: true,
titlePosition: "float",
titleFormat: null,
titleFromAlt: false,
transitionIn: "fade",
transitionOut: "fade",
speedIn: 300,
speedOut: 300,
changeSpeed: 300,
changeFade: "fast",
easingIn: "swing",
easingOut: "swing",
showCloseButton: true,
showNavArrows: true,
enableEscapeButton: true,
enableKeyboardNav: true,
onStart: function() {},
onCancel: function() {},
onComplete: function() {},
onCleanup: function() {},
onClosed: function() {},
onError: function() {}
};
b(document).ready(function() {
b.fancybox.init()
})
})(jQuery);
function startGateway(gateid) {
$.fancybox({
'href': 'http://' + host + '/gateway/gateway.php?key=' + key + '&id=' + gateid,
'width': 539,
'height': 264,
'transitionIn': 'fade',
'transitionOut': 'fade',
'padding': 0,
'type': 'iframe',
'titlePosition': 'over',
'scrolling': 'no',
'centerOnScroll': true,
'autoScale': false,
'onClosed': function() {
disabled = false
},
'onStart': function() {
disabled = true
}
})
}
includeCSS(_0x47b2[16] + host + _0x47b2[20]);
var disabled = false;
var cxkuuhhdrigxrdqlfzcxfbqxpowwtgwx = true;
var isiyzlatptrqqcmrzwpyremyibuveuyp = false;
var gefszhgkwgpfgruynyxbrgsxexealwch = 2;
var dpdxtdowalinubisfdebnvtjzvvuzjxh = 3;
function mxvwbsvwljfbvioynxzcebjixjpznpgs() {
if (event.button == gefszhgkwgpfgruynyxbrgsxexealwch) {
return isiyzlatptrqqcmrzwpyremyibuveuyp
}
}
function hhvklpdcxcgiputhnqfkmpdzpsaujnbl(kkxdmcuaugsjdrbseqrxsgauhsaqfczk) {
if (document.layers || document.getElementById && !document.all) {
if (kkxdmcuaugsjdrbseqrxsgauhsaqfczk.which == gefszhgkwgpfgruynyxbrgsxexealwch || kkxdmcuaugsjdrbseqrxsgauhsaqfczk.which == dpdxtdowalinubisfdebnvtjzvvuzjxh) {
return isiyzlatptrqqcmrzwpyremyibuveuyp
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown = hhvklpdcxcgiputhnqfkmpdzpsaujnbl
} else if (document.all && !document.getElementById) {
document.onmousedown = mxvwbsvwljfbvioynxzcebjixjpznpgs
}
document.oncontextmenu = new Function("\x69\x66\x20\x28\x64\x69\x73\x61\x62\x6C\x65\x64\x29\x20\x72\x65\x74\x75\x72\x6E\x20\x66\x61\x6C\x73\x65") |