function tickall(obj) {
    var formsubmit = new Array("key_ena_1", "key_ena_2", "key_ena_3", "key_ena_4", "key_ena_5", "key_ena_6", "key_ena_7", "key_ena_8", "key_ena_9", "key_ena_10", "key_ena_11", "key_ena_12", "key_ena_13", "key_ena_14");
    if (obj.checked==true) {
        for(key in formsubmit) {
            document.getElementById(formsubmit[key]).checked=true;
        }
    }
    
    else {
        for(key in formsubmit) {
            document.getElementById(formsubmit[key]).checked=false;
        }
    }
}

function boldall(obj) {
    var formsubmitbold = new Array("key_ena_1_b", "key_ena_2_b", "key_ena_3_b", "key_ena_4_b", "key_ena_5_b", "key_ena_6_b", "key_ena_7_b", "key_ena_8_b", "key_ena_9_b", "key_ena_10_b", "key_ena_11_b", "key_ena_14_b");
    if (obj.checked==true) {
        for(key in formsubmitbold) {
            document.getElementById(formsubmitbold[key]).checked=true;
        }
    }
    
    else {
        for(key in formsubmitbold) {
            document.getElementById(formsubmitbold[key]).checked=false;
        }
    }
}

function italicall(obj) {
    var formsubmititalic = new Array("key_ena_1_i", "key_ena_2_i", "key_ena_3_i", "key_ena_4_i", "key_ena_5_i", "key_ena_6_i", "key_ena_7_i", "key_ena_8_i", "key_ena_9_i", "key_ena_10_i", "key_ena_11_i", "key_ena_14_i");
    if (obj.checked==true) {
        for(key in formsubmititalic) {
            document.getElementById(formsubmititalic[key]).checked=true;
        }
    }
    
    else {
        for(key in formsubmititalic) {
            document.getElementById(formsubmititalic[key]).checked=false;
        }
    }
}

