function sitefinityForm(element,options){this.formElement=$(element); this.validation=new sitefinityValidation(); if(!options){options={}; }options.draggable=true; options.resizable=true; options.modal=true; options.visible=false; options.actions=[]; this.windowForm=this.formElement.kendoWindow(options); }sitefinityForm.prototype={initialize:function(){$(this.formElement).find("[data-field]").each(function(){if($(this).attr("data-sf-title")){var titleElement=document.createElement("label"); titleElement.setAttribute("for",$(this).attr("id")); titleElement.setAttribute("class","sfTxtLbl"); $(titleElement).html($(this).attr("data-sf-title")); $(this).before(titleElement); }if($(this).attr("data-sf-description")){var descriptionElement=document.createElement("div"); $(descriptionElement).addClass("sfExample"); $(descriptionElement).html($(this).attr("data-sf-description")); $(this).after(descriptionElement); }if($(this).attr("data-sf-example")){var exampleElement=document.createElement("div"); $(exampleElement).addClass("sfExample"); $(exampleElement).html($(this).attr("data-sf-example")); $(this).after(exampleElement); }}); },create:function(options){var window=$(this.windowForm).data("kendoWindow"); window.open(); if(options==null){options={fullScreen:true}; }if(options.fullScreen===null||options.fullScreen===true){window.maximize(); }},edit:function(entry){$(this.formElement).find("[data-field]").each(function(){var property=$(this).attr("data-field"); $(this).val(entry[property]); }); this.formElement.data("entry",entry); var window=$(this.windowForm).data("kendoWindow"); window.open(); window.maximize(); },reset:function(close){$(this).find("[data-field]").each(function(){$(this).val(""); }); this.formElement.data("entry",null); if(close){this.windowForm.data("kendoWindow").close(); }},isValid:function(){return this.validation.validateContainer(this.formElement); },areElementsValid:function(elements){var areValid=true; if(elements==null){return; }var elementsCount=elements.length; while(elementsCount--){var definitions=this.validation.getElementDefinitions(elements[elementsCount]); var definitionsCount=definitions.length; while(definitionsCount--){var isValid=this.validation.validateElement(definitions[definitionsCount]); if(isValid==false){this.validation.displayErrorMessage(definitions[definitionsCount]); areValid=false; }else{this.validation.removeDisplayErrorMessages(definitions[definitionsCount]); }}}return areValid; }};