/*
Copyright 2007, 2008, 2009 OLIVER SEIDEL  (email : oliver.seidel @ deliciousdays.com)

  This program is free software: you can redistribute it and/or modify it under the
  terms of the GNU General Public License as published by the Free Software Foundation,
  either version 3 of the License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

  You should have received a copy of the GNU General Public License along with this
  program. If not, see <http://www.gnu.org/licenses/>.
*/


// ONLY in case AJAX DOESN'T work you may want to double-check this path:
// If you do change this setting: CLEAR your BROWSER CACHE & RESTART you BROWSER!
var sajax_uri = '/wp-content/plugins/cforms/lib_ajax.php';


// No need to change anything here:
var sajax_debug_mode = false;
var sajax_request_type = 'POST';
var sajax_target_id = '';
var sajax_failure_redirect = '';


function sajax_debug(text) {
    if (sajax_debug_mode) alert(text)
}
function sajax_init_object() {
    sajax_debug("sajax_init_object() called..");
    var A;
    var msxmlhttp = new Array('Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.3.0', 'Msxml2.XMLHTTP', 'Microsoft.XMLHTTP');
    for (var i = 0; i < msxmlhttp.length; i++) {
        try {
            A = new ActiveXObject(msxmlhttp[i])
        } catch (e) {
            A = null
        }
    }
    if (!A && typeof XMLHttpRequest != "undefined") A = new XMLHttpRequest();
    if (!A) sajax_debug("Could not create connection object.");
    return A
}
var sajax_requests = new Array();

function sajax_cancel() {
    for (var i = 0; i < sajax_requests.length; i++) sajax_requests[i].abort()
}
function sajax_do_call(func_name, args) {
    var i, x, n;
    var uri;
    var post_data;
    var target_id;
    sajax_debug("in sajax_do_call().." + sajax_request_type + "/" + sajax_target_id);
    target_id = sajax_target_id;
    if (typeof (sajax_request_type) == "undefined" || sajax_request_type == "") sajax_request_type = "GET";
    uri = sajax_uri;
    if (sajax_request_type == "GET") {
        if (uri.indexOf("?") == -1) uri += "?rs=" + encodeURIComponent(func_name);
        else uri += "&rs=" + encodeURIComponent(func_name);
        uri += "&rst=" + encodeURIComponent(sajax_target_id);
        uri += "&rsrnd=" + new Date().getTime();
        for (i = 0; i < args.length - 1; i++) uri += "&rsargs[]=" + encodeURIComponent(args[i]);
        post_data = null
    } else if (sajax_request_type == "POST") {
        post_data = "rs=" + encodeURIComponent(func_name);
        post_data += "&rst=" + encodeURIComponent(sajax_target_id);
        post_data += "&rsrnd=" + new Date().getTime();
        for (i = 0; i < args.length - 1; i++) post_data = post_data + "&rsargs[]=" + encodeURIComponent(args[i])
    } else {
        alert("Illegal request type: " + sajax_request_type)
    }
    x = sajax_init_object();
    if (x == null) {
        if (sajax_failure_redirect != "") {
            location.href = sajax_failure_redirect;
            return false
        } else {
            sajax_debug("NULL sajax object for user agent:\n" + navigator.userAgent);
            return false
        }
    } else {
        x.open(sajax_request_type, uri, true);
        sajax_requests[sajax_requests.length] = x;
        if (sajax_request_type == "POST") {
            x.setRequestHeader("Method", "POST " + uri + " HTTP/1.1");
            x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
        }
        x.onreadystatechange = function () {
            if (x.readyState != 4) return;
            sajax_debug("received " + x.responseText);
            var status;
            var data;
            var txt = x.responseText.replace(/^\s*|\s*$/g, "");
            var offset = (txt.charCodeAt(0) > 255) ? 1 : 0;
            status = txt.charAt(0 + offset);
            data = txt.substring(2 + offset);
            if (status == "") {} else if (status == "-") {
                alert("Error: " + data)
            } else {
                if (target_id != "") {
                    document.getElementById(target_id).innerHTML = eval(data)
                } else {
                    try {
                        var callback;
                        var extra_data = false;
                        if (typeof args[args.length - 1] == "object") {
                            callback = args[args.length - 1].callback;
                            extra_data = args[args.length - 1].extra_data
                        } else {
                            callback = args[args.length - 1]
                        }
                        callback(eval(data), extra_data)
                    } catch (e) {
                        sajax_debug("Caught error " + e + ": Could not eval " + data)
                    }
                }
            }
        }
    }
    sajax_debug(func_name + " uri = " + uri + "*/post = " + post_data);
    x.send(post_data);
    sajax_debug(func_name + " waiting..");
    delete x;
    return true
}
function x_cforms_submitcomment() {
    sajax_do_call("cforms_submitcomment", x_cforms_submitcomment.arguments)
}
function x_reset_captcha() {
    sajax_do_call("reset_captcha", x_reset_captcha.arguments)
}
function reset_captcha(no) {
    x_reset_captcha(no, reset_captcha_done)
}
function reset_captcha_done(newimage) {
    no = newimage.split('|');
    document.getElementById('cf_captcha_img' + no[1]).src = no[2] + '&rnd=' + Math.round(Math.random() * 999999)
}
function call_err(no, err, custom_error, popFlag) {
    document.getElementById('sendbutton' + no).style.cursor = "auto";
    document.getElementById('sendbutton' + no).disabled = false;
    if (custom_error != '') custom_error = '<ol>' + custom_error + '</ol>';
    err = unescape(decodeURI(err.value)) + custom_error;
    stringXHTML = err.replace(/(\r\n)/g, '<br />');
    msgbox = 'usermessage' + no;
    ucm = (parseInt(no) > 1) ? ' failure' + no : '';
    if (document.getElementById(msgbox + 'a')) document.getElementById(msgbox + 'a').className = "cf_info failure" + ucm;
    if (document.getElementById(msgbox + 'b')) document.getElementById(msgbox + 'b').className = "cf_info failure" + ucm;
    //doInnerXHTML(msgbox, stringXHTML.replace(/\\/g, ""), '');
    
    /** JM:Alterted to load lightbox error message instead of that other crap **/
    cform_openFeedback(stringXHTML.replace(/\\/g, ""),true);
    
    err = err.replace(/\\/g, "");
    if (document.getElementById('cf_popup' + no).value.charAt(popFlag) == 'y') {
        err = err.replace(/<li>/g, "\r\n");
        err = err.replace(/<.?strong>/g, '*');
        err = err.replace(/(<([^>]+)>)/ig, '');
        err = err.replace(/&raquo;/ig, '');
        alert(err)
    }
}
function clearField(thefield) {
    if (thefield.defaultValue == thefield.value) thefield.value = ''
};

function setField(thefield) {
    if (thefield.value == '') thefield.value = thefield.defaultValue
};

