﻿
/*
### jQuery Star Rating Plugin v3.12 - 2009-04-16 ###
* Home: http://www.fyneworks.com/jquery/star-rating/
* Code: http://code.google.com/p/jquery-star-rating-plugin/
*
* Dual licensed under the MIT and GPL licenses:
*   http://www.opensource.org/licenses/mit-license.php
*   http://www.gnu.org/licenses/gpl.html
* 
*  Modified to add selectNoCallback function
###
*/


/**
* Cookie plugin
*
* Copyright (c) 2006 Klaus Hartl (stilbuero.de)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/
jQuery.cookie = function(d, c, a) { if (typeof c != "undefined") { a = a || {}; if (c === null) { c = ""; a.expires = -1 } var h = ""; if (a.expires && (typeof a.expires == "number" || a.expires.toUTCString)) { var b; if (typeof a.expires == "number") { b = new Date; b.setTime(b.getTime() + a.expires * 24 * 60 * 60 * 1e3) } else b = a.expires; h = "; expires=" + b.toUTCString() } var l = a.path ? "; path=" + a.path : "", j = a.domain ? "; domain=" + a.domain : "", k = a.secure ? "; secure" : ""; document.cookie = [d, "=", encodeURIComponent(c), h, l, j, k].join("") } else { var f = null; if (document.cookie && document.cookie != "") for (var g = document.cookie.split(";"), e = 0; e < g.length; e++) { var i = jQuery.trim(g[e]); if (i.substring(0, d.length + 1) == d + "=") { f = decodeURIComponent(i.substring(d.length + 1)); break } } return f } };

/*
* jQuery Timer Plugin
* http://www.evanbot.com/article/jquery-timer-plugin/23
*
* @version      1.0
* @copyright    2009 Evan Byrne (http://www.evanbot.com)
*/

jQuery.timer = function(d, c, a) { var b = { timer: setTimeout(c, d), callback: null }; if (typeof a == "function") b.callback = a; return b };

jQuery.clearTimer = function(a) { clearTimeout(a.timer); typeof a.callback == "function" && a.callback(); return this };