$(document).ready(function() {

    $('#key_ena_1_col').ColorPicker({
            onShow: function (colpkr) {
                    $(colpkr).fadeIn(500);
                    return false;
            },
            onHide: function (colpkr) {
                    $(colpkr).fadeOut(600);
                    return false;
            },
            onChange: function(hsb, hex, rgb) {
                    $('#key_ena_1_col').val("#"+hex);
                    $('#key_ena_1_col').css('backgroundColor', '#' + hex);
    
            },
            onBeforeShow: function () {
                    $(this).ColorPickerSetColor(this.value);
            },
            onSubmit: function (colpkr) {
                $(colpkr).fadeOut(900);
                return false;
            }
    });
    
    $('#key_ena_2_col').ColorPicker({
            onShow: function (colpkr) {
                    $(colpkr).fadeIn(500);
                    return false;
            },
            onHide: function (colpkr) {
                    $(colpkr).fadeOut(600);
                    return false;
            },
            onChange: function(hsb, hex, rgb) {
                    $('#key_ena_2_col').val("#"+hex);
                    $('#key_ena_2_col').css('backgroundColor', '#' + hex);
    
            },
            onBeforeShow: function () {
                    $(this).ColorPickerSetColor(this.value);
            },
            onSubmit: function(hsb, hex, rgb) {
                    $('#key_ena_2_col').val("#"+hex);
                    $('#key_ena_2_col').css('backgroundColor', '#' + hex);
            }
    });
    
    $('#key_ena_3_col').ColorPicker({
            onShow: function (colpkr) {
                    $(colpkr).fadeIn(500);
                    return false;
            },
            onHide: function (colpkr) {
                    $(colpkr).fadeOut(600);
                    return false;
            },
            onChange: function(hsb, hex, rgb) {
                    $('#key_ena_3_col').val("#"+hex);
                    $('#key_ena_3_col').css('backgroundColor', '#' + hex);
    
            },
            onBeforeShow: function () {
                    $(this).ColorPickerSetColor(this.value);
            },
            onSubmit: function(hsb, hex, rgb) {
                    $('#key_ena_3_col').val("#"+hex);
                    $('#key_ena_3_col').css('backgroundColor', '#' + hex);
            }
    });
    
    $('#key_ena_4_col').ColorPicker({
            onShow: function (colpkr) {
                    $(colpkr).fadeIn(500);
                    return false;
            },
            onHide: function (colpkr) {
                    $(colpkr).fadeOut(600);
                    return false;
            },
            onChange: function(hsb, hex, rgb) {
                    $('#key_ena_4_col').val("#"+hex);
                    $('#key_ena_4_col').css('backgroundColor', '#' + hex);
    
            },
            onBeforeShow: function () {
                    $(this).ColorPickerSetColor(this.value);
            },
            onSubmit: function(hsb, hex, rgb) {
                    $('#key_ena_4_col').val("#"+hex);
                    $('#key_ena_4_col').css('backgroundColor', '#' + hex);
            }
    });
    
    $('#key_ena_5_col').ColorPicker({
            onShow: function (colpkr) {
                    $(colpkr).fadeIn(500);
                    return false;
            },
            onHide: function (colpkr) {
                    $(colpkr).fadeOut(600);
                    return false;
            },
            onChange: function(hsb, hex, rgb) {
                    $('#key_ena_5_col').val("#"+hex);
                    $('#key_ena_5_col').css('backgroundColor', '#' + hex);
    
            },
            onBeforeShow: function () {
                    $(this).ColorPickerSetColor(this.value);
            },
            onSubmit: function(hsb, hex, rgb) {
                    $('#key_ena_5_col').val("#"+hex);
                    $('#key_ena_5_col').css('backgroundColor', '#' + hex);
            }
    });
    
    $('#key_ena_6_col').ColorPicker({
            onShow: function (colpkr) {
                    $(colpkr).fadeIn(500);
                    return false;
            },
            onHide: function (colpkr) {
                    $(colpkr).fadeOut(600);
                    return false;
            },
            onChange: function(hsb, hex, rgb) {
                    $('#key_ena_6_col').val("#"+hex);
                    $('#key_ena_6_col').css('backgroundColor', '#' + hex);
    
            },
            onBeforeShow: function () {
                    $(this).ColorPickerSetColor(this.value);
            },
            onSubmit: function(hsb, hex, rgb) {
                    $('#key_ena_6_col').val("#"+hex);
                    $('#key_ena_6_col').css('backgroundColor', '#' + hex);
            }
    });
    
    $('#key_ena_7_col').ColorPicker({
            onShow: function (colpkr) {
                    $(colpkr).fadeIn(500);
                    return false;
            },
            onHide: function (colpkr) {
                    $(colpkr).fadeOut(600);
                    return false;
            },
            onChange: function(hsb, hex, rgb) {
                    $('#key_ena_7_col').val("#"+hex);
                    $('#key_ena_7_col').css('backgroundColor', '#' + hex);
    
            },
            onBeforeShow: function () {
                    $(this).ColorPickerSetColor(this.value);
            },
            onSubmit: function(hsb, hex, rgb) {
                    $('#key_ena_7_col').val("#"+hex);
                    $('#key_ena_7_col').css('backgroundColor', '#' + hex);
            }
    });
    
    $('#key_ena_8_col').ColorPicker({
            onShow: function (colpkr) {
                    $(colpkr).fadeIn(500);
                    return false;
            },
            onHide: function (colpkr) {
                    $(colpkr).fadeOut(600);
                    return false;
            },
            onChange: function(hsb, hex, rgb) {
                    $('#key_ena_8_col').val("#"+hex);
                    $('#key_ena_8_col').css('backgroundColor', '#' + hex);
    
            },
            onBeforeShow: function () {
                    $(this).ColorPickerSetColor(this.value);
            },
            onSubmit: function(hsb, hex, rgb) {
                    $('#key_ena_8_col').val("#"+hex);
                    $('#key_ena_8_col').css('backgroundColor', '#' + hex);
            }
    });
    
    $('#key_ena_9_col').ColorPicker({
            onShow: function (colpkr) {
                    $(colpkr).fadeIn(500);
                    return false;
            },
            onHide: function (colpkr) {
                    $(colpkr).fadeOut(600);
                    return false;
            },
            onChange: function(hsb, hex, rgb) {
                    $('#key_ena_9_col').val("#"+hex);
                    $('#key_ena_9_col').css('backgroundColor', '#' + hex);
    
            },
            onBeforeShow: function () {
                    $(this).ColorPickerSetColor(this.value);
            },
            onSubmit: function(hsb, hex, rgb) {
                    $('#key_ena_9_col').val("#"+hex);
                    $('#key_ena_9_col').css('backgroundColor', '#' + hex);
            }
    });
    
    $('#key_ena_10_col').ColorPicker({
            onShow: function (colpkr) {
                    $(colpkr).fadeIn(500);
                    return false;
            },
            onHide: function (colpkr) {
                    $(colpkr).fadeOut(600);
                    return false;
            },
            onChange: function(hsb, hex, rgb) {
                    $('#key_ena_10_col').val("#"+hex);
                    $('#key_ena_10_col').css('backgroundColor', '#' + hex);
    
            },
            onBeforeShow: function () {
                    $(this).ColorPickerSetColor(this.value);
            },
            onSubmit: function(hsb, hex, rgb) {
                    $('#key_ena_10_col').val("#"+hex);
                    $('#key_ena_10_col').css('backgroundColor', '#' + hex);
            }
    });
    
    $('#key_ena_11_col').ColorPicker({
            onShow: function (colpkr) {
                    $(colpkr).fadeIn(500);
                    return false;
            },
            onHide: function (colpkr) {
                    $(colpkr).fadeOut(600);
                    return false;
            },
            onChange: function(hsb, hex, rgb) {
                    $('#key_ena_11_col').val("#"+hex);
                    $('#key_ena_11_col').css('backgroundColor', '#' + hex);
    
            },
            onBeforeShow: function () {
                    $(this).ColorPickerSetColor(this.value);
            },
            onSubmit: function(hsb, hex, rgb) {
                    $('#key_ena_11_col').val("#"+hex);
                    $('#key_ena_11_col').css('backgroundColor', '#' + hex);
            }
    });
    
    $('#key_ena_12_col').ColorPicker({
            onShow: function (colpkr) {
                    $(colpkr).fadeIn(500);
                    return false;
            },
            onHide: function (colpkr) {
                    $(colpkr).fadeOut(600);
                    return false;
            },
            onChange: function(hsb, hex, rgb) {
                    $('#key_ena_12_col').val("#"+hex);
                    $('#key_ena_12_col').css('backgroundColor', '#' + hex);
    
            },
            onBeforeShow: function () {
                    $(this).ColorPickerSetColor(this.value);
            },
            onSubmit: function(hsb, hex, rgb) {
                    $('#key_ena_12_col').val("#"+hex);
                    $('#key_ena_12_col').css('backgroundColor', '#' + hex);
            }
    });
    
    $('#key_ena_13_col').ColorPicker({
            onShow: function (colpkr) {
                    $(colpkr).fadeIn(500);
                    return false;
            },
            onHide: function (colpkr) {
                    $(colpkr).fadeOut(600);
                    return false;
            },
            onChange: function(hsb, hex, rgb) {
                    $('#key_ena_13_col').val("#"+hex);
                    $('#key_ena_13_col').css('backgroundColor', '#' + hex);
    
            },
            onBeforeShow: function () {
                    $(this).ColorPickerSetColor(this.value);
            },
            onSubmit: function(hsb, hex, rgb) {
                    $('#key_ena_13_col').val("#"+hex);
                    $('#key_ena_13_col').css('backgroundColor', '#' + hex);
            }
    });
    
    $('#key_ena_14_col').ColorPicker({
            onShow: function (colpkr) {
                    $(colpkr).fadeIn(500);
                    return false;
            },
            onHide: function (colpkr) {
                    $(colpkr).fadeOut(600);
                    return false;
            },
            onChange: function(hsb, hex, rgb) {
                    $('#key_ena_14_col').val("#"+hex);
                    $('#key_ena_14_col').css('backgroundColor', '#' + hex);
    
            },
            onBeforeShow: function () {
                    $(this).ColorPickerSetColor(this.value);
            },
            onSubmit: function(hsb, hex, rgb) {
                    $('#key_ena_14_col').val("#"+hex);
                    $('#key_ena_14_col').css('backgroundColor', '#' + hex);
            }
    });

});
