// when the DOM is ready...
$(document).ready(function () {
$("#telecform").validate({
 rules: {
          telefono: {
            minlength: 6
          }
      }
});
//form labels correction
          var max = 0;
            $("label").each(function(){
                if ($(this).width() > max)
                    max = $(this).width();
            });
            $("label").width(max);
//
    //change "comentario" to whatever your TEXTAREA is called
      CKEDITOR.replace( 'comentario',{
      toolbar :[
      						[ 'Bold', 'Italic', 'Underline','-', 'Undo','Redo' ]
      				 ],
      uiColor : '#B4D5C2'
      } );
//Capture iframe input to be properly used with jquery.validdate
      CKEDITOR.instances["comentario"].on("instanceReady", function(){
                              //set keyup event
                              this.document.on("keyup", updateTextArea);
                               //and paste event
                              this.document.on("paste", updateTextArea);
              });

              function updateTextArea(){
                      CKEDITOR.tools.setTimeout( function(){
                                      $("#comentario").val(CKEDITOR.instances.comentario.getData());
                                      $("#comentario").trigger('keyup');
                                  }, 0);
              }


      CKEDITOR.editorConfig = function( config ){
      	// Sizes are in pixels (apparently not working)
      	//config.resize_minWidth = 1800;
        //config.resize_maxWidth = '120%';
      	// config.resize_minHeight = 200;
      	// config.resize_maxHeight = 500;
      };
//

}); //THE END