function cforms_validate(no, upload) {
    if (!no) no = '';
    msgbox = 'usermessage' + no;

    if (document.getElementById(msgbox + 'a')) {
        document.getElementById(msgbox + 'a').className = "cf_info waiting"
    }
    if (document.getElementById(msgbox + 'b')) {
        document.getElementById(msgbox + 'b').className = "cf_info waiting"
    }
    waiting = unescape(decodeURI(document.getElementById('cf_working' + no).value));
    waiting = waiting.replace(/\\/g, "");
    waiting = "";

    function getStyle(oElm, strCssRule) {
        var strValue = "";
        try {
            if (document.defaultView && document.defaultView.getComputedStyle) {
                strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule)
            } else if (oElm.currentStyle) {
                strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1) {
                    return p1.toUpperCase()
                });
                strValue = oElm.currentStyle[strCssRule]
            }
        } catch (ee) {
            strValue = ""
        }
        if (strValue && (strValue.match(/px/) || strValue.match(/em/))) return strValue.substring(0, strValue.length - 2);
        else return strValue
    }
    
    function sameParentBG(col, el) {
        if (el) {
            var colStyle = getStyle(el, 'background-color');
            if (colStyle == col) return true;
            else if (el.parentNode && el.parentNode.tagName.toLowerCase() != "html") return sameParentBG(col, el.parentNode)
        }
        return false
    }
    
    var insert_err = new Array();
    var insert_err_p = new Array();
    var insert_err_count = 0;
    var all_custom_error = new Array();
    rest = document.getElementById('cf_customerr' + no).value.substr(3);
    show_err_li = document.getElementById('cf_customerr' + no).value.substr(0, 1);
    show_err_ins = document.getElementById('cf_customerr' + no).value.substr(1, 1);
    jump_to_err = document.getElementById('cf_customerr' + no).value.substr(2, 1);
    var error_container = decodeURIComponent(rest);
    error_container = error_container.split('|');
    for (i = 0; i < error_container.length; i++) {
        keyvalue = error_container[i].split('$#$');
        all_custom_error[keyvalue[0]] = keyvalue[1]
    }
    custom_error = '';
    var regexp_field_id = new RegExp('^.*field_([0-9]{1,3})$');
    if (doInnerXHTML(msgbox, waiting)) {
        var all_valid = true;
        var code_err = false;
        var regexp_e = new RegExp('^[\\w+-_\.]+@[\\w-_]+[\.][\\w-_\.]+$');
        objColl = document.getElementById('cforms' + no + 'form').getElementsByTagName('li');
        for (var i = 0; i < objColl.length; i++) {
            if (objColl[i].className.match(/cf_li_err/)) {
                if (objColl[i].className.match(/cf-box-title/)) objColl[i].className = 'cf-box-title';
                else objColl[i].className = ''
            }
        }
        objColl = document.getElementById('cforms' + no + 'form').getElementsByTagName('ul');
        while (objColl.length > 0) objColl[0].parentNode.removeChild(objColl[0]);
        objColl = document.getElementById('cforms' + no + 'form').getElementsByTagName('*');
        last_one = false;
        for (var i = 0, j = objColl.length; i < j; i++) {
            temp = objColl[i].className;
            if (temp.match(/secinput/)) newclass = 'secinput';
            else if (temp.match(/cf-box-./)) newclass = temp.match(/cf-box-./);
            else if (temp.match(/cformselect/)) newclass = 'cformselect';
            else if (temp.match(/upload/)) newclass = 'cf_upload';
            else if (temp.match(/cf_date/)) newclass = 'single cf_date';
            else if (temp.match(/single/)) newclass = 'single';
            else if (temp.match(/area/)) newclass = 'area';
            else if (temp.match(/cfselectmulti/)) newclass = 'cfselectmulti';
            else newclass = '';
            fld = objColl[i].nodeName.toLowerCase();
            typ = objColl[i].type;
            if ((fld == "input" || fld == "textarea" || fld == "select") && !(typ == "hidden" || typ == "submit")) {
                if (temp.match(/required/) && !temp.match(/email/) && typ != "radio") {
                    newclass = newclass + ' fldrequired';
                    n = objColl[i].nextSibling;
                    p = objColl[i].previousSibling;
                    if (temp.match(/cf-box-./)) {
                        if (objColl[i].checked == false) {
                            custom_error = check_for_customerr(objColl[i].id);
                            newclass = newclass + ' cf_error';
                            if (n && n.nodeName.toLowerCase() == "label" && !n.className.match(/errortxt/)) n.className = n.className + " cf_errortxt";
                            else if (p && p.nodeName.toLowerCase() == "label" && !p.className.match(/errortxt/)) p.className = p.className + " cf_errortxt";
                            all_valid = false;
                            if (!last_one && objColl[i].id != '') last_one = objColl[i].id
                        } else {
                            if (n && n.nodeName.toLowerCase() == "label" && n.className.match(/cf_errortxt/)) n.className = n.className.substr(0, n.className.search(/ cf_errortxt/));
                            else if (p && p.nodeName.toLowerCase() == "label" && p.className.match(/cf_errortxt/)) p.className = p.className.substr(0, p.className.search(/ cf_errortxt/))
                        }
                    } else if (temp.match(/cformselect/)) {
                        if (objColl[i].value == '' || objColl[i].value == '-') {
                            newclass = newclass + ' cf_error';
                            all_valid = false;
                            if (!last_one && objColl[i].id != '') last_one = objColl[i].id;
                            custom_error = check_for_customerr(objColl[i].id)
                        }
                    } else if (objColl[i].value == '') {
                        newclass = newclass + ' cf_error';
                        all_valid = false;
                        if (!last_one && objColl[i].id != '') last_one = objColl[i].id;
                        custom_error = check_for_customerr(objColl[i].id)
                    }
                }
                if (temp.match(/email/)) {
                    newclass = newclass + ' fldemail';
                    if (objColl[i].value == '' && !temp.match(/required/));
                    else if (!objColl[i].value.match(regexp_e)) {
                        newclass = newclass + ' fldrequired cf_error';
                        all_valid = false;
                        if (!last_one) last_one = objColl[i].name;
                        custom_error = check_for_customerr(objColl[i].id)
                    } else newclass = newclass + ' fldrequired'
                }
                if (temp.match(/required/) && temp.match(/cf-box-b/) && typ.match(/radio/)) {
                    temp_i = i;
                    radio_valid = false;
                    while (objColl[i].parentNode.className.match(/cf-box-group/) || objColl[i].parentNode.parentNode.className.match(/cf-box-group/)) {
                        temp = objColl[i].className;
                        if (temp.match(/cf-box-b/) && objColl[i].checked) {
                            radio_valid = true
                        }
                        i++
                    }
                    if (!radio_valid) {
                        all_valid = false;
                        if (!last_one) last_one = objColl[temp_i].parentNode.id;
                        custom_error = check_for_customerr_radio(objColl[temp_i].parentNode.id, objColl[temp_i].id.substr(0, objColl[temp_i].id.length - 2))
                    }
                } else objColl[i].className = newclass
            }
            regexp = 1;
            if (objColl[i] && document.getElementById(objColl[i].id + '_regexp')) {
                obj_regexp = document.getElementById(objColl[i].id + '_regexp');
                if (typ == 'textarea') INPval = objColl[i].value.replace(/\n\r?/g, ' ');
                else INPval = objColl[i].value;
                if (obj_regexp && obj_regexp.value != '') {
                    if (document.getElementById(obj_regexp.value)) {
                        if (INPval != document.getElementById(obj_regexp.value).value) regexp = null
                    } else {
                        if (INPval != '') {
                            regexp = new RegExp(obj_regexp.value, ['g']);
                            regexp = INPval.match(regexp)
                        }
                    }
                    if (regexp == null) {
                        newclass = newclass + ' cf_error';
                        all_valid = false;
                        if (!last_one && objColl[i].id != '') last_one = objColl[i].id;
                        custom_error = check_for_customerr(objColl[i].id)
                    }
                }
            }
        }
        if (document.getElementById('cforms_q' + no) && (document.getElementById('cforms_a' + no).value != hex_md5(encodeURI(document.getElementById('cforms_q' + no).value.toLowerCase())))) {
            document.getElementById('cforms_q' + no).className = "secinput cf_error";
            if (all_valid) {
                all_valid = false;
                code_err = true;
                if (!last_one) last_one = 'cforms_q' + no
            }
            custom_error = check_for_customerr('cforms_q' + no)
        }
        if (document.getElementById('cforms_captcha' + no)) {
            var read_cookie = readcookie(no);
            var cookie_part = read_cookie.split('+');
            a = cookie_part[1];
            b = document.getElementById('cforms_captcha' + no).value;
            if (cookie_part[0] == 'i') b = b.toLowerCase();
            b = hex_md5(b);
            if (a != b) {
                document.getElementById('cforms_captcha' + no).className = "secinput cf_error";
                if (all_valid) {
                    all_valid = false;
                    code_err = true;
                    if (!last_one) last_one = 'cforms_captcha' + no
                }
                custom_error = check_for_customerr('cforms_captcha' + no)
            }
        }
        if (show_err_ins == 'y') write_customerr();
        if (last_one != '' && jump_to_err == 'y') {
            location.href = '#' + last_one;
            document.getElementById(last_one).focus()
        }
        if (all_valid && upload) {
            document.getElementById('sendbutton' + no).disabled = true;
            var newSENDBUTTON = document.createElement('input');
            newSENDBUTTON.type = 'hidden';
            newSENDBUTTON.name = 'sendbutton' + no;
            newSENDBUTTON.value = '1';
            document.getElementById('cf_working' + no).parentNode.appendChild(newSENDBUTTON);
            document.getElementById('sendbutton' + no).style.cursor = "progress";
            document.getElementById('cforms' + no + 'form').submit();
            return true
        } else if (all_valid) {
        	document.getElementById('sendbutton' + no).style.cursor = "progress";
            document.getElementById('sendbutton' + no).disabled = true;
            cforms_submitcomment(no)
        }
        if (!all_valid && !code_err) {
        	call_err(no, document.getElementById('cf_failure' + no), custom_error, 1);
            return false
        }
        if (!all_valid) {
        	call_err(no, document.getElementById('cf_codeerr' + no), custom_error, 1);
            return false
        }
        return false
    } else return true;

    function check_for_customerr(id) {
        parent_el = document.getElementById(id).parentNode;
        if (show_err_li == 'y') {
            parent_el.className = "cf_li_err"
        }
        if (all_custom_error[id] && (gotone = all_custom_error[id]) != '') {
            if (show_err_ins == 'y') {
                insert_err_p[insert_err_count] = parent_el.id;
                ul = document.createElement('UL');
                li = document.createElement('LI');
                err = document.createTextNode('');
                li.innerHTML = stripslashes(gotone);
                cl = document.createAttribute('class');
                cl.nodeValue = 'cf_li_text_err';
                ul.appendChild(li);
                ul.setAttributeNode(cl);
                insert_err[insert_err_count++] = ul
            }
            if (parent_el.id != '') return custom_error + '<li><a href="#' + parent_el.id + '">' + gotone + ' &raquo;</li></a>';
            else return custom_error + '<li>' + gotone + '</li>'
        } else return custom_error
    }
    function check_for_customerr_radio(id, cerr) {
        parent_el = document.getElementById(id.substr(0, id.length - 5));
        if (show_err_li == 'y') {
            parent_el.className = "cf-box-title cf_li_err"
        }
        if (all_custom_error[cerr] && (gotone = all_custom_error[cerr]) != '') {
            if (show_err_ins == 'y') {
                insert_err_p[insert_err_count] = parent_el.id;
                ul = document.createElement('UL');
                li = document.createElement('LI');
                err = document.createTextNode('');
                li.innerHTML = stripslashes(gotone);
                cl = document.createAttribute('class');
                cl.nodeValue = 'cf_li_text_err';
                ul.appendChild(li);
                ul.setAttributeNode(cl);
                insert_err[insert_err_count++] = ul
            }
            if (parent_el.id != '') return custom_error + '<li><a href="#' + parent_el.id + '">' + gotone + ' &raquo;</li></a>';
            else return custom_error + '<li>' + gotone + '</li>'
        } else return custom_error
    }
    function write_customerr() {
        for (n = 0; n < insert_err_p.length; n++) {
            if (document.getElementById(insert_err_p[n])) document.getElementById(insert_err_p[n]).insertBefore(insert_err[n], document.getElementById(insert_err_p[n]).firstChild)
        }
    }
}
function stripslashes(str) {
    str = str.replace(/\\'/g, '\'');
    str = str.replace(/\\"/g, '"');
    str = str.replace(/\\\\/g, '\\');
    str = str.replace(/\\0/g, '\0');
    return str
}
function doInnerXHTML(elementId, stringXHTML, stringDOM) {
    try {
        if (document.getElementById(elementId + 'a')) document.getElementById(elementId + 'a').innerHTML = stringXHTML;
        if (document.getElementById(elementId + 'b')) document.getElementById(elementId + 'b').innerHTML = stringXHTML;
        return true
    } catch (ee) {
        return false
    }
}
function cforms_submitcomment(no) {
    var regexp = new RegExp('[$][#][$]', ['g']);
    var prefix = '$#$';
    if (no == '') params = '1';
    else params = no;
    objColl = document.getElementById('cforms' + no + 'form').getElementsByTagName('*');
    for (var i = 0, j = objColl.length; i < j; i++) {
        fld = objColl[i].nodeName.toLowerCase();
        typ = objColl[i].type;
        if (fld == "input" || fld == "textarea" || fld == "select") {
            if (typ == "checkbox") {
                if (objColl[i].name.match(/\[\]/)) {
                    group = '';
                    while (i < j && isParentChkBoxGroup(objColl[i])) {
                        if (objColl[i].type == 'checkbox' && objColl[i].name.match(/\[\]/) && objColl[i].checked) {
                            group = group + objColl[i].value + ','
                        }
                        i++
                    }
                    if (group.length > 1) params = params + prefix + group.substring(0, group.length - 1);
                    else params = params + prefix + "-"
                } else params = params + prefix + (objColl[i].checked ? ((objColl[i].value != "") ? objColl[i].value : "X") : "-")
            } else if (typ == "radio") {
                group = objColl[i].checked ? ((objColl[i].value != "") ? objColl[i].value : "X") : '';
                while (i < j && isParentChkBoxGroup(objColl[i + 1])) {
                    if (objColl[i + 1].type == 'radio' && objColl[i + 1].checked) {
                        group = group + ',' + objColl[i + 1].value
                    }
                    i++
                }
                if (group.charAt(0) == ',') params = params + prefix + group.substring(1, group.length);
                else params = params + prefix + group
            } else if (typ == "select-multiple") {
                all_child_obj = '';
                for (z = 0; z < objColl[i].childNodes.length; z++) {
                    if (objColl[i].childNodes[z].nodeName.toLowerCase() == 'option' && objColl[i].childNodes[z].selected) {
                        all_child_obj = all_child_obj + objColl[i].childNodes[z].value.replace(regexp, '$') + ','
                    }
                }
                params = params + prefix + all_child_obj.substring(0, all_child_obj.length - 1)
            } else if (typ == "hidden" && objColl[i].name.match(/comment_parent/)) {
                params = params + '+++' + objColl[i].value
            } else if (typ == "hidden" && objColl[i].name.match(/comment_post_ID/)) {
                params = params + '+++' + objColl[i].value
            } else if (typ == "hidden" && objColl[i].name.match(/cforms_pl/)) {
                params = params + '+++' + objColl[i].value
            } else if (typ == "hidden" && objColl[i].className.match(/cfhidden/)) {
                params = params + prefix + objColl[i].value
            } else if (typ != "hidden" && typ != "submit" && typ != "radio") {
                params = params + prefix + objColl[i].value.replace(regexp, '$')
            }
        }
    }
    if (document.getElementById('cforms' + no + 'form').action.match('lib_WPcomment.php')) params = params + '***';
    x_cforms_submitcomment(params, cforms_setsuccessmessage)
}
function isParentChkBoxGroup(el) {
    while (el.parentNode) {
        if (el.parentNode.className == 'cf-box-group') return true;
        else el = el.parentNode
    }
    return false
}
function cforms_setsuccessmessage(message) {
    hide = false;
    end = message.match(/|/) ? message.indexOf('|') : message.length;
    end = (end < 0) ? message.length : end;
    if (message.match(/---/)) {
        result = " failure"
    } else if (message.match(/!!!/)) {
        result = " mailerr"
    } else if (message.match(/~~~/)) {
        result = "success";
        hide = true
    } else {
        result = "success"
    }
    var offset = message.indexOf('*$#');
    var no = message.substring(0, offset);
    var pop = message.charAt(offset + 3);
    if (no == '1') no = '';
    if (!document.getElementById('cforms' + no + 'form').className.match(/cfnoreset/)) document.getElementById('cforms' + no + 'form').reset();
    document.getElementById('sendbutton' + no).style.cursor = "auto";
    document.getElementById('sendbutton' + no).disabled = false;
    stringXHTML = message.substring(offset + 4, end);
    if (stringXHTML.match(/\$#\$/)) {
        newcomment = stringXHTML.split('$#$');
        commentParent = newcomment[0];
        newcommentText = newcomment[1];
        stringXHTML = newcomment[2];
        if (document.getElementById(commentParent)) {
            var alt = '';
            var allLi = document.getElementById(commentParent).childNodes.length - 1;
            for (i = allLi; i >= 0; i--) {
                var elLi = document.getElementById(commentParent).childNodes[i];
                if (elLi.nodeType != '3' && elLi.tagName.toLowerCase() == 'li') {
                    if (elLi.className.match(/alt/)) alt = 'alt';
                    i = -1
                }
            }
            if (alt == 'alt') newcommentText = newcommentText.replace('class="alt"', '');
            document.getElementById(commentParent).innerHTML = document.getElementById(commentParent).innerHTML + newcommentText;
            if (window.AjaxEditComments) AjaxEditComments.init()
        }
        var dEl = newcommentText.match(/edit-comment-(user|admin)-link(s|-)[^" ]+/);
        if (dEl != null && dEl[0] != '' && document.getElementById(dEl[0])) {
            document.getElementById(dEl[0]).style.display = 'block'
        }
    }
    isA = false;
    ucm = (parseInt(no) > 1) ? ' ' + result + no : '';
    if (document.getElementById('usermessage' + no + 'a')) {
        document.getElementById('usermessage' + no + 'a').className = "cf_info " + result + ucm;
        isA = true
    }
    if (document.getElementById('usermessage' + no + 'b') && !(hide && isA)) document.getElementById('usermessage' + no + 'b').className = "cf_info " + result + ucm;
    
    cform_openFeedback(stringXHTML,false);
    return;
    //doInnerXHTML('usermessage' + no, stringXHTML, '');
    
    
    if (hide) {
        document.getElementById('cforms' + no + 'form').style.display = 'none';
        document.getElementById('ll' + no).style.display = 'none';
        if (!message.match(/>>>/)) location.href = '#usermessage' + no + 'a'
    }
    if (pop == 'y') {
        stringXHTML = stringXHTML.replace(/<br.?\/>/g, '\r\n');
        stringXHTML = stringXHTML.replace(/(<.?strong>|<.?b>)/g, '*');
        stringXHTML = stringXHTML.replace(/(<([^>]+)>)/ig, '');
        alert(stringXHTML)
    }
    if (message.match(/>>>/)) {
        location.href = message.substring((message.indexOf('|>>>') + 4), message.length);
        return
    }
}
var hexcase = 0;
var b64pad = "";
var chrsz = 8;

function hex_md5(s) {
    return binl2hex(core_md5(str2binl(s), s.length * chrsz))
}
function b64_md5(s) {
    return binl2b64(core_md5(str2binl(s), s.length * chrsz))
}
function str_md5(s) {
    return binl2str(core_md5(str2binl(s), s.length * chrsz))
}
function hex_hmac_md5(key, data) {
    return binl2hex(core_hmac_md5(key, data))
}
function b64_hmac_md5(key, data) {
    return binl2b64(core_hmac_md5(key, data))
}
function str_hmac_md5(key, data) {
    return binl2str(core_hmac_md5(key, data))
}
function md5_vm_test() {
    return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72"
}
function core_md5(x, len) {
    x[len >> 5] |= 0x80 << ((len) % 32);
    x[(((len + 64) >>> 9) << 4) + 14] = len;
    var a = 1732584193;
    var b = -271733879;
    var c = -1732584194;
    var d = 271733878;
    for (var i = 0; i < x.length; i += 16) {
        var olda = a;
        var oldb = b;
        var oldc = c;
        var oldd = d;
        a = md5_ff(a, b, c, d, x[i + 0], 7, -680876936);
        d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586);
        c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819);
        b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330);
        a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897);
        d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426);
        c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341);
        b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983);
        a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416);
        d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417);
        c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);
        b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);
        a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682);
        d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);
        c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);
        b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329);
        a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510);
        d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632);
        c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713);
        b = md5_gg(b, c, d, a, x[i + 0], 20, -373897302);
        a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691);
        d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083);
        c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);
        b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848);
        a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438);
        d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690);
        c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961);
        b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501);
        a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467);
        d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784);
        c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473);
        b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);
        a = md5_hh(a, b, c, d, x[i + 5], 4, -378558);
        d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463);
        c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562);
        b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);
        a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060);
        d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353);
        c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632);
        b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);
        a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174);
        d = md5_hh(d, a, b, c, x[i + 0], 11, -358537222);
        c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979);
        b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189);
        a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487);
        d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);
        c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520);
        b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651);
        a = md5_ii(a, b, c, d, x[i + 0], 6, -198630844);
        d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415);
        c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);
        b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055);
        a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571);
        d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606);
        c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);
        b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799);
        a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359);
        d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);
        c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380);
        b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649);
        a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070);
        d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);
        c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259);
        b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551);
        a = safe_add(a, olda);
        b = safe_add(b, oldb);
        c = safe_add(c, oldc);
        d = safe_add(d, oldd)
    }
    return Array(a, b, c, d)
}
function md5_cmn(q, a, b, x, s, t) {
    return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b)
}
function md5_ff(a, b, c, d, x, s, t) {
    return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t)
}
function md5_gg(a, b, c, d, x, s, t) {
    return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t)
}
function md5_hh(a, b, c, d, x, s, t) {
    return md5_cmn(b ^ c ^ d, a, b, x, s, t)
}
function md5_ii(a, b, c, d, x, s, t) {
    return md5_cmn(c ^ (b | (~d)), a, b, x, s, t)
}
function core_hmac_md5(key, data) {
    var bkey = str2binl(key);
    if (bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);
    var ipad = Array(16),
        opad = Array(16);
    for (var i = 0; i < 16; i++) {
        ipad[i] = bkey[i] ^ 0x36363636;
        opad[i] = bkey[i] ^ 0x5C5C5C5C
    }
    var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);
    return core_md5(opad.concat(hash), 512 + 128)
}
function safe_add(x, y) {
    var lsw = (x & 0xFFFF) + (y & 0xFFFF);
    var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
    return (msw << 16) | (lsw & 0xFFFF)
}
function bit_rol(num, cnt) {
    return (num << cnt) | (num >>> (32 - cnt))
}
function str2binl(str) {
    var bin = Array();
    var mask = (1 << chrsz) - 1;
    for (var i = 0; i < str.length * chrsz; i += chrsz) bin[i >> 5] |= (str.charCodeAt(i / chrsz) & mask) << (i % 32);
    return bin
}
function binl2str(bin) {
    var str = "";
    var mask = (1 << chrsz) - 1;
    for (var i = 0; i < bin.length * 32; i += chrsz) str += String.fromCharCode((bin[i >> 5] >>> (i % 32)) & mask);
    return str
}
function binl2hex(binarray) {
    var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
    var str = "";
    for (var i = 0; i < binarray.length * 4; i++) {
        str += hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8 + 4)) & 0xF) + hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8)) & 0xF)
    }
    return str
}
function binl2b64(binarray) {
    var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
    var str = "";
    for (var i = 0; i < binarray.length * 4; i += 3) {
        var triplet = (((binarray[i >> 2] >> 8 * (i % 4)) & 0xFF) << 16) | (((binarray[i + 1 >> 2] >> 8 * ((i + 1) % 4)) & 0xFF) << 8) | ((binarray[i + 2 >> 2] >> 8 * ((i + 2) % 4)) & 0xFF);
        for (var j = 0; j < 4; j++) {
            if (i * 8 + j * 6 > binarray.length * 32) str += b64pad;
            else str += tab.charAt((triplet >> 6 * (3 - j)) & 0x3F)
        }
    }
    return str
}
function readcookie(no) {
    var nameEQ = "turing_string_" + no + "=";
    var ca = document.cookie.split(';');
    for (var i = 0; i < ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) == ' ') c = c.substring(1, c.length);
        if (c.indexOf(nameEQ) == 0) return unescape(c.substring(nameEQ.length, c.length))
    }
    return ''
}

//eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('C 1v(5c){f(7K)2p(5c)}C 3j(){1v("3j() 5j..");l A;l 3H=1e 1z(\'3N.2V.6.0\',\'3N.2V.3.0\',\'3N.2V\',\'7q.2V\');N(l i=0;i<3H.D;i++){2X{A=1e 7i(3H[i])}2O(e){A=2f}}f(!A&&3W 57!="4G")A=1e 57();f(!A)1v("58 4c 5o 5p 3b.");v A}l 2k=1e 1z();C 7e(){N(l i=0;i<2k.D;i++)2k[i].5r()}C 35(2g,1d){l i,x,n;l 1f;l 1t;l 2F;1v("5s 35().."+1x+"/"+36);2F=36;f(3W(1x)=="4G"||1x=="")1x="41";1f=5u;f(1x=="41"){f(1f.2C("?")==-1)1f+="?3s="+1M(2g);u 1f+="&3s="+1M(2g);1f+="&42="+1M(36);1f+="&43="+1e 4M().4o();N(i=0;i<1d.D-1;i++)1f+="&46[]="+1M(1d[i]);1t=2f}u f(1x=="38"){1t="3s="+1M(2g);1t+="&42="+1M(36);1t+="&43="+1e 4M().4o();N(i=0;i<1d.D-1;i++)1t=1t+"&46[]="+1M(1d[i])}u{2p("5w 5x 2e: "+1x)}x=3j();f(x==2f){f(4i!=""){31.2h=4i;v J}u{1v("6i 5A 3b N 4b 65:\\n"+5C.5D);v J}}u{x.5E(1x,1f,1b);2k[2k.D]=x;f(1x=="38"){x.48("5F","38 "+1f+" 5H/1.1");x.48("5I-5J","89/x-88-1q-87")}x.5L=C(){f(x.85!=4)v;1v("84 "+x.4a);l 2H;l 19;l 33=x.4a.M(/^\\s*|\\s*$/g,"");l 1T=(33.5b(0)>5O)?1:0;2H=33.1E(0+1T);19=33.1m(2+1T);f(2H==""){}u f(2H=="-"){2p("5R: "+19)}u{f(2F!=""){k.o(2F).1K=3f(19)}u{2X{l 2z;l 2Z=J;f(3W 1d[1d.D-1]=="3b"){2z=1d[1d.D-1].2z;2Z=1d[1d.D-1].2Z}u{2z=1d[1d.D-1]}2z(3f(19),2Z)}2O(e){1v("7S 5W "+e+": 58 4c 3f "+19)}}}}}1v(2g+" 1f = "+1f+"*/7L = "+1t);x.60(1t);1v(2g+" 1R..");62 x;v 1b}C 3U(){35("37",3U.4e)}C 3O(){35("4f",3O.4e)}C 4f(m){3O(m,54)}C 54(4g){m=4g.2d(\'|\');k.o(\'7z\'+m[1]).67=m[2]+\'&68=\'+55.69(55.6b()*6c)}C 3A(m,S,L,50){k.o(\'1r\'+m).1J.34="40";k.o(\'1r\'+m).2T=J;f(L!=\'\')L=\'<52>\'+L+\'</52>\';S=3i(4Z(S.E))+L;Y=S.M(/(\\r\\n)/g,\'<4Q />\');1h=\'1H\'+m;2c=(4d(m)>1)?\' 2R\'+m:\'\';f(k.o(1h+\'a\'))k.o(1h+\'a\').F="1W 2R"+2c;f(k.o(1h+\'b\'))k.o(1h+\'b\').F="1W 2R"+2c;2Y(1h,Y.M(/\\\\/g,""),\'\');S=S.M(/\\\\/g,"");f(k.o(\'6e\'+m).E.1E(50)==\'y\'){S=S.M(/<U>/g,"\\r\\n");S=S.M(/<.?4p>/g,\'*\');S=S.M(/(<([^>]+)>)/3k,\'\');S=S.M(/&3G;/3k,\'\');2p(S)}}C 6f(1C){f(1C.4j==1C.E)1C.E=\'\'};C 6g(1C){f(1C.E==\'\')1C.E=1C.4j};C 7l(m,3w){f(!m)m=\'\';1h=\'1H\'+m;f(k.o(1h+\'a\')){k.o(1h+\'a\').F="1W 1R"}f(k.o(1h+\'b\')){k.o(1h+\'b\').F="1W 1R"}1R=3i(4Z(k.o(\'4h\'+m).E));1R=1R.M(/\\\\/g,"");C 4L(2U,2l){l 1o="";2X{f(k.3F&&k.3F.4k){1o=k.3F.4k(2U,"").6l(2l)}u f(2U.4m){2l=2l.M(/\\-(\\w)/g,C(6m,4S){v 4S.6o()});1o=2U.4m[2l]}}2O(53){1o=""}f(1o&&(1o.B(/6p/)||1o.B(/6q/)))v 1o.1m(0,1o.D-2);u v 1o}C 4q(3v,1i){f(1i){l 4J=4L(1i,\'6t-6u\');f(4J==3v)v 1b;u f(1i.1c&&1i.1c.47.1j()!="6v")v 4q(3v,1i.1c)}v J}l 2W=1e 1z();l 1N=1e 1z();l 2w=0;l 27=1e 1z();4r=k.o(\'2J\'+m).E.1I(3);3g=k.o(\'2J\'+m).E.1I(0,1);2K=k.o(\'2J\'+m).E.1I(1,1);4I=k.o(\'2J\'+m).E.1I(2,1);l 2m=6x(4r);2m=2m.2d(\'|\');N(i=0;i<2m.D;i++){3z=2m[i].2d(\'$#$\');27[3z[0]]=3z[1]}L=\'\';l 6y=1e 2S(\'^.*6z([0-9]{1,3})$\');f(2Y(1h,1R)){l 1a=1b;l 2I=J;l 4C=1e 2S(\'^[\\\\w+-3X\\.]+@[\\\\w-3X]+[\\.][\\\\w-3X\\.]+$\');h=k.o(\'1u\'+m+\'1q\').2Q(\'U\');N(l i=0;i<h.D;i++){f(h[i].F.B(/3C/)){f(h[i].F.B(/1l-1k-3e/))h[i].F=\'1l-1k-3e\';u h[i].F=\'\'}}h=k.o(\'1u\'+m+\'1q\').2Q(\'1s\');1Y(h.D>0)h[0].1c.6B(h[0]);h=k.o(\'1u\'+m+\'1q\').2Q(\'*\');O=J;N(l i=0,j=h.D;i<j;i++){P=h[i].F;f(P.B(/2P/))I=\'2P\';u f(P.B(/1l-1k-./))I=P.B(/1l-1k-./);u f(P.B(/3t/))I=\'3t\';u f(P.B(/3w/))I=\'6C\';u f(P.B(/4s/))I=\'3r 4s\';u f(P.B(/3r/))I=\'3r\';u f(P.B(/4v/))I=\'4v\';u f(P.B(/4t/))I=\'4t\';u I=\'\';1F=h[i].1S.1j();T=h[i].2e;f((1F=="3L"||1F=="3M"||1F=="3P")&&!(T=="1Q"||T=="3R")){f(P.B(/3p/)&&!P.B(/4B/)&&T!="2A"){I=I+\' 3o\';n=h[i].6D;p=h[i].6E;f(P.B(/1l-1k-./)){f(h[i].25==J){L=1D(h[i].G);I=I+\' 1L\';f(n&&n.1S.1j()=="2N"&&!n.F.B(/4w/))n.F=n.F+" 28";u f(p&&p.1S.1j()=="2N"&&!p.F.B(/4w/))p.F=p.F+" 28";1a=J;f(!O&&h[i].G!=\'\')O=h[i].G}u{f(n&&n.1S.1j()=="2N"&&n.F.B(/28/))n.F=n.F.1I(0,n.F.4z(/ 28/));u f(p&&p.1S.1j()=="2N"&&p.F.B(/28/))p.F=p.F.1I(0,p.F.4z(/ 28/))}}u f(P.B(/3t/)){f(h[i].E==\'\'||h[i].E==\'-\'){I=I+\' 1L\';1a=J;f(!O&&h[i].G!=\'\')O=h[i].G;L=1D(h[i].G)}}u f(h[i].E==\'\'){I=I+\' 1L\';1a=J;f(!O&&h[i].G!=\'\')O=h[i].G;L=1D(h[i].G)}}f(P.B(/4B/)){I=I+\' 6J\';f(h[i].E==\'\'&&!P.B(/3p/));u f(!h[i].E.B(4C)){I=I+\' 3o 1L\';1a=J;f(!O)O=h[i].1U;L=1D(h[i].G)}u I=I+\' 3o\'}f(P.B(/3p/)&&P.B(/1l-1k-b/)&&T.B(/2A/)){2s=i;3q=J;1Y(h[i].1c.F.B(/1l-1k-18/)||h[i].1c.1c.F.B(/1l-1k-18/)){P=h[i].F;f(P.B(/1l-1k-b/)&&h[i].25){3q=1b}i++}f(!3q){1a=J;f(!O)O=h[2s].1c.G;L=4O(h[2s].1c.G,h[2s].G.1I(0,h[2s].G.D-2))}}u h[i].F=I}1A=1;f(h[i]&&k.o(h[i].G+\'4E\')){29=k.o(h[i].G+\'4E\');f(T==\'3M\')2t=h[i].E.M(/\\n\\r?/g,\' \');u 2t=h[i].E;f(29&&29.E!=\'\'){f(k.o(29.E)){f(2t!=k.o(29.E).E)1A=2f}u{f(2t!=\'\'){1A=1e 2S(29.E,[\'g\']);1A=2t.B(1A)}}f(1A==2f){I=I+\' 1L\';1a=J;f(!O&&h[i].G!=\'\')O=h[i].G;L=1D(h[i].G)}}}}f(k.o(\'2n\'+m)&&(k.o(\'6Q\'+m).E!=2L(6R(k.o(\'2n\'+m).E.1j())))){k.o(\'2n\'+m).F="2P 1L";f(1a){1a=J;2I=1b;f(!O)O=\'2n\'+m}L=1D(\'2n\'+m)}f(k.o(\'2r\'+m)){l 4H=4F(m);l 3u=4H.2d(\'+\');a=3u[1];b=k.o(\'2r\'+m).E;f(3u[0]==\'i\')b=b.1j();b=2L(b);f(a!=b){k.o(\'2r\'+m).F="2P 1L";f(1a){1a=J;2I=1b;f(!O)O=\'2r\'+m}L=1D(\'2r\'+m)}}f(2K==\'y\')51();f(O!=\'\'&&4I==\'y\'){31.2h=\'#\'+O;k.o(O).6W()}f(1a&&3w){k.o(\'1r\'+m).2T=1b;l 2i=k.2u(\'3L\');2i.2e=\'1Q\';2i.1U=\'1r\'+m;2i.E=\'1\';k.o(\'4h\'+m).1c.3d(2i);k.o(\'1r\'+m).1J.34="4K";k.o(\'1u\'+m+\'1q\').3R();v 1b}u f(1a){k.o(\'1r\'+m).1J.34="4K";k.o(\'1r\'+m).2T=1b;37(m)}f(!1a&&!2I){3A(m,k.o(\'70\'+m),L,1);v J}f(!1a){3A(m,k.o(\'72\'+m),L,1);v J}v J}u v 1b;C 1D(G){1n=k.o(G).1c;f(3g==\'y\'){1n.F="3C"}f(27[G]&&(1G=27[G])!=\'\'){f(2K==\'y\'){1N[2w]=1n.G;1s=k.2u(\'4R\');U=k.2u(\'4T\');S=k.4U(\'\');U.1K=3I(1G);26=k.4V(\'3a\');26.4W=\'4X\';1s.3d(U);1s.4Y(26);2W[2w++]=1s}f(1n.G!=\'\')v L+\'<U><a 2h="#\'+1n.G+\'">\'+1G+\' &3G;</U></a>\';u v L+\'<U>\'+1G+\'</U>\'}u v L}C 4O(G,3D){1n=k.o(G.1I(0,G.D-5));f(3g==\'y\'){1n.F="1l-1k-3e 3C"}f(27[3D]&&(1G=27[3D])!=\'\'){f(2K==\'y\'){1N[2w]=1n.G;1s=k.2u(\'4R\');U=k.2u(\'4T\');S=k.4U(\'\');U.1K=3I(1G);26=k.4V(\'3a\');26.4W=\'4X\';1s.3d(U);1s.4Y(26);2W[2w++]=1s}f(1n.G!=\'\')v L+\'<U><a 2h="#\'+1n.G+\'">\'+1G+\' &3G;</U></a>\';u v L+\'<U>\'+1G+\'</U>\'}u v L}C 51(){N(n=0;n<1N.D;n++){f(k.o(1N[n]))k.o(1N[n]).7m(2W[n],k.o(1N[n]).7o)}}}C 3I(K){K=K.M(/\\\\\'/g,\'\\\'\');K=K.M(/\\\\"/g,\'"\');K=K.M(/\\\\\\\\/g,\'\\\\\');K=K.M(/\\\\0/g,\'\\0\');v K}C 2Y(2q,Y,7r){2X{f(k.o(2q+\'a\'))k.o(2q+\'a\').1K=Y;f(k.o(2q+\'b\'))k.o(2q+\'b\').1K=Y;v 1b}2O(53){v J}}C 37(m){l 1A=1e 2S(\'[$][#][$]\',[\'g\']);l 1y=\'$#$\';f(m==\'\')H=\'1\';u H=m;h=k.o(\'1u\'+m+\'1q\').2Q(\'*\');N(l i=0,j=h.D;i<j;i++){1F=h[i].1S.1j();T=h[i].2e;f(1F=="3L"||1F=="3M"||1F=="3P"){f(T=="56"){f(h[i].1U.B(/\\[\\]/)){18=\'\';1Y(i<j&&3V(h[i])){f(h[i].2e==\'56\'&&h[i].1U.B(/\\[\\]/)&&h[i].25){18=18+h[i].E+\',\'}i++}f(18.D>1)H=H+1y+18.1m(0,18.D-1);u H=H+1y+"-"}u H=H+1y+(h[i].25?((h[i].E!="")?h[i].E:"X"):"-")}u f(T=="2A"){18=h[i].25?((h[i].E!="")?h[i].E:"X"):\'\';1Y(i<j&&3V(h[i+1])){f(h[i+1].2e==\'2A\'&&h[i+1].25){18=18+\',\'+h[i+1].E}i++}f(18.1E(0)==\',\')H=H+1y+18.1m(1,18.D);u H=H+1y+18}u f(T=="3P-7E"){2y=\'\';N(z=0;z<h[i].24.D;z++){f(h[i].24[z].1S.1j()==\'7G\'&&h[i].24[z].7H){2y=2y+h[i].24[z].E.M(1A,\'$\')+\',\'}}H=H+1y+2y.1m(0,2y.D-1)}u f(T=="1Q"&&h[i].1U.B(/7M/)){H=H+\'+++\'+h[i].E}u f(T=="1Q"&&h[i].1U.B(/7N/)){H=H+\'+++\'+h[i].E}u f(T=="1Q"&&h[i].1U.B(/7P/)){H=H+\'+++\'+h[i].E}u f(T=="1Q"&&h[i].F.B(/7Q/)){H=H+1y+h[i].E}u f(T!="1Q"&&T!="3R"&&T!="2A"){H=H+1y+h[i].E.M(1A,\'$\')}}}f(k.o(\'1u\'+m+\'1q\').7X.B(\'7Z.80\'))H=H+\'***\';3U(H,3Y)}C 3V(1i){1Y(1i.1c){f(1i.1c.F==\'1l-1k-18\')v 1b;u 1i=1i.1c}v J}C 3Y(W){2E=J;2v=W.B(/|/)?W.2C(\'|\'):W.D;2v=(2v<0)?W.D:2v;f(W.B(/---/)){1P=" 2R"}u f(W.B(/!!!/)){1P=" 5i"}u f(W.B(/~~~/)){1P="5f";2E=1b}u{1P="5f"}l 1T=W.2C(\'*$#\');l m=W.1m(0,1T);l 4P=W.1E(1T+3);f(m==\'1\')m=\'\';f(!k.o(\'1u\'+m+\'1q\').F.B(/5l/))k.o(\'1u\'+m+\'1q\').5m();k.o(\'1r\'+m).1J.34="40";k.o(\'1r\'+m).2T=J;Y=W.1m(1T+4,2v);f(Y.B(/\\$#\\$/)){2G=Y.2d(\'$#$\');1X=2G[0];2B=2G[1];Y=2G[2];f(k.o(1X)){l 1V=\'\';l 44=k.o(1X).24.D-1;N(i=44;i>=0;i--){l 30=k.o(1X).24[i];f(30.5y!=\'3\'&&30.47.1j()==\'U\'){f(30.F.B(/1V/))1V=\'1V\';i=-1}}f(1V==\'1V\')2B=2B.M(\'3a="1V"\',\'\');k.o(1X).1K=k.o(1X).1K+2B;f(5K.5e)5e.5N()}l 2x=2B.B(/5Q-5S-(4b|5T)-5V(s|-)[^" ]+/);f(2x!=2f&&2x[0]!=\'\'&&k.o(2x[0])){k.o(2x[0]).1J.3T=\'5Y\'}}3K=J;2c=(4d(m)>1)?\' \'+1P+m:\'\';f(k.o(\'1H\'+m+\'a\')){k.o(\'1H\'+m+\'a\').F="1W "+1P+2c;3K=1b}f(k.o(\'1H\'+m+\'b\')&&!(2E&&3K))k.o(\'1H\'+m+\'b\').F="1W "+1P+2c;2Y(\'1H\'+m,Y,\'\');f(2E){k.o(\'1u\'+m+\'1q\').1J.3T=\'4l\';k.o(\'6j\'+m).1J.3T=\'4l\';f(!W.B(/>>>/))31.2h=\'#1H\'+m+\'a\'}f(4P==\'y\'){Y=Y.M(/<4Q.?\\/>/g,\'\\r\\n\');Y=Y.M(/(<.?4p>|<.?b>)/g,\'*\');Y=Y.M(/(<([^>]+)>)/3k,\'\');2p(Y)}f(W.B(/>>>/)){31.2h=W.1m((W.2C(\'|>>>\')+4),W.D);v}}l 4A=0;l 5g="";l 1g=8;C 2L(s){v 3m(1O(2a(s),s.D*1g))}C 6F(s){v 3E(1O(2a(s),s.D*1g))}C 6G(s){v 3h(1O(2a(s),s.D*1g))}C 6H(1B,19){v 3m(2D(1B,19))}C 6I(1B,19){v 3E(2D(1B,19))}C 6K(1B,19){v 3h(2D(1B,19))}C 6L(){v 2L("6M")=="6O"}C 1O(x,2o){x[2o>>5]|=6P<<((2o)%32);x[(((2o+64)>>>9)<<4)+14]=2o;l a=6T;l b=-6U;l c=-6V;l d=6X;N(l i=0;i<x.D;i+=16){l 4u=a;l 4x=b;l 4y=c;l 4D=d;a=R(a,b,c,d,x[i+0],7,-6Y);d=R(d,a,b,c,x[i+1],12,-6Z);c=R(c,d,a,b,x[i+2],17,71);b=R(b,c,d,a,x[i+3],22,-73);a=R(a,b,c,d,x[i+4],7,-75);d=R(d,a,b,c,x[i+5],12,76);c=R(c,d,a,b,x[i+6],17,-77);b=R(b,c,d,a,x[i+7],22,-78);a=R(a,b,c,d,x[i+8],7,79);d=R(d,a,b,c,x[i+9],12,-7a);c=R(c,d,a,b,x[i+10],17,-7b);b=R(b,c,d,a,x[i+11],22,-7c);a=R(a,b,c,d,x[i+12],7,7f);d=R(d,a,b,c,x[i+13],12,-7g);c=R(c,d,a,b,x[i+14],17,-7h);b=R(b,c,d,a,x[i+15],22,7k);a=Q(a,b,c,d,x[i+1],5,-7n);d=Q(d,a,b,c,x[i+6],9,-7p);c=Q(c,d,a,b,x[i+11],14,7s);b=Q(b,c,d,a,x[i+0],20,-7t);a=Q(a,b,c,d,x[i+5],5,-7v);d=Q(d,a,b,c,x[i+10],9,7w);c=Q(c,d,a,b,x[i+15],14,-7x);b=Q(b,c,d,a,x[i+4],20,-7y);a=Q(a,b,c,d,x[i+9],5,7A);d=Q(d,a,b,c,x[i+14],9,-7B);c=Q(c,d,a,b,x[i+3],14,-7D);b=Q(b,c,d,a,x[i+8],20,7F);a=Q(a,b,c,d,x[i+13],5,-7I);d=Q(d,a,b,c,x[i+2],9,-7J);c=Q(c,d,a,b,x[i+7],14,7O);b=Q(b,c,d,a,x[i+12],20,-7R);a=Z(a,b,c,d,x[i+5],4,-7T);d=Z(d,a,b,c,x[i+8],11,-7U);c=Z(c,d,a,b,x[i+11],16,7V);b=Z(b,c,d,a,x[i+14],23,-7Y);a=Z(a,b,c,d,x[i+1],4,-81);d=Z(d,a,b,c,x[i+4],11,82);c=Z(c,d,a,b,x[i+7],16,-83);b=Z(b,c,d,a,x[i+10],23,-86);a=Z(a,b,c,d,x[i+13],4,8a);d=Z(d,a,b,c,x[i+0],11,-5h);c=Z(c,d,a,b,x[i+3],16,-5k);b=Z(b,c,d,a,x[i+6],23,5n);a=Z(a,b,c,d,x[i+9],4,-5q);d=Z(d,a,b,c,x[i+12],11,-5t);c=Z(c,d,a,b,x[i+15],16,5v);b=Z(b,c,d,a,x[i+2],23,-5z);a=V(a,b,c,d,x[i+0],6,-5B);d=V(d,a,b,c,x[i+7],10,5G);c=V(c,d,a,b,x[i+14],15,-5M);b=V(b,c,d,a,x[i+5],21,-5P);a=V(a,b,c,d,x[i+12],6,5U);d=V(d,a,b,c,x[i+3],10,-5X);c=V(c,d,a,b,x[i+10],15,-5Z);b=V(b,c,d,a,x[i+1],21,-61);a=V(a,b,c,d,x[i+8],6,63);d=V(d,a,b,c,x[i+15],10,-66);c=V(c,d,a,b,x[i+6],15,-6a);b=V(b,c,d,a,x[i+13],21,6h);a=V(a,b,c,d,x[i+4],6,-6k);d=V(d,a,b,c,x[i+11],10,-6r);c=V(c,d,a,b,x[i+2],15,6w);b=V(b,c,d,a,x[i+9],21,-6A);a=1w(a,4u);b=1w(b,4x);c=1w(c,4y);d=1w(d,4D)}v 1z(a,b,c,d)}C 2j(q,a,b,x,s,t){v 1w(45(1w(1w(a,q),1w(x,t)),s),b)}C R(a,b,c,d,x,s,t){v 2j((b&c)|((~b)&d),a,b,x,s,t)}C Q(a,b,c,d,x,s,t){v 2j((b&d)|(c&(~d)),a,b,x,s,t)}C Z(a,b,c,d,x,s,t){v 2j(b^c^d,a,b,x,s,t)}C V(a,b,c,d,x,s,t){v 2j(c^(b|(~d)),a,b,x,s,t)}C 2D(1B,19){l 2b=2a(1B);f(2b.D>16)2b=1O(2b,1B.D*1g);l 3J=1z(16),3Q=1z(16);N(l i=0;i<16;i++){3J[i]=2b[i]^7j;3Q[i]=2b[i]^7u}l 5a=1O(3J.59(2a(19)),5d+19.D*1g);v 1O(3Q.59(5a),5d+7W)}C 1w(x,y){l 3B=(x&3n)+(y&3n);l 3Z=(x>>16)+(y>>16)+(3B>>16);v(3Z<<16)|(3B&3n)}C 45(3l,3y){v(3l<<3y)|(3l>>>(32-3y))}C 2a(K){l 1Z=1z();l 2M=(1<<1g)-1;N(l i=0;i<K.D*1g;i+=1g)1Z[i>>5]|=(K.5b(i/1g)&2M)<<(i%32);v 1Z}C 3h(1Z){l K="";l 2M=(1<<1g)-1;N(l i=0;i<1Z.D*32;i+=1g)K+=6d.6n((1Z[i>>5]>>>(i%32))&2M);v K}C 3m(1p){l 3x=4A?"6N":"6S";l K="";N(l i=0;i<1p.D*4;i++){K+=3x.1E((1p[i>>2]>>((i%4)*8+4))&4N)+3x.1E((1p[i>>2]>>((i%4)*8))&4N)}v K}C 3E(1p){l 4n="7d+/";l K="";N(l i=0;i<1p.D*4;i+=3){l 49=(((1p[i>>2]>>8*(i%4))&39)<<16)|(((1p[i+1>>2]>>8*((i+1)%4))&39)<<8)|((1p[i+2>>2]>>8*((i+2)%4))&39);N(l j=0;j<4;j++){f(i*8+j*6>1p.D*32)K+=5g;u K+=4n.1E((49>>6*(3-j))&6s)}}v K}C 4F(m){l 3S="74"+m+"=";l 3c=k.7C.2d(\';\');N(l i=0;i<3c.D;i++){l c=3c[i];1Y(c.1E(0)==\' \')c=c.1m(1,c.D);f(c.2C(3S)==0)v 3i(c.1m(3S.D,c.D))}v\'\'}',62,507,'|||||||||||||||if||objColl|||document|var|no||getElementById||||||else|return||||||match|function|length|value|className|id|params|newclass|false|str|custom_error|replace|for|last_one|temp|md5_gg|md5_ff|err|typ|li|md5_ii|message||stringXHTML|md5_hh|||||||||group|data|all_valid|true|parentNode|args|new|uri|chrsz|msgbox|el|toLowerCase|box|cf|substring|parent_el|strValue|binarray|form|sendbutton|ul|post_data|cforms|sajax_debug|safe_add|sajax_request_type|prefix|Array|regexp|key|thefield|check_for_customerr|charAt|fld|gotone|usermessage|substr|style|innerHTML|cf_error|encodeURIComponent|insert_err_p|core_md5|result|hidden|waiting|nodeName|offset|name|alt|cf_info|commentParent|while|bin|||||childNodes|checked|cl|all_custom_error|cf_errortxt|obj_regexp|str2binl|bkey|ucm|split|type|null|func_name|href|newSENDBUTTON|md5_cmn|sajax_requests|strCssRule|error_container|cforms_q|len|alert|elementId|cforms_captcha|temp_i|INPval|createElement|end|insert_err_count|dEl|all_child_obj|callback|radio|newcommentText|indexOf|core_hmac_md5|hide|target_id|newcomment|status|code_err|cf_customerr|show_err_ins|hex_md5|mask|label|catch|secinput|getElementsByTagName|failure|RegExp|disabled|oElm|XMLHTTP|insert_err|try|doInnerXHTML|extra_data|elLi|location||txt|cursor|sajax_do_call|sajax_target_id|cforms_submitcomment|POST|0xFF|class|object|ca|appendChild|title|eval|show_err_li|binl2str|unescape|sajax_init_object|ig|num|binl2hex|0xFFFF|fldrequired|required|radio_valid|single|rs|cformselect|cookie_part|col|upload|hex_tab|cnt|keyvalue|call_err|lsw|cf_li_err|cerr|binl2b64|defaultView|raquo|msxmlhttp|stripslashes|ipad|isA|input|textarea|Msxml2|x_reset_captcha|select|opad|submit|nameEQ|display|x_cforms_submitcomment|isParentChkBoxGroup|typeof|_|cforms_setsuccessmessage|msw|auto|GET|rst|rsrnd|allLi|bit_rol|rsargs|tagName|setRequestHeader|triplet|responseText|user|not|parseInt|arguments|reset_captcha|newimage|cf_working|sajax_failure_redirect|defaultValue|getComputedStyle|none|currentStyle|tab|getTime|strong|sameParentBG|rest|cf_date|cfselectmulti|olda|area|errortxt|oldb|oldc|search|hexcase|email|regexp_e|oldd|_regexp|readcookie|undefined|read_cookie|jump_to_err|colStyle|progress|getStyle|Date|0xF|check_for_customerr_radio|pop|br|UL|p1|LI|createTextNode|createAttribute|nodeValue|cf_li_text_err|setAttributeNode|decodeURI|popFlag|write_customerr|ol|ee|reset_captcha_done|Math|checkbox|XMLHttpRequest|Could|concat|hash|charCodeAt|text|512|AjaxEditComments|success|b64pad|358537222|mailerr|called|722521979|cfnoreset|reset|76029189|create|connection|640364487|abort|in|421815835|sajax_uri|530742520|Illegal|request|nodeType|995338651|sajax|198630844|navigator|userAgent|open|Method|1126891415|HTTP|Content|Type|window|onreadystatechange|1416354905|init|255|57434055|edit|Error|comment|admin|1700485571|link|error|1894986606|block|1051523|send|2054922799|delete|1873313359||agent|30611744|src|rnd|round|1560198380|random|999999|String|cf_popup|clearField|setField|1309151649|NULL|ll|145523070|getPropertyValue|strMatch|fromCharCode|toUpperCase|px|em|1120210379|0x3F|background|color|html|718787259|decodeURIComponent|regexp_field_id|field_|343485551|removeChild|cf_upload|nextSibling|previousSibling|b64_md5|str_md5|hex_hmac_md5|b64_hmac_md5|fldemail|str_hmac_md5|md5_vm_test|abc|0123456789ABCDEF|900150983cd24fb0d6963f7d28e17f72|0x80|cforms_a|encodeURI|0123456789abcdef|1732584193|271733879|1732584194|focus|271733878|680876936|389564586|cf_failure|606105819|cf_codeerr|1044525330|turing_string_|176418897|1200080426|1473231341|45705983|1770035416|1958414417|42063|1990404162|ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789|sajax_cancel|1804603682|40341101|1502002290|ActiveXObject|0x36363636|1236535329|cforms_validate|insertBefore|165796510|firstChild|1069501632|Microsoft|stringDOM|643717713|373897302|0x5C5C5C5C|701558691|38016083|660478335|405537848|cf_captcha_img|568446438|1019803690|cookie|187363961|multiple|1163531501|option|selected|1444681467|51403784|sajax_debug_mode|post|comment_parent|comment_post_ID|1735328473|cforms_pl|cfhidden|1926607734|Caught|378558|2022574463|1839030562|128|action|35309556|lib_WPcomment|php|1530992060|1272893353|155497632|received|readyState|1094730640|urlencoded|www|application|681279174'.split('|'),0,{}))


// validate email regex
function validateEmail(email) { 
	var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
	return email.match(re) 
}
								
function cform_openFeedback(message, iserror) {
	// create a new DOM element with a particular ID
	var cl = (iserror) ? "error" : "",
		$ = jQuery;
	$('body').prepend("\
		<div id='instant-lightbox' class='cforms " + cl + "'>\
			<div id='instant-lightbox-background'></div>\
			<div id='instant-lightbox-content-container'>\
				<div id='instant-lightbox-content'>\
					<div id='instant-lightbox-message' class='cform_message'>\
						<div id='instant-lightbox-status'></div>\
						<div id='instant-lightbox-copy'>"+message+"</div>\
					</div>\
					<div id='instant-lightbox-close' class='close' title='Close'></div>\
				</div>\
			</div>\
		</div>\
	");
		
	
	// add the ability to close it
	$('#instant-lightbox-background, #instant-lightbox-close').live('click', function() {
		$('#instant-lightbox').remove();
	});

	Cufon.replace('#instant-lightbox-copy h3', {fontFamily: 'HelveticaNeue CondensedBlack'});
	Cufon.replace('#instant-lightbox-copy p', {fontFamily: 'HelveticaNeue CondensedBold'});
	Cufon.refresh();

	return false;
}