/*
* jQuery validation plug-in 1.5.5
*
* http://bassistance.de/jquery-plugins/jquery-plugin-validation/
* http://docs.jquery.com/Plugins/Validation
*
* Copyright (c) 2006 - 2008 Jörn Zaefferer
*
* $Id: jquery.validate.js 6403 2009-06-17 14:27:16Z joern.zaefferer $
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
* 
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* 
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
(function($) {
    $.extend($.fn, { validate: function(options) { if (!this.length) { options && options.debug && window.console && console.warn("nothing selected, can't validate, returning nothing"); return; } var validator = $.data(this[0], 'validator'); if (validator) { return validator; } validator = new $.validator(options, this[0]); $.data(this[0], 'validator', validator); if (validator.settings.onsubmit) { this.find("input, button").filter(".cancel").click(function() { validator.cancelSubmit = true; }); if (validator.settings.submitHandler) { this.find("input, button").filter(":submit").click(function() { validator.submitButton = this; }); } this.submit(function(event) { if (validator.settings.debug) event.preventDefault(); function handle() { if (validator.settings.submitHandler) { if (validator.submitButton) { var hidden = $("<input type='hidden'/>").attr("name", validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm); } validator.settings.submitHandler.call(validator, validator.currentForm); if (validator.submitButton) { hidden.remove(); } return false; } return true; } if (validator.cancelSubmit) { validator.cancelSubmit = false; return handle(); } if (validator.form()) { if (validator.pendingRequest) { validator.formSubmitted = true; return false; } return handle(); } else { validator.focusInvalid(); return false; } }); } return validator; }, valid: function() { if ($(this[0]).is('form')) { return this.validate().form(); } else { var valid = true; var validator = $(this[0].form).validate(); this.each(function() { valid &= validator.element(this); }); return valid; } }, removeAttrs: function(attributes) { var result = {}, $element = this; $.each(attributes.split(/\s/), function(index, value) { result[value] = $element.attr(value); $element.removeAttr(value); }); return result; }, rules: function(command, argument) { var element = this[0]; if (command) { var settings = $.data(element.form, 'validator').settings; var staticRules = settings.rules; var existingRules = $.validator.staticRules(element); switch (command) { case "add": $.extend(existingRules, $.validator.normalizeRule(argument)); staticRules[element.name] = existingRules; if (argument.messages) settings.messages[element.name] = $.extend(settings.messages[element.name], argument.messages); break; case "remove": if (!argument) { delete staticRules[element.name]; return existingRules; } var filtered = {}; $.each(argument.split(/\s/), function(index, method) { filtered[method] = existingRules[method]; delete existingRules[method]; }); return filtered; } } var data = $.validator.normalizeRules($.extend({}, $.validator.metadataRules(element), $.validator.classRules(element), $.validator.attributeRules(element), $.validator.staticRules(element)), element); if (data.required) { var param = data.required; delete data.required; data = $.extend({ required: param }, data); } return data; } }); $.extend($.expr[":"], { blank: function(a) { return !$.trim(a.value); }, filled: function(a) { return !!$.trim(a.value); }, unchecked: function(a) { return !a.checked; } }); $.validator = function(options, form) { this.settings = $.extend({}, $.validator.defaults, options); this.currentForm = form; this.init(); }; $.validator.format = function(source, params) { if (arguments.length == 1) return function() { var args = $.makeArray(arguments); args.unshift(source); return $.validator.format.apply(this, args); }; if (arguments.length > 2 && params.constructor != Array) { params = $.makeArray(arguments).slice(1); } if (params.constructor != Array) { params = [params]; } $.each(params, function(i, n) { source = source.replace(new RegExp("\\{" + i + "\\}", "g"), n); }); return source; }; $.extend($.validator, { defaults: { messages: {}, groups: {}, rules: {}, errorClass: "error", validClass: "valid", errorElement: "label", focusInvalid: true, errorContainer: $([]), errorLabelContainer: $([]), onsubmit: true, ignore: [], ignoreTitle: false, onfocusin: function(element) { this.lastActive = element; if (this.settings.focusCleanup && !this.blockFocusCleanup) { this.settings.unhighlight && this.settings.unhighlight.call(this, element, this.settings.errorClass, this.settings.validClass); this.errorsFor(element).hide(); } }, onfocusout: function(element) { if (!this.checkable(element) && (element.name in this.submitted || !this.optional(element))) { this.element(element); } }, onkeyup: function(element) { if (element.name in this.submitted || element == this.lastElement) { this.element(element); } }, onclick: function(element) { if (element.name in this.submitted) this.element(element); }, highlight: function(element, errorClass, validClass) { $(element).addClass(errorClass).removeClass(validClass); }, unhighlight: function(element, errorClass, validClass) { $(element).removeClass(errorClass).addClass(validClass); } }, setDefaults: function(settings) { $.extend($.validator.defaults, settings); }, messages: { required: "This field is required.", remote: "Please fix this field.", email: "Please enter a valid email address.", url: "Please enter a valid URL.", date: "Please enter a valid date.", dateISO: "Please enter a valid date (ISO).", dateDE: "Bitte geben Sie ein gültiges Datum ein.", number: "Please enter a valid number.", numberDE: "Bitte geben Sie eine Nummer ein.", digits: "Please enter only digits", creditcard: "Please enter a valid credit card number.", equalTo: "Please enter the same value again.", accept: "Please enter a value with a valid extension.", maxlength: $.validator.format("Please enter no more than {0} characters."), minlength: $.validator.format("Please enter at least {0} characters."), rangelength: $.validator.format("Please enter a value between {0} and {1} characters long."), range: $.validator.format("Please enter a value between {0} and {1}."), max: $.validator.format("Please enter a value less than or equal to {0}."), min: $.validator.format("Please enter a value greater than or equal to {0}.") }, autoCreateRanges: false, prototype: { init: function() { this.labelContainer = $(this.settings.errorLabelContainer); this.errorContext = this.labelContainer.length && this.labelContainer || $(this.currentForm); this.containers = $(this.settings.errorContainer).add(this.settings.errorLabelContainer); this.submitted = {}; this.valueCache = {}; this.pendingRequest = 0; this.pending = {}; this.invalid = {}; this.reset(); var groups = (this.groups = {}); $.each(this.settings.groups, function(key, value) { $.each(value.split(/\s/), function(index, name) { groups[name] = key; }); }); var rules = this.settings.rules; $.each(rules, function(key, value) { rules[key] = $.validator.normalizeRule(value); }); function delegate(event) { var validator = $.data(this[0].form, "validator"); validator.settings["on" + event.type] && validator.settings["on" + event.type].call(validator, this[0]); } $(this.currentForm).delegate("focusin focusout keyup", ":text, :password, :file, select, textarea", delegate).delegate("click", ":radio, :checkbox", delegate); if (this.settings.invalidHandler) $(this.currentForm).bind("invalid-form.validate", this.settings.invalidHandler); }, form: function() { this.checkForm(); $.extend(this.submitted, this.errorMap); this.invalid = $.extend({}, this.errorMap); if (!this.valid()) $(this.currentForm).triggerHandler("invalid-form", [this]); this.showErrors(); return this.valid(); }, checkForm: function() { this.prepareForm(); for (var i = 0, elements = (this.currentElements = this.elements()); elements[i]; i++) { this.check(elements[i]); } return this.valid(); }, element: function(element) { element = this.clean(element); this.lastElement = element; this.prepareElement(element); this.currentElements = $(element); var result = this.check(element); if (result) { delete this.invalid[element.name]; } else { this.invalid[element.name] = true; } if (!this.numberOfInvalids()) { this.toHide = this.toHide.add(this.containers); } this.showErrors(); return result; }, showErrors: function(errors) { if (errors) { $.extend(this.errorMap, errors); this.errorList = []; for (var name in errors) { this.errorList.push({ message: errors[name], element: this.findByName(name)[0] }); } this.successList = $.grep(this.successList, function(element) { return !(element.name in errors); }); } this.settings.showErrors ? this.settings.showErrors.call(this, this.errorMap, this.errorList) : this.defaultShowErrors(); }, resetForm: function() { if ($.fn.resetForm) $(this.currentForm).resetForm(); this.submitted = {}; this.prepareForm(); this.hideErrors(); this.elements().removeClass(this.settings.errorClass); }, numberOfInvalids: function() { return this.objectLength(this.invalid); }, objectLength: function(obj) { var count = 0; for (var i in obj) count++; return count; }, hideErrors: function() { this.addWrapper(this.toHide).hide(); }, valid: function() { return this.size() == 0; }, size: function() { return this.errorList.length; }, focusInvalid: function() { if (this.settings.focusInvalid) { try { $(this.findLastActive() || this.errorList.length && this.errorList[0].element || []).filter(":visible").focus(); } catch (e) { } } }, findLastActive: function() { var lastActive = this.lastActive; return lastActive && $.grep(this.errorList, function(n) { return n.element.name == lastActive.name; }).length == 1 && lastActive; }, elements: function() { var validator = this, rulesCache = {}; return $([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function() { !this.name && validator.settings.debug && window.console && console.error("%o has no name assigned", this); if (this.name in rulesCache || !validator.objectLength($(this).rules())) return false; rulesCache[this.name] = true; return true; }); }, clean: function(selector) { return $(selector)[0]; }, errors: function() { return $(this.settings.errorElement + "." + this.settings.errorClass, this.errorContext); }, reset: function() { this.successList = []; this.errorList = []; this.errorMap = {}; this.toShow = $([]); this.toHide = $([]); this.formSubmitted = false; this.currentElements = $([]); }, prepareForm: function() { this.reset(); this.toHide = this.errors().add(this.containers); }, prepareElement: function(element) { this.reset(); this.toHide = this.errorsFor(element); }, check: function(element) {
        element = this.clean(element); if (this.checkable(element)) { element = this.findByName(element.name)[0]; } var rules = $(element).rules(); var dependencyMismatch = false; for (method in rules) {
            var rule = { method: method, parameters: rules[method] }; try { var result = $.validator.methods[method].call(this, element.value.replace(/\r/g, ""), element, rule.parameters); if (result == "dependency-mismatch") { dependencyMismatch = true; continue; } dependencyMismatch = false; if (result == "pending") { this.toHide = this.toHide.not(this.errorsFor(element)); return; } if (!result) { this.formatAndAdd(element, rule); return false; } } catch (e) {
                this.settings.debug && window.console && console.log("exception occured when checking element " + element.id
+ ", check the '" + rule.method + "' method"); throw e;
            }
        } if (dependencyMismatch) return; if (this.objectLength(rules)) this.successList.push(element); return true;
    }, customMetaMessage: function(element, method) { if (!$.metadata) return; var meta = this.settings.meta ? $(element).metadata()[this.settings.meta] : $(element).metadata(); return meta && meta.messages && meta.messages[method]; }, customMessage: function(name, method) { var m = this.settings.messages[name]; return m && (m.constructor == String ? m : m[method]); }, findDefined: function() { for (var i = 0; i < arguments.length; i++) { if (arguments[i] !== undefined) return arguments[i]; } return undefined; }, defaultMessage: function(element, method) { return this.findDefined(this.customMessage(element.name, method), this.customMetaMessage(element, method), !this.settings.ignoreTitle && element.title || undefined, $.validator.messages[method], "<strong>Warning: No message defined for " + element.name + "</strong>"); }, formatAndAdd: function(element, rule) { var message = this.defaultMessage(element, rule.method); if (typeof message == "function") message = message.call(this, rule.parameters, element); this.errorList.push({ message: message, element: element }); this.errorMap[element.name] = message; this.submitted[element.name] = message; }, addWrapper: function(toToggle) { if (this.settings.wrapper) toToggle = toToggle.add(toToggle.parent(this.settings.wrapper)); return toToggle; }, defaultShowErrors: function() { for (var i = 0; this.errorList[i]; i++) { var error = this.errorList[i]; this.settings.highlight && this.settings.highlight.call(this, error.element, this.settings.errorClass, this.settings.validClass); this.showLabel(error.element, error.message); } if (this.errorList.length) { this.toShow = this.toShow.add(this.containers); } if (this.settings.success) { for (var i = 0; this.successList[i]; i++) { this.showLabel(this.successList[i]); } } if (this.settings.unhighlight) { for (var i = 0, elements = this.validElements(); elements[i]; i++) { this.settings.unhighlight.call(this, elements[i], this.settings.errorClass, this.settings.validClass); } } this.toHide = this.toHide.not(this.toShow); this.hideErrors(); this.addWrapper(this.toShow).show(); }, validElements: function() { return this.currentElements.not(this.invalidElements()); }, invalidElements: function() { return $(this.errorList).map(function() { return this.element; }); }, showLabel: function(element, message) { var label = this.errorsFor(element); if (label.length) { label.removeClass().addClass(this.settings.errorClass); label.attr("generated") && label.html(message); } else { label = $("<" + this.settings.errorElement + "/>").attr({ "for": this.idOrName(element), generated: true }).addClass(this.settings.errorClass).html(message || ""); if (this.settings.wrapper) { label = label.hide().show().wrap("<" + this.settings.wrapper + "/>").parent(); } if (!this.labelContainer.append(label).length) this.settings.errorPlacement ? this.settings.errorPlacement(label, $(element)) : label.insertAfter(element); } if (!message && this.settings.success) { label.text(""); typeof this.settings.success == "string" ? label.addClass(this.settings.success) : this.settings.success(label); } this.toShow = this.toShow.add(label); }, errorsFor: function(element) { return this.errors().filter("[for='" + this.idOrName(element) + "']"); }, idOrName: function(element) { return this.groups[element.name] || (this.checkable(element) ? element.name : element.id || element.name); }, checkable: function(element) { return /radio|checkbox/i.test(element.type); }, findByName: function(name) { var form = this.currentForm; return $(document.getElementsByName(name)).map(function(index, element) { return element.form == form && element.name == name && element || null; }); }, getLength: function(value, element) { switch (element.nodeName.toLowerCase()) { case 'select': return $("option:selected", element).length; case 'input': if (this.checkable(element)) return this.findByName(element.name).filter(':checked').length; } return value.length; }, depend: function(param, element) { return this.dependTypes[typeof param] ? this.dependTypes[typeof param](param, element) : true; }, dependTypes: { "boolean": function(param, element) { return param; }, "string": function(param, element) { return !!$(param, element.form).length; }, "function": function(param, element) { return param(element); } }, optional: function(element) { return !$.validator.methods.required.call(this, $.trim(element.value), element) && "dependency-mismatch"; }, startRequest: function(element) { if (!this.pending[element.name]) { this.pendingRequest++; this.pending[element.name] = true; } }, stopRequest: function(element, valid) { this.pendingRequest--; if (this.pendingRequest < 0) this.pendingRequest = 0; delete this.pending[element.name]; if (valid && this.pendingRequest == 0 && this.formSubmitted && this.form()) { $(this.currentForm).submit(); } else if (!valid && this.pendingRequest == 0 && this.formSubmitted) { $(this.currentForm).triggerHandler("invalid-form", [this]); } }, previousValue: function(element) { return $.data(element, "previousValue") || $.data(element, "previousValue", previous = { old: null, valid: true, message: this.defaultMessage(element, "remote") }); }
    }, classRuleSettings: { required: { required: true }, email: { email: true }, url: { url: true }, date: { date: true }, dateISO: { dateISO: true }, dateDE: { dateDE: true }, number: { number: true }, numberDE: { numberDE: true }, digits: { digits: true }, creditcard: { creditcard: true} }, addClassRules: function(className, rules) { className.constructor == String ? this.classRuleSettings[className] = rules : $.extend(this.classRuleSettings, className); }, classRules: function(element) { var rules = {}; var classes = $(element).attr('class'); classes && $.each(classes.split(' '), function() { if (this in $.validator.classRuleSettings) { $.extend(rules, $.validator.classRuleSettings[this]); } }); return rules; }, attributeRules: function(element) { var rules = {}; var $element = $(element); for (method in $.validator.methods) { var value = $element.attr(method); if (value) { rules[method] = value; } } if (rules.maxlength && /-1|2147483647|524288/.test(rules.maxlength)) { delete rules.maxlength; } return rules; }, metadataRules: function(element) { if (!$.metadata) return {}; var meta = $.data(element.form, 'validator').settings.meta; return meta ? $(element).metadata()[meta] : $(element).metadata(); }, staticRules: function(element) { var rules = {}; var validator = $.data(element.form, 'validator'); if (validator.settings.rules) { rules = $.validator.normalizeRule(validator.settings.rules[element.name]) || {}; } return rules; }, normalizeRules: function(rules, element) { $.each(rules, function(prop, val) { if (val === false) { delete rules[prop]; return; } if (val.param || val.depends) { var keepRule = true; switch (typeof val.depends) { case "string": keepRule = !!$(val.depends, element.form).length; break; case "function": keepRule = val.depends.call(element, element); break; } if (keepRule) { rules[prop] = val.param !== undefined ? val.param : true; } else { delete rules[prop]; } } }); $.each(rules, function(rule, parameter) { rules[rule] = $.isFunction(parameter) ? parameter(element) : parameter; }); $.each(['minlength', 'maxlength', 'min', 'max'], function() { if (rules[this]) { rules[this] = Number(rules[this]); } }); $.each(['rangelength', 'range'], function() { if (rules[this]) { rules[this] = [Number(rules[this][0]), Number(rules[this][1])]; } }); if ($.validator.autoCreateRanges) { if (rules.min && rules.max) { rules.range = [rules.min, rules.max]; delete rules.min; delete rules.max; } if (rules.minlength && rules.maxlength) { rules.rangelength = [rules.minlength, rules.maxlength]; delete rules.minlength; delete rules.maxlength; } } if (rules.messages) { delete rules.messages } return rules; }, normalizeRule: function(data) { if (typeof data == "string") { var transformed = {}; $.each(data.split(/\s/), function() { transformed[this] = true; }); data = transformed; } return data; }, addMethod: function(name, method, message) { $.validator.methods[name] = method; $.validator.messages[name] = message || $.validator.messages[name]; if (method.length < 3) { $.validator.addClassRules(name, $.validator.normalizeRule(name)); } }, methods: { required: function(value, element, param) { if (!this.depend(param, element)) return "dependency-mismatch"; switch (element.nodeName.toLowerCase()) { case 'select': var options = $("option:selected", element); return options.length > 0 && (element.type == "select-multiple" || ($.browser.msie && !(options[0].attributes['value'].specified) ? options[0].text : options[0].value).length > 0); case 'input': if (this.checkable(element)) return this.getLength(value, element) > 0; default: return $.trim(value).length > 0; } }, remote: function(value, element, param) { if (this.optional(element)) return "dependency-mismatch"; var previous = this.previousValue(element); if (!this.settings.messages[element.name]) this.settings.messages[element.name] = {}; this.settings.messages[element.name].remote = typeof previous.message == "function" ? previous.message(value) : previous.message; param = typeof param == "string" && { url: param} || param; if (previous.old !== value) { previous.old = value; var validator = this; this.startRequest(element); var data = {}; data[element.name] = value; $.ajax($.extend(true, { url: param, mode: "abort", port: "validate" + element.name, dataType: "json", data: data, success: function(response) { var valid = response === true; if (valid) { var submitted = validator.formSubmitted; validator.prepareElement(element); validator.formSubmitted = submitted; validator.successList.push(element); validator.showErrors(); } else { var errors = {}; errors[element.name] = previous.message = response || validator.defaultMessage(element, "remote"); validator.showErrors(errors); } previous.valid = valid; validator.stopRequest(element, valid); } }, param)); return "pending"; } else if (this.pending[element.name]) { return "pending"; } return previous.valid; }, minlength: function(value, element, param) { return this.optional(element) || this.getLength($.trim(value), element) >= param; }, maxlength: function(value, element, param) { return this.optional(element) || this.getLength($.trim(value), element) <= param; }, rangelength: function(value, element, param) { var length = this.getLength($.trim(value), element); return this.optional(element) || (length >= param[0] && length <= param[1]); }, min: function(value, element, param) { return this.optional(element) || value >= param; }, max: function(value, element, param) { return this.optional(element) || value <= param; }, range: function(value, element, param) { return this.optional(element) || (value >= param[0] && value <= param[1]); }, email: function(value, element) { return this.optional(element) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value); }, url: function(value, element) { return this.optional(element) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value); }, date: function(value, element) { return this.optional(element) || !/Invalid|NaN/.test(new Date(value)); }, dateISO: function(value, element) { return this.optional(element) || /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value); }, dateDE: function(value, element) { return this.optional(element) || /^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(value); }, number: function(value, element) { return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value); }, numberDE: function(value, element) { return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(value); }, digits: function(value, element) { return this.optional(element) || /^\d+$/.test(value); }, creditcard: function(value, element) { if (this.optional(element)) return "dependency-mismatch"; if (/[^0-9-]+/.test(value)) return false; var nCheck = 0, nDigit = 0, bEven = false; value = value.replace(/\D/g, ""); for (n = value.length - 1; n >= 0; n--) { var cDigit = value.charAt(n); var nDigit = parseInt(cDigit, 10); if (bEven) { if ((nDigit *= 2) > 9) nDigit -= 9; } nCheck += nDigit; bEven = !bEven; } return (nCheck % 10) == 0; }, accept: function(value, element, param) { param = typeof param == "string" ? param.replace(/,/g, '|') : "png|jpe?g|gif"; return this.optional(element) || value.match(new RegExp(".(" + param + ")$", "i")); }, equalTo: function(value, element, param) { return value == $(param).val(); } }
    }); $.format = $.validator.format;
})(jQuery); ; (function($) { var ajax = $.ajax; var pendingRequests = {}; $.ajax = function(settings) { settings = $.extend(settings, $.extend({}, $.ajaxSettings, settings)); var port = settings.port; if (settings.mode == "abort") { if (pendingRequests[port]) { pendingRequests[port].abort(); } return (pendingRequests[port] = ajax.apply(this, arguments)); } return ajax.apply(this, arguments); }; })(jQuery); ; (function($) { $.each({ focus: 'focusin', blur: 'focusout' }, function(original, fix) { $.event.special[fix] = { setup: function() { if ($.browser.msie) return false; this.addEventListener(original, $.event.special[fix].handler, true); }, teardown: function() { if ($.browser.msie) return false; this.removeEventListener(original, $.event.special[fix].handler, true); }, handler: function(e) { arguments[0] = $.event.fix(e); arguments[0].type = fix; return $.event.handle.apply(this, arguments); } }; }); $.extend($.fn, { delegate: function(type, delegate, handler) { return this.bind(type, function(event) { var target = $(event.target); if (target.is(delegate)) { return handler.apply(target, arguments); } }); }, triggerEvent: function(type, target) { return this.triggerHandler(type, [$.event.fix({ type: type, target: target })]); } }) })(jQuery);


(function(a) { a.fn.ellipsis = function(b) { var c = document.documentElement.style; return this.each(function() { var c = a(this); if (c.css("overflow") == "hidden") { var f = c.html(), h = c.width(), e = a(this.cloneNode(true)).hide().css({ position: "absolute", width: "auto", overflow: "visible", "max-width": "inherit" }); c.after(e); var d = f; while (d.length > 0 && e.width() > c.width()) { d = d.substr(0, d.length - 1); e.html(d + "...") } c.html(e.html()); e.remove(); if (b == true) { var g = c.width(); setInterval(function() { if (c.width() != g) { g = c.width(); c.html(f); c.ellipsis() } }, 200) } } }) } })(jQuery);

/*
* Simple textbox watermarking plugin.
* control will have 'watermark' class when the watermark text is being displayed
* and 'active' class when not displayed
*
* To use:
* $("#aTextBox").watermark("First Name");
* 
* Be sure to check the .val() of the text box to see if it contains the watermark
* text before using.		
*/
(function(a) { a.fn.watermark = function(b) { return this.each(function() { var d = "active", c = "watermark", e = a(this); if (e.val() == "" || e.val() == b) { e.val(b); e.addClass(c); e.removeClass(d) } else { e.addClass(d); e.removeClass(c) } a(this).focus(function() { var e = a(this); e.addClass(d); e.val() == b && e.val("").removeClass(c) }); a(this).blur(function() { var e = a(this); e.removeClass(d); if (e.val() == "" || e.val() == b) { e.addClass(c); e.val(b) } }) }) } })(jQuery);

