/*
* Json Plugin (for jQuery)
* @requires jQuery v1.2 or later
*/
(function($) {
    m = {
        '\b': '\\b',
        '\t': '\\t',
        '\n': '\\n',
        '\f': '\\f',
        '\r': '\\r',
        '"': '\\"',
        '\\': '\\\\'
    },
	$.toJSON = function(value, whitelist) {
        var a,          // The array holding the partial texts.
			i,          // The loop counter.
			k,          // The member key.
			l,          // Length.
			r = /["\\\x00-\x1f\x7f-\x9f]/g,
			v;          // The member value.

        switch (typeof value) {
            case 'string':
                return r.test(value) ?
				'"' + value.replace(r, function(a) {
                    var c = m[a];
                    if (c) {
                        return c;
                    }
                    c = a.charCodeAt();
                    return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
                }) + '"' :
				'"' + value + '"';

            case 'number':
                return isFinite(value) ? String(value) : 'null';

            case 'boolean':
            case 'null':
                return String(value);

            case 'object':
                if (!value) {
                    return 'null';
                }
                if (typeof value.toJSON === 'function') {
                    return $.toJSON(value.toJSON());
                }
                a = [];
                if (typeof value.length === 'number' &&
					!(value.propertyIsEnumerable('length'))) {
                    l = value.length;
                    for (i = 0; i < l; i += 1) {
                        a.push($.toJSON(value[i], whitelist) || 'null');
                    }
                    return '[' + a.join(',') + ']';
                }
                if (whitelist) {
                    l = whitelist.length;
                    for (i = 0; i < l; i += 1) {
                        k = whitelist[i];
                        if (typeof k === 'string') {
                            v = $.toJSON(value[k], whitelist);
                            if (v) {
                                a.push($.toJSON(k) + ':' + v);
                            }
                        }
                    }
                } else {
                    for (k in value) {
                        if (typeof k === 'string') {
                            v = $.toJSON(value[k], whitelist);
                            if (v) {
                                a.push($.toJSON(k) + ':' + v);
                            }
                        }
                    }
                }
                return '{' + a.join(',') + '}';
        }
    };

})(jQuery);
/*
* Facebox (for jQuery)
* version: 1.2 (05/05/2008)
* @requires jQuery v1.2 or later
*/
(function($) {
    $.facebox = function(data, klass) {
        $.facebox.loading();

        if (data.ajax) fillFaceboxFromAjax(data.ajax);
        else if (data.image) fillFaceboxFromImage(data.image);
        else if (data.div) fillFaceboxFromHref(data.div);
        else if ($.isFunction(data)) data.call($);
        else $.facebox.reveal(data, klass);
    }

    /*
    * Public, $.facebox methods
    */

    $.extend($.facebox, {
        settings: {
            opacity: 0,
            overlay: true,
            loadingImage: '/facebox/loading.gif',
            closeImage: '/facebox/closelabel.gif',
            imageTypes: ['png', 'jpg', 'jpeg', 'gif'],
            faceboxHtml: '\
                <div id="facebox" style="display:none;"> \
                  <div class="popup"> \
                    <table> \
                      <tbody> \
                        <tr> \
                          <td class="tl"/><td class="b"/><td class="tr"/> \
                        </tr> \
                        <tr> \
                          <td class="b"/> \
                          <td class="body"> \
                            <div class="content"> \
                            </div> \
                            <div class="footer"> \
                              <a href="#" class="close"> \
                                <img src="/facebox/closelabel.gif" title="" class="close_image" /> \
                              </a> \
                            </div> \
                          </td> \
                          <td class="b"/> \
                        </tr> \
                        <tr> \
                          <td class="bl"/><td class="b"/><td class="br"/> \
                        </tr> \
                      </tbody> \
                    </table> \
                  </div> \
                </div>'
        },

        loading: function() {
            init();
            if ($('#facebox .loading').length == 1) return true;

            showOverlay();

            $('#facebox .content').empty();
            $('#facebox .body').children().hide().end().append('<div class="loading"><img src="' + $.facebox.settings.loadingImage + '"/></div>');

            $('#facebox').css({
                top: getPageScroll()[1] + (getPageHeight() / 10),
                left: 385.5
            }).show();

            //      $(document).bind('keydown.facebox', function(e) {
            //        if (e.keyCode == 27) $.facebox.close()
            //        return true
            //      })
            $(document).trigger('loading.facebox');
        },

        reveal: function(data, klass) {
            $(document).trigger('beforeReveal.facebox');
            if (klass) $('#facebox .content').addClass(klass);
            $('#facebox .content').append(data);
            $('#facebox .loading').remove();
            //$('#facebox .body').children().fadeIn('normal')
            $('#facebox .body').children().show();
            $('#facebox').css('left', $(window).width() / 2 - ($('#facebox .popup').width() / 2));
            $(document).trigger('reveal.facebox').trigger('afterReveal.facebox');
        },

        close: function() {
            $(document).trigger('close.facebox');
            return false;
        }
    })

    /*
    * Public, $.fn methods
    */
    $.fn.facebox = function(settings) {
        init(settings);

        function clickHandler() {
            $.facebox.loading(true);

            // support for rel="facebox.inline_popup" syntax, to add a class
            // also supports deprecated "facebox[.inline_popup]" syntax
            var klass = this.rel.match(/facebox\[?\.(\w+)\]?/);
            if (klass) klass = klass[1];

            fillFaceboxFromHref(this.href, klass);
            return false;
        }

        return this.click(clickHandler);
    }

    /*
    * Private methods
    */
    // called one time to setup facebox on this page
    function init(settings) {
        if ($.facebox.settings.inited) return true;
        else $.facebox.settings.inited = true;

        $(document).trigger('init.facebox');

        var imageTypes = $.facebox.settings.imageTypes.join('|');
        $.facebox.settings.imageTypesRegexp = new RegExp('\.' + imageTypes + '$', 'i');

        if (settings) $.extend($.facebox.settings, settings);
        $('body').append($.facebox.settings.faceboxHtml);

        var preload = [new Image(), new Image()];
        preload[0].src = $.facebox.settings.closeImage;
        preload[1].src = $.facebox.settings.loadingImage;

        $('#facebox').find('.b:first, .bl, .br, .tl, .tr').each(function() {
            preload.push(new Image());
            preload.slice(-1).src = $(this).css('background-image').replace(/url\((.+)\)/, '$1');
        })

        $('#facebox .close').click($.facebox.close);
        $('#facebox .close_image').attr('src', $.facebox.settings.closeImage);
    }

    // getPageScroll() by quirksmode.com
    function getPageScroll() {
        var xScroll, yScroll;
        if (self.pageYOffset) {
            yScroll = self.pageYOffset;
            xScroll = self.pageXOffset;
        } else if (document.documentElement && document.documentElement.scrollTop) {	 // Explorer 6 Strict
            yScroll = document.documentElement.scrollTop;
            xScroll = document.documentElement.scrollLeft;
        } else if (document.body) {// all other Explorers
            yScroll = document.body.scrollTop;
            xScroll = document.body.scrollLeft;
        }
        return new Array(xScroll, yScroll);
    }

    // Adapted from getPageSize() by quirksmode.com
    function getPageHeight() {
        var windowHeight;
        if (self.innerHeight) {	// all except Explorer
            windowHeight = self.innerHeight;
        } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
            windowHeight = document.documentElement.clientHeight;
        } else if (document.body) { // other Explorers
            windowHeight = document.body.clientHeight;
        }
        return windowHeight;
    }

    // Figures out what you want to display and displays it
    // formats are:
    //     div: #id
    //   image: blah.extension
    //    ajax: anything else
    function fillFaceboxFromHref(href, klass) {
        // div
        if (href.match(/#/)) {
            var url = window.location.href.split('#')[0];
            var target = href.replace(url, '');
            $.facebox.reveal($(target).clone().show(), klass);

            // image
        } else if (href.match($.facebox.settings.imageTypesRegexp)) {
            fillFaceboxFromImage(href, klass);
            // ajax
        } else {
            fillFaceboxFromAjax(href, klass);
        }
    }

    function fillFaceboxFromImage(href, klass) {
        var image = new Image();
        image.onload = function() {
            $.facebox.reveal('<div class="image"><img src="' + image.src + '" /></div>', klass);
        }
        image.src = href;
    }

    function fillFaceboxFromAjax(href, klass) {
        $.get(href, function(data) { $.facebox.reveal(data, klass) });
    }

    function skipOverlay() {
        return $.facebox.settings.overlay == false || $.facebox.settings.opacity === null;
    }

    function showOverlay() {
        if (skipOverlay()) return;

        if ($('facebox_overlay').length == 0)
            $("body").append('<div id="facebox_overlay" class="facebox_hide"></div>');

        $('#facebox_overlay').hide().addClass("facebox_overlayBG").css('opacity', $.facebox.settings.opacity).show();
        //.click(function() { $(document).trigger('close.facebox') })
        //.fadeIn(200)
        return false;
    }

    function hideOverlay() {
        if (skipOverlay()) return;

        $("#facebox_overlay").removeClass("facebox_overlayBG");
        $("#facebox_overlay").addClass("facebox_hide");
        $("#facebox_overlay").remove();
        $('#facebox_overlay').hide();

        return false;
    }

    /*
    * Bindings
    */
    $(document).bind('close.facebox', function() {
        //$(document).unbind('keydown.facebox')
        $('#facebox').hide();
        $('#facebox .content').removeClass().addClass('content');
        hideOverlay();
        $('#facebox .loading').remove();
    })
})(jQuery);
/*
* jQuery.ahove plugin
* Version: 1.0
* @requires jQuery v1.2 or later
*/
(function($) {
    $.extend({
        ahover: {
            version: 1.0,
            defaults: {
                toggleSpeed: 75,
                toggleEffect: 'both',
                hoverEffect: null,
                moveSpeed: 250,
                easing: 'swing',
                className: 'ahover'
            },
            effects: {
                'width': { width: 0 },
                'height': { height: 0 },
                'both': { width: 0, height: 0 }
            }
        }
    });

    $.fn.extend({
        ahover: function(options) {
            var options = $.extend({}, $.ahover.defaults, options);
            var effect = (
                (typeof options.toggleEffect == 'string') ?
                $.ahover.effects[options.toggleEffect] : options.toggleEffect
            );
            var parent = this.offsetParent();
            return this.hover(
                function(e) {
                var over = $(this);
                var overSize = {
                    width: over.outerWidth(),
                    height: over.outerHeight()
                };
                var overOffset = over.offset();
                var parentOffset = parent.offset();

                var under = $('div.' + options.className, parent).stop();
                var created = (under.length == 0);
                if (created) {
                    under = $('<div>&nbsp;</div>')
                            .addClass(options.className)
                            .appendTo(parent).css(overSize);
                }

                var underOffset = {
                    left: overOffset.left - parentOffset.left -
                            (under.outerWidth() - under.width()) / 2,
                    top: overOffset.top - parentOffset.top -
                            (under.outerHeight() - under.height()) / 2
                }

                if (created) {
                    under.css(underOffset).css(effect).animate(overSize, {
                        queue: false,
                        duration: options.toggleSpeed,
                        easing: options.easing
                    });
                }
                else {
                    var underCSS = $.extend({}, overSize, underOffset);
                    under.animate(underCSS, {
                        queue: false,
                        duration: options.moveSpeed,
                        easing: options.easing
                    });
                }
                if ($.isFunction(options.hoverEffect)) {
                    under.queue(options.hoverEffect);
                }
            },
                function(e) {
                $('div.' + options.className, parent).animate(effect, {
                    queue: false,
                    duration: options.toggleSpeed,
                    easing: options.easing,
                    complete: function() { $(this).remove(); }
                });
            }
            );
        }
    });
})(jQuery);
/*
* Watermark plugin (for jQuery)
* Version: 1.0
* @requires jQuery v1.2 or later
* Created by baldwin for "SunBlog" ( http://www.dnnsun.com )
*/
(function($) {
    $.fn.watermark = function(options) {
        // build main options before element iteration
        var opts = $.extend({}, $.fn.watermark.defaults, options);

        return this.each(function() {
            var target = $(this);

            function clear() {
                if (target.val() == opts.defaultText
                    && target.hasClass(opts.watermarkCss)) {
                    target.val("").removeClass(opts.watermarkCss);
                }
            }

            function renderDefault() {
                if ($.trim(target.val()) === '') {
                    target.val(opts.defaultText).addClass(opts.watermarkCss);
                }
            }

            // Bind the related event handlers
            target.focus(clear);
            target.blur(renderDefault);
            target.change(renderDefault);

            renderDefault();
        });
    };

    // plugin defaults settings
    $.fn.watermark.defaults = {
        defaultText: 'search',
        watermarkCss: 'watermark'
    };
})(jQuery);

// jQuery Rater Plugin 1.1 Copyright 2008 Jarrett Vance http://jvance.com
(function($) {
    $.fn.rater = function(options) {
        var opts = $.extend({}, $.fn.rater.defaults, options);
        return this.each(function() {
            var $this = $(this);
            var $on = $this.find('.ui-rater-starsOn');
            var $off = $this.find('.ui-rater-starsOff');
            if (opts.size == undefined) opts.size = $off.height();
            if (opts.rating == undefined) opts.rating = $on.width() / opts.size;
            if (opts.id == undefined) opts.id = $this.attr('id');

            $off.mousemove(function(e) {
                var left = e.clientX - $off.offset().left;
                var width = $off.width() - ($off.width() - left);
                width = Math.min(Math.ceil(width / (opts.size / opts.step)) * opts.size / opts.step, opts.size * opts.ratings.length)
                $on.width(width);
                var r = Math.round($on.width() / $off.width() * (opts.ratings.length * opts.step)) / opts.step;
                $this.attr('title', opts.ratings[r - 1] == undefined ? r : opts.ratings[r - 1]);
            }).hover(function(e) { $on.addClass('ui-rater-starsHover'); }, function(e) {
                $on.removeClass('ui-rater-starsHover'); $on.width(opts.rating * opts.size);
            }).click(function(e) {
                var r = Math.round($on.width() / $off.width() * (opts.ratings.length * opts.step)) / opts.step;
                $.fn.rater.rate($this, opts, r);
            }).css('cursor', 'pointer'); $on.css('cursor', 'pointer');
        });
    };

    $.fn.rater.defaults = {
        postHref: location.href,
        ratings: ['Bad', 'Boring', 'Average', 'Good', 'Great'],
        step: 1
    };

    $.fn.rater.rate = function($this, opts, rating) {
        var $on = $this.find('.ui-rater-starsOn');
        var $off = $this.find('.ui-rater-starsOff');
        $off.fadeTo(600, 0.4, function() {
            $.ajax({
                url: opts.postHref,
                type: "POST",
                data: 'id=' + opts.id + '&rating=' + rating,
                complete: function(req) {
                    if (req.status == 200) { //success
                        if (req.responseText == "HASRATED") {
                            alert("You already rated this post");
                        } else {
                            opts.rating = parseFloat(req.responseText);
                            $off.unbind('click').unbind('mousemove').unbind('mouseenter').unbind('mouseleave');
                            $off.css('cursor', 'default'); $on.css('cursor', 'default');
                            $off.fadeTo(600, 0.1, function() {
                                $on.removeClass('ui-rater-starsHover').width(opts.rating * opts.size);
                                var $count = $this.find('.ui-rater-rateCount');
                                $count.text(parseInt($count.text()) + 1);
                                $this.find('.ui-rater-rating').text(opts.rating.toFixed(1));
                                $off.fadeTo(500, 1);
                                $this.attr('title', 'Your rating: ' + rating.toFixed(1));
                            });

                            alert("Your rating has been registered. Thank you!");
                        }
                    } else { //failure
                        //alert(req.responseText);
                        alert("An error occured while registering your rating. Please try again");
                        $off.fadeTo(2200, 1);
                    }
                }
            });
        });
    };
})(jQuery);
/* ------------------------------------------------------------------------
s3Capcha
	
Developped By: Boban Karišik -> http://www.serie3.info/
Icons and css: Mészáros Róbert -> http://www.perspectived.com/
Version: 1.0
	
Copyright: Feel free to redistribute the script/modify it, as
long as you leave my infos at the top.
------------------------------------------------------------------------- */
(function($) {
    jQuery.fn.extend({
        check: function() {
            return this.each(function() { this.checked = true; });
        },
        uncheck: function() {
            return this.each(function() { this.checked = false; });
        }
    });


    $.fn.s3Capcha = function(vars) {
        var element = this;
        var spans = $("#" + element[0].id + " div span");
        var radios = $("#" + element[0].id + " div span input");
        var images = $("#" + element[0].id + " div .img");
        // hide radios //
        spans.css({ 'display': 'none' });
        // show images //
        images.css({ 'display': 'block' });

        images.each(function(i) {
            $(images[i]).click(function() {
                images.css({ 'background-position': 'bottom left' });
                $(images[i]).css({ 'background-position': 'top left' });
                $(radios[i]).check();
            });
        });

    }

})(jQuery);
/**
* SWFObject v1.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
*
* SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*
* **SWFObject is the SWF embed script formarly known as FlashObject. The name was changed for
*   legal reasons.
*/
if (typeof deconcept == "undefined") { var deconcept = new Object(); }
if (typeof deconcept.util == "undefined") { deconcept.util = new Object(); }
if (typeof deconcept.SWFObjectUtil == "undefined") { deconcept.SWFObjectUtil = new Object(); }
deconcept.SWFObject = function(_1, id, w, h, _5, c, _7, _8, _9, _a, _b) {
    if (!document.createElement || !document.getElementById) { return; }
    this.DETECT_KEY = _b ? _b : "detectflash";
    this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
    this.params = new Object();
    this.variables = new Object();
    this.attributes = new Array();
    if (_1) { this.setAttribute("swf", _1); }
    if (id) { this.setAttribute("id", id); }
    if (w) { this.setAttribute("width", w); }
    if (h) { this.setAttribute("height", h); }
    if (_5) { this.setAttribute("version", new deconcept.PlayerVersion(_5.toString().split("."))); }
    this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion(this.getAttribute("version"), _7);
    if (c) { this.addParam("bgcolor", c); }
    var q = _8 ? _8 : "high";
    this.addParam("quality", q);
    this.setAttribute("useExpressInstall", _7);
    this.setAttribute("doExpressInstall", false);
    var _d = (_9) ? _9 : window.location;
    this.setAttribute("xiRedirectUrl", _d);
    this.setAttribute("redirectUrl", "");
    if (_a) { this.setAttribute("redirectUrl", _a); }
};
deconcept.SWFObject.prototype = { setAttribute: function(_e, _f) {
        this.attributes[_e] = _f;
    }, getAttribute: function(_10) {
        return this.attributes[_10];
    }, addParam: function(_11, _12) {
        this.params[_11] = _12;
    }, getParams: function() {
        return this.params;
    }, addVariable: function(_13, _14) {
        this.variables[_13] = _14;
    }, getVariable: function(_15) {
        return this.variables[_15];
    }, getVariables: function() {
        return this.variables;
    }, getVariablePairs: function() {
        var _16 = new Array();
        var key;
        var _18 = this.getVariables();
        for (key in _18) {
            _16.push(key + "=" + _18[key]);
        }
        return _16;
    }, getSWFHTML: function() {
        var _19 = "";
        if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) {
            if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "PlugIn"); }
            _19 = "<embed type=\"application/x-shockwave-flash\" src=\"" + this.getAttribute("swf") + "\" width=\"" + this.getAttribute("width") + "\" height=\"" + this.getAttribute("height") + "\"";
            _19 += " id=\"" + this.getAttribute("id") + "\" name=\"" + this.getAttribute("id") + "\" ";
            var _1a = this.getParams();
            for (var key in _1a) { _19 += [key] + "=\"" + _1a[key] + "\" "; }
            var _1c = this.getVariablePairs().join("&");
            if (_1c.length > 0) { _19 += "flashvars=\"" + _1c + "\""; }
            _19 += "/>";
        } else {
            if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "ActiveX"); }
            _19 = "<object id=\"" + this.getAttribute("id") + "\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"" + this.getAttribute("width") + "\" height=\"" + this.getAttribute("height") + "\">";
            _19 += "<param name=\"movie\" value=\"" + this.getAttribute("swf") + "\" />";
            var _1d = this.getParams();
            for (var key in _1d) { _19 += "<param name=\"" + key + "\" value=\"" + _1d[key] + "\" />"; }
            var _1f = this.getVariablePairs().join("&");
            if (_1f.length > 0) { _19 += "<param name=\"flashvars\" value=\"" + _1f + "\" />"; }
            _19 += "</object>";
        }
        return _19;
    }, write: function(_20) {
        if (this.getAttribute("useExpressInstall")) {
            var _21 = new deconcept.PlayerVersion([6, 0, 65]);
            if (this.installedVer.versionIsValid(_21) && !this.installedVer.versionIsValid(this.getAttribute("version"))) {
                this.setAttribute("doExpressInstall", true);
                this.addVariable("MMredirectURL", escape(this.getAttribute("xiRedirectUrl")));
                document.title = document.title.slice(0, 47) + " - Flash Player Installation";
                this.addVariable("MMdoctitle", document.title);
            }
        }
        if (this.skipDetect || this.getAttribute("doExpressInstall") || this.installedVer.versionIsValid(this.getAttribute("version"))) {
            var n = (typeof _20 == "string") ? document.getElementById(_20) : _20;
            n.innerHTML = this.getSWFHTML();
            return true;
        } else {
            if (this.getAttribute("redirectUrl") != "") { document.location.replace(this.getAttribute("redirectUrl")); }
        }
        return false;
    }
};
deconcept.SWFObjectUtil.getPlayerVersion = function(_23, _24) {
    var _25 = new deconcept.PlayerVersion([0, 0, 0]);
    if (navigator.plugins && navigator.mimeTypes.length) {
        var x = navigator.plugins["Shockwave Flash"];
        if (x && x.description) { _25 = new deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split(".")); }
    } else {
        try {
            var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
            for (var i = 3; axo != null; i++) {
                axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);
                _25 = new deconcept.PlayerVersion([i, 0, 0]);
            }
        }
        catch (e) { }
        if (_23 && _25.major > _23.major) { return _25; }
        if (!_23 || ((_23.minor != 0 || _23.rev != 0) && _25.major == _23.major) || _25.major != 6 || _24) {
            try { _25 = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(",")); }
            catch (e) { }
        }
    }
    return _25;
};
deconcept.PlayerVersion = function(_29) {
    this.major = parseInt(_29[0]) != null ? parseInt(_29[0]) : 0;
    this.minor = parseInt(_29[1]) || 0;
    this.rev = parseInt(_29[2]) || 0;
};
deconcept.PlayerVersion.prototype.versionIsValid = function(fv) {
    if (this.major < fv.major) { return false; }
    if (this.major > fv.major) { return true; }
    if (this.minor < fv.minor) { return false; }
    if (this.minor > fv.minor) { return true; }
    if (this.rev < fv.rev) { return false; } return true;
};
deconcept.util = { getRequestParameter: function(_2b) {
        var q = document.location.search || document.location.hash;
        if (q) {
            var _2d = q.indexOf(_2b + "=");
            var _2e = (q.indexOf("&", _2d) > -1) ? q.indexOf("&", _2d) : q.length;
            if (q.length > 1 && _2d > -1) {
                return q.substring(q.indexOf("=", _2d) + 1, _2e);
            }
        } return "";
    }
};
if (Array.prototype.push == null) {
    Array.prototype.push = function(_2f) {
        this[this.length] = _2f;
        return this.length;
    };
}
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject; // for backwards compatibility
var SWFObject = deconcept.SWFObject;