var number_format_dec = '.';
var number_format_th = '';
var number_format_point = '2';
var store_language = 'en';
var xcart_web_dir = "/shop";
var images_dir = "/shop/skin/common_files/images";
var alt_images_dir = "/shop/skin/vivid_dreams_aquamarine/images";var lbl_no_items_have_been_selected = 'No items have been selected';
var current_area = 'C';
var currency_format = "AUD$x";
var lbl_product_minquantity_error = "Sorry, the minimum order quantity for this product is {{min}}.";
var lbl_product_maxquantity_error = "Sorry, the maximum order quantity for this product is {{max}}.";
var lbl_product_quantity_type_error = "You can specify a number from {{min}} to {{max}}.";
var is_limit = false;
var lbl_required_field_is_empty = "The required field \'~~field~~\' is empty!";
var lbl_field_required = "Field is required";
var lbl_field_format_is_invalid = "The format of the \'~~field~~\' field is invalid.";
var txt_required_fields_not_completed = "The following required fields have not been completed: {{fields}} Do you wish to submit the form with these fields empty?";
var lbl_blockui_default_message = "Please wait...";
var lbl_error = 'Error';
var lbl_warning = 'Warning';
var lbl_ok = 'OK';
var lbl_yes = 'Yes';
var lbl_no = 'No';
var txt_minicart_total_note = 'Order subtotal does not cover discounts and extra costs like shipping charges, etc. The final cost of the order will be calculated at the checkout page.';
var txt_ajax_error_note = 'An error occurred while processing a request. Please refresh the page. If the problem still persists after refreshing the page please contact us<\/a> on the matter.';
var txt_email_invalid = "Email address is invalid! Please correct";
var email_validation_regexp = new RegExp("^[a-z0-9!#$%&\'*+\\/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&\'*+\\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z](?:[a-z0-9-]*[a-z0-9])?$", "gi");
var is_admin_editor = false;
/* vim: set ts=2 sw=2 sts=2 et: */
/**
* Common JavaScript variables and functions
*
* @category X-Cart
* @package X-Cart
* @subpackage ____sub_package____
* @author Ruslan R. Fazlyev
* @copyright Copyright (c) 2001-2011 Ruslan R. Fazlyev
* @license http://www.x-cart.com/license.php X-Cart license agreement
* @version $Id: common.js,v 1.13.2.4 2011/03/03 10:53:08 aim Exp $
* @link http://www.x-cart.com/
* @see ____file_see____
*/
/**
* Enviroment identificator
*/
var localIsDOM = document.getElementById ? true: false;
var localIsJava = navigator.javaEnabled();
var localIsStrict = document.compatMode == 'CSS1Compat';
var localPlatform = navigator.platform;
var localVersion = "0";
var localBrowser = "";
var localBFamily = "";
var isHttps = false;
if (window.opera && localIsDOM) {
localBFamily = localBrowser = "Opera";
if (navigator.userAgent.search(/^.*Opera.([\d.]+).*$/) != - 1) localVersion = navigator.userAgent.replace(/^.*Opera.([\d.]+).*$/, "$1");
else if (window.print) localVersion = "6";
else localVersion = "5";
} else {
if (document.all && document.all.item)
localBFamily = localBrowser = 'MSIE';
}
if (navigator.appName == "Netscape") {
localBFamily = "NC";
if (!localIsDOM) {
localBrowser = 'Netscape';
localVersion = navigator.userAgent.replace(/^.*Mozilla.([\d.]+).*$/, "$1");
if (localVersion != '') localVersion = "4";
}
else if (navigator.userAgent.indexOf("Chrome") >= 0) localBrowser = 'Chrome';
else if (navigator.userAgent.indexOf("Safari") >= 0) localBrowser = 'Safari';
else if (navigator.userAgent.indexOf("Netscape") >= 0) localBrowser = 'Netscape';
else if (navigator.userAgent.indexOf("Firefox") >= 0) localBrowser = 'Firefox';
else localBrowser = 'Mozilla';
}
if (navigator.userAgent.indexOf("MSMSGS") >= 0)
localBrowser = "WMessenger";
else if (navigator.userAgent.indexOf("e2dk") >= 0)
localBrowser = "Edonkey";
else if (navigator.userAgent.indexOf("Gnutella") + navigator.userAgent.indexOf("Gnucleus") >= 0)
localBrowser = "Gnutella";
else if (navigator.userAgent.indexOf("KazaaClient") >= 0)
localBrowser = "Kazaa";
if (localVersion == '0' && localBrowser != '') {
var rg = new RegExp("^.*" + localBrowser + ".([\\d.]+).*$");
localVersion = navigator.userAgent.replace(rg, "$1");
}
var localIsCookie = ((localBrowser == 'Netscape' && localVersion == '4')
? (document.cookie != '')
: navigator.cookieEnabled);
var isHttps = document.location.protocol == "https:";
function change_antibot_image(id) {
var image = document.getElementById(id);
if (image) {
var src = xcart_web_dir + "/antibot_image.php?tmp=" + Math.random() + "§ion=" + id + "®enerate=Y";
setTimeout(
function() {
image.src = src;
},
200);
}
$('#antibot_input_str', $(image).parents('form')[0]).val('');
}
/**
* Get real inner width (jsel- JQuery selector)
*/
function getRealWidth(jsel) {
var sw = $(jsel).attr('scrollWidth');
if ($.browser.opera)
return sw;
var pl = parseInt($(jsel).css('padding-left'));
if (!isNaN(pl)) sw -= pl;
var pr = parseInt($(jsel).css('padding-right'));
if (!isNaN(pr))
sw -= pr;
return sw;
}
/**
* Show note next to element
*/
function showNote(id, next_to) {
if ( typeof showNote.isReadyToShow == 'undefined' ) {
showNote.isReadyToShow = true;
}
if (
showNote.isReadyToShow
&& $('#' + id).css('display') == 'none'
) {
showNote.isReadyToShow = false;
var div = $('#' + id).get();
$('#' + id).remove();
$('body').append(div);
$('#' + id).show();
var sw = getRealWidth('#' + id);
$('#' + id).css('left', $(next_to).offset().left + $(next_to).width() + 'px');
$('#' + id).css('top', $(next_to).offset().top + 'px');
if (sw > $('#' + id).width()) {
$('#' + id).css('width', sw + 'px');
}
showNote.isReadyToShow = true;
}
}
/**
* Find element by classname
*/
function getElementsByClassName(clsName) {
var elem, cls;
var arr = [];
var elems = document.getElementsByTagName("*");
for (var i = 0; (elem = elems[i]); i++) {
if (elem.className == clsName) {
arr[arr.length] = elem;
}
}
return arr;
}
function getProperDimensions(old_x, old_y, new_x, new_y, crop) {
if (old_x <= 0 || old_y <= 0 || (new_x <= 0 && new_y <= 0) || (crop && old_x <= new_x && old_y <= new_y))
return [old_x, old_y];
var k = 1;
if (new_x <= 0) {
k = (crop && old_y <= new_y) ? 1: new_y / old_y;
} else if (new_y <= 0) {
k = (crop && old_x <= new_x) ? 1: new_x / old_x;
} else {
var _kx = new_x / old_x;
var _ky = new_y / old_y;
k = crop ? Math.min(_kx, _ky, 1) : Math.min(_kx, _ky);
}
return [round(k * old_x), round(k * old_y)];
}
/**
* Opener/Closer HTML block
*/
function visibleBox(id, skipOpenClose) {
elm1 = document.getElementById("open" + id);
elm2 = document.getElementById("close" + id);
elm3 = document.getElementById("box" + id);
if (!elm3) return false;
if (skipOpenClose) {
elm3.style.display = (elm3.style.display == "") ? "none": "";
} else if (elm1) {
if (elm1.style.display == "") {
elm1.style.display = "none";
if (elm2) elm2.style.display = "";
elm3.style.display = "none";
var class_objs = getElementsByClassName('DialogBox');
for (var i = 0; i < class_objs.length; i++) {
class_objs[i].style.height = "1%";
}
} else {
elm1.style.display = "";
if (elm2) elm2.style.display = "none";
elm3.style.display = "";
}
}
return true;
}
function switchVisibleBox(id) {
var box = document.getElementById(id);
var plus = document.getElementById(id + '_plus');
var minus = document.getElementById(id + '_minus');
if (!box || ! plus || ! minus) return false;
if (box.style.display == 'none') {
box.style.display = '';
plus.style.display = 'none';
minus.style.display = '';
} else {
box.style.display = 'none';
minus.style.display = 'none';
plus.style.display = '';
}
return true;
}
/**
* URL encode
*/
function urlEncode(url) {
return url.replace(/\s/g, "+").replace(/&/, "&").replace(/"/, """)
}
/**
* Math.round() wrapper
*/
function round(n, p) {
if (isNaN(n)) n = parseFloat(n);
if (!p || isNaN(p)) return Math.round(n);
p = Math.pow(10, p);
return Math.round(n * p) / p;
}
/**
* Price format
*/
function price_format(price, thousand_delim, decimal_delim, precision, currency) {
thousand_delim = (arguments.length > 1 && thousand_delim !== false)
? thousand_delim
: number_format_th;
decimal_delim = (arguments.length > 2 && decimal_delim !== false)
? decimal_delim
: number_format_dec;
precision = (arguments.length > 3 && precision !== false)
? precision
: number_format_point;
currency = (arguments.length > 4 && currency !== false)
? currency_format
: "x";
if (precision > 0) {
precision = Math.pow(10, precision);
price = Math.round(price * precision) / precision;
var top = Math.floor(price);
var bottom = Math.round((price - top) * precision) + precision;
} else {
var top = Math.round(price);
var bottom = 0;
}
top = top + "";
bottom = bottom + "";
var cnt = 0;
for (var x = top.length; x >= 0; x--) {
if (cnt % 3 == 0 && cnt > 0 && x > 0) top = top.substr(0, x) + thousand_delim + top.substr(x, top.length);
cnt++;
}
return currency.replace("x", (bottom > 0) ? (top + decimal_delim + bottom.substr(1, bottom.length)) : top);
}
/**
* Substitute
*/
function substitute(lbl) {
var rg;
for (var x = 1; x < arguments.length; x += 2) {
if (arguments[x] && arguments[x + 1]) {
lbl = lbl.replace(new RegExp("\\{\\{" + arguments[x] + "\\}\\}", "gi"), arguments[x + 1])
.replace(new RegExp('~~' + arguments[x] + '~~', "gi"), arguments[x + 1]);
}
}
return lbl;
}
function getWindowOutWidth(w) {
if (!w)
w = window;
return localBFamily == "MSIE" ? w.document.body.clientWidth: w.outerWidth;
}
function getWindowOutHeight(w) {
if (!w)
w = window;
return localBFamily == "MSIE" ? w.document.body.clientHeight: w.outerHeight;
}
function getWindowWidth(w) {
if (!w)
w = window;
return localBFamily == "MSIE" ? w.document.body.clientWidth: w.innerWidth;
}
function getWindowHeight(w) {
if (!w)
w = window;
return localBFamily == "MSIE" ? w.document.body.clientHeight: w.innerHeight;
}
function getDocumentHeight(w) {
if (!w)
w = window;
return Math.max(w.document.documentElement.scrollHeight, w.document.body.scrollHeight);
}
function getDocumentWidth(w) {
if (!w)
w = window;
return Math.max(w.document.documentElement.scrollWidth, w.document.body.scrollWidth);
}
/**
* Check list of checkboxes
*/
function checkMarks(form, reg, lbl) {
var is_exist = false;
if (!form || form.elements.length == 0)
return true;
for (var x = 0; x < form.elements.length; x++) {
if (form.elements[x].name.search(reg) == 0 && form.elements[x].type == 'checkbox' && ! form.elements[x].disabled) {
is_exist = true;
if (form.elements[x].checked)
return true;
}
}
if (!is_exist)
return true;
if (lbl) {
alert(lbl);
} else if (lbl_no_items_have_been_selected) {
alert(lbl_no_items_have_been_selected);
}
return false;
}
/**
* Submit form with specified value of 'mode' parmaeters
*/
function submitForm(formObj, formMode, e) {
if (!e && typeof(window.event) != 'undefined') e = event;
if (e) {
if (e.stopPropagation) e.stopPropagation();
else e.cancelBubble = true;
}
if (!formObj)
return false;
if (formObj.tagName != "FORM") {
if (!formObj.form)
return false;
formObj = formObj.form;
}
if (formObj.mode) formObj.mode.value = formMode;
if (typeof(window.$) != 'undefined') {
var r = $(formObj).triggerHandler('submit');
if (r === false)
return false;
}
return formObj.submit();
}
/**
* Convert number from current format
* (according to 'Input and display format for floating comma numbers' option)
* to float number
*/
function convert_number(num) {
var regDec = new RegExp(reg_quote(number_format_dec), "gi");
var regTh = new RegExp(reg_quote(number_format_th), "gi");
var pow = Math.pow(10, parseInt(number_format_point));
num = parseFloat(num.replace(" ", "").replace(regTh, "").replace(regDec, "."));
return Math.round(num * pow) / pow;
}
/**
* Check string as number
* (according to 'Input and display format for floating comma numbers' option)
*/
function check_is_number(num) {
var regDec = new RegExp(reg_quote(number_format_dec), "gi");
var regTh = new RegExp(reg_quote(number_format_th), "gi");
num = num.replace(" ", "").replace(regTh, "").replace(regDec, ".");
return (num.search(/^[+-]?[0-9]+(\.[0-9]+)?$/) != - 1);
}
/**
* Qutation for RegExp class
*/
function reg_quote(s) {
return s.replace(/\./g, "\\.").replace(/\//g, "\\/").replace(/\*/g, "\\*").replace(/\+/g, "\\+").replace(/\[/g, "\\[").replace(/\]/g, "\\]");
}
function setCookie(name, value, path, expires, domain) {
if (typeof(expires) == 'object') {
try {
var days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
if (days[expires.getDay()] && months[expires.getMonth()]) expires = days[expires.getDay()] + " " + expires.getDate() + "-" + months[expires.getMonth()] + "-" + expires.getFullYear() + " " + expires.getHours() + ":" + expires.getMinutes() + ":" + expires.getSeconds() + " GMT";
} catch(e) {}
}
if (typeof(expires) != 'string') expires = false;
if (typeof(domain) != 'string') domain = false;
document.cookie = name + "=" + escape(value) + (expires ? "; expires=" + expires: "") + (path ? "; path=" + path: "") + (domain ? "; domain=" + domain: "");
}
function getCookie(name) {
if (document.cookie.length > 0) {
start = document.cookie.indexOf(name + "=");
if (start != - 1) {
start = start + name.length + 1;
end = document.cookie.indexOf(";", start);
if (end == - 1) end = document.cookie.length;
return unescape(document.cookie.substring(start, end));
}
}
return false;
}
function deleteCookie(name) {
document.cookie = name + "=0; expires=Fri, 31 Dec 1999 23:59:59 GMT;";
}
/**
* Clone object
*/
function cloneObject(orig) {
var r = {};
for (var i in orig) {
if (hasOwnProperty(orig, i)) r[i] = orig[i];
}
return r;
}
/**
* getElementById() wrapper
*/
function _getById(id) {
if (typeof(id) != 'string' || ! id) return false;
var obj = document.getElementById(id);
if (obj && obj.id != id) {
obj = false;
for (var i = 0; i < document.all.length && obj === false; i++) {
if (document.all[i].id == id) obj = document.all[i];
}
}
return obj;
}
// undefined or not
function isset(obj) {
return typeof(obj) != 'undefined' && obj !== null;
}
// Check - variable is function or not
function isFunction(f) {
return (typeof(f) == 'function' || (typeof(f) == 'object' && (f + "").search(/\s*function /) === 0));
}
// Get text length without \r
function getPureLength(text) {
return (text && text.replace) ? text.replace(new RegExp("\r", "g"), '').length: - 1;
}
// Ge text area selection limits
function getTASelection(t) {
if (document.selection) {
t.focus();
var sel1 = document.selection.createRange();
var sel2 = sel1.duplicate();
sel2.moveToElementText(t);
var selText = sel1.text;
var c = String.fromCharCode(1);
sel1.text = c;
var index = sel2.text.indexOf(c);
t.selectionStart = getPureLength((index == - 1) ? sel2.text: sel2.text.substring(0, index));
t.selectionEnd = getPureLength(selText) + t.selectionStart;
sel1.moveStart('character', - 1);
sel1.text = selText;
}
return [t.selectionStart, t.selectionEnd];
}
// Insert string to text area to current position
function insert2TA(t, str) {
if (!t) return false;
var pos = getTASelection(t);
var p;
if (!isNaN(pos[0])) {
t.value = t.value.substr(0, pos[0]) + str + t.value.substr(pos[0]);
p = pos[0];
} else {
p = getPureLength(t.value);
t.value += str;
}
setTACursorPos(t, p);
return p;
}
// Set cursor pointer to specified postion for text area
function setTACursorPos(t, begin, end) {
if (!t || ! t.tagName || t.tagName.toUpperCase() != 'TEXTAREA')
return false;
if (isNaN(begin)) {
begin = 0;
} else if (getPureLength(t.value) < begin) {
begin = getPureLength(t.value);
end = begin;
}
if (isNaN(end)) end = begin;
if (document.selection) {
var sel = t.createTextRange();
sel.collapse(true);
sel.moveStart('character', begin);
sel.moveEnd('character', end - begin);
sel.select();
} else if (!isNaN(t.selectionStart)) {
t.selectionStart = begin;
t.selectionEnd = end;
}
if (t.focus) t.focus();
return true;
}
/**
* Position functions
*/
function posGetPageOffset(o) {
var l = 0;
var t = 0;
do {
l += o.offsetLeft;
t += o.offsetTop;
} while ((o = o.offsetParent));
return {
left: l,
top: t
};
}
function getMethod(method, obj) {
var args = [];
for (var i = 2; i < arguments.length; i++)
args[args.length] = arguments[i];
if (!obj) obj = window;
return function() {
if (!isFunction(method)) method = obj[method];
return method.apply ? method.apply(obj, args) : method();
}
}
function lockForm(form) {
if (form.locked)
return false;
form.locked = true;
setTimeout(
function() {
form.locked = false;
},
1000);
return true;
}
function getPopupControl(elm) {
var e = elm;
while (e && e.tagName && ! e._popupControl)
e = e.parentNode;
return (e && e._popupControl) ? e._popupControl: false;
}
function parse_url(url) {
if (!url || url.constructor != String)
return false;
var m = url.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/);
if (!m)
return false;
var res = {
scheme: m[2],
host: m[4],
path: m[5],
query: m[7],
fragment: m[9]
};
if (res.host) {
m = res.host.match(/^(?:([^:]+):)?([^@]+)@(.+)$/);
if (m) {
res.host = m[3];
res.user = m[1] ? m[1] : m[2];
res.password = m[1] ? m[2] : false;
}
}
return res;
}
var xxx = 0;
function pngFix(elm) {
if (!elm || ! elm.tagName || ! $.browser.msie || parseFloat($.browser.version) >= 7 || elm.tagName.toUpperCase() != 'IMG')
return false;
var src = elm.src.replace(/\(/g, '%28').replace(/\)/g, '%29');
elm.src = images_dir + '/spacer.gif';
elm.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + src.replace(/"/, '\"') + '",sizingMethod="scale")';
return true;
}
function getImgSrc(elm) {
if (!elm || ! elm.tagName || elm.tagName.toUpperCase() != 'IMG' || ! elm.src)
return false;
if ($.browser.msie && elm.src.search(/\/spacer\.gif$/) != - 1 && elm.filters['DXImageTransform.Microsoft.AlphaImageLoader'])
return elm.filters['DXImageTransform.Microsoft.AlphaImageLoader'].src;
return elm.src;
}
function isPngFix(elm) {
return $.browser.msie && elm && elm.tagName && elm.tagName.toUpperCase() == 'IMG' && elm.src && elm.src.search(/\/spacer\.gif$/) != - 1 && elm.filters['DXImageTransform.Microsoft.AlphaImageLoader'];
}
function extend(c, p) {
var f = function() {}
f.prototype = p.prototype;
c.prototype = new f();
c.prototype.constructor = c;
c.superclass = p.prototype;
}
function hasOwnProperty(obj, prop) {
if (typeof(obj) != 'undefined' && Object.prototype.hasOwnProperty)
return obj.hasOwnProperty(prop);
return typeof(obj[prop]) != 'undefined' && obj.constructor.prototype[prop] !== obj[prop];
}
var hint_timer = new Array();
function skipDefaultValue(form) {
$('input.default-value', form).each(function() {
this.value = '';
})
return true;
}
function initResetDefault() {
$('input.default-value').bind('focus', function() {
if (!this.isReseted) {
this.defaultValue = this.value;
this.value = '';
$(this).removeClass('default-value');
this.isReseted = true;
}
return true;
}).bind('change', function() {
this.isContentIsChanged = true;
return true;
}).bind('blur', function() {
if (this.isReseted && ! this.isContentIsChanged && this.defaultValue) {
this.value = this.defaultValue;
$(this).addClass('default-value');
this.isReseted = false;
}
return true;
}).each(
function() {
if (!this.form.isSetReset) {
$(this.form).bind('submit', function() {
$('input.default-value', this).each(
function() {
this.value = '';
});
return true;
});
this.form.isSetReset = true;
}
});
}
if (window.addEventListener)
window.addEventListener('load', initResetDefault, false);
else if (window.attachEvent)
window.attachEvent('onload', initResetDefault);
var popup_html_editor_text;
/*
Debug window (require jQuery)
Usage:
debug().html('example');
debug().html('example', 10);
debug().add('second string')
debug().clean();
debug().hide();
debug().show();
debug().row(0).html('example');
debug().row(0).add('second part');
debug().row(0).remove();
debug().opacity(0.1);
*/
var debug = function() {
var debug_panel = false;
return function() {
if (typeof(window.$) == 'undefined')
return false;
if (!debug_panel) {
debug_panel = $(document.createElement('DIV')).
css({
position: 'absolute',
border: '1px solid black',
backgroundColor: 'white',
display: 'none',
top: '0px',
left: '0px',
width: '200px',
height: '200px',
overflow: 'auto',
padding: '5px',
margin: '0px'
}).get(0);
document.body.appendChild(debug_panel);
debug_panel.defaultOpacity = 0.9;
debug_panel.ttl = 0;
debug_panel._extend_create = false;
debug_panel._ttlTO = false;
debug_panel._rowsLength = 0;
/* Replace window content */
debug_panel.html = function(str, ttl) {
this._getBox().innerHTML = str;
this.show();
this.startTTL(arguments.length > 1 ? ttl: this.ttl);
}
/* Add new string */
debug_panel.add = function(str, ttl) {
this._getBox().innerHTML += str + " \n";
this.show();
this.startTTL(arguments.length > 1 ? ttl: this.ttl);
}
/* Get row (old or new) */
debug_panel.row = function(i) {
var row = $('div:eq(' + i + ')', this._getBox()).get(0);
if (!row) {
for (var x = this._rowsLength; x < i + 1; x++) {
row = this._getBox().appendChild(document.createElement('DIV'));
row.remove = this._removeRow;
row.html = this._htmlRow;
row.add = this._addRow;
row.box = this;
}
this._rowsLength = i + 1;
}
return row;
}
/* Remove row */
debug_panel._removeRow = function() {
if (this.parentNode) {
this.box._rowsLength--;
this.parentNode.removeChild(this);
}
}
/* Replace row content */
debug_panel._htmlRow = function(str, ttl) {
this.innerHTML = str;
this.box.show();
this.box.startTTL(arguments.length > 1 ? ttl: this.parentNode.ttl);
}
/* Add content ot row */
debug_panel._addRow = function(str, ttl) {
this.innerHTML += str;
this.box.show();
this.box.startTTL(arguments.length > 1 ? ttl: this.parentNode.ttl);
}
/* Clean window content */
debug_panel.clean = function() {
this._rowsLength = 0;
this._getBox().innerHTML = '';
}
/* Hide window */
debug_panel.hide = function() {
this.style.display = 'none';
}
/* Show window */
debug_panel.show = function() {
this.style.display = '';
}
/* Set window opacity */
debug_panel.opacity = function(level) {
level = parseFloat(level);
if (isNaN(level) || level < 0 || level > 1) return false;
level = Math.round(level * 100) / 100;
if ($.browser.msie) {
this.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity = ' + (level * 100) + ')';
} else {
this.style.opacity = level;
}
return true;
}
/* Start window auto-hide timer */
debug_panel.startTTL = function(ttl) {
if (this._ttlTO) clearTimeout(this._ttlTO);
if (ttl <= 0) return false;
var o = this;
this._ttlTO = setTimeout(function() {
o.hide();
},
ttl * 1000);
return true;
}
/* Extend debug panel */
debug_panel.extend = function() {
if (this._extend_create) return true;
var scripts = document.getElementsByTagName('SCRIPT');
var m;
var path = false;
for (var i = 0; i < scripts.length && ! path; i++) {
if (scripts[i].src && (m = scripts[i].src.match(/^(.+\/)common.js/))) path = m[1];
}
if (!path) return false;
var s = document.createElement('SCRIPT');
s.src = path + 'debug.js';
document.body.appendChild(s);
this._extend_create = true;
return true;
}
/* Check - debug extended or not */
debug_panel.is_extended = function() {
return this._extend_create && typeof(window._debug_is_extended) != 'undefined' && _debug_is_extended;
}
debug_panel._getBox = function() {
return this;
}
if (debug_panel.defaultOpacity > 0 && debug_panel.defaultOpacity <= 1) {
debug_panel.opacity(debug_panel.defaultOpacity);
}
}
/* Extend debug panel methods */
if (typeof(window.debug_panel_ext_methods) != 'undefined' && debug_panel_ext_methods) {
for (var i = 0; i < debug_panel_ext_methods.length; i++) {
debug_panel[debug_panel_ext_methods[i]] = debug_panel_ext[debug_panel_ext_methods[i]];
}
if (typeof(debug_panel_ext.init) != 'undefined') debug_panel_ext.init.call(debug_panel);
debug_panel_ext_methods = false;
debug_panel_ext = false;
}
return debug_panel;
}
} ();
/**
* Changing button width on the fly (IE bugs)
*/
function change_width_iefix() {
$("td div button").each(function() {
$(this).width("auto").width($(this).width());
});
}
/**
* Popup wrapper
*/
function popup(url, width, height) {
window.open(
url, 'popup', 'width=' + width + ',height=' + height + ',toolbar=no,status=no,scrollbars=yes,resizable=no,menubar=no,location=no,direction=no');
}
/**
* Dialog tools specific toggle function.
*
* @param string active_panel left or right panel that should be activated
* @param string nonactive_panel left or right panel that should be deactivated
*
* @return void
* @see ____func_see____
* @since 4.4.0
*/
function dialog_tools_activate(active_panel, nonactive_panel) {
$('.dialog-header-' + active_panel).removeClass('dialog-tools-nonactive');
$('.dialog-header-' + nonactive_panel).addClass('dialog-tools-nonactive');
$('.dialog-tools-' + active_panel).removeClass('hidden');
$('.dialog-tools-' + nonactive_panel).addClass('hidden');
}
/**
* Check form fields (CSS class-based)
*
* @return void
* @see ____func_see____
*/
function checkFormFields() {
var errFields = [];
if (!this.tagName || this.tagName.toUpperCase() != 'FORM') {
if (
arguments.length > 0
&& arguments[0]
&& arguments[0].tagName
&& arguments[0].tagName.toUpperCase() == 'FORM'
) {
return checkFormFields.call(arguments[0]);
}
return true;
}
var error_found = err = empty = false;
var frm = this;
$('label[for]', frm).each(function() {
err = empty = false;
if (!this.htmlFor) {
return;
}
var f = $('#' + this.htmlFor, frm).get(0);
if (!f || f.disabled) {
return;
}
if ($(f).is(':hidden')) {
return;
}
var errMsg = lbl_required_field_is_empty;
var r = (
$(f).hasClass('input-required')
|| $(this).hasClass('data-required')
|| (
$(this).parent('td').hasClass('data-name')
&& $(this).closest('tr').find('td.data-required').length > 0
)
);
var fType = false;
if (f.className) {
var m = $(f).attr('class').replace(/input-required/, '').match(/input-([a-z]+)/);
if (m) {
fType = m[1];
}
}
if (!fType && !r) {
return;
}
if (r && $.trim($(f).val()) == '') {
err = true;
empty = true;
} else if (fType) {
var val = $(f).val().replace(/^\s+/g, '').replace(/\s+$/g, '');
errMsg = lbl_field_format_is_invalid;
switch (fType) {
case 'email':
if (val.search(email_validation_regexp) == - 1) {
err = true;
errMsg = txt_email_invalid;
}
break;
case 'int':
err = val.search(/^[-+]?\d+$/) == - 1;
break;
case 'uint':
err = val.search(/^\+?\d+$/) == - 1;
break;
case 'intz':
err = val.search(/^[-+]?\d+$/) == - 1 || val == '0';
break;
case 'uintz':
err = val.search(/^\+?\d+$/) == - 1 || val == '0';
break;
case 'double':
err = val.search(/^[-+]?(?:\d+|\.\d+|\d+\.|\d+\.\d+)$/) == - 1;
break;
case 'udouble':
err = val.search(/^\+?(?:\d+|\.\d+|\d+\.|\d+\.\d+)$/) == - 1;
break;
case 'doublez':
err = val.search(/^[-+]?(?:\d+|\.\d+|\d+\.|\d+\.\d+)$/) == - 1 || val.search(/^[-+]?[0\.]+$/) != - 1;
break;
case 'udoublez':
err = val.search(/^\+?(?:\d+|\.\d+|\d+\.|\d+\.\d+)$/) == - 1 || val.search(/^\+?[0\.]+$/) != - 1;
break;
case 'ip':
err = val.search(/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/) == - 1;
break;
}
}
if (err) {
error_found = true;
markErrorField(f, empty ? lbl_field_required: '');
$(f).focus();
if (is_admin_editor) {
if (errFields.length < 20)
errFields[errFields.length] = $(this).html();
}
else {
xAlert(substitute(errMsg, 'field', $(this).html()), lbl_warning);
return false;
}
}
});
if (error_found && !is_admin_editor) {
return false;
} else if (errFields.length > 0) {
return confirm(substitute(txt_required_fields_not_completed, 'fields', "\n\t" + errFields.join(",\n\t") + "\n\n"));
}
return true;
}
/**
* Highlight error field (CSS-based)
*
* @param object $f Field object
* @param string $errLabel Error label
*
* @return void
* @see ____func_see____
*/
function markErrorField(f, errLabel) {
if (!f || f == 'undefined') {
return true;
}
var container = $(f).parents('tr, .field-container')[0];
if (container && container != 'undefined' && ! $(container).hasClass('fill-error')) {
$(container).addClass('fill-error');
if (errLabel && errLabel != '') {
$(document.createElement('div')).attr('class', 'error-label').appendTo($(f).parent()).html(lbl_field_required);
}
$(f).bind('keydown', function(event) {
if (event.keyCode == '13') {
event.preventDefault();
}
if ($.trim($(this).val() + String.fromCharCode(event.keyCode)) != '') {
$(container).removeClass('fill-error').find('div.error-label').remove();
$(this).unbind('keydown');
}
});
}
}
/**
* Mark empty required form fields
*
* @param form $form Form object
*
* @return void
* @see ____func_see____
*/
function markEmptyFields(form) {
if (!form) {
return;
}
$(form).find('.data-required').each(function() {
var parentObj = $(this).parents('tr, .field-container')[0];
if (!parentObj || parentObj == 'undefined') {
return;
}
$(parentObj).find('input, textarea, select').each(function() {
if (this.value == '') {
markErrorField(this);
}
});
});
}
/**
* Apply checking of the required fields of the form
* on submit automatically
*
* @param form $form Form DOM object
*
* @return bool
* @see ____func_see____
*/
function applyCheckOnSubmit(form) {
if (!form) {
return true;
}
var defaultAction = false;
if (undefined !== form.onsubmit && form.onsubmit && form.onsubmit.constructor != String) {
var defaultAction = form.onsubmit;
form.onsubmit = null;
}
$(form).submit(function() {
if (checkFormFields(form)) {
if (defaultAction != false) {
return defaultAction.call(form);
}
return true;
}
return false;
});
}
/**
* Custom alert using jQuery UI
*
* @param string $msg Message
* @param string $header Alert header
*
* @return void
* @see ____func_see____
*/
function xAlert(msg, header) {
var buttons = {};
buttons[lbl_ok] = function() {
$(this).dialog('destroy').remove();
}
$(document.createElement('div')).attr('class', 'xalertbox').html(msg).dialog({
modal: $('.ui-widget-overlay').length <= 0,
title: undefined === header ? '': header,
buttons: buttons
});
}
/**
* Custom confirm using jQuery UI
*
* @param string $msg Message
* @param string $callback Callback on confirm
* @param string $header Confirmation header text
*
* @return void
* @see ____func_see____
*/
function xConfirm(msg, callback, header) {
var buttons = {};
buttons[lbl_no] = function() {
$(this).dialog('destroy').remove();
}
buttons[lbl_yes] = function() {
if (undefined !== callback && callback != '') {
eval(callback);
}
$(this).dialog('destroy').remove();
}
$(document.createElement('div')).attr('class', 'xalertbox').html(msg).dialog({
modal: $('.ui-widget-overlay').length <= 0,
title: undefined === header ? '': header,
buttons: buttons
});
}
/* SWFObject v2.2
is released under the MIT License
*/
var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y0){for(var af=0;af0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad '}}aa.outerHTML='"+af+" ";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab").appendTo("body"),c=b.css("display");b.remove();if(c==="none"||c==="")c="block";b_[a]=c}return b_[a]}function ce(a,b){var c={};d.each(cd.concat.apply([],cd.slice(0,b)),function(){c[this]=a});return c}function b$(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function bZ(){try{return new a.XMLHttpRequest}catch(b){}}function bY(){d(a).unload(function(){for(var a in bW)bW[a](0,1)})}function bS(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var e=a.dataTypes,f={},g,h,i=e.length,j,k=e[0],l,m,n,o,p;for(g=1;g=0===c})}function P(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function H(a,b){return(a&&a!=="*"?a+".":"")+b.replace(t,"`").replace(u,"&")}function G(a){var b,c,e,f,g,h,i,j,k,l,m,n,o,p=[],q=[],s=d._data(this,"events");if(a.liveFired!==this&&s&&s.live&&!a.target.disabled&&(!a.button||a.type!=="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var t=s.live.slice(0);for(i=0;ic)break;a.currentTarget=f.elem,a.data=f.handleObj.data,a.handleObj=f.handleObj,o=f.handleObj.origHandler.apply(f.elem,arguments);if(o===!1||a.isPropagationStopped()){c=f.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function E(a,c,e){var f=d.extend({},e[0]);f.type=a,f.originalEvent={},f.liveFired=b,d.event.handle.call(c,f),f.isDefaultPrevented()&&e[0].preventDefault()}function y(){return!0}function x(){return!1}function i(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function h(a,c,e){if(e===b&&a.nodeType===1){e=a.getAttribute("data-"+c);if(typeof e==="string"){try{e=e==="true"?!0:e==="false"?!1:e==="null"?null:d.isNaN(e)?g.test(e)?d.parseJSON(e):e:parseFloat(e)}catch(f){}d.data(a,c,e)}else e=b}return e}var c=a.document,d=function(){function G(){if(!d.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(G,1);return}d.ready()}}var d=function(a,b){return new d.fn.init(a,b,g)},e=a.jQuery,f=a.$,g,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,i=/\S/,j=/^\s+/,k=/\s+$/,l=/\d/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=navigator.userAgent,w,x,y,z=Object.prototype.toString,A=Object.prototype.hasOwnProperty,B=Array.prototype.push,C=Array.prototype.slice,D=String.prototype.trim,E=Array.prototype.indexOf,F={};d.fn=d.prototype={constructor:d,init:function(a,e,f){var g,i,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!e&&c.body){this.context=c,this[0]=c.body,this.selector="body",this.length=1;return this}if(typeof a==="string"){g=h.exec(a);if(!g||!g[1]&&e)return!e||e.jquery?(e||f).find(a):this.constructor(e).find(a);if(g[1]){e=e instanceof d?e[0]:e,k=e?e.ownerDocument||e:c,j=m.exec(a),j?d.isPlainObject(e)?(a=[c.createElement(j[1])],d.fn.attr.call(a,e,!0)):a=[k.createElement(j[1])]:(j=d.buildFragment([g[1]],[k]),a=(j.cacheable?d.clone(j.fragment):j.fragment).childNodes);return d.merge(this,a)}i=c.getElementById(g[2]);if(i&&i.parentNode){if(i.id!==g[2])return f.find(a);this.length=1,this[0]=i}this.context=c,this.selector=a;return this}if(d.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return d.makeArray(a,this)},selector:"",jquery:"1.5.2",length:0,size:function(){return this.length},toArray:function(){return C.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 e=this.constructor();d.isArray(a)?B.apply(e,a):d.merge(e,a),e.prevObject=this,e.context=this.context,b==="find"?e.selector=this.selector+(this.selector?" ":"")+c:b&&(e.selector=this.selector+"."+b+"("+c+")");return e},each:function(a,b){return d.each(this,a,b)},ready:function(a){d.bindReady(),x.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(C.apply(this,arguments),"slice",C.call(arguments).join(","))},map:function(a){return this.pushStack(d.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:B,sort:[].sort,splice:[].splice},d.fn.init.prototype=d.fn,d.extend=d.fn.extend=function(){var a,c,e,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"&&!d.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;x.resolveWith(c,[d]),d.fn.trigger&&d(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!x){x=d._Deferred();if(c.readyState==="complete")return setTimeout(d.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",y,!1),a.addEventListener("load",d.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",y),a.attachEvent("onload",d.ready);var b=!1;try{b=a.frameElement==null}catch(e){}c.documentElement.doScroll&&b&&G()}}},isFunction:function(a){return d.type(a)==="function"},isArray:Array.isArray||function(a){return d.type(a)==="array"},isWindow:function(a){return a&&typeof a==="object"&&"setInterval"in a},isNaN:function(a){return a==null||!l.test(a)||isNaN(a)},type:function(a){return a==null?String(a):F[z.call(a)]||"object"},isPlainObject:function(a){if(!a||d.type(a)!=="object"||a.nodeType||d.isWindow(a))return!1;if(a.constructor&&!A.call(a,"constructor")&&!A.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a){}return c===b||A.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=d.trim(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return a.JSON&&a.JSON.parse?a.JSON.parse(b):(new Function("return "+b))();d.error("Invalid JSON: "+b)},parseXML:function(b,c,e){a.DOMParser?(e=new DOMParser,c=e.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),e=c.documentElement,(!e||!e.nodeName||e.nodeName==="parsererror")&&d.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(a){if(a&&i.test(a)){var b=c.head||c.getElementsByTagName("head")[0]||c.documentElement,e=c.createElement("script");d.support.scriptEval()?e.appendChild(c.createTextNode(a)):e.text=a,b.insertBefore(e,b.firstChild),b.removeChild(e)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,e){var f,g=0,h=a.length,i=h===b||d.isFunction(a);if(e){if(i){for(f in a)if(c.apply(a[f],e)===!1)break}else for(;g1?f.call(arguments,0):c,--g||h.resolveWith(h,f.call(b,0))}}var b=arguments,c=0,e=b.length,g=e,h=e<=1&&a&&d.isFunction(a.promise)?a:d.Deferred();if(e>1){for(;ca ";var e=b.getElementsByTagName("*"),f=b.getElementsByTagName("a")[0],g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=b.getElementsByTagName("input")[0];if(e&&e.length&&f){d.support={leadingWhitespace:b.firstChild.nodeType===3,tbody:!b.getElementsByTagName("tbody").length,htmlSerialize:!!b.getElementsByTagName("link").length,style:/red/.test(f.getAttribute("style")),hrefNormalized:f.getAttribute("href")==="/a",opacity:/^0.55$/.test(f.style.opacity),cssFloat:!!f.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,deleteExpando:!0,optDisabled:!1,checkClone:!1,noCloneEvent:!0,noCloneChecked:!0,boxModel:null,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableHiddenOffsets:!0,reliableMarginRight:!0},i.checked=!0,d.support.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,d.support.optDisabled=!h.disabled;var j=null;d.support.scriptEval=function(){if(j===null){var b=c.documentElement,e=c.createElement("script"),f="script"+d.now();try{e.appendChild(c.createTextNode("window."+f+"=1;"))}catch(g){}b.insertBefore(e,b.firstChild),a[f]?(j=!0,delete a[f]):j=!1,b.removeChild(e)}return j};try{delete b.test}catch(k){d.support.deleteExpando=!1}!b.addEventListener&&b.attachEvent&&b.fireEvent&&(b.attachEvent("onclick",function l(){d.support.noCloneEvent=!1,b.detachEvent("onclick",l)}),b.cloneNode(!0).fireEvent("onclick")),b=c.createElement("div"),b.innerHTML=" ";var m=c.createDocumentFragment();m.appendChild(b.firstChild),d.support.checkClone=m.cloneNode(!0).cloneNode(!0).lastChild.checked,d(function(){var a=c.createElement("div"),b=c.getElementsByTagName("body")[0];if(b){a.style.width=a.style.paddingLeft="1px",b.appendChild(a),d.boxModel=d.support.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,d.support.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
",d.support.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="";var e=a.getElementsByTagName("td");d.support.reliableHiddenOffsets=e[0].offsetHeight===0,e[0].style.display="",e[1].style.display="none",d.support.reliableHiddenOffsets=d.support.reliableHiddenOffsets&&e[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(a.style.width="1px",a.style.marginRight="0",d.support.reliableMarginRight=(parseInt(c.defaultView.getComputedStyle(a,null).marginRight,10)||0)===0),b.removeChild(a).style.display="none",a=e=null}});var n=function(a){var b=c.createElement("div");a="on"+a;if(!b.attachEvent)return!0;var d=a in b;d||(b.setAttribute(a,"return;"),d=typeof b[a]==="function");return d};d.support.submitBubbles=n("submit"),d.support.changeBubbles=n("change"),b=e=f=null}}();var g=/^(?:\{.*\}|\[.*\])$/;d.extend({cache:{},uuid:0,expando:"jQuery"+(d.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?d.cache[a[d.expando]]:a[d.expando];return!!a&&!i(a)},data:function(a,c,e,f){if(d.acceptData(a)){var g=d.expando,h=typeof c==="string",i,j=a.nodeType,k=j?d.cache:a,l=j?a[d.expando]:a[d.expando]&&d.expando;if((!l||f&&l&&!k[l][g])&&h&&e===b)return;l||(j?a[d.expando]=l=++d.uuid:l=d.expando),k[l]||(k[l]={},j||(k[l].toJSON=d.noop));if(typeof c==="object"||typeof c==="function")f?k[l][g]=d.extend(k[l][g],c):k[l]=d.extend(k[l],c);i=k[l],f&&(i[g]||(i[g]={}),i=i[g]),e!==b&&(i[c]=e);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[c]:i}},removeData:function(b,c,e){if(d.acceptData(b)){var f=d.expando,g=b.nodeType,h=g?d.cache:b,j=g?b[d.expando]:d.expando;if(!h[j])return;if(c){var k=e?h[j][f]:h[j];if(k){delete k[c];if(!i(k))return}}if(e){delete h[j][f];if(!i(h[j]))return}var l=h[j][f];d.support.deleteExpando||h!=a?delete h[j]:h[j]=null,l?(h[j]={},g||(h[j].toJSON=d.noop),h[j][f]=l):g&&(d.support.deleteExpando?delete b[d.expando]:b.removeAttribute?b.removeAttribute(d.expando):b[d.expando]=null)}},_data:function(a,b,c){return d.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=d.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),d.fn.extend({data:function(a,c){var e=null;if(typeof a==="undefined"){if(this.length){e=d.data(this[0]);if(this[0].nodeType===1){var f=this[0].attributes,g;for(var i=0,j=f.length;i-1)return!0;return!1},val:function(a){if(!arguments.length){var c=this[0];if(c){if(d.nodeName(c,"option")){var e=c.attributes.value;return!e||e.specified?c.value:c.text}if(d.nodeName(c,"select")){var f=c.selectedIndex,g=[],h=c.options,i=c.type==="select-one";if(f<0)return null;for(var j=i?f:0,k=i?f+1:h.length;j=0;else if(d.nodeName(this,"select")){var f=d.makeArray(e);d("option",this).each(function(){this.selected=d.inArray(d(this).val(),f)>=0}),f.length||(this.selectedIndex=-1)}else this.value=e}})}}),d.extend({attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,e,f){if(!a||a.nodeType===3||a.nodeType===8||a.nodeType===2)return b;if(f&&c in d.attrFn)return d(a)[c](e);var g=a.nodeType!==1||!d.isXMLDoc(a),h=e!==b;c=g&&d.props[c]||c;if(a.nodeType===1){var i=m.test(c);if(c==="selected"&&!d.support.optSelected){var j=a.parentNode;j&&(j.selectedIndex,j.parentNode&&j.parentNode.selectedIndex)}if((c in a||a[c]!==b)&&g&&!i){h&&(c==="type"&&n.test(a.nodeName)&&a.parentNode&&d.error("type property can't be changed"),e===null?a.nodeType===1&&a.removeAttribute(c):a[c]=e);if(d.nodeName(a,"form")&&a.getAttributeNode(c))return a.getAttributeNode(c).nodeValue;if(c==="tabIndex"){var k=a.getAttributeNode("tabIndex");return k&&k.specified?k.value:o.test(a.nodeName)||p.test(a.nodeName)&&a.href?0:b}return a[c]}if(!d.support.style&&g&&c==="style"){h&&(a.style.cssText=""+e);return a.style.cssText}h&&a.setAttribute(c,""+e);if(!a.attributes[c]&&(a.hasAttribute&&!a.hasAttribute(c)))return b;var l=!d.support.hrefNormalized&&g&&i?a.getAttribute(c,2):a.getAttribute(c);return l===null?b:l}h&&(a[c]=e);return a[c]}});var r=/\.(.*)$/,s=/^(?:textarea|input|select)$/i,t=/\./g,u=/ /g,v=/[^\w\s.|`]/g,w=function(a){return a.replace(v,"\\$&")};d.event={add:function(c,e,f,g){if(c.nodeType!==3&&c.nodeType!==8){try{d.isWindow(c)&&(c!==a&&!c.frameElement)&&(c=a)}catch(h){}if(f===!1)f=x;else if(!f)return;var i,j;f.handler&&(i=f,f=i.handler),f.guid||(f.guid=d.guid++);var k=d._data(c);if(!k)return;var l=k.events,m=k.handle;l||(k.events=l={}),m||(k.handle=m=function(a){return typeof d!=="undefined"&&d.event.triggered!==a.type?d.event.handle.apply(m.elem,arguments):b}),m.elem=c,e=e.split(" ");var n,o=0,p;while(n=e[o++]){j=i?d.extend({},i):{handler:f,data:g},n.indexOf(".")>-1?(p=n.split("."),n=p.shift(),j.namespace=p.slice(0).sort().join(".")):(p=[],j.namespace=""),j.type=n,j.guid||(j.guid=f.guid);var q=l[n],r=d.event.special[n]||{};if(!q){q=l[n]=[];if(!r.setup||r.setup.call(c,g,p,m)===!1)c.addEventListener?c.addEventListener(n,m,!1):c.attachEvent&&c.attachEvent("on"+n,m)}r.add&&(r.add.call(c,j),j.handler.guid||(j.handler.guid=f.guid)),q.push(j),d.event.global[n]=!0}c=null}},global:{},remove:function(a,c,e,f){if(a.nodeType!==3&&a.nodeType!==8){e===!1&&(e=x);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=d.hasData(a)&&d._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(e=c.handler,c=c.type);if(!c||typeof c==="string"&&c.charAt(0)==="."){c=c||"";for(h in t)d.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("(^|\\.)"+d.map(m.slice(0).sort(),w).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!e){for(j=0;j=0&&(a.type=f=f.slice(0,-1),a.exclusive=!0),e||(a.stopPropagation(),d.event.global[f]&&d.each(d.cache,function(){var b=d.expando,e=this[b];e&&e.events&&e.events[f]&&d.event.trigger(a,c,e.handle.elem)}));if(!e||e.nodeType===3||e.nodeType===8)return b;a.result=b,a.target=e,c=d.makeArray(c),c.unshift(a)}a.currentTarget=e;var h=d._data(e,"handle");h&&h.apply(e,c);var i=e.parentNode||e.ownerDocument;try{e&&e.nodeName&&d.noData[e.nodeName.toLowerCase()]||e["on"+f]&&e["on"+f].apply(e,c)===!1&&(a.result=!1,a.preventDefault())}catch(j){}if(!a.isPropagationStopped()&&i)d.event.trigger(a,c,i,!0);else if(!a.isDefaultPrevented()){var k,l=a.target,m=f.replace(r,""),n=d.nodeName(l,"a")&&m==="click",o=d.event.special[m]||{};if((!o._default||o._default.call(e,a)===!1)&&!n&&!(l&&l.nodeName&&d.noData[l.nodeName.toLowerCase()])){try{l[m]&&(k=l["on"+m],k&&(l["on"+m]=null),d.event.triggered=a.type,l[m]())}catch(p){}k&&(l["on"+m]=k),d.event.triggered=b}}},handle:function(c){var e,f,g,h,i,j=[],k=d.makeArray(arguments);c=k[0]=d.event.fix(c||a.event),c.currentTarget=this,e=c.type.indexOf(".")<0&&!c.exclusive,e||(g=c.type.split("."),c.type=g.shift(),j=g.slice(0).sort(),h=new RegExp("(^|\\.)"+j.join("\\.(?:.*\\.)?")+"(\\.|$)")),c.namespace=c.namespace||j.join("."),i=d._data(this,"events"),f=(i||{})[c.type];if(i&&f){f=f.slice(0);for(var l=0,m=f.length;l-1?d.map(a.options,function(a){return a.selected}).join("-"):"":a.nodeName.toLowerCase()==="select"&&(c=a.selectedIndex);return c},D=function D(a){var c=a.target,e,f;if(s.test(c.nodeName)&&!c.readOnly){e=d._data(c,"_change_data"),f=C(c),(a.type!=="focusout"||c.type!=="radio")&&d._data(c,"_change_data",f);if(e===b||f===e)return;if(e!=null||f)a.type="change",a.liveFired=b,d.event.trigger(a,arguments[1],c)}};d.event.special.change={filters:{focusout:D,beforedeactivate:D,click:function(a){var b=a.target,c=b.type;(c==="radio"||c==="checkbox"||b.nodeName.toLowerCase()==="select")&&D.call(this,a)},keydown:function(a){var b=a.target,c=b.type;(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&D.call(this,a)},beforeactivate:function(a){var b=a.target;d._data(b,"_change_data",C(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in B)d.event.add(this,c+".specialChange",B[c]);return s.test(this.nodeName)},teardown:function(a){d.event.remove(this,".specialChange");return s.test(this.nodeName)}},B=d.event.special.change.filters,B.focus=B.beforeactivate}c.addEventListener&&d.each({focus:"focusin",blur:"focusout"},function(a,b){function f(a){var c=d.event.fix(a);c.type=b,c.originalEvent={},d.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var e=0;d.event.special[b]={setup:function(){e++===0&&c.addEventListener(a,f,!0)},teardown:function(){--e===0&&c.removeEventListener(a,f,!0)}}}),d.each(["bind","one"],function(a,c){d.fn[c]=function(a,e,f){if(typeof a==="object"){for(var g in a)this[c](g,e,a[g],f);return this}if(d.isFunction(e)||e===!1)f=e,e=b;var h=c==="one"?d.proxy(f,function(a){d(this).unbind(a,h);return f.apply(this,arguments)}):f;if(a==="unload"&&c!=="one")this.one(a,e,f);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},d.attrFn&&(d.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){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+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,e,g){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!=="string")return e;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(f.call(n)==="[object Array]")if(u)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]))&&e.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&e.push(j[t]);else e.push.apply(e,n);else p(n,e);o&&(k(o,h,e,g),k.uniqueSort(e));return e};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b==="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=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]=e++;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"text"===c&&(b===c||b===null)},radio:function(a){return"radio"===a.type},checkbox:function(a){return"checkbox"===a.type},file:function(a){return"file"===a.type},password:function(a){return"password"===a.type},submit:function(a){return"submit"===a.type},image:function(a){return"image"===a.type},reset:function(a){return"reset"===a.type},button:function(a){return"button"===a.type||a.nodeName.toLowerCase()==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)}},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 bc[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=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(f.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length==="number")for(var e=a.length;c ",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.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="
";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="
";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;g0)for(var g=c;g0},closest:function(a,b){var c=[],e,f,g=this[0];if(d.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(e=0,f=a.length;e-1:d(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=N.test(a)?d(a,b||this.context):null;for(e=0,f=this.length;e-1:d.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b)break}}c=c.length>1?d.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a==="string")return d.inArray(this[0],a?d(a):this.parent().children());return d.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a==="string"?d(a,b):d.makeArray(a),e=d.merge(this.get(),c);return this.pushStack(P(c[0])||P(e[0])?e:d.unique(e))},andSelf:function(){return this.add(this.prevObject)}}),d.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return d.dir(a,"parentNode")},parentsUntil:function(a,b,c){return d.dir(a,"parentNode",c)},next:function(a){return d.nth(a,2,"nextSibling")},prev:function(a){return d.nth(a,2,"previousSibling")},nextAll:function(a){return d.dir(a,"nextSibling")},prevAll:function(a){return d.dir(a,"previousSibling")},nextUntil:function(a,b,c){return d.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return d.dir(a,"previousSibling",c)},siblings:function(a){return d.sibling(a.parentNode.firstChild,a)},children:function(a){return d.sibling(a.firstChild)},contents:function(a){return d.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:d.makeArray(a.childNodes)}},function(a,b){d.fn[a]=function(c,e){var f=d.map(this,b,c),g=M.call(arguments);I.test(a)||(e=c),e&&typeof e==="string"&&(f=d.filter(e,f)),f=this.length>1&&!O[a]?d.unique(f):f,(this.length>1||K.test(e))&&J.test(a)&&(f=f.reverse());return this.pushStack(f,a,g.join(","))}}),d.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?d.find.matchesSelector(b[0],a)?[b[0]]:[]:d.find.matches(a,b)},dir:function(a,c,e){var f=[],g=a[c];while(g&&g.nodeType!==9&&(e===b||g.nodeType!==1||!d(g).is(e)))g.nodeType===1&&f.push(g),g=g[c];return f},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 R=/ jQuery\d+="(?:\d+|null)"/g,S=/^\s+/,T=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,U=/<([\w:]+)/,V=/",""],legend:[1,""," "],thead:[1,""],tr:[2,""],td:[3,""],col:[2,""],area:[1,""," "],_default:[0,"",""]};Z.optgroup=Z.option,Z.tbody=Z.tfoot=Z.colgroup=Z.caption=Z.thead,Z.th=Z.td,d.support.htmlSerialize||(Z._default=[1,"div","
"]),d.fn.extend({text:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(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 d.text(this)},wrapAll:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapAll(a.call(this,b))});if(this[0]){var b=d(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(d.isFunction(a))return this.each(function(b){d(this).wrapInner(a.call(this,b))});return this.each(function(){var b=d(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){d(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){d.nodeName(this,"body")||d(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=d(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,d(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,e;(e=this[c])!=null;c++)if(!a||d.filter(a,[e]).length)!b&&e.nodeType===1&&(d.cleanData(e.getElementsByTagName("*")),d.cleanData([e])),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&d.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 d.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(R,""):null;if(typeof a!=="string"||X.test(a)||!d.support.leadingWhitespace&&S.test(a)||Z[(U.exec(a)||["",""])[1].toLowerCase()])d.isFunction(a)?this.each(function(b){var c=d(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);else{a=a.replace(T,"<$1>$2>");try{for(var c=0,e=this.length;c1&&l0?this.clone(!0):this).get();d(f[h])[b](j),e=e.concat(j)}return this.pushStack(e,a,f.selector)}}),d.extend({clone:function(a,b,c){var e=a.cloneNode(!0),f,g,h;if((!d.support.noCloneEvent||!d.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!d.isXMLDoc(a)){ba(a,e),f=bb(a),g=bb(e);for(h=0;f[h];++h)ba(f[h],g[h])}if(b){_(a,e);if(c){f=bb(a),g=bb(e);for(h=0;f[h];++h)_(f[h],g[h])}}return e},clean:function(a,b,e,f){b=b||c,typeof b.createElement==="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var g=[];for(var h=0,i;(i=a[h])!=null;h++){typeof i==="number"&&(i+="");if(!i)continue;if(typeof i!=="string"||W.test(i)){if(typeof i==="string"){i=i.replace(T,"<$1>$2>");var j=(U.exec(i)||["",""])[1].toLowerCase(),k=Z[j]||Z._default,l=k[0],m=b.createElement("div");m.innerHTML=k[1]+i+k[2];while(l--)m=m.lastChild;if(!d.support.tbody){var n=V.test(i),o=j==="table"&&!n?m.firstChild&&m.firstChild.childNodes:k[1]===""&&!n?m.childNodes:[];for(var p=o.length-1;p>=0;--p)d.nodeName(o[p],"tbody")&&!o[p].childNodes.length&&o[p].parentNode.removeChild(o[p])}!d.support.leadingWhitespace&&S.test(i)&&m.insertBefore(b.createTextNode(S.exec(i)[0]),m.firstChild),i=m.childNodes}}else i=b.createTextNode(i);i.nodeType?g.push(i):g=d.merge(g,i)}if(e)for(h=0;g[h];h++)!f||!d.nodeName(g[h],"script")||g[h].type&&g[h].type.toLowerCase()!=="text/javascript"?(g[h].nodeType===1&&g.splice.apply(g,[h+1,0].concat(d.makeArray(g[h].getElementsByTagName("script")))),e.appendChild(g[h])):f.push(g[h].parentNode?g[h].parentNode.removeChild(g[h]):g[h]);return g},cleanData:function(a){var b,c,e=d.cache,f=d.expando,g=d.event.special,h=d.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&d.noData[j.nodeName.toLowerCase()])continue;c=j[d.expando];if(c){b=e[c]&&e[c][f];if(b&&b.events){for(var k in b.events)g[k]?d.event.remove(j,k):d.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[d.expando]:j.removeAttribute&&j.removeAttribute(d.expando),delete e[c]}}}});var bd=/alpha\([^)]*\)/i,be=/opacity=([^)]*)/,bf=/-([a-z])/ig,bg=/([A-Z]|^ms)/g,bh=/^-?\d+(?:px)?$/i,bi=/^-?\d/,bj={position:"absolute",visibility:"hidden",display:"block"},bk=["Left","Right"],bl=["Top","Bottom"],bm,bn,bo,bp=function(a,b){return b.toUpperCase()};d.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return d.access(this,a,c,!0,function(a,c,e){return e!==b?d.style(a,c,e):d.css(a,c)})},d.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bm(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0},cssProps:{"float":d.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,e,f){if(a&&a.nodeType!==3&&a.nodeType!==8&&a.style){var g,h=d.camelCase(c),i=a.style,j=d.cssHooks[h];c=d.cssProps[h]||h;if(e===b){if(j&&"get"in j&&(g=j.get(a,!1,f))!==b)return g;return i[c]}if(typeof e==="number"&&isNaN(e)||e==null)return;typeof e==="number"&&!d.cssNumber[h]&&(e+="px");if(!j||!("set"in j)||(e=j.set(a,e))!==b)try{i[c]=e}catch(k){}}},css:function(a,c,e){var f,g=d.camelCase(c),h=d.cssHooks[g];c=d.cssProps[g]||g;if(h&&"get"in h&&(f=h.get(a,!0,e))!==b)return f;if(bm)return bm(a,c,g)},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(bf,bp)}}),d.curCSS=d.css,d.each(["height","width"],function(a,b){d.cssHooks[b]={get:function(a,c,e){var f;if(c){a.offsetWidth!==0?f=bq(a,b,e):d.swap(a,bj,function(){f=bq(a,b,e)});if(f<=0){f=bm(a,b,b),f==="0px"&&bo&&(f=bo(a,b,b));if(f!=null)return f===""||f==="auto"?"0px":f}if(f<0||f==null){f=a.style[b];return f===""||f==="auto"?"0px":f}return typeof f==="string"?f:f+"px"}},set:function(a,b){if(!bh.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),d.support.opacity||(d.cssHooks.opacity={get:function(a,b){return be.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style;c.zoom=1;var e=d.isNaN(b)?"":"alpha(opacity="+b*100+")",f=c.filter||"";c.filter=bd.test(f)?f.replace(bd,e):c.filter+" "+e}}),d(function(){d.support.reliableMarginRight||(d.cssHooks.marginRight={get:function(a,b){var c;d.swap(a,{display:"inline-block"},function(){b?c=bm(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bn=function(a,c,e){var f,g,h;e=e.replace(bg,"-$1").toLowerCase();if(!(g=a.ownerDocument.defaultView))return b;if(h=g.getComputedStyle(a,null))f=h.getPropertyValue(e),f===""&&!d.contains(a.ownerDocument.documentElement,a)&&(f=d.style(a,e));return f}),c.documentElement.currentStyle&&(bo=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bh.test(d)&&bi.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}),bm=bn||bo,d.expr&&d.expr.filters&&(d.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!d.support.reliableHiddenOffsets&&(a.style.display||d.css(a,"display"))==="none"},d.expr.filters.visible=function(a){return!d.expr.filters.hidden(a)});var br=/%20/g,bs=/\[\]$/,bt=/\r?\n/g,bu=/#.*$/,bv=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bw=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bx=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,by=/^(?:GET|HEAD)$/,bz=/^\/\//,bA=/\?/,bB=/