/*
* Not really a plugin, but is handy! 
*/
function isNullOrEmpty(a) { return a == null ? true : a == "" ? true : false };


/*
* @name BeautyTips
* @desc a tooltips/baloon-help plugin for jQuery
*
* @author Jeff Robbins - Lullabot - http://www.lullabot.com
* @version 0.9.5-rc1  (5/20/2009)
*/
jQuery.bt = { version: "0.9.5-rc1" }; (function($) { jQuery.fn.bt = function(content, options) { if (typeof content != "string") { var contentSelect = true; options = content; content = false; } else { var contentSelect = false; } if (jQuery.fn.hoverIntent && jQuery.bt.defaults.trigger == "hover") { jQuery.bt.defaults.trigger = "hoverIntent"; } return this.each(function(index) { var opts = jQuery.extend(false, jQuery.bt.defaults, jQuery.bt.options, options); opts.spikeLength = numb(opts.spikeLength); opts.spikeGirth = numb(opts.spikeGirth); opts.overlap = numb(opts.overlap); var ajaxTimeout = false; if (opts.killTitle) { $(this).find("[title]").andSelf().each(function() { if (!$(this).attr("bt-xTitle")) { $(this).attr("bt-xTitle", $(this).attr("title")).attr("title", ""); } }); } if (typeof opts.trigger == "string") { opts.trigger = [opts.trigger]; } if (opts.trigger[0] == "hoverIntent") { var hoverOpts = jQuery.extend(opts.hoverIntentOpts, { over: function() { this.btOn(); }, out: function() { this.btOff(); } }); $(this).hoverIntent(hoverOpts); } else { if (opts.trigger[0] == "hover") { $(this).hover(function() { this.btOn(); }, function() { this.btOff(); }); } else { if (opts.trigger[0] == "now") { if ($(this).hasClass("bt-active")) { this.btOff(); } else { this.btOn(); } } else { if (opts.trigger[0] == "none") { } else { if (opts.trigger.length > 1 && opts.trigger[0] != opts.trigger[1]) { $(this).bind(opts.trigger[0], function() { this.btOn(); }).bind(opts.trigger[1], function() { this.btOff(); }); } else { $(this).bind(opts.trigger[0], function() { if ($(this).hasClass("bt-active")) { this.btOff(); } else { this.btOn(); } }); } } } } } this.btOn = function() { if (typeof $(this).data("bt-box") == "object") { this.btOff(); } opts.preBuild.apply(this); $(jQuery.bt.vars.closeWhenOpenStack).btOff(); $(this).addClass("bt-active " + opts.activeClass); if (contentSelect && opts.ajaxPath == null) { if (opts.killTitle) { $(this).attr("title", $(this).attr("bt-xTitle")); } content = $.isFunction(opts.contentSelector) ? opts.contentSelector.apply(this) : eval(opts.contentSelector); if (opts.killTitle) { $(this).attr("title", ""); } } if (opts.ajaxPath != null && content == false) { if (typeof opts.ajaxPath == "object") { var url = eval(opts.ajaxPath[0]); url += opts.ajaxPath[1] ? " " + opts.ajaxPath[1] : ""; } else { var url = opts.ajaxPath; } var off = url.indexOf(" "); if (off >= 0) { var selector = url.slice(off, url.length); url = url.slice(0, off); } var cacheData = opts.ajaxCache ? $(document.body).data("btCache-" + url.replace(/\./g, "")) : null; if (typeof cacheData == "string") { content = selector ? $("<div/>").append(cacheData.replace(/<script(.|\s)*?\/script>/g, "")).find(selector) : cacheData; } else { var target = this; var ajaxOpts = jQuery.extend(false, { type: opts.ajaxType, data: opts.ajaxData, cache: opts.ajaxCache, url: url, complete: function(XMLHttpRequest, textStatus) { if (textStatus == "success" || textStatus == "notmodified") { if (opts.ajaxCache) { $(document.body).data("btCache-" + url.replace(/\./g, ""), XMLHttpRequest.responseText); } ajaxTimeout = false; content = selector ? $("<div/>").append(XMLHttpRequest.responseText.replace(/<script(.|\s)*?\/script>/g, "")).find(selector) : XMLHttpRequest.responseText; } else { if (textStatus == "timeout") { ajaxTimeout = true; } content = opts.ajaxError.replace(/%error/g, XMLHttpRequest.statusText); } if ($(target).hasClass("bt-active")) { target.btOn(); } } }, opts.ajaxOpts); jQuery.ajax(ajaxOpts); content = opts.ajaxLoading; } } var shadowMarginX = 0; var shadowMarginY = 0; var shadowShiftX = 0; var shadowShiftY = 0; if (opts.shadow && !shadowSupport()) { opts.shadow = false; jQuery.extend(opts, opts.noShadowOpts); } if (opts.shadow) { if (opts.shadowBlur > Math.abs(opts.shadowOffsetX)) { shadowMarginX = opts.shadowBlur * 2; } else { shadowMarginX = opts.shadowBlur + Math.abs(opts.shadowOffsetX); } shadowShiftX = (opts.shadowBlur - opts.shadowOffsetX) > 0 ? opts.shadowBlur - opts.shadowOffsetX : 0; if (opts.shadowBlur > Math.abs(opts.shadowOffsetY)) { shadowMarginY = opts.shadowBlur * 2; } else { shadowMarginY = opts.shadowBlur + Math.abs(opts.shadowOffsetY); } shadowShiftY = (opts.shadowBlur - opts.shadowOffsetY) > 0 ? opts.shadowBlur - opts.shadowOffsetY : 0; } if (opts.offsetParent) { var offsetParent = $(opts.offsetParent); var offsetParentPos = offsetParent.offset(); var pos = $(this).offset(); var top = numb(pos.top) - numb(offsetParentPos.top) + numb($(this).css("margin-top")) - shadowShiftY; var left = numb(pos.left) - numb(offsetParentPos.left) + numb($(this).css("margin-left")) - shadowShiftX; } else { var offsetParent = ($(this).css("position") == "absolute") ? $(this).parents().eq(0).offsetParent() : $(this).offsetParent(); var pos = $(this).btPosition(); var top = numb(pos.top) + numb($(this).css("margin-top")) - shadowShiftY; var left = numb(pos.left) + numb($(this).css("margin-left")) - shadowShiftX; } var width = $(this).btOuterWidth(); var height = $(this).outerHeight(); if (typeof content == "object") { var original = content; var clone = $(original).clone(true).show(); var origClones = $(original).data("bt-clones") || []; origClones.push(clone); $(original).data("bt-clones", origClones); $(clone).data("bt-orig", original); $(this).data("bt-content-orig", { original: original, clone: clone }); content = clone; } if (typeof content == "null" || content == "") { return; } var $text = $('<div class="bt-content"></div>').append(content).css({ padding: opts.padding, position: "absolute", width: (opts.shrinkToFit ? "auto" : opts.width), zIndex: opts.textzIndex, left: shadowShiftX, top: shadowShiftY }).css(opts.cssStyles); var $box = $('<div class="bt-wrapper"></div>').append($text).addClass(opts.cssClass).css({ position: "absolute", width: opts.width, zIndex: opts.wrapperzIndex, visibility: "hidden" }).appendTo(offsetParent); if (jQuery.fn.bgiframe) { $text.bgiframe(); $box.bgiframe(); } $(this).data("bt-box", $box); var scrollTop = numb($(document).scrollTop()); var scrollLeft = numb($(document).scrollLeft()); var docWidth = numb($(window).width()); var docHeight = numb($(window).height()); var winRight = scrollLeft + docWidth; var winBottom = scrollTop + docHeight; var space = new Object(); var thisOffset = $(this).offset(); space.top = thisOffset.top - scrollTop; space.bottom = docHeight - ((thisOffset + height) - scrollTop); space.left = thisOffset.left - scrollLeft; space.right = docWidth - ((thisOffset.left + width) - scrollLeft); var textOutHeight = numb($text.outerHeight()); var textOutWidth = numb($text.btOuterWidth()); if (opts.positions.constructor == String) { opts.positions = opts.positions.replace(/ /, "").split(","); } if (opts.positions[0] == "most") { var position = "top"; for (var pig in space) { position = space[pig] > space[position] ? pig : position; } } else { for (var x in opts.positions) { var position = opts.positions[x]; if ((position == "left" || position == "right") && space[position] > textOutWidth + opts.spikeLength) { break; } else { if ((position == "top" || position == "bottom") && space[position] > textOutHeight + opts.spikeLength) { break; } } } } var horiz = left + ((width - textOutWidth) * 0.5); var vert = top + ((height - textOutHeight) * 0.5); var points = new Array(); var textTop, textLeft, textRight, textBottom, textTopSpace, textBottomSpace, textLeftSpace, textRightSpace, crossPoint, textCenter, spikePoint; switch (position) { case "top": $text.css("margin-bottom", opts.spikeLength + "px"); $box.css({ top: (top - $text.outerHeight(true)) + opts.overlap, left: horiz }); textRightSpace = (winRight - opts.windowMargin) - ($text.offset().left + $text.btOuterWidth(true)); var xShift = shadowShiftX; if (textRightSpace < 0) { $box.css("left", (numb($box.css("left")) + textRightSpace) + "px"); xShift -= textRightSpace; } textLeftSpace = ($text.offset().left + numb($text.css("margin-left"))) - (scrollLeft + opts.windowMargin); if (textLeftSpace < 0) { $box.css("left", (numb($box.css("left")) - textLeftSpace) + "px"); xShift += textLeftSpace; } textTop = $text.btPosition().top + numb($text.css("margin-top")); textLeft = $text.btPosition().left + numb($text.css("margin-left")); textRight = textLeft + $text.btOuterWidth(); textBottom = textTop + $text.outerHeight(); textCenter = { x: textLeft + ($text.btOuterWidth() * opts.centerPointX), y: textTop + ($text.outerHeight() * opts.centerPointY) }; points[points.length] = spikePoint = { y: textBottom + opts.spikeLength, x: ((textRight - textLeft) * 0.5) + xShift, type: "spike" }; crossPoint = findIntersectX(spikePoint.x, spikePoint.y, textCenter.x, textCenter.y, textBottom); crossPoint.x = crossPoint.x < textLeft + opts.spikeGirth / 2 + opts.cornerRadius ? textLeft + opts.spikeGirth / 2 + opts.cornerRadius : crossPoint.x; crossPoint.x = crossPoint.x > (textRight - opts.spikeGirth / 2) - opts.cornerRadius ? (textRight - opts.spikeGirth / 2) - opts.CornerRadius : crossPoint.x; points[points.length] = { x: crossPoint.x - (opts.spikeGirth / 2), y: textBottom, type: "join" }; points[points.length] = { x: textLeft, y: textBottom, type: "corner" }; points[points.length] = { x: textLeft, y: textTop, type: "corner" }; points[points.length] = { x: textRight, y: textTop, type: "corner" }; points[points.length] = { x: textRight, y: textBottom, type: "corner" }; points[points.length] = { x: crossPoint.x + (opts.spikeGirth / 2), y: textBottom, type: "join" }; points[points.length] = spikePoint; break; case "left": $text.css("margin-right", opts.spikeLength + "px"); $box.css({ top: vert + "px", left: ((left - $text.btOuterWidth(true)) + opts.overlap) + "px" }); textBottomSpace = (winBottom - opts.windowMargin) - ($text.offset().top + $text.outerHeight(true)); var yShift = shadowShiftY; if (textBottomSpace < 0) { $box.css("top", (numb($box.css("top")) + textBottomSpace) + "px"); yShift -= textBottomSpace; } textTopSpace = ($text.offset().top + numb($text.css("margin-top"))) - (scrollTop + opts.windowMargin); if (textTopSpace < 0) { $box.css("top", (numb($box.css("top")) - textTopSpace) + "px"); yShift += textTopSpace; } textTop = $text.btPosition().top + numb($text.css("margin-top")); textLeft = $text.btPosition().left + numb($text.css("margin-left")); textRight = textLeft + $text.btOuterWidth(); textBottom = textTop + $text.outerHeight(); textCenter = { x: textLeft + ($text.btOuterWidth() * opts.centerPointX), y: textTop + ($text.outerHeight() * opts.centerPointY) }; points[points.length] = spikePoint = { x: textRight + opts.spikeLength, y: ((textBottom - textTop) * 0.5) + yShift, type: "spike" }; crossPoint = findIntersectY(spikePoint.x, spikePoint.y, textCenter.x, textCenter.y, textRight); crossPoint.y = crossPoint.y < textTop + opts.spikeGirth / 2 + opts.cornerRadius ? textTop + opts.spikeGirth / 2 + opts.cornerRadius : crossPoint.y; crossPoint.y = crossPoint.y > (textBottom - opts.spikeGirth / 2) - opts.cornerRadius ? (textBottom - opts.spikeGirth / 2) - opts.cornerRadius : crossPoint.y; points[points.length] = { x: textRight, y: crossPoint.y + opts.spikeGirth / 2, type: "join" }; points[points.length] = { x: textRight, y: textBottom, type: "corner" }; points[points.length] = { x: textLeft, y: textBottom, type: "corner" }; points[points.length] = { x: textLeft, y: textTop, type: "corner" }; points[points.length] = { x: textRight, y: textTop, type: "corner" }; points[points.length] = { x: textRight, y: crossPoint.y - opts.spikeGirth / 2, type: "join" }; points[points.length] = spikePoint; break; case "bottom": $text.css("margin-top", opts.spikeLength + "px"); $box.css({ top: (top + height) - opts.overlap, left: horiz }); textRightSpace = (winRight - opts.windowMargin) - ($text.offset().left + $text.btOuterWidth(true)); var xShift = shadowShiftX; if (textRightSpace < 0) { $box.css("left", (numb($box.css("left")) + textRightSpace) + "px"); xShift -= textRightSpace; } textLeftSpace = ($text.offset().left + numb($text.css("margin-left"))) - (scrollLeft + opts.windowMargin); if (textLeftSpace < 0) { $box.css("left", (numb($box.css("left")) - textLeftSpace) + "px"); xShift += textLeftSpace; } textTop = $text.btPosition().top + numb($text.css("margin-top")); textLeft = $text.btPosition().left + numb($text.css("margin-left")); textRight = textLeft + $text.btOuterWidth(); textBottom = textTop + $text.outerHeight(); textCenter = { x: textLeft + ($text.btOuterWidth() * opts.centerPointX), y: textTop + ($text.outerHeight() * opts.centerPointY) }; points[points.length] = spikePoint = { x: ((textRight - textLeft) * 0.5) + xShift, y: shadowShiftY, type: "spike" }; crossPoint = findIntersectX(spikePoint.x, spikePoint.y, textCenter.x, textCenter.y, textTop); crossPoint.x = crossPoint.x < textLeft + opts.spikeGirth / 2 + opts.cornerRadius ? textLeft + opts.spikeGirth / 2 + opts.cornerRadius : crossPoint.x; crossPoint.x = crossPoint.x > (textRight - opts.spikeGirth / 2) - opts.cornerRadius ? (textRight - opts.spikeGirth / 2) - opts.cornerRadius : crossPoint.x; points[points.length] = { x: crossPoint.x + opts.spikeGirth / 2, y: textTop, type: "join" }; points[points.length] = { x: textRight, y: textTop, type: "corner" }; points[points.length] = { x: textRight, y: textBottom, type: "corner" }; points[points.length] = { x: textLeft, y: textBottom, type: "corner" }; points[points.length] = { x: textLeft, y: textTop, type: "corner" }; points[points.length] = { x: crossPoint.x - (opts.spikeGirth / 2), y: textTop, type: "join" }; points[points.length] = spikePoint; break; case "right": $text.css("margin-left", (opts.spikeLength + "px")); $box.css({ top: vert + "px", left: ((left + width) - opts.overlap) + "px" }); textBottomSpace = (winBottom - opts.windowMargin) - ($text.offset().top + $text.outerHeight(true)); var yShift = shadowShiftY; if (textBottomSpace < 0) { $box.css("top", (numb($box.css("top")) + textBottomSpace) + "px"); yShift -= textBottomSpace; } textTopSpace = ($text.offset().top + numb($text.css("margin-top"))) - (scrollTop + opts.windowMargin); if (textTopSpace < 0) { $box.css("top", (numb($box.css("top")) - textTopSpace) + "px"); yShift += textTopSpace; } textTop = $text.btPosition().top + numb($text.css("margin-top")); textLeft = $text.btPosition().left + numb($text.css("margin-left")); textRight = textLeft + $text.btOuterWidth(); textBottom = textTop + $text.outerHeight(); textCenter = { x: textLeft + ($text.btOuterWidth() * opts.centerPointX), y: textTop + ($text.outerHeight() * opts.centerPointY) }; points[points.length] = spikePoint = { x: shadowShiftX, y: ((textBottom - textTop) * 0.5) + yShift, type: "spike" }; crossPoint = findIntersectY(spikePoint.x, spikePoint.y, textCenter.x, textCenter.y, textLeft); crossPoint.y = crossPoint.y < textTop + opts.spikeGirth / 2 + opts.cornerRadius ? textTop + opts.spikeGirth / 2 + opts.cornerRadius : crossPoint.y; crossPoint.y = crossPoint.y > (textBottom - opts.spikeGirth / 2) - opts.cornerRadius ? (textBottom - opts.spikeGirth / 2) - opts.cornerRadius : crossPoint.y; points[points.length] = { x: textLeft, y: crossPoint.y - opts.spikeGirth / 2, type: "join" }; points[points.length] = { x: textLeft, y: textTop, type: "corner" }; points[points.length] = { x: textRight, y: textTop, type: "corner" }; points[points.length] = { x: textRight, y: textBottom, type: "corner" }; points[points.length] = { x: textLeft, y: textBottom, type: "corner" }; points[points.length] = { x: textLeft, y: crossPoint.y + opts.spikeGirth / 2, type: "join" }; points[points.length] = spikePoint; break; } var canvas = document.createElement("canvas"); $(canvas).attr("width", (numb($text.btOuterWidth(true)) + opts.strokeWidth * 2 + shadowMarginX)).attr("height", (numb($text.outerHeight(true)) + opts.strokeWidth * 2 + shadowMarginY)).appendTo($box).css({ position: "absolute", zIndex: opts.boxzIndex }); if (typeof G_vmlCanvasManager != "undefined") { canvas = G_vmlCanvasManager.initElement(canvas); } if (opts.cornerRadius > 0) { var newPoints = new Array(); var newPoint; for (var i = 0; i < points.length; i++) { if (points[i].type == "corner") { newPoint = betweenPoint(points[i], points[(i - 1) % points.length], opts.cornerRadius); newPoint.type = "arcStart"; newPoints[newPoints.length] = newPoint; newPoints[newPoints.length] = points[i]; newPoint = betweenPoint(points[i], points[(i + 1) % points.length], opts.cornerRadius); newPoint.type = "arcEnd"; newPoints[newPoints.length] = newPoint; } else { newPoints[newPoints.length] = points[i]; } } points = newPoints; } var ctx = canvas.getContext("2d"); if (opts.shadow && opts.shadowOverlap !== true) { var shadowOverlap = numb(opts.shadowOverlap); switch (position) { case "top": if (opts.shadowOffsetX + opts.shadowBlur - shadowOverlap > 0) { $box.css("top", (numb($box.css("top")) - (opts.shadowOffsetX + opts.shadowBlur - shadowOverlap))); } break; case "right": if (shadowShiftX - shadowOverlap > 0) { $box.css("left", (numb($box.css("left")) + shadowShiftX - shadowOverlap)); } break; case "bottom": if (shadowShiftY - shadowOverlap > 0) { $box.css("top", (numb($box.css("top")) + shadowShiftY - shadowOverlap)); } break; case "left": if (opts.shadowOffsetY + opts.shadowBlur - shadowOverlap > 0) { $box.css("left", (numb($box.css("left")) - (opts.shadowOffsetY + opts.shadowBlur - shadowOverlap))); } break; } } drawIt.apply(ctx, [points], opts.strokeWidth); ctx.fillStyle = opts.fill; if (opts.shadow) { ctx.shadowOffsetX = opts.shadowOffsetX; ctx.shadowOffsetY = opts.shadowOffsetY; ctx.shadowBlur = opts.shadowBlur; ctx.shadowColor = opts.shadowColor; } ctx.closePath(); ctx.fill(); if (opts.strokeWidth > 0) { ctx.shadowColor = "rgba(0, 0, 0, 0)"; ctx.lineWidth = opts.strokeWidth; ctx.strokeStyle = opts.strokeStyle; ctx.beginPath(); drawIt.apply(ctx, [points], opts.strokeWidth); ctx.closePath(); ctx.stroke(); } opts.preShow.apply(this, [$box[0]]); $box.css({ display: "none", visibility: "visible" }); opts.showTip.apply(this, [$box[0]]); if (opts.overlay) { var overlay = $('<div class="bt-overlay"></div>').css({ position: "absolute", backgroundColor: "blue", top: top, left: left, width: width, height: height, opacity: ".2" }).appendTo(offsetParent); $(this).data("overlay", overlay); } if ((opts.ajaxPath != null && opts.ajaxCache == false) || ajaxTimeout) { content = false; } if (opts.clickAnywhereToClose) { jQuery.bt.vars.clickAnywhereStack.push(this); $(document).click(jQuery.bt.docClick); } if (opts.closeWhenOthersOpen) { jQuery.bt.vars.closeWhenOpenStack.push(this); } opts.postShow.apply(this, [$box[0]]); }; this.btOff = function() { var box = $(this).data("bt-box"); opts.preHide.apply(this, [box]); var i = this; i.btCleanup = function() { var box = $(i).data("bt-box"); var contentOrig = $(i).data("bt-content-orig"); var overlay = $(i).data("bt-overlay"); if (typeof box == "object") { $(box).remove(); $(i).removeData("bt-box"); } if (typeof contentOrig == "object") { var clones = $(contentOrig.original).data("bt-clones"); $(contentOrig).data("bt-clones", arrayRemove(clones, contentOrig.clone)); } if (typeof overlay == "object") { $(overlay).remove(); $(i).removeData("bt-overlay"); } jQuery.bt.vars.clickAnywhereStack = arrayRemove(jQuery.bt.vars.clickAnywhereStack, i); jQuery.bt.vars.closeWhenOpenStack = arrayRemove(jQuery.bt.vars.closeWhenOpenStack, i); $(i).removeClass("bt-active " + opts.activeClass); opts.postHide.apply(i); }; opts.hideTip.apply(this, [box, i.btCleanup]); }; var refresh = this.btRefresh = function() { this.btOff(); this.btOn(); }; }); function drawIt(points, strokeWidth) { this.moveTo(points[0].x, points[0].y); for (i = 1; i < points.length; i++) { if (points[i - 1].type == "arcStart") { this.quadraticCurveTo(round5(points[i].x, strokeWidth), round5(points[i].y, strokeWidth), round5(points[(i + 1) % points.length].x, strokeWidth), round5(points[(i + 1) % points.length].y, strokeWidth)); i++; } else { this.lineTo(round5(points[i].x, strokeWidth), round5(points[i].y, strokeWidth)); } } } function round5(num, strokeWidth) { var ret; strokeWidth = numb(strokeWidth); if (strokeWidth % 2) { ret = num; } else { ret = Math.round(num - 0.5) + 0.5; } return ret; } function numb(num) { return parseInt(num) || 0; } function arrayRemove(arr, elem) { var x, newArr = new Array(); for (x in arr) { if (arr[x] != elem) { newArr.push(arr[x]); } } return newArr; } function canvasSupport() { var canvas_compatible = false; try { canvas_compatible = !!(document.createElement("canvas").getContext("2d")); } catch (e) { canvas_compatible = !!(document.createElement("canvas").getContext); } return canvas_compatible; } function shadowSupport() { try { var userAgent = navigator.userAgent.toLowerCase(); if (/webkit/.test(userAgent)) { return true; } else { if (/gecko|mozilla/.test(userAgent) && parseFloat(userAgent.match(/firefox\/(\d+(?:\.\d+)+)/)[1]) >= 3.1) { return true; } } } catch (err) { } return false; } function betweenPoint(point1, point2, dist) { var y, x; if (point1.x == point2.x) { y = point1.y < point2.y ? point1.y + dist : point1.y - dist; return { x: point1.x, y: y }; } else { if (point1.y == point2.y) { x = point1.x < point2.x ? point1.x + dist : point1.x - dist; return { x: x, y: point1.y }; } } } function centerPoint(arcStart, corner, arcEnd) { var x = corner.x == arcStart.x ? arcEnd.x : arcStart.x; var y = corner.y == arcStart.y ? arcEnd.y : arcStart.y; var startAngle, endAngle; if (arcStart.x < arcEnd.x) { if (arcStart.y > arcEnd.y) { startAngle = (Math.PI / 180) * 180; endAngle = (Math.PI / 180) * 90; } else { startAngle = (Math.PI / 180) * 90; endAngle = 0; } } else { if (arcStart.y > arcEnd.y) { startAngle = (Math.PI / 180) * 270; endAngle = (Math.PI / 180) * 180; } else { startAngle = 0; endAngle = (Math.PI / 180) * 270; } } return { x: x, y: y, type: "center", startAngle: startAngle, endAngle: endAngle }; } function findIntersect(r1x1, r1y1, r1x2, r1y2, r2x1, r2y1, r2x2, r2y2) { if (r2x1 == r2x2) { return findIntersectY(r1x1, r1y1, r1x2, r1y2, r2x1); } if (r2y1 == r2y2) { return findIntersectX(r1x1, r1y1, r1x2, r1y2, r2y1); } var r1m = (r1y1 - r1y2) / (r1x1 - r1x2); var r1b = r1y1 - (r1m * r1x1); var r2m = (r2y1 - r2y2) / (r2x1 - r2x2); var r2b = r2y1 - (r2m * r2x1); var x = (r2b - r1b) / (r1m - r2m); var y = r1m * x + r1b; return { x: x, y: y }; } function findIntersectY(r1x1, r1y1, r1x2, r1y2, x) { if (r1y1 == r1y2) { return { x: x, y: r1y1 }; } var r1m = (r1y1 - r1y2) / (r1x1 - r1x2); var r1b = r1y1 - (r1m * r1x1); var y = r1m * x + r1b; return { x: x, y: y }; } function findIntersectX(r1x1, r1y1, r1x2, r1y2, y) { if (r1x1 == r1x2) { return { x: r1x1, y: y }; } var r1m = (r1y1 - r1y2) / (r1x1 - r1x2); var r1b = r1y1 - (r1m * r1x1); var x = (y - r1b) / r1m; return { x: x, y: y }; } }; jQuery.fn.btPosition = function() { function num(elem, prop) { return elem[0] && parseInt(jQuery.curCSS(elem[0], prop, true), 10) || 0; } var left = 0, top = 0, results; if (this[0]) { var offsetParent = this.offsetParent(), offset = this.offset(), parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0} : offsetParent.offset(); offset.top -= num(this, "marginTop"); offset.left -= num(this, "marginLeft"); parentOffset.top += num(offsetParent, "borderTopWidth"); parentOffset.left += num(offsetParent, "borderLeftWidth"); results = { top: offset.top - parentOffset.top, left: offset.left - parentOffset.left }; } return results; }; jQuery.fn.btOuterWidth = function(margin) { function num(elem, prop) { return elem[0] && parseInt(jQuery.curCSS(elem[0], prop, true), 10) || 0; } return this["innerWidth"]() + num(this, "borderLeftWidth") + num(this, "borderRightWidth") + (margin ? num(this, "marginLeft") + num(this, "marginRight") : 0); }; jQuery.fn.btOn = function() { return this.each(function(index) { if (jQuery.isFunction(this.btOn)) { this.btOn(); } }); }; jQuery.fn.btOff = function() { return this.each(function(index) { if (jQuery.isFunction(this.btOff)) { this.btOff(); } }); }; jQuery.bt.vars = { clickAnywhereStack: [], closeWhenOpenStack: [] }; jQuery.bt.docClick = function(e) { if (!e) { var e = window.event; } if (!$(e.target).parents().andSelf().filter(".bt-wrapper, .bt-active").length && jQuery.bt.vars.clickAnywhereStack.length) { $(jQuery.bt.vars.clickAnywhereStack).btOff(); $(document).unbind("click", jQuery.bt.docClick); } }; jQuery.bt.defaults = { trigger: "hover", clickAnywhereToClose: true, closeWhenOthersOpen: false, shrinkToFit: false, width: "200px", padding: "10px", spikeGirth: 10, spikeLength: 15, overlap: 0, overlay: false, killTitle: true, textzIndex: 9999, boxzIndex: 9998, wrapperzIndex: 9997, offsetParent: null, positions: ["most"], fill: "rgb(255, 255, 102)", windowMargin: 10, strokeWidth: 1, strokeStyle: "#000", cornerRadius: 5, centerPointX: 0.5, centerPointY: 0.5, shadow: false, shadowOffsetX: 2, shadowOffsetY: 2, shadowBlur: 3, shadowColor: "#000", shadowOverlap: false, noShadowOpts: { strokeStyle: "#999" }, cssClass: "", cssStyles: {}, activeClass: "bt-active", contentSelector: "$(this).attr('title')", ajaxPath: null, ajaxError: "<strong>ERROR:</strong> <em>%error</em>", ajaxLoading: "<blink>Loading...</blink>", ajaxData: {}, ajaxType: "GET", ajaxCache: true, ajaxOpts: {}, preBuild: function() { }, preShow: function(box) { }, showTip: function(box) { $(box).show(); }, postShow: function(box) { }, preHide: function(box) { }, hideTip: function(box, callback) { $(box).hide(); callback(); }, postHide: function() { }, hoverIntentOpts: { interval: 300, timeout: 500} }; jQuery.bt.options = {}; })(jQuery);




