//CKEditor
function setupCkEditor(inputHiddenField) {

    containerId = inputHiddenField.replace(':', '_');
    inputHiddenField = '#' + inputHiddenField.replace(':', '\\:');
    $(inputHiddenField).parent().append('<textarea name="descr' + containerId + '" id="' + containerId + '" rows="10" cols="50"  >' + $(inputHiddenField).val() + '</textarea>');
    CKEDITOR.replace(containerId);

    CKEDITOR.config.toolbar =
    	[
	        {name: 'clipboard', groups: ['clipboard', 'undo'], items: ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo']},
	        {name: 'editing', groups: ['find', 'selection', 'spellchecker'], items: ['Find', 'Replace', '-', 'SelectAll', '-', 'Scayt']},
	        {name: 'basicstyles', groups: ['basicstyles', 'cleanup'], items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat']},
	        {name: 'links', items: ['Link', 'Unlink', 'Anchor']},
	        {name: 'colors', items: ['TextColor', 'BGColor']},
	        {name: 'tools', items: ['Maximize']},
	        '/',
	        {name: 'styles', items: ['Styles', 'Format', 'Font', 'FontSize']},
	        {name: 'paragraph', groups: ['list', 'indent', 'blocks', 'align', 'bidi'], items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl']},
	        {name: 'others', items: ['-']}
        ];

    CKEDITOR.instances[containerId].on('change', function () {
        $(inputHiddenField).val(CKEDITOR.instances[containerId].getData());
    });
}
