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(n, b, o, e, j, l, g, f, d, m, k){
    if (!document.getElementById) {
        return
    }
    this.DETECT_KEY = k ? k : "detectflash";
    this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
    this.params = new Object();
    this.variables = new Object();
    this.attributes = new Array();
    if (n) {
        this.setAttribute("swf", n)
    }
    if (b) {
        this.setAttribute("id", b)
    }
    if (o) {
        this.setAttribute("width", o)
    }
    if (e) {
        this.setAttribute("height", e)
    }
    if (j) {
        this.setAttribute("version", new deconcept.PlayerVersion(j.toString().split(".")))
    }
    this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
    if (l) {
        this.addParam("bgcolor", l)
    }
    var a = f ? f : "high";
    this.addParam("quality", a);
    this.setAttribute("useExpressInstall", g);
    this.setAttribute("doExpressInstall", false);
    var i = (d) ? d : window.location;
    this.setAttribute("xiRedirectUrl", i);
    this.setAttribute("redirectUrl", "");
    if (m) {
        this.setAttribute("redirectUrl", m)
    }
};
deconcept.SWFObject.prototype = {
    setAttribute: function(a, b){
        this.attributes[a] = b
    },
    getAttribute: function(a){
        return this.attributes[a]
    },
    addParam: function(b, a){
        this.params[b] = a
    },
    getParams: function(){
        return this.params
    },
    addVariable: function(b, a){
        this.variables[b] = a
    },
    getVariable: function(a){
        return this.variables[a]
    },
    getVariables: function(){
        return this.variables
    },
    getVariablePairs: function(){
        var c = new Array();
        var b;
        var a = this.getVariables();
        for (b in a) {
            c.push(b + "=" + a[b])
        }
        return c
    },
    getSWFHTML: function(){
        var b = "";
        if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) {
            if (this.getAttribute("doExpressInstall")) {
                this.addVariable("MMplayerType", "PlugIn")
            }
            b = '<embed type="application/x-shockwave-flash" src="' + this.getAttribute("swf") + '" width="' + this.getAttribute("width") + '" height="' + this.getAttribute("height") + '"';
            b += ' id="' + this.getAttribute("id") + '" name="' + this.getAttribute("id") + '" ';
            var f = this.getParams();
            for (var e in f) {
                b += [e] + '="' + f[e] + '" '
            }
            var d = this.getVariablePairs().join("&");
            if (d.length > 0) {
                b += 'flashvars="' + d + '"'
            }
            b += "/>"
        }
        else {
            if (this.getAttribute("doExpressInstall")) {
                this.addVariable("MMplayerType", "ActiveX")
            }
            b = '<object id="' + this.getAttribute("id") + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + this.getAttribute("width") + '" height="' + this.getAttribute("height") + '">';
            b += '<param name="movie" value="' + this.getAttribute("swf") + '" />';
            var c = this.getParams();
            for (var e in c) {
                b += '<param name="' + e + '" value="' + c[e] + '" />'
            }
            var a = this.getVariablePairs().join("&");
            if (a.length > 0) {
                b += '<param name="flashvars" value="' + a + '" />'
            }
            b += "</object>"
        }
        return b
    },
    write: function(b){
        if (this.getAttribute("useExpressInstall")) {
            var a = new deconcept.PlayerVersion([6, 0, 65]);
            if (this.installedVer.versionIsValid(a) && !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 c = (typeof b == "string") ? document.getElementById(b) : b;
            c.innerHTML = this.getSWFHTML();
            return true
        }
        else {
            if (this.getAttribute("redirectUrl") != "") {
                document.location.replace(this.getAttribute("redirectUrl"))
            }
        }
        return false
    }
};
deconcept.SWFObjectUtil.getPlayerVersion = function(){
    var d = new deconcept.PlayerVersion([0, 0, 0]);
    if (navigator.plugins && navigator.mimeTypes.length) {
        var a = navigator.plugins["Shockwave Flash"];
        if (a && a.description) {
            d = new deconcept.PlayerVersion(a.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."))
        }
    }
    else {
        try {
            var b = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")
        } 
        catch (c) {
            try {
                var b = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
                d = new deconcept.PlayerVersion([6, 0, 21]);
                b.AllowScriptAccess = "always"
            } 
            catch (c) {
                if (d.major == 6) {
                    return d
                }
            }
            try {
                b = new ActiveXObject("ShockwaveFlash.ShockwaveFlash")
            } 
            catch (c) {
            }
        }
        if (b != null) {
            d = new deconcept.PlayerVersion(b.GetVariable("$version").split(" ")[1].split(","))
        }
    }
    return d
};
deconcept.PlayerVersion = function(a){
    this.major = a[0] != null ? parseInt(a[0]) : 0;
    this.minor = a[1] != null ? parseInt(a[1]) : 0;
    this.rev = a[2] != null ? parseInt(a[2]) : 0
};
deconcept.PlayerVersion.prototype.versionIsValid = function(a){
    if (this.major < a.major) {
        return false
    }
    if (this.major > a.major) {
        return true
    }
    if (this.minor < a.minor) {
        return false
    }
    if (this.minor > a.minor) {
        return true
    }
    if (this.rev < a.rev) {
        return false
    }
    return true
};
deconcept.util = {
    getRequestParameter: function(a){
        var d = document.location.search || document.location.hash;
        if (d) {
            var c = d.substring(1).split("&");
            for (var b = 0; b < c.length; b++) {
                if (c[b].substring(0, c[b].indexOf("=")) == a) {
                    return c[b].substring((c[b].indexOf("=") + 1))
                }
            }
        }
        return ""
    }
};
deconcept.SWFObjectUtil.cleanupSWFs = function(){
    if (window.opera || !document.all) {
        return
    }
    var c = document.getElementsByTagName("OBJECT");
    for (var b = 0; b < c.length; b++) {
        c[b].style.display = "none";
        for (var a in c[b]) {
            if (typeof c[b][a] == "function") {
                c[b][a] = function(){
                }
            }
        }
    }
};
deconcept.SWFObjectUtil.prepUnload = function(){
    __flash_unloadHandler = function(){
    };
    __flash_savedUnloadHandler = function(){
    };
    if (typeof window.onunload == "function") {
        var a = window.onunload;
        window.onunload = function(){
            deconcept.SWFObjectUtil.cleanupSWFs();
            a()
        }
    }
    else {
        window.onunload = deconcept.SWFObjectUtil.cleanupSWFs
    }
};
if (typeof window.onbeforeunload == "function") {
    var oldBeforeUnload = window.onbeforeunload;
    window.onbeforeunload = function(){
        deconcept.SWFObjectUtil.prepUnload();
        oldBeforeUnload()
    }
}
else {
    window.onbeforeunload = deconcept.SWFObjectUtil.prepUnload
}
if (Array.prototype.push == null) {
    Array.prototype.push = function(a){
        this[this.length] = a;
        return this.length
    }
}
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject;
var SWFObject = deconcept.SWFObject;

/**
 * @author Ryan Johnson <http://syntacticx.com/>
 * @copyright 2008 PersonalGrid Corporation <http://personalgrid.com/>
 * @package LivePipe UI
 * @license MIT
 * @url http://livepipe.net/core
 * @require prototype.js
 */

if(typeof(Control) == 'undefined')
    Control = {};
    
var $proc = function(proc){
    return typeof(proc) == 'function' ? proc : function(){return proc};
};

var $value = function(value){
    return typeof(value) == 'function' ? value() : value;
};

Object.Event = {
    extend: function(object){
        object._objectEventSetup = function(event_name){
            this._observers = this._observers || {};
            this._observers[event_name] = this._observers[event_name] || [];
        };
        object.observe = function(event_name,observer){
            if(typeof(event_name) == 'string' && typeof(observer) != 'undefined'){
                this._objectEventSetup(event_name);
                if(!this._observers[event_name].include(observer))
                    this._observers[event_name].push(observer);
            }else
                for(var e in event_name)
                    this.observe(e,event_name[e]);
        };
        object.stopObserving = function(event_name,observer){
            this._objectEventSetup(event_name);
            if(event_name && observer)
                this._observers[event_name] = this._observers[event_name].without(observer);
            else if(event_name)
                this._observers[event_name] = [];
            else
                this._observers = {};
        };
        object.observeOnce = function(event_name,outer_observer){
            var inner_observer = function(){
                outer_observer.apply(this,arguments);
                this.stopObserving(event_name,inner_observer);
            }.bind(this);
            this._objectEventSetup(event_name);
            this._observers[event_name].push(inner_observer);
        };
        object.notify = function(event_name){
            this._objectEventSetup(event_name);
            var collected_return_values = [];
            var args = $A(arguments).slice(1);
            try{
                for(var i = 0; i < this._observers[event_name].length; ++i)
                    collected_return_values.push(this._observers[event_name][i].apply(this._observers[event_name][i],args) || null);
            }catch(e){
                if(e == $break)
                    return false;
                else
                    throw e;
            }
            return collected_return_values;
        };
        if(object.prototype){
            object.prototype._objectEventSetup = object._objectEventSetup;
            object.prototype.observe = object.observe;
            object.prototype.stopObserving = object.stopObserving;
            object.prototype.observeOnce = object.observeOnce;
            object.prototype.notify = function(event_name){
                if(object.notify){
                    var args = $A(arguments).slice(1);
                    args.unshift(this);
                    args.unshift(event_name);
                    object.notify.apply(object,args);
                }
                this._objectEventSetup(event_name);
                var args = $A(arguments).slice(1);
                var collected_return_values = [];
                try{
                    if(this.options && this.options[event_name] && typeof(this.options[event_name]) == 'function')
                        collected_return_values.push(this.options[event_name].apply(this,args) || null);
                    for(var i = 0; i < this._observers[event_name].length; ++i)
                        collected_return_values.push(this._observers[event_name][i].apply(this._observers[event_name][i],args) || null);
                }catch(e){
                    if(e == $break)
                        return false;
                    else
                        throw e;
                }
                return collected_return_values;
            };
        }
    }
};

/* Begin Core Extensions */

//Element.observeOnce
Element.addMethods({
    observeOnce: function(element,event_name,outer_callback){
        var inner_callback = function(){
            outer_callback.apply(this,arguments);
            Element.stopObserving(element,event_name,inner_callback);
        };
        Element.observe(element,event_name,inner_callback);
    }
});

//mouse:wheel
(function(){
    function wheel(event){
        var delta, element, custom_event;
        // normalize the delta
        if (event.wheelDelta) { // IE & Opera
            delta = event.wheelDelta / 120;
        } else if (event.detail) { // W3C
            delta =- event.detail / 3;
        }
        if (!delta) { return; }
        element = Event.extend(event).target;
        element = Element.extend(element.nodeType === Node.TEXT_NODE ? element.parentNode : element);
        custom_event = element.fire('mouse:wheel',{ delta: delta });
        if (custom_event.stopped) {
            Event.stop(event);
            return false;
        }
    }
    document.observe('mousewheel',wheel);
    document.observe('DOMMouseScroll',wheel);
})();

/* End Core Extensions */

//from PrototypeUI
var IframeShim = Class.create({
    initialize: function() {
        this.element = new Element('iframe',{
            style: 'position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);display:none',
            src: 'javascript:void(0);',
            frameborder: 0 
        });
        $(document.body).insert(this.element);
    },
    hide: function() {
        this.element.hide();
        return this;
    },
    show: function() {
        this.element.show();
        return this;
    },
    positionUnder: function(element) {
        var element = $(element);
        var offset = element.cumulativeOffset();
        var dimensions = element.getDimensions();
        this.element.setStyle({
            left: offset[0] + 'px',
            top: offset[1] + 'px',
            width: dimensions.width + 'px',
            height: dimensions.height + 'px',
            zIndex: element.getStyle('zIndex') - 1
        }).show();
        return this;
    },
    setBounds: function(bounds) {
        for(prop in bounds)
            bounds[prop] += 'px';
        this.element.setStyle(bounds);
        return this;
    },
    destroy: function() {
        if(this.element)
            this.element.remove();
        return this;
    }
});

Object.extend(Function.prototype, {
    benchmark: function(){
        benchStart = (new Date()).getTime();
        returnVal = this.apply(this, arguments);
        passedMilSec = (new Date()).getTime() - benchStart;
        return "Function with return value " + Object.inspect(returnVal) + " is excuted in " + passedMilSec + " milliseconds"
    },
    bodyAsString: function(){
        var a = this.toString();
        a = a.replace(/[^{]+{/, "");
        a = a.substring(0, a.length - 1);
        a = a.replace(/\n/gi, "");
        return a.strip()
    }
});
Object.extend(String.prototype, {
    makeElement: function(){
        str = this.strip();
        if (!str.startsWith("<") || !str.endsWith(">")) {
            wrapTag = arguments[0] || "span";
            str = "<" + wrapTag + ">" + str + "</" + wrapTag + ">"
        }
        var a = new Element("span");
        a.innerHTML = str;
        if (a.childElements().length == 1) {
            return a.down()
        }
        return a
    },
    strip: function(){
        if (arguments[0]) {
        }
        else {
            return this.replace(/^\s+/, "").replace(/\s+$/, "")
        }
    },
    extractElements: function(a){
        return this.makeElement().select(a)
    },
    parseInteger: function(){
        return parseInt(this)
    },
    parseFloat: function(){
        return parseFloat(this)
    }
});
Object.extend(Enumerable, {
    findIndex: function(b){
        var a;
        this.each(function(d, c){
            if (b(d, c)) {
                a = c;
                throw $break
            }
        });
        return a
    }
});
Array.prototype.findIndex = Enumerable.findIndex;
Object.extend(Array.prototype, {
    intersect: function(a){
        a = $A(arguments).flatten();
        return this.uniq().findAll(function(b){
            return a.detect(function(c){
                return b === c
            })
        })
    },
    diff: function(a){
        a = $A(arguments).flatten();
        return this.uniq().findAll(function(b){
            return !a.detect(function(c){
                return b === c
            })
        })
    },
    split: function(a){
        out = $A();
        array = this.clone();
        do {
            out.push(array.splice(0, a))
        }
        while (array.length > 0);
        return out
    },
    product: function(){
        var a = 0;
        this.each(function(){
            a *= parseInt(arguments[0])
        });
        return a
    },
    sum: function(){
        var a = 0;
        this.each(function(){
            a += parseInt(arguments[0])
        });
        return a
    }
});
Element.addMethods("select", {
    addOption: function(a){
        a = $(a);
        a.appendChild(option = new Element("option", arguments[1] ||
        {}));
        return option
    },
    fill: function(c, a){
        c = $(c);
        for (var b in a) {
            opt = c.addOption();
            opt.text = a[b];
            opt.value = b
        }
        return c
    },
    fillAjax: function(b, a){
        b = $(b);
        options = arguments[2] ||
        {};
        options.onSuccess = function(d, c){
            this.empty();
            if (c) {
                this.fill(c)
            }
            else {
                if (d.responseText.isJSON()) {
                    this.fill(d.responseText.evalJSON())
                }
            }
        }
.bind(b);
        if (Object.isFunction(options.onLoading)) {
            options.onLoading.bind(b)
        }
        if (Object.isFunction(options.onComplete)) {
            options.onComplete.bind(b)
        }
        new Ajax.Request(a, options);
        return b
    },
    empty: function(a){
        a = $(a);
        while (a.options.length > 0) {
            a.removeChild(a.options[0])
        }
        return a
    }
});
Element.addMethods({
    toHTML: function(a){
        a = $($(a).cloneNode(true));
        var b = new Element("div");
        b.appendChild(a);
        return b.innerHTML
    },
    scrollTo: function(b, a){
        b = $(b);
        Object.extend({
            x: true,
            y: true
        }, a ||
        {});
        var c = this.cumulativeOffset(b);
        window.scrollTo(a.x ? c[0] : window.scrollX, a.y ? c[1] : window.scrollY);
        return b
    },
    replaceClassName: function(b, c, a){
        b = $(b);
        b.removeClassName(c).addClassName(a);
        return b
    },
    removeClassName: function(a, b){
        b = $A(arguments).slice(1).flatten();
        a = $(a);
        existingClassNames = a.className.split(/\s/);
        a.className = existingClassNames.diff(b).join(" ");
        return a
    },
    cycleClassNames: function(a, b){
        if (!Object.isArray(b)) {
            return a
        }
        a = $(a);
        b = b.uniq();
        existingClassNames = a.className.split(/\s/);
        if (b.length == 1) {
            a.toggleClassName(className.first());
            return a
        }
        includedClassName = existingClassNames.intersect(b)[0] || false;
        if (!includedClassName) {
            a.addClassName(b.first())
        }
        else {
            index = b.indexOf(includedClassName);
            a.replaceClassName(includedClassName, b[index + 1] ? b[index + 1] : b[0])
        }
        return a
    },
    pngHack: function(d){
        var d = $(d);
        if (!Prototype.Browser.IE) {
            return d
        }
        var c = "images/s.gif";
        if ((d.match("img")) && (d.src.include("png"))) {
            var b = d.src;
            var e = "scale";
            d.src = c
        }
        else {
            if (d.getStyle("backgroundImage").include("png")) {
                var a = d.getStyle("backgroundColor") || "";
                var b = d.getStyle("backgroundImage").gsub(/url\(|\)|'|"/, "");
                var e = "crop";
                d.setStyle({
                    background: [a, " url(", c, ") no-repeat"].join("")
                })
            }
            else {
                return d
            }
        }
        d.runtimeStyle.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="#{al}",sizingMethod="#{sz}")'.interpolate({
            al: b,
            sz: e
        });
        return d
    },
    contains: function(c, b){
        c = $(c);
        b = $(b);
        var a = false;
        do {
            if ((a = c == b)) {
                break
            }
            b = b.up()
        }
        while (Object.isElement(b));
        return a
    }
});
Element.addMethods("A", {
    disableHrefFollow: function(a){
        a = $(a);
        if (Object.isFunction(a.onclick)) {
            var b = a.onclick;
            a.onclick = function(c){
                b(c);
                return false
            }
        }
        else {
            a.onclick = function(c){
                return false
            }
        }
        attrOnCl = a.readAttribute("onclick") || "";
        a.writeAttribute("onclick", "return false;" + attrOnCl);
        return a
    }
});
Object.extend(Form.Methods, {
    addRelRules: function(a){
        a = $(a);
        Element.select(a, "*[rel]").each(function(b){
            b.readAttribute("rel").split(/[\|]+/).each(function(c){
                b.addRule(c.toQueryParams())
            })
        });
        return a
    },
    addRules: function(a, b){
        a = $(a);
        formEls = a.getElements();
        a._rules = Object.clone(b);
        formEls.each(function(c){
            if (this._rules[c.name]) {
                c.addRule(b[c.name])
            }
        }
.bind(a));
        return a
    },
    validate: function(b){
        b = $(b);
        formEls = b.getElements();
        var a = false;
        res = formEls.all(function(c){
            a = c;
            return c.validate()
        });
        if (!res) {
            b.fire("form:invalidated", a)
        }
        else {
            b.fire("form:validated")
        }
        return res
    },
    submitAjax: function(b, a){
        b = $(b);
        a = a ||
        {};
        a.parameters = b.serialize(true);
        a.method = b.method || "POST";
        a.caching = false;
        new Ajax.Request(b.action || "?", a)
    },
    clear: function(a){
        a = $(a);
        a.getElements().each(function(b){
            switch (b.tagName.toUpperCase()) {
                case "INPUT":
                    switch (b.type.toLowerCase()) {
                        case "radio":
                        case "checkbox":
                            b.checked = false;
                            break;
                        default:
                            b.setValue("");
                            break
                    }
                case "TEXTAREA":
                    b.setValue("");
                    break;
                case "SELECT":
                    b.select("option").each(function(c){
                        c.selected = false
                    });
                    break
            }
        });
        return a
    },
    applyCapcha: function(b, a, d){
        b = $(b);
        var c = Cookie.get(a) || Math.round(Math.random() * 10000000);
        var inp = Element.down(b, 'input[name='+d+']');
		if (inp){
			inp.setValue(c);
		}else{
	        Element.insert(b, new Element("input", {
	            type: "hidden",
	            name: d,
	            value: c
	        }), {
	            position: top
	        });
		}
        Cookie.set(a, c);
		return b;
    }
});
Object.extend(Form.Element.Methods, {
    addRule: function(a, b){
        a = $(a);
        if (!a._validateRule) {
            a._validateRule = $A()
        }
        if (Object.isArray(b)) {
            $(b).each(function(c){
                a.addRule(c)
            })
        }
        else {
            if (b.name && Object.isString(b.name) && Form.Rules[b.name]) {
                b.tester = Form.Rules[b.name];
                a._validateRule.push(b)
            }
            else {
                if (b.tester.test && Object.isFunction(b.tester.test)) {
                    a._validateRule.push(b)
                }
                else {
                    throw new Error("Unknown rule is given")
                }
            }
        }
        a.observe("change", function(){
            this.validated = false;
            this._rulesChecked = false
        }
.bind(a));
        a.observe("blur", function(){
            this._rulesChecked = false
        }
.bind(a));
        a.validated = false;
        return a
    },
    validate: function(a){
        a = $(a);
        if (a._validateRule && a.validated != true) {
            if (!a._rulesChecked) {
                a._invalidRule = false;
                var b = false;
                res = a._validateRule.all(function(c){
                    b = c;
                    testFnc = c.tester.test.bind(a);
                    return testFnc(a.getValue(), c.params || null)
                }
.bind(a));
                a._rulesChecked = true
            }
            else {
                res = false;
                b = a._invalidRule
            }
            if (res) {
                ev = "element:validated";
                a.validated = true
            }
            else {
                ev = "element:invalidated"
            }
            a._invalidRule = b;
            a.fire(ev, b);
            return res
        }
        return true
    }
});
Element.addMethods();

Form.Rules = {
    email: {
        test: function(a){
            return a.blank() ? true : a.match(/^[\w\.\-\_]+@[\w\.\-]+\.[a-z]{2,4}$/)
        }
    },
    url: {
        test: function(a){
            return a.blank() ? true : a.match("^(https?://)?(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?(([0-9]{1,3}.){3}[0-9]{1,3}|([0-9a-z_!~*'()-]+.)*([0-9a-z][0-9a-z-]{0,61})?[0-9a-z].[a-z]{2,6})(:[0-9]{1,4})?((/?)|(/[0-9a-z_!~*'().;?:@&=+$,%#-]+)+/?)$")
        }
    },
    numeric: {
        test: function(a){
            return (a.length == 0) || a.match(/^\d+$/)
        }
    },
    minlength: {
        test: function(a, b){
            return a.length >= parseInt(b)
        }
    },
    maxlength: {
        test: function(a, b){
            return a.length < parseInt(b)
        }
    },
    minwords: {
        test: function(b, a){
            return b.split(/[\s,\.:;]+/).length >= parseInt(a)
        }
    },
    maxwords: {
        test: function(b, a){
            return b.blank() ? true : (b.split(/\s+/).length <= parseInt(a))
        }
    },
    length: {
        test: function(b, a){
            return b.length == parseInt(a)
        }
    },
    regexp: {
        test: function(b, a){
            return b.blank() || b.match(a)
        }
    },
    required: {
        test: function(){
            if (this.type == "radio") {
                return $A(this.form.elements[this.name]).findAll(function(a){
                    return a.checked == true
                }).length > 0
            }
            else {
                value = this.getValue();
                if (Object.isString(value)) {
                    return !value.blank()
                }
                else {
                    if (Object.isArray(value)) {
                        return value.length != 0
                    }
                    else {
                        return true
                    }
                }
            }
        }
    },
    compare: {
        test: function(a, b){
            return (a == $(this.form.elements[b]).getValue())
        }
    },
    alphanumeric: {
        test: function(a){
            return a.match(/^\w+$/)
        }
    }
};
var Cookie = {
    get: function(c){
        var e = document.cookie.split(";");
        for (var d = 0; d < e.length; d++) {
            var b = e[d].split("=");
            if (b.length == 2) {
                b[0] = b[0].strip();
                b[1] = b[1].strip();
                if (b[0] == c) {
                    return unescape(b[1])
                }
            }
        }
        return ""
    },
    set: function(a, b){
        document.cookie = a + "=" + escape(b) + ";path=/"
    },
    remove: function(a){
        document.cookie = a + "=; expires=Thu, 01-Jan-70 00:00:01 GMT"
    }
};
Ajax.Request.addMethods({
    request: Ajax.Request.prototype.request.wrap(function(b, a){
        if (!this.options.caching || this.options.caching === false) {
            b(a)
        }
        else {
            var d = Object.toJSON(this.options.parameters ||
            {}) + a;
            if (!Ajax.Request.cache[d]) {
                var c = this.options.onSuccess || Prototype.K;
                this.options.onSuccess = function(e){
                    Ajax.Request.cache[d] = e;
                    c(resp, resp.responseJSON || null)
                };
                if (this.options.ttl && this.options.ttl > 0) {
                    (function(){
                        delete Ajax.Request.cache[d]
                    })().delay(this.options.ttl * 60)
                }
                b(a)
            }
            else {
                (this.options.onSuccess || Prototype.K)(response, response.responseJSON || null);
                (this.options.onComplete || Prototype.K)(response, response.responseJSON || null)
            }
        }
    })
});
Ajax.Request.cache = {};
Object.extend(Event, {
    observe: Event.observe.wrap(function(a, c, b, d){
        if (Object.isArray(b)) {
            b.each(function(e){
                a(c, e, d)
            })
        }
        else {
            a(c, b, d)
        }
        return c
    })
});
Element.addMethods({
    observe: Event.observe,
    makePrintable: function(a){
        return new Element.Printable(a, arguments[1] ||
        {})
    }
});
Element.Printable = Class.create({
    _elementsToPrint: $A(),
    _styleSheets: $A(),
    initialize: function(b, a){
        this.element = $(b);
        this._elementsToPrint = $A([this.element]);
        this.windowOptions = a.window ||
        {}
    },
    append: function(a){
        this._elementsToPrint.push(a);
        return this
    },
    prepend: function(a){
        this._elementsToPrint.unshift(a);
        return this
    },
    styleSheets: function(){
        return this._styleSheets
    },
    print: function(){
        var a = window.open("", "Printable", "width=" + (this.windowOptions.width || (this.element.getWidth() + 50)) + ",top=250,left=345,toolbars=no,scrollbars=no,status=no,resizable=yes");
        a.document.open();
        a.document.write('<html><head><style type="text/css" media="print">');
        this.styleSheets().each(function(c, b){
            c.document.write('@import "' + b + '";')
        }
.curry(a));
        a.document.write("</style></head><body>");
        this._elementsToPrint.each(function(c, b){
            c.document.write(Object.isElement(b) ? $(b.cloneNode(true)).toHTML() : (Object.isString(b) ? b : ""))
        }
.curry(a));
        a.document.write("</body></html>");
        a.document.close();
        a.print()
    }
});


$A(['round', 'floor', 'ceil' ]).each(function(funcName){
	Math[funcName] = Math[funcName].wrap(function(parent, number, precision){
		precision = Math.abs(parseInt(precision)) || 0;
		var coefficient = Math.pow(10, precision);
		return parent(number*coefficient)/coefficient;
	})
});





Event.observe(document, "dom:loaded", function(){
    $$("form").invoke("applyCapcha", "capcha_c", "capcha_f")
});