/**
* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @author    Brian Cherne <brian@cherne.net>
*/
(function($) { $.fn.hoverIntent = function(f, g) { var cfg = { sensitivity: 7, interval: 100, timeout: 0 }; cfg = $.extend(cfg, g ? { over: f, out: g} : f); var cX, cY, pX, pY; var track = function(ev) { cX = ev.pageX; cY = ev.pageY; }; var compare = function(ev, ob) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); if ((Math.abs(pX - cX) + Math.abs(pY - cY)) < cfg.sensitivity) { $(ob).unbind("mousemove", track); ob.hoverIntent_s = 1; return cfg.over.apply(ob, [ev]); } else { pX = cX; pY = cY; ob.hoverIntent_t = setTimeout(function() { compare(ev, ob); }, cfg.interval); } }; var delay = function(ev, ob) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); ob.hoverIntent_s = 0; return cfg.out.apply(ob, [ev]); }; var handleHover = function(e) { var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget; while (p && p != this) { try { p = p.parentNode; } catch (e) { p = this; } } if (p == this) { return false; } var ev = jQuery.extend({}, e); var ob = this; if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); } if (e.type == "mouseover") { pX = ev.pageX; pY = ev.pageY; $(ob).bind("mousemove", track); if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout(function() { compare(ev, ob); }, cfg.interval); } } else { $(ob).unbind("mousemove", track); if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout(function() { delay(ev, ob); }, cfg.timeout); } } }; return this.mouseover(handleHover).mouseout(handleHover); }; })(jQuery);

