﻿// --------------------- START JQPrint -----------------
// -----------------------------------------------------------------------
// eros@recoding.it
// jqprint 0.3
//
// - 19/06/2009 - some new implementations, added Opera support
// - 11/05/2009 - first sketch
//
// Printing plug-in for jQuery, evolution of jPrintArea: http://plugins.jquery.com/project/jPrintArea
// requires jQuery 1.3.x
//------------------------------------------------------------------------

(function(b) { var a; b.fn.jqprint = function(d) { a = b.extend({}, b.fn.jqprint.defaults, d); var c = (this instanceof jQuery) ? this : b(this); if (a.operaSupport && b.browser.opera) { var e = window.open("", "jqPrint-preview"); e.document.open(); var g = e.document } else { var f = b("<iframe  />"); if (!a.debug) { f.css({ position: "absolute", width: "0px", height: "0px", left: "-600px", top: "-600px" }) } f.appendTo("body"); var g = f[0].contentWindow.document } if (a.importCSS) { if (b("link[media=print]").length > 0) { b("link[media=print]").each(function() { g.write("<link type='text/css' rel='stylesheet' href='" + b(this).attr("href") + "' media='print' />") }) } else { b("link").each(function() { g.write("<link type='text/css' rel='stylesheet' href='" + b(this).attr("href") + "' />") }) } } if (a.printContainer) { g.write(c.outer()) } else { c.each(function() { g.write(b(this).html()) }) } g.close(); (a.operaSupport && b.browser.opera ? e : f[0].contentWindow).focus(); setTimeout(function() { (a.operaSupport && b.browser.opera ? e : f[0].contentWindow).print(); if (e) { e.close() } }, 1000) }; b.fn.jqprint.defaults = { debug: false, importCSS: true, printContainer: true, operaSupport: true }; jQuery.fn.outer = function() { return b(b("<div></div>").html(this.clone())).html() } })(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);

/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
*
* $LastChangedDate: 2007-07-21 18:45:56 -0500 (Sat, 21 Jul 2007) $
* $Rev: 2447 $
*
* Version 2.1.1
*/
(function($) { $.fn.bgIframe = $.fn.bgiframe = function(s) { if ($.browser.msie && /6.0/.test(navigator.userAgent)) { s = $.extend({ top: 'auto', left: 'auto', width: 'auto', height: 'auto', opacity: true, src: 'javascript:false;' }, s || {}); var prop = function(n) { return n && n.constructor == Number ? n + 'px' : n; }, html = '<iframe class="bgiframe"frameborder="0"tabindex="-1"src="' + s.src + '"' + 'style="display:block;position:absolute;z-index:-1;' + (s.opacity !== false ? 'filter:Alpha(Opacity=\'0\');' : '') + 'top:' + (s.top == 'auto' ? 'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')' : prop(s.top)) + ';' + 'left:' + (s.left == 'auto' ? 'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')' : prop(s.left)) + ';' + 'width:' + (s.width == 'auto' ? 'expression(this.parentNode.offsetWidth+\'px\')' : prop(s.width)) + ';' + 'height:' + (s.height == 'auto' ? 'expression(this.parentNode.offsetHeight+\'px\')' : prop(s.height)) + ';' + '"/>'; return this.each(function() { if ($('> iframe.bgiframe', this).length == 0) this.insertBefore(document.createElement(html), this.firstChild); }); } return this; }; })(jQuery);