// -----------------------------------------------------------------------------------
// http://wowslider.com/
// JavaScript Wow Slider is a free software that helps you easily generate delicious 
// slideshows with gorgeous transition effects, in a few clicks without writing a single line of code.
// Last updated: 2010-29-11
//
//***********************************************
// Obfuscated by Javascript Obfuscator
// http://javascript-source.com
//***********************************************
ws_fade = function(options) {
    var $ = jQuery; options.duration = options.duration || 1000;
    var Images = [];
    var curIdx = 0; this.init = function(aCont) {
        Images = $("img", aCont).get();
        $(Images).each(function(Index) {
            if (!Index) {
                $(this).show();
            } else {
                $(this).hide();
            }
        });
    };
    this.go = function(new_index) {
        $(Images).each(function(Index) {
            if (Index == new_index) { $(this).fadeIn(options.duration); } if (Index == curIdx) { $(this).fadeOut(options.duration); }
        }); curIdx = new_index; return true;
    };
};
// -----------------------------------------------------------------------------------
// http://wowslider.com/
// JavaScript Wow Slider is a free software that helps you easily generate delicious 
// slideshows with gorgeous transition effects, in a few clicks without writing a single line of code.
// Last updated: 2010-29-11
//
//***********************************************
// Obfuscated by Javascript Obfuscator
// http://javascript-source.com
//***********************************************
function WowSlider(options) {
    var $ = jQuery;
    options = options || {};
    var $Elements = $("#wowslider-images A");
    $Elements.each(function(index) {
        var inner = $(this).html() || "";
        var pos = inner.indexOf(">", inner);
        if (pos >= 0) {
            $(this).data("descr", inner.substr(pos + 1));
            if (pos < inner.length - 1) {
                $(this).html(inner.substr(0, pos + 1));
            }
        } $(this).css({ 'font-size': 0 });
    });
    var elementsCount = $Elements.length;
    var $ws_container = $("#wowslider-container");
    var frame = $("A#wowslider-frame").get(0);
    var curIdx = 0;


    function go(index) {
        if (curIdx == index) { return; }
        var current = effect.go(index); if (!current)
        { return; } if (typeof current != "object") { current = $Elements[index]; }
        curIdx = index; go2(index); if (options.caption) { setTitle(current); }
    }
    function go2(index) { if (options.bullets) { setBullet(index); } if (frame) { frame.setAttribute("href", $Elements.get(index).href); } } var autoPlayTimer;
    function restartPlay() {
        stopPlay(); if (options.autoPlay) {
            autoPlayTimer = setTimeout(
    function() { go(curIdx < elementsCount - 1 ? curIdx + 1 : 0); restartPlay(); }, options.delay + options.duration);
        }
    }
    function stopPlay() { if (autoPlayTimer) { clearTimeout(autoPlayTimer); } autoPlayTimer = null; } $Elements.find("IMG").css("position", "absolute"); var effect = new window["ws_" + options.effect](options); effect.init($("#wowslider-images")); $Elements.find("IMG").css("visibility", "visible"); var ic = c = $("#wowslider-images"); var t = ""; c = t ? $("<div></div>") : 0; if (c) { c.css({ position: "absolute", right: "2px", bottom: "2px", padding: "0 0 0 0" }); ic.append(c); } if (c && document.all) { var f = $("<iframe src=\"javascript:false\"></iframe>"); f.css({ position: "absolute", left: 0, top: 0, width: "100%", height: "100%", filter: "alpha(opacity=0)" }); f.attr({ scrolling: "no", framespacing: 0, border: 0, frameBorder: "no" }); c.append(f); } var d = c ? $(document.createElement("A")) : c; if (d) {
        d.css({ position: "relative", display: "block", 'background-color': "#E4EFEB", color: "#837F80", 'font-family': "Lucida Grande,sans-serif", 'font-size': "11px", 'font-weight': "normal", 'font-style': "normal", '-moz-border-radius': "5px", 'border-radius': "5px", padding: "1px 5px", width: "auto", height: "auto", margin: "0 0 0 0", outline: "none" }); d.attr({ href: "ht" + "tp://" + t.toLowerCase() }); d.html(t); d.bind("contextmenu",
    function(eventObject) { return false; }); c.append(d);
    } if (options.controls) {
        var $next_photo = $("<a href=\"#\" class=\"ws_next\">" + options.next + "</a>");
        var $prev_photo = $("<a href=\"#\" class=\"ws_prev\">" + options.prev + "</a>");
        $ws_container.append($next_photo); $ws_container.append($prev_photo);
        $next_photo.bind("click", function(e) {
            stopPlay(); e.preventDefault();
            go(curIdx < elementsCount - 1 ? curIdx + 1 : 0); restartPlay();
        });
        $prev_photo.bind("click", function(e) { stopPlay(); e.preventDefault(); go(curIdx > 0 ? curIdx - 1 : elementsCount - 1); restartPlay(); });
    }
    function initBullets() { $bullets = $(".ws_bullets a", $ws_container); $bullets.each(function(index) { $(this).bind("click", function(e) { stopPlay(); e.preventDefault(); go(index); restartPlay(); }); }); }
    function setBullet(new_index) { $(".ws_bullets A", $ws_container).each(function(index) { if (index == new_index) { $(this).addClass("ws_selbull"); } else { $(this).removeClass("ws_selbull"); } }); } if (options.caption) { $caption = $("<div class='ws-title' style='display:none'></div>"); $ws_container.append($caption); $caption.bind("mouseover", function(e) { stopPlay(); }); $caption.bind("mouseout", function(e) { restartPlay(); }); }
    function setTitle(A) { var title = $("img", A).attr("title"); var descr = $(A).data("descr"); var $Title = $(".ws-title", $ws_container); $Title.hide(); if (title || descr) { $Title.html((title ? "<span>" + title + "</span>" : "") + (descr ? "<div>" + descr + "</div>" : "")); $Title.fadeIn(400, function() { if ($.browser.msie) { $(this).get(0).style.removeAttribute("filter"); } }); } } if (options.bullets) { initBullets(); } go2(0); if (options.caption) { setTitle($Elements[0]); } restartPlay();
}

function WowBegin() {
    var wowSlider = new WowSlider({ effect: "fade", prev: "prev", next: "next", duration: 10 * 100, delay: 20 * 100, outWidth: 611, outHeight: 252, width: 611, height: 252, caption: true, controls: true, autoPlay: true, bullets: true });
}