/*
* Superfish v1.4.8 - jQuery menu widget
* Copyright (c) 2008 Joel Birch
*
* Dual licensed under the MIT and GPL licenses:
* 	http://www.opensource.org/licenses/mit-license.php
* 	http://www.gnu.org/licenses/gpl.html
*
* CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
*/
(function(b) { b.fn.superfish = function(k) { var g = b.fn.superfish, j = g.c, f = b(['<span class="', j.arrowClass, '"> &#187;</span>'].join("")), i = function() { var c = b(this), l = d(c); clearTimeout(l.sfTimer); c.showSuperfishUl().siblings().hideSuperfishUl() }, e = function() { var c = b(this), m = d(c), l = g.op; clearTimeout(m.sfTimer); m.sfTimer = setTimeout(function() { l.retainPath = (b.inArray(c[0], l.$path) > -1); c.hideSuperfishUl(); if (l.$path.length && c.parents(["li.", l.hoverClass].join("")).length < 1) { i.call(l.$path) } }, l.delay) }, d = function(c) { var l = c.parents(["ul.", j.menuClass, ":first"].join(""))[0]; g.op = g.o[l.serial]; return l }, h = function(c) { c.addClass(j.anchorClass).append(f.clone()) }; return this.each(function() { var c = this.serial = g.o.length; var m = b.extend({}, g.defaults, k); m.$path = b("li." + m.pathClass, this).slice(0, m.pathLevels).each(function() { b(this).addClass([m.hoverClass, j.bcClass].join(" ")).filter("li:has(ul)").removeClass(m.pathClass) }); g.o[c] = g.op = m; b("li:has(ul)", this)[(b.fn.hoverIntent && !m.disableHI) ? "hoverIntent" : "hover"](i, e).each(function() { if (m.autoArrows) { h(b(">a:first-child", this)) } }).not("." + j.bcClass).hideSuperfishUl(); var l = b("a", this); l.each(function(n) { var o = l.eq(n).parents("li"); l.eq(n).focus(function() { i.call(o) }).blur(function() { e.call(o) }) }); m.onInit.call(this) }).each(function() { var c = [j.menuClass]; if (g.op.dropShadows && !(b.browser.msie && b.browser.version < 7)) { c.push(j.shadowClass) } b(this).addClass(c.join(" ")) }) }; var a = b.fn.superfish; a.o = []; a.op = {}; a.IE7fix = function() { var c = a.op; if (b.browser.msie && b.browser.version > 6 && c.dropShadows && c.animation.opacity != undefined) { this.toggleClass(a.c.shadowClass + "-off") } }; a.c = { bcClass: "sf-breadcrumb", menuClass: "sf-js-enabled", anchorClass: "sf-with-ul", arrowClass: "sf-sub-indicator", shadowClass: "sf-shadow" }; a.defaults = { hoverClass: "sfHover", pathClass: "overideThisToUse", pathLevels: 1, delay: 800, animation: { opacity: "show" }, speed: "normal", autoArrows: true, dropShadows: true, disableHI: false, onInit: function() { }, onBeforeShow: function() { }, onShow: function() { }, onHide: function() { } }; b.fn.extend({ hideSuperfishUl: function() { var e = a.op, d = (e.retainPath === true) ? e.$path : ""; e.retainPath = false; var c = b(["li.", e.hoverClass].join(""), this).add(this).not(d).removeClass(e.hoverClass).find(">ul").hide().css("visibility", "hidden"); e.onHide.call(c); return this }, showSuperfishUl: function() { var e = a.op, d = a.c.shadowClass + "-off", c = this.addClass(e.hoverClass).find(">ul:hidden").css("visibility", "visible"); a.IE7fix.call(c); e.onBeforeShow.call(c); c.animate(e.animation, e.speed, function() { a.IE7fix.call(c); e.onShow.call(c) }); return this } }) })(jQuery); (function(a) { a.fn.supersubs = function(b) { var c = a.extend({}, a.fn.supersubs.defaults, b); return this.each(function() { var d = a(this); var e = a.meta ? a.extend({}, c, d.data()) : c; var f = a('<li id="menu-fontsize">&#8212;</li>').css({ padding: 0, position: "absolute", top: "-999em", width: "auto" }).appendTo(d).width(); a("#menu-fontsize").remove(); $ULs = d.find("ul"); $ULs.each(function(l) { var k = $ULs.eq(l); var j = k.children(); var g = j.children("a"); var m = j.css("white-space", "nowrap").css("float"); var h = k.add(j).add(g).css({ "float": "none", width: "auto" }).end().end()[0].clientWidth / f; h += e.extraWidth; if (h > e.maxWidth) { h = e.maxWidth } else { if (h < e.minWidth) { h = e.minWidth } } h += "em"; k.css("width", h); j.css({ "float": m, width: "100%", "white-space": "normal" }).each(function() { var n = a(">ul", this); var i = n.css("left") !== undefined ? "left" : "right"; n.css(i, h) }) }) }) }; a.fn.supersubs.defaults = { minWidth: 9, maxWidth: 25, extraWidth: 0} })(jQuery);

/*
http://www.JSON.org/json2.js
2009-08-17

Public Domain.    */
if (!this.JSON) { this.JSON = {} } (function() { function f(n) { return n < 10 ? "0" + n : n } if (typeof Date.prototype.toJSON !== "function") { Date.prototype.toJSON = function(key) { return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null }; String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function(key) { return this.valueOf() } } var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = { "\b": "\\b", "\t": "\\t", "\n": "\\n", "\f": "\\f", "\r": "\\r", '"': '\\"', "\\": "\\\\" }, rep; function quote(string) { escapable.lastIndex = 0; return escapable.test(string) ? '"' + string.replace(escapable, function(a) { var c = meta[a]; return typeof c === "string" ? c : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4) }) + '"' : '"' + string + '"' } function str(key, holder) { var i, k, v, length, mind = gap, partial, value = holder[key]; if (value && typeof value === "object" && typeof value.toJSON === "function") { value = value.toJSON(key) } if (typeof rep === "function") { value = rep.call(holder, key, value) } switch (typeof value) { case "string": return quote(value); case "number": return isFinite(value) ? String(value) : "null"; case "boolean": case "null": return String(value); case "object": if (!value) { return "null" } gap += indent; partial = []; if (Object.prototype.toString.apply(value) === "[object Array]") { length = value.length; for (i = 0; i < length; i += 1) { partial[i] = str(i, value) || "null" } v = partial.length === 0 ? "[]" : gap ? "[\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "]" : "[" + partial.join(",") + "]"; gap = mind; return v } if (rep && typeof rep === "object") { length = rep.length; for (i = 0; i < length; i += 1) { k = rep[i]; if (typeof k === "string") { v = str(k, value); if (v) { partial.push(quote(k) + (gap ? ": " : ":") + v) } } } } else { for (k in value) { if (Object.hasOwnProperty.call(value, k)) { v = str(k, value); if (v) { partial.push(quote(k) + (gap ? ": " : ":") + v) } } } } v = partial.length === 0 ? "{}" : gap ? "{\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "}" : "{" + partial.join(",") + "}"; gap = mind; return v } } if (typeof JSON.stringify !== "function") { JSON.stringify = function(value, replacer, space) { var i; gap = ""; indent = ""; if (typeof space === "number") { for (i = 0; i < space; i += 1) { indent += " " } } else { if (typeof space === "string") { indent = space } } rep = replacer; if (replacer && typeof replacer !== "function" && (typeof replacer !== "object" || typeof replacer.length !== "number")) { throw new Error("JSON.stringify") } return str("", { "": value }) } } if (typeof JSON.parse !== "function") { JSON.parse = function(text, reviver) { var j; function walk(holder, key) { var k, v, value = holder[key]; if (value && typeof value === "object") { for (k in value) { if (Object.hasOwnProperty.call(value, k)) { v = walk(value, k); if (v !== undefined) { value[k] = v } else { delete value[k] } } } } return reviver.call(holder, key, value) } cx.lastIndex = 0; if (cx.test(text)) { text = text.replace(cx, function(a) { return "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4) }) } if (/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) { j = eval("(" + text + ")"); return typeof reviver === "function" ? walk({ "": j }, "") : j } throw new SyntaxError("JSON.parse") } } } ());

/**
* jQuery.ScrollTo - Easy element scrolling using jQuery.
* Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
* Dual licensed under MIT and GPL.
* Date: 5/25/2009
* @author Ariel Flesler
* @version 1.4.2
*
* http://flesler.blogspot.com/2007/10/jqueryscrollto.html
*/
; (function(d) { var k = d.scrollTo = function(a, i, e) { d(window).scrollTo(a, i, e) }; k.defaults = { axis: 'xy', duration: parseFloat(d.fn.jquery) >= 1.3 ? 0 : 1 }; k.window = function(a) { return d(window)._scrollable() }; d.fn._scrollable = function() { return this.map(function() { var a = this, i = !a.nodeName || d.inArray(a.nodeName.toLowerCase(), ['iframe', '#document', 'html', 'body']) != -1; if (!i) return a; var e = (a.contentWindow || a).document || a.ownerDocument || a; return d.browser.safari || e.compatMode == 'BackCompat' ? e.body : e.documentElement }) }; d.fn.scrollTo = function(n, j, b) { if (typeof j == 'object') { b = j; j = 0 } if (typeof b == 'function') b = { onAfter: b }; if (n == 'max') n = 9e9; b = d.extend({}, k.defaults, b); j = j || b.speed || b.duration; b.queue = b.queue && b.axis.length > 1; if (b.queue) j /= 2; b.offset = p(b.offset); b.over = p(b.over); return this._scrollable().each(function() { var q = this, r = d(q), f = n, s, g = {}, u = r.is('html,body'); switch (typeof f) { case 'number': case 'string': if (/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)) { f = p(f); break } f = d(f, this); case 'object': if (f.is || f.style) s = (f = d(f)).offset() } d.each(b.axis.split(''), function(a, i) { var e = i == 'x' ? 'Left' : 'Top', h = e.toLowerCase(), c = 'scroll' + e, l = q[c], m = k.max(q, i); if (s) { g[c] = s[h] + (u ? 0 : l - r.offset()[h]); if (b.margin) { g[c] -= parseInt(f.css('margin' + e)) || 0; g[c] -= parseInt(f.css('border' + e + 'Width')) || 0 } g[c] += b.offset[h] || 0; if (b.over[h]) g[c] += f[i == 'x' ? 'width' : 'height']() * b.over[h] } else { var o = f[h]; g[c] = o.slice && o.slice(-1) == '%' ? parseFloat(o) / 100 * m : o } if (/^\d+$/.test(g[c])) g[c] = g[c] <= 0 ? 0 : Math.min(g[c], m); if (!a && b.queue) { if (l != g[c]) t(b.onAfterFirst); delete g[c] } }); t(b.onAfter); function t(a) { r.animate(g, j, b.easing, a && function() { a.call(this, n, b) }) } }).end() }; k.max = function(a, i) { var e = i == 'x' ? 'Width' : 'Height', h = 'scroll' + e; if (!d(a).is('html,body')) return a[h] - d(a)[e.toLowerCase()](); var c = 'client' + e, l = a.ownerDocument.documentElement, m = a.ownerDocument.body; return Math.max(l[h], m[h]) - Math.min(l[c], m[c]) }; function p(a) { return typeof a == 'object' ? a : { top: a, left: a} } })(jQuery);

/* Created by Martin Hintzmann 2008 martin [a] hintzmann.dk
* MIT (http://www.opensource.org/licenses/mit-license.php) licensed.
*
* Version: 0.1
*
* Requires:
*   jQuery 1.2+
*/
(function(a) { a.fn.boxShadow = function(b, e, d, c) { if (!a.browser.msie) { return } return this.each(function() { a(this).css({ position: "relative", zoom: 1, zIndex: "2" }); a(this).parent().css({ position: "relative" }); var j = document.createElement("div"); a(this).parent().append(j); var i, h, f, g; if (d != 0) { a(j).css("filter", "progid:DXImageTransform.Microsoft.Blur(pixelRadius=" + (d) + ", enabled='true')"); i = e - d - 1; h = b - d - 1; f = a(this).outerWidth() + 1; g = a(this).outerHeight() + 1 } else { i = e; h = b; f = a(this).outerWidth(); g = a(this).outerHeight() } a(j).css({ top: i, left: h, width: f, height: g, background: c, position: "absolute", zIndex: 1 }) }) } })(jQuery);


jQuery.fn.extend(
{
    showDefaultText: function(defaultText, defaultTextStyle) {
        ///	<summary>
        ///		Displays defaultText in empty TextBox element
        ///     Clears text onfocus
        ///	</summary>
        ///	<param name="defaultText" type="String">
        ///		text to display when TextBox is empty
        ///	</param>
        ///	<param name="defaultText" type="String">
        ///		text to display when TextBox is empty
        ///	</param>

        ///	<returns type="jQuery" />
        var options = {
            defaultText: defaultText,
            defaultTextStyle: (defaultTextStyle ? defaultTextStyle : "ac_defaultTextActive")
        };

        return this.each(function() {
            $(this).focus(
function() { 
    if ($(this).val() == options.defaultText) {
        $(this).removeClass(options.defaultTextStyle);
        $(this).val("");
    }
}
);
            $(this).blur(
function() {
    if ($(this).val() == "") {
        $(this).addClass(options.defaultTextStyle);
        $(this).val(options.defaultText);
    }
}
);
            $(this).blur();
        }
)
    }
}
)

jQuery.fn.extend(
{
    convertToInt: function(sIn, defaultValue) {
        var ret = parseInt(sIn);
        if (isNaN(ret))
            return defaultValue;
        else
            return ret;
    },

    availableWidth: function() {
        var container = this.parent();
        return container.innerWidth()
            - this.convertToInt(container.css("padding-left"), 0)
            - this.convertToInt(container.css("padding-right"), 0)
            - (this.outerWidth(true) - this.innerWidth())
            - this.convertToInt(this.css("padding-left"), 0)
            - this.convertToInt(this.css("padding-right"), 0)
            + this.convertToInt(this.css("margin-right"), 0);
    },
    availableHeight: function() {
        var container = this.parent();
        return container.innerHeight()
            - this.convertToInt(container.css("padding-top"), 0)
            - this.convertToInt(container.css("padding-bottom"), 0)
            - (this.outerHeight(true) - this.innerHeight())
            - this.convertToInt(this.css("padding-top"), 0)
            - this.convertToInt(this.css("padding-bottom"), 0);
    },

    resizeToFillContainerWidth: function(otherItem) {
        if (otherItem)
            this.width(this.availableWidth() - otherItem.outerWidth(true) - 2);
        else
            this.width(this.availableWidth() - 2);

        return this;
    },
    resizeToFillContainerHeight: function() {
        ///	<summary>
        ///		Resizes the collection of elements to fill their container height
        ///	</summary>

        ///	<returns type="jQuery" />

        var parent = $(this).parent()
        if (parent[0].nodeName.toLowerCase() == "td" || parent[0].nodeName.toLowerCase() == "form") {
            var parentHeight = parent.height();
            var extraHeight = $(this).outerHeight() - $(this).innerHeight();
            var otherHeight = parent.height() - $(this).outerHeight() - extraHeight;
            $(this).height(parent.height() - otherHeight)

        }
        else {
            var parentHeight = parent.height();
            var parentCSSHeight = parent.css("height");
            parent.css("height", "");

            var extraHeight = $(this).outerHeight() - $(this).innerHeight();
            var availableHeight = parentHeight - extraHeight;
            $(this).height(availableHeight);
            parent.height(parentCSSHeight);
        }
        return $(this);
    }
, fillAllContainers: function(resizeClass) {
    $(resizeClass).each(function(i) {
        $(this).resizeToFillContainerHeight();
    });
    //        $(window).resize(function() {
    //            $(resizeClass).each(function(i) {
    //                $(this).resizeToFillContainerHeight();
    //            });
    //        });     
}
})



