[
  [
    "webform.module", 
    "webform.module", 
    [
      "Left base folder: C:\\Documents and Settings\\Olga\\My Documents\\Downloads\\webform-6.x-3.0-beta5(2)\\webform", 
      "Right base folder: C:\\xampp\\htdocs\\ogorun\\sites\\all\\modules\\webform", 
      "--- webform.module", 
      "+++ webform.module", 
      "@@ -1338,18 +1338,46 @@", 
      "", 
      "// Shorten up our variable names.", 
      "$component_tree = $form_state['webform']['component_tree'];", 
      "$page_count = $form_state['webform']['page_count'];", 
      "$page_num = $form_state['webform']['page_num'];", 
      "", 
      "+    // Start gathering JS settings for conditional fields engine", 
      "+    $settings = array(", 
      "+      'objects' => array(),", 
      "+      'mandatory' => array(),", 
      "+      'previousPagesFields' => array(),", 
      "+      'nid' => $node->nid", 
      "+    );", 
      "+", 
      "// Recursively add components to the form.", 
      "foreach ($component_tree['children'] as $cid => $component) {", 
      "-      $component_value = isset($form_state['values']['submitted'][$component['form_key']]) ? $form_state['values']['submitted'][$component['form_key']] : NULL;", 
      "-      if (_webform_client_form_rule_check($node, $component, $page_num, $form_state)) {", 
      "-        _webform_client_form_add_component($component, $component_value, $form['submitted'], $form, $submission, 'form', $page_num, $filter);", 
      "-      }", 
      "+        if (isset($form_state['values']['submitted'][$component['form_key']])) {", 
      "+           $component_value = $form_state['values']['submitted'][$component['form_key']];", 
      "+        }", 
      "+        elseif (isset($form_state['storage']['submitted'][$component['form_key']])) {", 
      "+            $component_value = $form_state['storage']['submitted'][$component['form_key']];", 
      "+        }", 
      "+        else {", 
      "+            $component_value = null;", 
      "+        }", 
      "+        _webform_client_form_add_component($component, $component_value, $form['submitted'], $form, $settings, $submission, 'form', $page_num, $filter);", 
      "+    }", 
      "+", 
      "+    $form['webform_conditional_mandatory']=array(", 
      "+      '#type' => 'hidden',", 
      "+      '#default_value' => implode('|',$settings['mandatory']),", 
      "+    );", 
      "+", 
      "+    if (empty($_POST)) {", 
      "+        $path = drupal_get_path('module','webform');", 
      "+        drupal_add_js($path . '/le/jquery.json-2.2.min.js');", 
      "+        drupal_add_js($path . '/le/le.conditionsConstructor.js');", 
      "+        drupal_add_js($path . '/le/le.conditionalFormFields.js');", 
      "+        drupal_add_js(array('webformConditional' => $settings), 'setting');", 
      "+        drupal_add_js($path . '/js/webform_conditional.js');", 
      "}", 
      "", 
      "// These form details help managing data upon submission.", 
      "$form['details']['nid'] = array(", 
      "'#type' => 'value',", 
      "'#value' => $node->nid,", 
      "@@ -1421,79 +1449,12 @@", 
      "}", 
      "}", 
      "", 
      "return $form;", 
      "}", 
      "", 
      "-/**", 
      "- * Check if a component should be displayed on the current page.", 
      "- */", 
      "-function _webform_client_form_rule_check($node, $component, $page_num, $form_state = NULL, $submission = NULL) {", 
      "-  $conditional_values = isset($component['extra']['conditional_values']) ? $component['extra']['conditional_values'] : NULL;", 
      "-  $conditional_component = isset($component['extra']['conditional_component']) && isset($node->webform['components'][$component['extra']['conditional_component']]) ? $node->webform['components'][$component['extra']['conditional_component']] : NULL;", 
      "-", 
      "-  // Check the rules for this entire page. Note individual page breaks are", 
      "-  // checked down below in the individual component rule checks.", 
      "-  $show_page = TRUE;", 
      "-  if ($component['page_num'] > 1 && $component['type'] != 'pagebreak') {", 
      "-    foreach ($node->webform['components'] as $cid => $page_component) {", 
      "-      if ($page_component['type'] == 'pagebreak' && $page_component['page_num'] == $page_num) {", 
      "-        $show_page = _webform_client_form_rule_check($node, $page_component, $page_num, $form_state, $submission);", 
      "-        break;", 
      "-      }", 
      "-    }", 
      "-  }", 
      "-", 
      "-  // Check any parents' visibility rules.", 
      "-  $show_parent = $show_page;", 
      "-  if ($show_parent && $component['pid'] && isset($node->webform['components'][$component['pid']])) {", 
      "-    $parent_component = $node->webform['components'][$component['pid']];", 
      "-    $show_parent = _webform_client_form_rule_check($node, $parent_component, $page_num, $form_state, $submission);", 
      "-  }", 
      "-", 
      "-  // Check the individual component rules.", 
      "-  $show_component = $show_parent;", 
      "-  if ($show_component && $component['page_num'] == $page_num && $conditional_component && strlen(trim($conditional_values))) {", 
      "-    $input_values = array();", 
      "-    if (isset($form_state)) {", 
      "-      $parents = webform_component_parent_keys($node, $conditional_component);", 
      "-      $input_value = isset($form_state['values']['submitted']) ? $form_state['values']['submitted'] : array();", 
      "-      foreach ($parents as $parent) {", 
      "-        if (isset($input_value[$parent])) {", 
      "-          $input_value = $input_value[$parent];", 
      "-        }", 
      "-        else {", 
      "-          $input_value = NULL;", 
      "-          break;", 
      "-        }", 
      "-      }", 
      "-      $input_values = is_array($input_value) ? array_keys($input_value) : array($input_value);", 
      "-    }", 
      "-    elseif (isset($submission)) {", 
      "-      $input_values = $submission->data[$conditional_component['cid']]['value'];", 
      "-    }", 
      "-", 
      "-    $test_values = array_map('trim', explode(\"\\n\", $conditional_values));", 
      "-    if (empty($input_values) && !empty($test_values)) {", 
      "-      $show_component = FALSE;", 
      "-    }", 
      "-    else {", 
      "-      foreach ($input_values as $input_value) {", 
      "-        if ($show_component = in_array($input_value, $test_values)) {", 
      "-          break;", 
      "-        }", 
      "-      }", 
      "-    }", 
      "-", 
      "-    if ($component['extra']['conditional_operator'] == '!=') {", 
      "-      $show_component = !$show_component;", 
      "-    }", 
      "-  }", 
      "-", 
      "-  return $show_component;", 
      "-}", 
      "", 
      "/**", 
      "* Add a component to a renderable array. Called recursively for fieldsets.", 
      "*", 
      "* This function assists in the building of the client form, as well as the", 
      "* display of results, and the text of e-mails.", 
      "@@ -1519,13 +1480,13 @@", 
      "*   Whether the form element properties should be filtered. Only set to FALSE", 
      "*   if needing the raw properties for editing.", 
      "*", 
      "* @see webform_client_form", 
      "* @see webform_submission_render", 
      "*/", 
      "-function _webform_client_form_add_component($component, $component_value, &$parent_fieldset, &$form, $submission, $format = 'form', $page_num = 0, $filter = TRUE) {", 
      "+function _webform_client_form_add_component($component, $component_value, &$parent_fieldset, &$form, &$js_settings, $submission, $format = 'form', $page_num = 0, $filter = TRUE) {", 
      "$cid = $component['cid'];", 
      "", 
      "// Load with submission information if necessary.", 
      "if ($format != 'form') {", 
      "// This component is display only.", 
      "$data = empty($submission->data[$cid]['value']) ? NULL : $submission->data[$cid]['value'];", 
      "@@ -1540,12 +1501,15 @@", 
      "if (!isset($display_element['#id'])) {", 
      "$display_element['#id'] = form_clean_id('edit-' . implode('-', $display_element['#parents']));", 
      "}", 
      "$parent_fieldset[$component['form_key']] = $display_element;", 
      "}", 
      "}", 
      "+  elseif ($component['page_num'] < $page_num) {", 
      "+    $js_settings['previousPagesFields'][$component['form_key']] = !is_null($component_value) ? $component_value[0] : $data;", 
      "+  }", 
      "elseif ($component['page_num'] == $page_num) {", 
      "// Add this user-defined field to the form (with all the values that are always available).", 
      "$data = isset($submission->data[$cid]['value']) ? $submission->data[$cid]['value'] : NULL;", 
      "if ($element = webform_component_invoke($component['type'], 'render', $component, $data, $filter)) {", 
      "$parent_fieldset[$component['form_key']] = $element;", 
      "", 
      "@@ -1555,12 +1519,28 @@", 
      "if (is_array($component_value)) {", 
      "foreach ($component_value as $key => $value) {", 
      "if (isset($parent_fieldset[$component['form_key']][$key])) {", 
      "$parent_fieldset[$component['form_key']][$key]['#default_value'] = $value;", 
      "}", 
      "}", 
      "+        }", 
      "+      }", 
      "+", 
      "+", 
      "+      if(!empty($component['extra']['condition'])){", 
      "+        $condition = json_decode($component['extra']['condition']);", 
      "+        if (!empty($condition->optype)) {", 
      "+          $js_settings['objects'][$component['form_key']] = array(", 
      "+            'type' => $component['type'],", 
      "+            'fieldsetId' => !empty($component['#parent_fieldsets']) ? implode('_', $component['#parent_fieldsets']) : '', // array_slice($parent_fieldset, 0, -1)),", 
      "+            'expression' => $condition,", 
      "+            'mandatory' => (bool)$component['extra']['conditional_mandatory'],", 
      "+          );", 
      "+        }", 
      "+        if($component['extra']['conditional_mandatory']){", 
      "+          $js_settings['mandatory'][] = $component['form_key'];", 
      "}", 
      "}", 
      "}", 
      "else {", 
      "drupal_set_message(t('The webform component @type is not able to be displayed', array('@type' => $component['type'])));", 
      "}", 
      "@@ -1573,13 +1553,16 @@", 
      "$parent_fieldset[$component['form_key']]['#webform_validated'] = FALSE;", 
      "}", 
      "", 
      "if (isset($component['children']) && is_array($component['children'])) {", 
      "foreach ($component['children'] as $scid => $subcomponent) {", 
      "$subcomponent_value = isset($component_value[$subcomponent['form_key']]) ? $component_value[$subcomponent['form_key']] : NULL;", 
      "-      _webform_client_form_add_component($subcomponent, $subcomponent_value, $parent_fieldset[$component['form_key']], $form, $submission, $format, $page_num, $filter);", 
      "+      $fieldsets = !empty($component['#parent_fieldsets']) ? $component['#parent_fieldsets'] : array();", 
      "+      $fieldsets[] = $component['form_key'];", 
      "+      $subcomponent['#parent_fieldsets'] = $fieldsets;", 
      "+      _webform_client_form_add_component($subcomponent, $subcomponent_value, $parent_fieldset[$component['form_key']], $form, $js_settings, $submission, $format, $page_num, $filter);", 
      "}", 
      "}", 
      "}", 
      "", 
      "function webform_client_form_validate($form, &$form_state) {", 
      "$node = node_load($form_state['values']['details']['nid']);", 
      "@@ -1595,15 +1578,59 @@", 
      "$error = theme('webform_view_messages', $node, 0, 1, 0, $limit_exceeded, array_keys(user_roles()));", 
      "form_set_error('', $error);", 
      "return;", 
      "}", 
      "}", 
      "", 
      "+  // Check conditional mandatory fields", 
      "+  _webform_client_form_conditional_mandatory_validate($form, $form_state);", 
      "+", 
      "// Run all #element_validate and #required checks. These are skipped initially", 
      "// by setting #validated = TRUE on all components when they are added.", 
      "_webform_client_form_validate($form, $form_state);", 
      "+}", 
      "+", 
      "+/**", 
      "+ * Check conditional mandatory fields - fields that should be filled in in case they are visible", 
      "+ *", 
      "+ * To avoid duplication in condition evaluation all calculation is done only on client side", 
      "+ * and pass fields that should be considered not mandatory with hidden field 'webform_conditional_mandatory'", 
      "+ *", 
      "+ * @param array $form", 
      "+ * @param array $form_state", 
      "+ */", 
      "+function _webform_client_form_conditional_mandatory_validate($form, $form_state) {", 
      "+  if (!empty($form_state['values']['webform_conditional_mandatory'])) {", 
      "+    $mandatory = explode('|', $form_state['values']['webform_conditional_mandatory']);", 
      "+    $values = _webform_flattern_submitted_tree($form_state['values']['submitted']);", 
      "+    foreach($mandatory as $name) {", 
      "+      if ($values[$name]['value'] == '') {", 
      "+        form_set_error('submitted][' . implode('][', $values[$name]['parents']) . $name, t('Field !name is required', array('!name' => $name)));", 
      "+      }", 
      "+    }", 
      "+  }", 
      "+}", 
      "+", 
      "+function _webform_flattern_submitted_tree($submitted, $parents = array()) {", 
      "+    $values = array();", 
      "+    if (!empty($submitted)) {", 
      "+        foreach ($submitted as $field => $val) {", 
      "+            if (is_array($val)) {", 
      "+                $next_parents = $parents;", 
      "+                array_push($next_parents, $field);", 
      "+                $values = array_merge($values, _webform_flattern_submitted_tree($val, $next_parents));", 
      "+            }", 
      "+            else {", 
      "+                $values[$field]['value'] = $val;", 
      "+                $values[$field]['parents'] = $parents;", 
      "+            }", 
      "+        }", 
      "+    }", 
      "+", 
      "+    return $values;", 
      "+", 
      "}", 
      "", 
      "/**", 
      "* Recursive validation function to trigger normal Drupal validation.", 
      "*", 
      "* This function imitates _form_validate in Drupal's form.inc, only it sets"
    ]
  ], 
  [
    "includes/webform.components.inc", 
    "includes/webform.components.inc", 
    [
      "", 
      "", 
      "Left base folder: C:\\Documents and Settings\\Olga\\My Documents\\Downloads\\webform-6.x-3.0-beta5(2)\\webform", 
      "Right base folder: C:\\xampp\\htdocs\\ogorun\\sites\\all\\modules\\webform", 
      "--- includes/webform.components.inc", 
      "+++ includes/webform.components.inc", 
      "@@ -420,72 +420,74 @@", 
      "'#description' => t('Optional. In the menu, the heavier items will sink and the lighter items will be positioned nearer the top.'),", 
      "'#weight' => 4,", 
      ");", 
      "", 
      "// Add conditional fields.", 
      "$conditional_components = array();", 
      "-  $counter = 0;", 
      "$last_pagebreak_slice = 0;", 
      "foreach ($node->webform['components'] as $cid => $test_component) {", 
      "// Only components before the pagebreak can be considered.", 
      "-    if ($test_component['type'] == 'pagebreak') {", 
      "-      $last_pagebreak_slice = $counter;", 
      "-    }", 
      "-    if (isset($component['cid']) && $cid == $component['cid']) {", 
      "+    if (isset($component['cid']) && $cid == $component['cid']) {", 
      "break;", 
      "}", 
      "if (webform_component_feature($test_component['type'], 'conditional')) {", 
      "-      $conditional_components[$cid] = $test_component;", 
      "+      $conditional_components[$test_component['form_key']] = $test_component['name'];", 
      "}", 
      "-    $counter++;", 
      "}", 
      "-  if ($component['type'] != 'pagebreak') {", 
      "-    $fieldset_description = t('Create a rule to control whether or not to skip this page.');", 
      "-  }", 
      "-  else {", 
      "-    $fieldset_description = t('Create a rule to control whether or not to show this form element.');", 
      "-  }", 
      "-  $conditional_components = array_slice($conditional_components, 0, $last_pagebreak_slice, TRUE);", 
      "$form['conditional'] = array(", 
      "'#weight' => 10,", 
      "'#type' => 'fieldset',", 
      "'#title' => t('Conditional rules'),", 
      "'#collapsible' => TRUE,", 
      "-    '#collapsed' => TRUE,", 
      "+    '#collapsed' => !$component['extra']['condition'],", 
      "'#description' => t('Create a rule to control whether or not to show this form element.'),", 
      "'#tree' => FALSE,", 
      ");", 
      "$form['conditional']['extra'] = array(", 
      "'#tree' => TRUE,", 
      ");", 
      "-  $form['conditional']['extra']['conditional_component'] = array(", 
      "-    '#type' => 'select',", 
      "-    '#title' => t('Component'),", 
      "-    '#options' => webform_component_list($node, $conditional_components, FALSE, TRUE),", 
      "-    '#description' => t('Select another component to decide whether to show or hide this component. You can only select components occurring before the most recent pagebreak.'),", 
      "-    '#default_value' => $component['extra']['conditional_component'],", 
      "+", 
      "+  $form['conditional']['extra']['condition'] = array(", 
      "+    '#type' => 'hidden',", 
      "+    '#default_value' => $component['extra']['condition']", 
      ");", 
      "-  $form['conditional']['extra']['conditional_operator'] = array(", 
      "-    '#type' => 'select',", 
      "-    '#title' => t('Operator'),", 
      "-    '#options' => array(", 
      "-      '=' => t('Is one of'),", 
      "-      '!=' => t('Is not one of')", 
      "-    ),", 
      "-    '#description' => t('Determines whether the list below is inclusive or exclusive.'),", 
      "-    '#default_value' => $component['extra']['conditional_operator'],", 
      "+", 
      "+  $form['conditional']['extra']['conditional_mandatory'] = array(", 
      "+    '#type' => 'checkbox',", 
      "+    '#title' => t('Conditional mandatory'),", 
      "+    '#default_value' => $component['extra']['conditional_mandatory']", 
      ");", 
      "-  $form['conditional']['extra']['conditional_values'] = array(", 
      "-    '#type' => 'textarea',", 
      "-    '#title' => t('Values'),", 
      "-    '#description' => t('List values, one per line, that will trigger this action. If you leave this blank, this component will always display.'),", 
      "-    '#default_value' => $component['extra']['conditional_values'],", 
      "+", 
      "+  $form['conditional']['extra']['constructor'] = array(", 
      "+     '#type' => 'markup',", 
      "+     '#value' => '<div id=\"webform-conditions-constructor\"></div>'", 
      ");", 
      "", 
      "if (empty($conditional_components)) {", 
      "$form['conditional']['#access'] = FALSE;", 
      "+  }", 
      "+  else {", 
      "+    $settings = array(", 
      "+      'webformConditionalSettings' => array(", 
      "+        'currentConditions' => $component['extra']['condition'] ? json_decode($component['extra']['condition']) : new StdClass(),", 
      "+        'lOperandFormElement' => 'select',", 
      "+        'availableLOperands' => $conditional_components,", 
      "+        'buttonFlags' => array(", 
      "+          'addElement' => true,", 
      "+          'addAndGroup' => true,", 
      "+          'addOrGroup' => true,", 
      "+          'showExpression' => true", 
      "+        ),", 
      "+      )", 
      "+    );", 
      "+    drupal_add_js($settings, 'setting');", 
      "+    $path = drupal_get_path('module','webform');", 
      "+    drupal_add_js($path . '/js/webform_conditional.js');", 
      "+    drupal_add_js($path . '/le/jquery.json-2.2.min.js');", 
      "+    drupal_add_js($path . '/le/le.conditionsConstructor.js');", 
      "+    drupal_add_css($path . '/le/conditions_constructor.css');", 
      "}", 
      "", 
      "// Add the fields specific to this component type:", 
      "$additional_form_elements = (array) webform_component_invoke($component['type'], 'edit', $component);", 
      "if (empty($additional_form_elements)) {", 
      "drupal_set_message(t('The webform component of type @type does not have an edit function defined.', array('@type' => $component['type'])));"
    ]
  ], 
  [
    "includes/webform.submissions.inc", 
    "includes/webform.submissions.inc", 
    [
      "", 
      "", 
      "Left base folder: C:\\Documents and Settings\\Olga\\My Documents\\Downloads\\webform-6.x-3.0-beta5(2)\\webform", 
      "Right base folder: C:\\xampp\\htdocs\\ogorun\\sites\\all\\modules\\webform", 
      "--- includes/webform.submissions.inc", 
      "+++ includes/webform.submissions.inc", 
      "@@ -223,13 +223,13 @@", 
      "$excluded_components = isset($email) ? $email['excluded_components'] : array();", 
      "", 
      "_webform_components_tree_build($node->webform['components'], $component_tree, 0, $page_count);", 
      "", 
      "// Recursively add components to the form.", 
      "foreach ($component_tree['children'] as $cid => $component) {", 
      "-    if (!in_array($cid, $excluded_components) && _webform_client_form_rule_check($node, $component, $component['page_num'], NULL, $submission)) {", 
      "+    if (!in_array($cid, $excluded_components)) {", 
      "_webform_client_form_add_component($component, NULL, $renderable, $renderable, $submission, $format);", 
      "}", 
      "}", 
      "", 
      "return drupal_render($renderable);", 
      "}"
    ]
  ], 
  [
    ".", 
    "js/webform_conditional.js", 
    [
      "", 
      "", 
      "Left base folder: C:\\Documents and Settings\\Olga\\My Documents\\Downloads\\webform-6.x-3.0-beta5(2)\\webform", 
      "Right base folder: C:\\xampp\\htdocs\\ogorun\\sites\\all\\modules\\webform", 
      "--- .", 
      "+++ js/webform_conditional.js", 
      "@@ -0,0 +1,97 @@", 
      "+Drupal.behaviors.webformCond = function(context) {", 
      "+  if (typeof Drupal.settings['webformConditional'] != 'undefined' && Drupal.settings['webformConditional']['objects']) {", 
      "+    var options = {", 
      "+      mandatoryFieldSelector: '#edit-webform-conditional-mandatory',", 
      "+      objectByName: function(name) {", 
      "+        return $('[name*=\"['+name+']\"]');", 
      "+      },", 
      "+      feldsetByName: function(name) {", 
      "+        return $('#webform-component-' + name);", 
      "+      },", 
      "+      getWrapper: function(name,info) {", 
      "+        if(info['type']=='fieldset' || info['type']=='markup'){", 
      "+          return $('#webform-component-' + name);", 
      "+        }", 
      "+        var cssName = name.replace(/_/g,\"-\");", 
      "+        if(info['fieldsetId']!=''){", 
      "+          cssName = info['fieldsetId'].replace(/_/g,\"-\") + \"-\" + cssName;", 
      "+        }", 
      "+", 
      "+        if (info['type'] == 'grid') {", 
      "+          return $('[name*=\\\"['+name+']\\\"]').parent('.form-item').parents('.form-item');", 
      "+        }", 
      "+        var cssId = \"#edit-submitted-\" + cssName + \"-wrapper\";", 
      "+        if($(cssId).length==0) {", 
      "+          cssId = \"#edit-submitted-\" + cssName + \"-1-wrapper\";", 
      "+          return $(cssId).parent().parent();", 
      "+        } else {", 
      "+          return $(cssId);", 
      "+        }", 
      "+      },", 
      "+      expression: $.le.defaultOptions.conditionalForm.expression", 
      "+    };", 
      "+", 
      "+", 
      "+    options.setMandatoryLikeView = function(name, info) {", 
      "+      var wrap = options.getWrapper(name, info).parent();", 
      "+      if (!wrap.find('label span.form-required').length) {", 
      "+        $('<span title=\"This field is required.\" class=\"form-required\">*</span>').appendTo(wrap.find('label'));", 
      "+      }", 
      "+    };", 
      "+", 
      "+    options.expression.operandHandler.left = function (val) {", 
      "+      var obj = options.objectByName(val);", 
      "+      if (obj.length) {", 
      "+          if(obj.filter('input:checked').length == 1) {", 
      "+            return obj.filter('input:checked').val();", 
      "+          } else if(obj.filter('input:checkbox,input:radio').length) {", 
      "+            return false;", 
      "+          } else if(obj.filter('option:selected').length == 1) {", 
      "+            return obj.filter('option:selected').val();", 
      "+          } else {", 
      "+            return obj.val();", 
      "+          }", 
      "+      }", 
      "+      else if (Drupal.settings.webformConditional.previousPagesFields[val]) {", 
      "+          return Drupal.settings.webformConditional.previousPagesFields[val];", 
      "+      }", 
      "+      else {", 
      "+          return false;", 
      "+      }", 
      "+", 
      "+    };", 
      "+", 
      "+    $.extend(options, Drupal.settings.webformConditional);", 
      "+", 
      "+    $('form.webform-client-form').leConditionalForm(options);", 
      "+  }", 
      "+};", 
      "+", 
      "+Drupal.behaviors.webformCondSettings = function(context) {", 
      "+", 
      "+    $('#webform-conditions-constructor:not(.webformCondSettings-processed)', context)", 
      "+    .addClass('webformCondSettings-processed')", 
      "+    .each(function() {", 
      "+    \tvar domObj = this;", 
      "+    \tvar $this = $(this);", 
      "+    \tvar options = Drupal.settings.webformConditionalSettings;", 
      "+    \toptions.defaultNewElement = function () {", 
      "+    \t\tvar el;", 
      "+    \t\tfor (el in options.availableLOperands) {", 
      "+    \t\t\tbreak;", 
      "+    \t\t}", 
      "+\t\t\treturn {", 
      "+\t\t\t\toptype: 'el',", 
      "+\t\t\t\tleft: el,", 
      "+\t\t\t\top:  'opEqual',", 
      "+\t\t\t\tright: '',", 
      "+\t\t\t\tneg: false", 
      "+\t\t\t};", 
      "+\t\t}", 
      "+    \tvar conditions = $this.leConstructor(Drupal.settings.webformConditionalSettings.currentConditions, options);", 
      "+", 
      "+    \t$('#webform-component-edit-form').submit(function () {", 
      "+    \t\t$('#edit-extra-condition').val(domObj.le.expression.getSerialised());", 
      "+    \t});", 
      "+    });", 
      "+};"
    ]
  ], 
  [
    ".", 
    "le/conditions_constructor.css", 
    [
      "", 
      "", 
      "Left base folder: C:\\Documents and Settings\\Olga\\My Documents\\Downloads\\webform-6.x-3.0-beta5(2)\\webform", 
      "Right base folder: C:\\xampp\\htdocs\\ogorun\\sites\\all\\modules\\webform", 
      "--- .", 
      "+++ le/conditions_constructor.css", 
      "@@ -0,0 +1,47 @@", 
      "+@CHARSET \"UTF-8\";", 
      "+.constructor ul, .constructor ul li{", 
      "+\tlist-style-image:url(\"icons/condition.png\");", 
      "+\tlist-style-type:square;", 
      "+\tbackground: none;", 
      "+/*\tpadding-left: 15px;*/", 
      "+}", 
      "+", 
      "+.constructor-group {", 
      "+\tpadding: 10px 20px;", 
      "+\tborder: 1px solid #DDE5EA;", 
      "+}", 
      "+", 
      "+.constructor ul.constructor-admin-links {", 
      "+\tdisplay: inline;", 
      "+\tlist-style-type:none;", 
      "+}", 
      "+", 
      "+.constructor .constructor-admin-links li {", 
      "+\t display: inline;", 
      "+\t padding: 0px 7px;", 
      "+\t/* background: white url(\"icons/add.png\") no-repeat; */", 
      "+}", 
      "+", 
      "+.conditions-constructor ul, .conditions-constructor ul li{", 
      "+\tlist-style-image:url(\"icons/condition.png\");", 
      "+\tlist-style-type:square;", 
      "+\tbackground: none;", 
      "+\tpadding-left: 15px;", 
      "+}", 
      "+", 
      "+.conditions-constructor-group {", 
      "+\tpadding: 10px 20px;", 
      "+\tborder: 1px solid #DDE5EA;", 
      "+}", 
      "+", 
      "+.conditions-constructor ul.conditions-constructor-admin-links {", 
      "+\tdisplay: inline;", 
      "+\tlist-style-image:url(\"icons/add.png\");", 
      "+\tlist-style-type:square;", 
      "+}", 
      "+", 
      "+.conditions-constructor .conditions-constructor-admin-links li {", 
      "+\t display: inline;", 
      "+\t padding: 0px 7px;", 
      "+\t/* background: white url(\"icons/add.png\") no-repeat; */", 
      "+}"
    ]
  ], 
  [
    ".", 
    "le/jquery.json-2.2.min.js", 
    [
      "\\ No newline at end of file", 
      "", 
      "", 
      "Left base folder: C:\\Documents and Settings\\Olga\\My Documents\\Downloads\\webform-6.x-3.0-beta5(2)\\webform", 
      "Right base folder: C:\\xampp\\htdocs\\ogorun\\sites\\all\\modules\\webform", 
      "--- .", 
      "+++ le/jquery.json-2.2.min.js", 
      "@@ -0,0 +1,31 @@", 
      "+", 
      "+(function($){$.toJSON=function(o)", 
      "+{if(typeof(JSON)=='object'&&JSON.stringify)", 
      "+return JSON.stringify(o);var type=typeof(o);if(o===null)", 
      "+return\"null\";if(type==\"undefined\")", 
      "+return undefined;if(type==\"number\"||type==\"boolean\")", 
      "+return o+\"\";if(type==\"string\")", 
      "+return $.quoteString(o);if(type=='object')", 
      "+{if(typeof o.toJSON==\"function\")", 
      "+return $.toJSON(o.toJSON());if(o.constructor===Date)", 
      "+{var month=o.getUTCMonth()+1;if(month<10)month='0'+month;var day=o.getUTCDate();if(day<10)day='0'+day;var year=o.getUTCFullYear();var hours=o.getUTCHours();if(hours<10)hours='0'+hours;var minutes=o.getUTCMinutes();if(minutes<10)minutes='0'+minutes;var seconds=o.getUTCSeconds();if(seconds<10)seconds='0'+seconds;var milli=o.getUTCMilliseconds();if(milli<100)milli='0'+milli;if(milli<10)milli='0'+milli;return'\"'+year+'-'+month+'-'+day+'T'+", 
      "+hours+':'+minutes+':'+seconds+'.'+milli+'Z\"';}", 
      "+if(o.constructor===Array)", 
      "+{var ret=[];for(var i=0;i<o.length;i++)", 
      "+ret.push($.toJSON(o[i])||\"null\");return\"[\"+ret.join(\",\")+\"]\";}", 
      "+var pairs=[];for(var k in o){var name;var type=typeof k;if(type==\"number\")", 
      "+name='\"'+k+'\"';else if(type==\"string\")", 
      "+name=$.quoteString(k);else", 
      "+continue;if(typeof o[k]==\"function\")", 
      "+continue;var val=$.toJSON(o[k]);pairs.push(name+\":\"+val);}", 
      "+return\"{\"+pairs.join(\", \")+\"}\";}};$.evalJSON=function(src)", 
      "+{if(typeof(JSON)=='object'&&JSON.parse)", 
      "+return JSON.parse(src);return eval(\"(\"+src+\")\");};$.secureEvalJSON=function(src)", 
      "+{if(typeof(JSON)=='object'&&JSON.parse)", 
      "+return JSON.parse(src);var filtered=src;filtered=filtered.replace(/\\\\[\"\\\\\\/bfnrtu]/g,'@');filtered=filtered.replace(/\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g,']');filtered=filtered.replace(/(?:^|:|,)(?:\\s*\\[)+/g,'');if(/^[\\],:{}\\s]*$/.test(filtered))", 
      "+return eval(\"(\"+src+\")\");else", 
      "+throw new SyntaxError(\"Error parsing JSON, source is not valid.\");};$.quoteString=function(string)", 
      "+{if(string.match(_escapeable))", 
      "+{return'\"'+string.replace(_escapeable,function(a)", 
      "+{var c=_meta[a];if(typeof c==='string')return c;c=a.charCodeAt();return'\\\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16);})+'\"';}", 
      "+return'\"'+string+'\"';};var _escapeable=/[\"\\\\\\x00-\\x1f\\x7f-\\x9f]/g;var _meta={'\\b':'\\\\b','\\t':'\\\\t','\\n':'\\\\n','\\f':'\\\\f','\\r':'\\\\r','\"':'\\\\\"','\\\\':'\\\\\\\\'};})(jQuery);"
    ]
  ], 
  [
    ".", 
    "le/le.conditionalFormFields.js", 
    [
      "\\ No newline at end of file", 
      "", 
      "", 
      "Left base folder: C:\\Documents and Settings\\Olga\\My Documents\\Downloads\\webform-6.x-3.0-beta5(2)\\webform", 
      "Right base folder: C:\\xampp\\htdocs\\ogorun\\sites\\all\\modules\\webform", 
      "--- .", 
      "+++ le/le.conditionalFormFields.js", 
      "@@ -0,0 +1,220 @@", 
      "+(function($) {", 
      "+    // setup a namespace for us", 
      "+    var nsp = 'le';", 
      "+\t$[nsp].conditionalForm = function(form, o){", 
      "+", 
      "+\t\tthis.formDomObj = form[0];", 
      "+\t\tvar that = this;", 
      "+\t\tvar _ = {", 
      "+\t\t\tdependencies: function(expression) {", 
      "+\t\t\t\tvar result = [];", 
      "+", 
      "+\t\t\t\tif (typeof expression['optype'] != 'undefined') {", 
      "+\t\t\t\t\tswitch (expression['optype']) {", 
      "+\t\t\t\t\t\tcase 'expr':", 
      "+\t\t\t\t\t\t\t$.each(expression.operands, function(key, operand) {", 
      "+\t\t\t\t\t\t\t\tresult = $.unique(result.concat(_.dependencies(operand)));", 
      "+\t\t\t\t\t\t\t});", 
      "+\t\t\t\t\t\t\tbreak;", 
      "+\t\t\t\t\t\tcase 'el':", 
      "+\t\t\t\t\t\t\tresult = [expression.left];", 
      "+\t\t\t\t\t\t\tbreak;", 
      "+\t\t\t\t\t}", 
      "+\t\t\t\t}", 
      "+", 
      "+\t\t\t\treturn result;", 
      "+\t\t\t},", 
      "+", 
      "+\t\t\tbuildDependencies: function (formFields) {", 
      "+\t\t\t\tvar dependents = {};", 
      "+", 
      "+\t\t\t\t$.each(formFields, function(dependentField, dependentInfo) {", 
      "+                                    var fieldObj = o.objectByName(dependentField);", 
      "+                                    if (fieldObj.length) {", 
      "+\t\t\t\t\tvar fields = _.dependencies(dependentInfo.expression);", 
      "+\t\t\t\t\t$.each(fields, function(key, field) {", 
      "+\t\t\t\t\t\tif (typeof dependents[field] == 'undefined') {", 
      "+\t\t\t\t\t\t\tdependents[field] = [dependentField];", 
      "+\t\t\t\t\t\t}", 
      "+\t\t\t\t\t\telse {", 
      "+\t\t\t\t\t\t\tdependents[field].push(dependentField);", 
      "+\t\t\t\t\t\t}", 
      "+\t\t\t\t\t});", 
      "+                                    }", 
      "+\t\t\t\t});", 
      "+", 
      "+\t\t\t\treturn dependents;", 
      "+\t\t\t},", 
      "+", 
      "+\t\t\tchangeFunction: function (name, info, mandatory) {", 
      "+\t\t\t\t//var o = that.formDomObj[nsp].options;", 
      "+\t\t\t\tvar obj = o.objectByName(name);", 
      "+\t\t\t\tvar wrap = o.getWrapper(name, info);", 
      "+\t\t\t\tif(obj[0][nsp].expression.evaluate()) {", 
      "+\t\t\t\t\t// show the hidden div", 
      "+\t\t\t\t\twrap.show(\"slow\");", 
      "+\t\t\t\t\t_.updateDependent(name, false, mandatory);", 
      "+\t\t\t\t}", 
      "+\t\t\t\telse {", 
      "+\t\t\t\t\t// otherwise, hide it", 
      "+\t\t\t\t\t_.clearDependent(name, info, mandatory);", 
      "+\t\t\t\t\twrap.css(\"display\", \"none\"); // hide() doesn't work if element is in hidden container", 
      "+\t\t\t\t}", 
      "+\t\t\t},", 
      "+", 
      "+\t\t\tupdateDependent: function(field, exclude, mandatoryList) {", 
      "+\t\t\t\t//var o = that.formDomObj[nsp].options;", 
      "+", 
      "+\t\t\t\tif (!o.mandatoryFieldSelector || !$(o.mandatoryFieldSelector, form).length) {", 
      "+\t\t\t\t\treturn;", 
      "+\t\t\t\t}", 
      "+", 
      "+\t\t\t\tif ($.inArray(field, mandatoryList) >  -1) {", 
      "+\t\t\t\t\tvar mandatory = $(o.mandatoryFieldSelector).val();", 
      "+\t\t\t\t\tmandatory = mandatory ? mandatory.split('|') : [];", 
      "+\t\t\t\t\tvar index = $.inArray(field, mandatory);", 
      "+\t\t\t\t\tif (index > -1 && exclude) { // add", 
      "+\t\t\t\t\t\tmandatory.splice(index, 1);", 
      "+\t\t\t\t\t}", 
      "+\t\t\t\t\telse if (index == -1 && !exclude) { // remove", 
      "+\t\t\t\t\t\tmandatory[mandatory.length] = field;", 
      "+\t\t\t\t\t}", 
      "+", 
      "+\t\t\t\t\t$(o.mandatoryFieldSelector).val(mandatory.join('|'));", 
      "+\t\t\t\t}", 
      "+\t\t\t},", 
      "+", 
      "+\t\t\tclearDependent: function(dependentField,dependentInfo, mandatory) {", 
      "+\t\t\t\t_.updateDependent(dependentField, true, mandatory);", 
      "+", 
      "+\t\t\t    if(dependentInfo['type']=='fieldset'){", 
      "+\t\t\t\t  // when hidding a fieldset clear all components inside it", 
      "+\t\t\t    \tvar fieldset = o.fieldsetByName(name);", 
      "+\t\t\t\t\t$('input[type=text], select, textarea', fieldset).val('').trigger('change');", 
      "+\t\t\t\t\t$('input[type=checkbox],input[type=radio]', fieldset).attr('checked', false).trigger('change');", 
      "+\t\t\t\t\treturn;", 
      "+\t\t\t\t }", 
      "+", 
      "+\t\t\t\tvar component = o.objectByName(dependentField);", 
      "+", 
      "+\t\t\t\t //make sure there are actually components - could be just markup", 
      "+\t\t\t\tif(component.length > 0){", 
      "+\t\t\t\t\t if((component[0].nodeName == 'INPUT' && component.attr('type') == 'text' )", 
      "+\t\t\t\t\t \t|| component[0].nodeName == 'SELECT'", 
      "+\t\t\t\t\t \t|| component[0].nodeName == 'TEXTAREA') {", 
      "+\t\t\t\t\t\t component.val('').trigger('change');", 
      "+\t\t\t\t\t }else if(component[0].nodeName == 'INPUT' &&", 
      "+\t\t\t\t\t\t\t(component.attr('type') == 'radio' || component.attr('type') == 'checkbox'  ) ){", 
      "+\t\t\t\t\t\t component.attr('checked', false).trigger('change');", 
      "+\t\t\t\t\t }", 
      "+\t\t\t\t }", 
      "+\t\t\t}", 
      "+\t\t};", 
      "+", 
      "+\t\tif (o.mandatoryFieldSelector && $(o.mandatoryFieldSelector, form).length) {", 
      "+\t\t\t$(o.mandatoryFieldSelector, form).val('');", 
      "+\t\t}", 
      "+\t\tvar dependents = _.buildDependencies(o.objects);", 
      "+\t\tvar expressionOpts = o.expression ? o.expression : {};", 
      "+", 
      "+\t\t$.each(o.objects, function(dependentField, dependentInfo) {", 
      "+\t\t\tvar fieldObj = o.objectByName(dependentField);", 
      "+\t\t\tif (fieldObj.length) {", 
      "+\t\t\t\tfieldObj[0][nsp] = {", 
      "+\t\t\t\t\t\texpression: new $[nsp].expression(dependentInfo.expression, expressionOpts)", 
      "+\t\t\t\t\t};", 
      "+", 
      "+\t\t\t\tvar formItemWrapper = o.getWrapper(dependentField,dependentInfo);", 
      "+\t\t\t\tif (formItemWrapper.length) {", 
      "+\t\t\t\t\tformItemWrapper.css(\"display\", \"none\");", 
      "+\t\t\t\t}", 
      "+\t\t\t\tif (dependentInfo['mandatory']) {", 
      "+\t\t\t\t\to.setMandatoryLikeView(dependentField, dependentInfo);", 
      "+\t\t\t\t}", 
      "+\t\t\t\t_.changeFunction(dependentField, dependentInfo, o.mandatory);", 
      "+\t\t\t}", 
      "+\t\t});", 
      "+", 
      "+\t\t$.each(dependents, function(field, dependentFieldNames) {", 
      "+\t\t\tvar components = o.objectByName(field);", 
      "+                        if (components.length) {", 
      "+\t\t\t  if(components.attr('type')=='radio' || components.attr('type')=='checkbox'){", 
      "+\t\t\t\tcomponents.click(changeFunction);", 
      "+\t\t\t  }else{", 
      "+\t\t\t\tcomponents.change(changeFunction);", 
      "+\t\t\t  }", 
      "+\t\t\t  components.change(changeFunction);", 
      "+                        }", 
      "+", 
      "+\t\t\tfunction changeFunction() {", 
      "+\t\t\t\t$.each(dependentFieldNames, function(key, name) {", 
      "+\t\t\t\t\t_.changeFunction(name, o.objects[name], o.mandatory);", 
      "+\t\t\t\t});", 
      "+\t\t\t};", 
      "+\t\t});", 
      "+\t};", 
      "+", 
      "+    $[nsp].defaultOptions.conditionalForm = {", 
      "+    \texpression: {", 
      "+\t\t\toperandHandler: {", 
      "+\t\t\t\tleft: function (val) {", 
      "+\t\t\t\t\tvar obj = $('[name=\"'+val+'\"]');", 
      "+\t\t\t\t\tif(obj.filter('input:checked').length == 1){", 
      "+\t\t\t\t\t\treturn obj.filter('input:checked').val();", 
      "+\t\t\t\t\t}else if(obj.filter('option:selected').length == 1){", 
      "+\t\t\t\t\t\treturn obj.filter('option:selected').val();", 
      "+\t\t\t\t\t}else {", 
      "+\t\t\t\t\t\treturn obj.val();", 
      "+\t\t\t\t\t}", 
      "+\t\t\t\t},", 
      "+\t\t\t\tright: function (val) {", 
      "+\t\t\t\t\treturn val;", 
      "+\t\t\t\t}", 
      "+    \t\t}", 
      "+    \t},", 
      "+    \tmandatoryFieldSelector: null,", 
      "+    \tobjectByName: function(name) {", 
      "+    \t\treturn $('[name=\"'+name+'\"]');", 
      "+    \t},", 
      "+    \tfeldsetByName: function(name) {", 
      "+    \t\t// suppose name stands for ID in case of fieldset", 
      "+    \t\treturn $('#' + name);", 
      "+    \t},", 
      "+    \tgetWrapper: function(name,info) {", 
      "+    \t\treturn $('[name=\"'+name+'\"]').parent();", 
      "+    \t},", 
      "+    \tsetMandatoryLikeView: function(name, info) {", 
      "+    \t\tvar wrap = $('[name=\"'+name+'\"').parent();", 
      "+    \t\tif (!wrap.find('label span.form-required').length) {", 
      "+    \t\t\t$('<span title=\"This field is required.\" class=\"form-required\">*</span>').appendTo(wrap.find('label'));", 
      "+    \t\t}", 
      "+    \t}", 
      "+    };", 
      "+", 
      "+    $.fn[nsp+'ConditionalForm'] = function(opts) {", 
      "+        var localOpts = $.extend(", 
      "+           {},", 
      "+           $[nsp].defaultOptions.conditionalForm,", 
      "+           opts", 
      "+        );", 
      "+", 
      "+        function conditionalForm() {", 
      "+\t        // $this to access the jQuery object", 
      "+\t        var $this = $(this);", 
      "+", 
      "+\t         // lets you override the options", 
      "+\t        // inside the dom objects class property", 
      "+\t        // requires the jQuery metadata plugin", 
      "+\t        // <div class=\"hello {color: 'red'}\">ddd</div>", 
      "+\t\t\tvar metaOpts = $.meta ? $.extend({}, localOpts, $this.data()) : localOpts;", 
      "+\t\t\tif (!this[nsp]) {", 
      "+\t\t\t\tthis[nsp] = {};", 
      "+\t\t\t}", 
      "+\t\t\tthis[nsp].options = metaOpts;", 
      "+\t        $[nsp].conditionalForm($this, this[nsp].options);", 
      "+        };", 
      "+", 
      "+        // run the action for each matching node", 
      "+        return this.each(conditionalForm);", 
      "+    };", 
      "+})(jQuery);"
    ]
  ], 
  [
    ".", 
    "le/le.conditionsConstructor.js", 
    [
      "\\ No newline at end of file", 
      "", 
      "", 
      "Left base folder: C:\\Documents and Settings\\Olga\\My Documents\\Downloads\\webform-6.x-3.0-beta5(2)\\webform", 
      "Right base folder: C:\\xampp\\htdocs\\ogorun\\sites\\all\\modules\\webform", 
      "--- .", 
      "+++ le/le.conditionsConstructor.js", 
      "@@ -0,0 +1,737 @@", 
      "+/* *********************************************************************", 
      "+jQuery Plugin: logicalExpression", 
      "+", 
      "+Conditions constructor is jquery plugin with two main purposes:", 
      "+ - Provide API for creation/changing/evaluation of arbitrary complicity logical expression", 
      "+ - Provide GUI for such expression building", 
      "+", 
      "+  @author Olga Gorun <ogorun@gmail.com>", 
      "+", 
      "+  TODO:", 
      "+  ======", 
      "+  *) Improve error handling", 
      "+  *) Make expression.obj - private field", 
      "+ ** **********************************************************************/", 
      "+;(function($) {", 
      "+    // setup a namespace for us", 
      "+    var nsp = 'le';", 
      "+", 
      "+   // Public Static Variables and Methods", 
      "+    $[nsp] = {", 
      "+", 
      "+\t\t//$.le.defaultOptions", 
      "+\t\tdefaultOptions: {", 
      "+\t\t},", 
      "+", 
      "+\t\t// $.le.expression", 
      "+\t\t// Base component class representing expression and its API", 
      "+\t\texpression: function (expr, options) {", 
      "+", 
      "+\t\t\t/**", 
      "+\t\t\t * @var obj", 
      "+\t\t\t *   - expression tree object", 
      "+\t\t\t *", 
      "+\t\t\t *   obj = <expr>", 
      "+\t\t\t *", 
      "+\t\t\t *   <expr> = <el> | <group>", 
      "+\t\t\t *", 
      "+\t\t\t *   <el> = {", 
      "+\t\t\t *       optype: 'el',", 
      "+\t\t\t *       left: <left operand value>,", 
      "+\t\t\t *       op: <operator name>,", 
      "+\t\t\t *       right: <right operand value>,", 
      "+\t\t\t *       neg: <negated flag>", 
      "+\t\t\t *  };", 
      "+\t\t\t *", 
      "+\t\t\t * <group> = {", 
      "+\t\t\t *       optype: 'expr',", 
      "+\t\t\t *       type: 'AND' | 'OR',", 
      "+\t\t\t *       neg: <negated flag>", 
      "+\t\t\t *       operands: [<expr1>, <expr2>, ...]", 
      "+\t\t\t *  };", 
      "+\t\t\t **/", 
      "+\t\t\tthis.obj = expr ? expr : null;", 
      "+", 
      "+\t\t\t/**", 
      "+\t\t\t * @var o", 
      "+\t\t\t *  - options", 
      "+\t\t\t **/", 
      "+\t\t\tthis.o = $.extend({}, $[nsp].defaultOptions.expression, options);", 
      "+", 
      "+\t\t\t////////////////////////////// API methods /////////////////////////////////", 
      "+", 
      "+\t\t\t/**", 
      "+\t\t\t * Return expression object", 
      "+\t\t\t **/", 
      "+\t\t\tthis.getExpression =  function() {", 
      "+\t\t\t\treturn this.obj;", 
      "+\t\t\t};", 
      "+", 
      "+\t\t\t/**", 
      "+\t\t\t * Returns serialized expression", 
      "+\t\t\t **/", 
      "+\t\t\tthis.getSerialised = function() {", 
      "+\t\t\t\treturn $.isFunction($.toJSON) ? $.toJSON(this.obj) : $.param(this.obj);", 
      "+\t\t\t};", 
      "+", 
      "+\t\t\t/**", 
      "+\t\t\t * Add simple element to expression", 
      "+\t\t\t *", 
      "+\t\t\t * @var level", 
      "+\t\t\t *    - Array containing 'path' to parent element", 
      "+\t\t\t * @var left", 
      "+\t\t\t *   - Left operand", 
      "+\t\t\t * @var op", 
      "+\t\t\t *  - Operator name", 
      "+\t\t\t * @var right", 
      "+\t\t\t *  - Right operand", 
      "+\t\t\t * @var negated", 
      "+\t\t\t *  - Negated flag", 
      "+\t\t\t **/", 
      "+\t\t\tthis.addElement = function(level, left, op, right, negated) {", 
      "+\t\t\t\tvar el = {", 
      "+\t\t\t\t\toptype: 'el',", 
      "+\t\t\t\t\tleft: left,", 
      "+\t\t\t\t\top: op,", 
      "+\t\t\t\t\tright: right,", 
      "+\t\t\t\t\tneg: (negated ? true : false)", 
      "+\t\t\t\t};", 
      "+", 
      "+\t\t\t\treturn _.addElement(level, el);", 
      "+\t\t\t};", 
      "+", 
      "+\t\t\t/**", 
      "+\t\t\t * Add new expression (group)  to expression.", 
      "+\t\t\t * AND or OR expression without operands", 
      "+\t\t\t *", 
      "+\t\t\t * @var level", 
      "+\t\t\t *    - Array containing 'path' to parent element", 
      "+\t\t\t * @var type", 
      "+\t\t\t *   - AND|OR", 
      "+\t\t\t * @var negated", 
      "+\t\t\t *  - Negated flag", 
      "+\t\t\t **/", 
      "+\t\t\tthis.addNewGroup = function(level, type, negated) {", 
      "+\t\t\t\tvar el = {", 
      "+\t\t\t\t\toptype: 'expr',", 
      "+\t\t\t\t\ttype: type,", 
      "+\t\t\t\t\tneg: (negated ? true : false),", 
      "+\t\t\t\t\toperands: []", 
      "+\t\t\t\t};", 
      "+", 
      "+\t\t\t\treturn _.addElement(level, el);", 
      "+\t\t\t};", 
      "+", 
      "+\t\t\t/**", 
      "+\t\t\t * Add expression given by object to expression.", 
      "+\t\t\t *", 
      "+\t\t\t * @var level", 
      "+\t\t\t *    - Array containing 'path' to parent element", 
      "+\t\t\t * @var expr", 
      "+\t\t\t *   - $.le.expression class object", 
      "+\t\t\t **/", 
      "+\t\t\tthis.addExpression = function(level, expr) {", 
      "+\t\t\t\treturn _.addElement(level, expr.getExpression());", 
      "+\t\t\t};", 
      "+", 
      "+\t\t\t/**", 
      "+\t\t\t  * Change expression element property", 
      "+\t\t\t *", 
      "+\t\t\t * @var level", 
      "+\t\t\t *    - Array containing 'path' to element", 
      "+\t\t\t * @var key", 
      "+\t\t\t *   - property name", 
      "+\t\t\t * @var val", 
      "+\t\t\t *   - property value", 
      "+\t\t\t  **/", 
      "+\t\t\tthis.changeElement = function(level, key, val) {", 
      "+\t\t\t\tvar el = _.findExpressionElement(level);", 
      "+\t\t\t\tif (!el) {", 
      "+\t\t\t\t\treturn false;", 
      "+\t\t\t\t}", 
      "+", 
      "+\t\t\t\tel[key] = val;", 
      "+\t\t\t\treturn true;", 
      "+\t\t\t};", 
      "+", 
      "+\t\t\t/**", 
      "+\t\t\t * Delete element from expression", 
      "+\t\t\t *", 
      "+\t\t\t * @var level", 
      "+\t\t\t *    - Array containing 'path' to element", 
      "+\t\t\t **/", 
      "+\t\t\tthis.deleteElement = function(level) {", 
      "+\t\t\t\tif (level.length > 1) {", 
      "+\t\t\t\t\tvar parentLevel = level.slice(0, -1);", 
      "+\t\t\t\t\tvar parent = _.findExpressionElement(parentLevel);", 
      "+\t\t\t\t\tif (!parent) {", 
      "+\t\t\t\t\t\treturn false;", 
      "+\t\t\t\t\t}", 
      "+\t\t\t\t\tif (parent.operands.length >= level[level.length -1]) {", 
      "+\t\t\t\t\t\tparent.operands.splice(level[level.length -1] - 1, 1);", 
      "+\t\t\t\t\t}", 
      "+\t\t\t\t}", 
      "+\t\t\t\telse {", 
      "+\t\t\t\t\tthis.obj = null;", 
      "+\t\t\t\t}", 
      "+", 
      "+\t\t\t\treturn true;", 
      "+\t\t\t};", 
      "+", 
      "+\t\t\t/**", 
      "+\t\t\t * Evaluates expression", 
      "+\t\t\t **/", 
      "+\t\t\tthis.evaluate = function() {", 
      "+\t\t\t\treturn _.evaluate(this.obj);", 
      "+\t\t\t};", 
      "+\t\t\t////////////////////////////// End of API methods /////////////////////////////////", 
      "+", 
      "+\t\t\tvar that = this;", 
      "+\t\t\tvar _ = {", 
      "+\t\t\t\tfindExpressionElement: function(levelArr) {", 
      "+\t\t\t\t\tvar i;", 
      "+", 
      "+\t\t\t\t\tvar test = that.obj;", 
      "+\t\t\t\t\tif (levelArr.length > 1) {", 
      "+\t\t\t\t\t\tfor (i = 1; i < levelArr.length; i++)", 
      "+\t\t\t\t\t\t{", 
      "+\t\t\t\t\t\t\tif (typeof test == 'object' && typeof test['optype'] == 'string') {", 
      "+\t\t\t\t\t\t\t\tswitch (test.optype) {", 
      "+\t\t\t\t\t\t\t\t\tcase 'expr':", 
      "+\t\t\t\t\t\t\t\t\t\ttest = test.operands[levelArr[i] - 1];", 
      "+\t\t\t\t\t\t\t\t\t\tbreak;", 
      "+\t\t\t\t\t\t\t\t\tcase 'el':", 
      "+\t\t\t\t\t\t\t\t\t\tif (i < levelArr.length - 1) {", 
      "+\t\t\t\t\t\t\t\t\t\t\treturn null;", 
      "+\t\t\t\t\t\t\t\t\t\t}", 
      "+\t\t\t\t\t\t\t\t}", 
      "+\t\t\t\t\t\t\t}", 
      "+\t\t\t\t\t\t}", 
      "+\t\t\t\t\t}", 
      "+", 
      "+\t\t\t\t\treturn test;", 
      "+\t\t\t\t},", 
      "+", 
      "+\t\t\t\taddElement: function (parentLevel, el) {", 
      "+\t\t\t\t\tvar parent;", 
      "+", 
      "+\t\t\t\t\tif (parentLevel[0] == '0') {", 
      "+\t\t\t\t\t\t// add to root as last element", 
      "+\t\t\t\t\t\tif (that.obj == null || typeof that.obj['optype'] != 'string') {", 
      "+\t\t\t\t\t\t\t//   1. empty tree", 
      "+\t\t\t\t\t\t\tthat.obj = el;", 
      "+\t\t\t\t\t\t}", 
      "+\t\t\t\t\t\telse {", 
      "+\t\t\t\t\t\t\t// not empty tree.", 
      "+\t\t\t\t\t\t\t// Rebuild it with new root AND expression with two operands:", 
      "+\t\t\t\t\t\t\t// - Previous root is first one", 
      "+\t\t\t\t\t\t\t// - New element is last one", 
      "+", 
      "+\t\t\t\t\t\t\tvar temp = that.o.defaultNewExpr();", 
      "+\t\t\t\t\t\t\ttemp.operands[0] = that.obj;", 
      "+\t\t\t\t\t\t\ttemp.operands[1] = el;", 
      "+\t\t\t\t\t\t\tthat.obj = temp;", 
      "+\t\t\t\t\t\t}", 
      "+\t\t\t\t\t}", 
      "+\t\t\t\t\telse {", 
      "+\t\t\t\t\t\t// add to group element with default properties", 
      "+\t\t\t\t\t\tparent = _.findExpressionElement(parentLevel);", 
      "+\t\t\t\t\t\tif (typeof parent['operands'] == 'undefined') {", 
      "+\t\t\t\t\t\t\treturn false;", 
      "+\t\t\t\t\t\t}", 
      "+\t\t\t\t\t\tparent.operands[parent.operands.length] = el;", 
      "+\t\t\t\t\t}", 
      "+", 
      "+\t\t\t\t\treturn true;", 
      "+\t\t\t\t},", 
      "+", 
      "+\t\t\t\tevaluate : function(e) {", 
      "+\t\t\t\t\tvar result = true;", 
      "+", 
      "+\t\t\t\t\tif (typeof e['optype'] != 'undefined') {", 
      "+\t\t\t\t\t\tswitch (e['optype']) {", 
      "+\t\t\t\t\t\t\tcase 'expr':", 
      "+\t\t\t\t\t\t\t\tif (e['type'] == 'AND') {", 
      "+\t\t\t\t\t\t\t\t\t$.each(e['operands'], function(key, operand) {", 
      "+\t\t\t\t\t\t\t\t\t\tresult = result && _.evaluate(operand);", 
      "+\t\t\t\t\t\t\t\t\t\tif (!result) { // optimization break in case of FALSE", 
      "+\t\t\t\t\t\t\t\t\t\t\treturn false;", 
      "+\t\t\t\t\t\t\t\t\t\t}", 
      "+\t\t\t\t\t\t\t\t\t});", 
      "+\t\t\t\t\t\t\t\t}", 
      "+\t\t\t\t\t\t\t\telse {", 
      "+\t\t\t\t\t\t\t\t\t// type == OR", 
      "+\t\t\t\t\t\t\t\t\tresult = false;", 
      "+\t\t\t\t\t\t\t\t\t$.each(e['operands'], function(key, operand) {", 
      "+\t\t\t\t\t\t\t\t\t\tresult = result || _.evaluate(operand);", 
      "+\t\t\t\t\t\t\t\t\t\tif (result) { // optimization break in case of TRUE", 
      "+\t\t\t\t\t\t\t\t\t\t\treturn false;", 
      "+\t\t\t\t\t\t\t\t\t\t}", 
      "+\t\t\t\t\t\t\t\t\t});", 
      "+\t\t\t\t\t\t\t\t}", 
      "+\t\t\t\t\t\t\t\tbreak;", 
      "+\t\t\t\t\t\t\tcase 'el':", 
      "+\t\t\t\t\t\t\t\tresult = _.match(e.left, e.right, e.op);", 
      "+\t\t\t\t\t\t\t\tbreak;", 
      "+\t\t\t\t\t\t}", 
      "+", 
      "+\t\t\t\t\t\tif (e.neg) {", 
      "+\t\t\t\t\t\t\tresult = !result;", 
      "+\t\t\t\t\t\t}", 
      "+\t\t\t\t\t}", 
      "+", 
      "+\t\t\t\t\treturn result;", 
      "+\t\t\t\t},", 
      "+", 
      "+\t\t\t\tmatch: function(left, right, op) {", 
      "+\t\t\t\t\tvar result = false;", 
      "+\t\t\t\t\tvar l = that.o.operandHandler.left(left);", 
      "+\t\t\t\t\tvar r = that.o.operandHandler.right(right);", 
      "+\t\t\t\t\tif ($.isFunction(that.o.ops[op]))", 
      "+\t\t\t\t\t{", 
      "+\t\t\t\t\t\tresult = that.o.ops[op](l, r);", 
      "+\t\t\t\t\t}", 
      "+\t\t\t\t\telse", 
      "+\t\t\t\t\t{", 
      "+\t\t\t\t\t\tresult = that.o.ops['opEqual'](l, r);", 
      "+\t\t\t\t\t}", 
      "+", 
      "+\t\t\t\t\treturn result;", 
      "+\t\t\t\t}", 
      "+\t\t\t};", 
      "+", 
      "+\t\t}", 
      "+\t};", 
      "+", 
      "+\tvar _ = {};", 
      "+", 
      "+\t// $.le.defaultOptions.expression", 
      "+\t$[nsp].defaultOptions.expression = {", 
      "+\t\tops: {", 
      "+\t\t\topEqual: function(val, sample) {", 
      "+\t\t\t\treturn val == sample;", 
      "+\t\t\t},", 
      "+", 
      "+\t\t\topLess: function(val, sample) {", 
      "+\t\t\t\treturn parseFloat(val) < parseFloat(sample);", 
      "+\t\t\t},", 
      "+", 
      "+\t\t\topLessOrEqual: function(val, sample) {", 
      "+\t\t\t\treturn parseFloat(val) <= parseFloat(sample);", 
      "+\t\t\t},", 
      "+", 
      "+\t\t\topGreater: function(val, sample) {", 
      "+\t\t\t\treturn parseFloat(val) > parseFloat(sample);", 
      "+\t\t\t},", 
      "+", 
      "+\t\t\topGreaterOrEqual: function(val, sample) {", 
      "+\t\t\t\treturn parseFloat(val) >= parseFloat(sample);", 
      "+\t\t\t},", 
      "+", 
      "+\t\t\topOneOf: function(val, sample) {", 
      "+\t\t\t\tvar pattern = new RegExp('^' + sample + '$');", 
      "+\t\t\t\treturn pattern.test(val);", 
      "+\t\t\t},", 
      "+", 
      "+\t\t\topStartsFrom: function(val, sample) {", 
      "+\t\t\t\tvar pattern = new RegExp('^' + sample);", 
      "+\t\t\t\treturn pattern.test(val);", 
      "+\t\t\t},", 
      "+", 
      "+\t\t\topEndsWith: function(val, sample) {", 
      "+\t\t\t\tvar pattern = new RegExp(sample + '$');", 
      "+\t\t\t\treturn pattern.test(val);", 
      "+\t\t\t},", 
      "+", 
      "+\t\t\topContains: function(val, sample) {", 
      "+\t\t\t\tvar pattern = new RegExp(sample);", 
      "+\t\t\t\treturn pattern.test(val);", 
      "+\t\t\t},", 
      "+", 
      "+\t\t\topEmpty: function(val, sample) {", 
      "+\t\t\t\treturn !val;", 
      "+\t\t\t}", 
      "+\t\t},", 
      "+\t\toperandHandler: {", 
      "+\t\t\tleft: function (val) {", 
      "+\t\t\t\treturn val;", 
      "+\t\t\t},", 
      "+\t\t\tright: function (val) {", 
      "+\t\t\t\treturn val;", 
      "+\t\t\t}", 
      "+\t\t},", 
      "+\t\tdefaultNewExpr: function() {", 
      "+\t\t\treturn {", 
      "+\t\t\t\toptype: 'expr',", 
      "+\t\t\t\ttype: 'AND',", 
      "+\t\t\t\tneg: false,", 
      "+\t\t\t\toperands: []", 
      "+\t\t\t};", 
      "+\t\t}", 
      "+\t};", 
      "+\t// end of $[nsp].expression class", 
      "+", 
      "+\t// $le.constructor", 
      "+\t$[nsp].constructor = function(container, expr, options){", 
      "+", 
      "+\t\tthis.renderElement = function(el, level, o) {", 
      "+\t\t\tvar left, right, operator, negated;", 
      "+", 
      "+\t\t\tif (o.lOperandFormElement == 'select') {", 
      "+\t\t\t\tleft = _.form.select('constructor_el_l_' + _.utils.classToNameDecorate(level), el.left, o.availableLOperands);", 
      "+\t\t\t}", 
      "+\t\t\telse {", 
      "+\t\t\t\tleft = _.form.input('constructor_el_l_' + _.utils.classToNameDecorate(level), el.left);", 
      "+\t\t\t}", 
      "+", 
      "+\t\t\tif (o.rOperandFormElement == 'select') {", 
      "+\t\t\t\tright = _.form.select('constructor_el_r_' + _.utils.classToNameDecorate(level), el.right, o.availableROperands);", 
      "+\t\t\t}", 
      "+\t\t\telse {", 
      "+\t\t\t\tright = _.form.input('constructor_el_r_' + _.utils.classToNameDecorate(level), el.right);", 
      "+\t\t\t}", 
      "+", 
      "+\t\t\toperator = _.form.select('constructor_el_op_' + _.utils.classToNameDecorate(level), el.op, o.availableOperators);", 
      "+\t\t\tnegated = _.form.checkbox('constructor_el_neg_' + _.utils.classToNameDecorate(level), 'Negated', el.neg);", 
      "+", 
      "+\t\t\treturn '<div class=\"constructor-el level-' + level + '\">' +", 
      "+\t\t\t\t\t\t' <span class=\"constructor-el-l\">' + left + '</span>' +", 
      "+\t\t\t\t\t\t' <span class=\"constructor-el-op\">' + operator + '</span>' +", 
      "+\t\t\t\t\t\t' <span class=\"constructor-el-r\">' + right + '</span>' +", 
      "+\t\t\t\t\t\t' <em class=\"constructor-el-negated\">' + negated + '</em>' +", 
      "+\t\t\t\t\t\t' <span><ul class=\"constructor-admin-links\">' +", 
      "+\t\t\t\t\t\t\t'<li><a href=\"\" class=\"constructor-admin-delete-el level-' + level + '\">Delete</a></li>' +", 
      "+\t\t\t\t\t\t'</ul></span>' +", 
      "+\t\t\t\t\t'</div>';", 
      "+\t\t};", 
      "+", 
      "+\t\tthis.renderGroup = function(el, level, o) {", 
      "+\t\t\tvar operands, negated, i;", 
      "+", 
      "+\t\t\tnegated = _.form.checkbox('constructor_group_neg_' + _.utils.classToNameDecorate(level), 'Negated', el.neg);", 
      "+", 
      "+\t\t\toperands = '';", 
      "+\t\t\tif (el.operands.length)\t{", 
      "+\t\t\t\toperands = '<ul>';", 
      "+\t\t\t\tfor (i = 0; i < el.operands.length; i++) {", 
      "+\t\t\t\t\toperands += '<li>' + _.renderTree(el.operands[i], level + '-' + (i+1), o) + '</li>';", 
      "+\t\t\t\t}", 
      "+\t\t\t\toperands += '</ul>';", 
      "+\t\t\t}", 
      "+", 
      "+\t\t\treturn '<div class=\"constructor-group type-' + el.type + ' level-' + level + '\">' +", 
      "+\t\t\t\t\t\t'<span class=\"constructor-group-label type-' + el.type + '\">' + el.type + '</span>' +", 
      "+\t\t\t\t\t\t' <em class=\"constructor-group-negated\">' + negated + '</em>' +", 
      "+\t\t\t\t\t\t  operands +", 
      "+\t\t\t\t\t\t'<ul class=\"constructor-admin-links\">' +", 
      "+\t\t\t\t\t\t\t'<li><a href=\"\" class=\"level-' + level + ' constructor-admin-delete-group\">Delete expression</a></li>' +", 
      "+\t\t\t\t\t\t\t'<li><a href=\"\" class=\"level-' + level + ' constructor-admin-add-el\">Add element</a></li>' +", 
      "+\t\t\t\t\t\t\t'<li><a href=\"\" class=\"level-' + level + ' constructor-admin-add-and-group\">Add <em>AND</em> expression</a></li>' +", 
      "+\t\t\t\t\t\t\t'<li><a href=\"\" class=\"level-' + level + ' constructor-admin-add-or-group\">Add <em>OR</em> expression</a></li>' +", 
      "+\t\t\t\t\t\t'</ul>' +", 
      "+\t\t\t\t\t'</div>';", 
      "+\t\t};", 
      "+", 
      "+\t\tvar that = this;", 
      "+\t\tvar _ = {", 
      "+\t\t\tthat: this,", 
      "+\t\t\tutils: {", 
      "+\t\t\t\tclassToNameDecorate: function(str) {", 
      "+\t\t\t\t\tstr= new String(str);", 
      "+\t\t\t\t\treturn str.replace(/-/g, '_');", 
      "+\t\t\t\t},", 
      "+", 
      "+\t\t\t\tgetLevelFromName: function(name) {", 
      "+\t\t\t\t\tvar test = name.match(/^[^0-9]+([0-9]+(_[0-9]+)*)$/);", 
      "+\t\t\t\t\tif (test) {", 
      "+\t\t\t\t\t\tlevel = test[1].split('_');", 
      "+\t\t\t\t\t\treturn level;", 
      "+\t\t\t\t\t}", 
      "+", 
      "+\t\t\t\t\treturn null;", 
      "+\t\t\t\t},", 
      "+", 
      "+\t\t\t\tgetLevelFromClass: function(className) {", 
      "+\t\t\t\t\tvar test = className.match(/[^0-9]+([0-9]+(-[0-9]+)*)/);", 
      "+\t\t\t\t\tif (test) {", 
      "+\t\t\t\t\t\tlevel = test[1].split('-');", 
      "+\t\t\t\t\t\treturn level;", 
      "+\t\t\t\t\t}", 
      "+", 
      "+\t\t\t\t\treturn null;", 
      "+\t\t\t\t},", 
      "+\t\t\t},", 
      "+", 
      "+\t\t\tform: {", 
      "+\t\t\t\tselect: function(name, value, options) {", 
      "+\t\t\t\t\tvar elementOptions = '';", 
      "+\t\t\t\t\tfor (i in options) {", 
      "+\t\t\t\t\t\telementOptions += '<option value=\"' + i + '\"' + (value == i ? ' selected' : '') + '>' + options[i] + '</option>';", 
      "+\t\t\t\t\t}", 
      "+\t\t\t\t\treturn  '<select name=\"' + name + '\">' + elementOptions + '</select>';", 
      "+\t\t\t\t},", 
      "+", 
      "+\t\t\t\tinput: function(name, value) {", 
      "+\t\t\t\t\treturn '<input type=\"text\" name=\"' + name + '\" value=\"' + value + '\" />';", 
      "+\t\t\t\t},", 
      "+", 
      "+\t\t\t\tcheckbox: function(name, label, checked) {", 
      "+\t\t\t\t\treturn '<label for=\"' + name + '\">' + label + '</label>' +", 
      "+\t\t\t\t\t'<input type=\"checkbox\" name=\"' + name + '\"' + (checked ? ' checked' : '') + ' />';", 
      "+\t\t\t\t}", 
      "+\t\t\t},", 
      "+", 
      "+\t\t\trenderTree: function(el, level, o) {", 
      "+\t\t\t\tvar content = '';", 
      "+", 
      "+\t\t\t\tif (el == null) {", 
      "+\t\t\t\t\treturn null;", 
      "+\t\t\t\t}", 
      "+", 
      "+\t\t\t\tswitch (el['optype']) {", 
      "+\t\t\t\t\tcase 'expr':", 
      "+\t\t\t\t\t\tcontent = that.renderGroup(el, level, o);", 
      "+\t\t\t\t\t\tbreak;", 
      "+\t\t\t\t\tcase 'el':", 
      "+\t\t\t\t\t\tcontent = that.renderElement(el, level, o);", 
      "+\t\t\t\t\t\tbreak;", 
      "+\t\t\t\t}", 
      "+", 
      "+\t\t\t\treturn '<ul>' + content + '</ul>';", 
      "+\t\t\t},", 
      "+", 
      "+\t\t\tbuildConstructor: function(container) {", 
      "+\t\t\t\tvar expr = container[nsp].expression;", 
      "+\t\t\t\tvar o = container[nsp].options;", 
      "+\t\t\t\tvar content = _.renderTree(expr.getExpression(), '1', o);", 
      "+", 
      "+\t\t\t\tvar links = [];", 
      "+\t\t\t\tif (o.buttonFlags['addElement']) {", 
      "+\t\t\t\t\tlinks[links.length] = '<a href=\"\" class=\"constructor-admin-add-el level-0\">Add element</a>';", 
      "+\t\t\t\t}", 
      "+\t\t\t\tif (o.buttonFlags['addAndGroup']) {", 
      "+\t\t\t\t\tlinks[links.length] = '<a href=\"\" class=\"constructor-admin-add-and-group level-0\">Add <em>AND</em> expression</a>';", 
      "+\t\t\t\t}", 
      "+\t\t\t\tif (o.buttonFlags['addOrGroup']) {", 
      "+\t\t\t\t\tlinks[links.length] = '<a href=\"\" class=\"constructor-admin-add-or-group level-0\">Add <em>OR</em> expression</a>';", 
      "+\t\t\t\t}", 
      "+\t\t\t\tif (o.buttonFlags['showExpression']) {", 
      "+\t\t\t\t\tlinks[links.length] = '<a href=\"\" class=\"constructor-admin-show-expression level-0\">Show expression</a>';", 
      "+\t\t\t\t}", 
      "+\t\t\t\tif (o.buttonFlags['evaluate']) {", 
      "+\t\t\t\t\tlinks[links.length] = '<a href=\"\" class=\"constructor-admin-evaluate level-0\">Evaluate</a>';", 
      "+\t\t\t\t}", 
      "+\t\t\t\tif (typeof o.buttons == 'array') {", 
      "+\t\t\t\t\tfor(var i = 0; i < o.buttons.length; i++) {", 
      "+\t\t\t\t\t\tlinks[links.length] = o.buttons[i];", 
      "+\t\t\t\t\t}", 
      "+\t\t\t\t}", 
      "+\t\t\t\tcontent = (content ? content : '<span>No conditiotions found</span>') +", 
      "+\t\t\t\t' <ul class=\"constructor-admin-links\">' +", 
      "+\t\t\t\t\t(links.length ? '<li>' + links.join('</li><li>') + '</li>' : '') +", 
      "+\t\t\t\t'</ul>';", 
      "+", 
      "+\t\t\t\tvar obj = $(container);", 
      "+\t\t\t\tobj.empty();", 
      "+\t\t\t\t$(content).appendTo(obj);", 
      "+\t\t\t\t_.appendHandlers(obj);", 
      "+\t\t\t},", 
      "+", 
      "+\t\t\thandlers: {", 
      "+\t\t\t\tchangeElement: function(domObj, name, key, val) {", 
      "+\t\t\t\t\tvar level = _.utils.getLevelFromName(name);", 
      "+\t\t\t\t\tdomObj[nsp].expression.changeElement(level, key, val);", 
      "+\t\t\t\t},", 
      "+", 
      "+\t\t\t\taddElement: function(domObj, link, type) {", 
      "+\t\t\t\t\tvar parentLevel = _.utils.getLevelFromClass(link.attr('class'));", 
      "+\t\t\t\t\tvar parent;", 
      "+\t\t\t\t\tvar newObj;", 
      "+", 
      "+\t\t\t\t\tswitch(type) {", 
      "+\t\t\t\t\t\tcase 'el':", 
      "+\t\t\t\t\t\t\tnewObj = domObj[nsp].options.defaultNewElement();", 
      "+\t\t\t\t\t\t\tbreak;", 
      "+\t\t\t\t\t\tcase 'and_expr':", 
      "+\t\t\t\t\t\t\tnewObj = domObj[nsp].options.defaultNewANDExpr();", 
      "+\t\t\t\t\t\t\tbreak;", 
      "+\t\t\t\t\t\tcase 'or_expr':", 
      "+\t\t\t\t\t\t\tnewObj = domObj[nsp].options.defaultNewORExpr();", 
      "+\t\t\t\t\t\t\tbreak;", 
      "+\t\t\t\t\t}", 
      "+", 
      "+\t\t\t\t\tdomObj[nsp].expression.addExpression(level, new $[nsp].expression(newObj));", 
      "+\t\t\t\t\t_.buildConstructor(domObj);", 
      "+\t\t\t\t},", 
      "+", 
      "+\t\t\t\tdeleteElement: function(domObj, link) {", 
      "+\t\t\t\t\tvar level = _.utils.getLevelFromClass(link.attr('class'));", 
      "+\t\t\t\t\tdomObj[nsp].expression.deleteElement(level);", 
      "+\t\t\t\t\t_.buildConstructor(domObj);", 
      "+\t\t\t\t}", 
      "+\t\t\t},", 
      "+", 
      "+\t\t\tappendHandlers: function(obj) {", 
      "+", 
      "+\t\t\t\t// Show Expression", 
      "+\t\t\t\t$('.constructor-admin-show-expression', obj).click(function() {", 
      "+\t\t\t\t\t//alert(getSerialisedExpression());", 
      "+\t\t\t\t\talert(obj[0][nsp].expression.getSerialised());", 
      "+\t\t\t\t\treturn false;", 
      "+\t\t\t\t});", 
      "+", 
      "+\t\t\t\t// Evaluate Expression", 
      "+\t\t\t\t$('.constructor-admin-evaluate', obj).click(function() {", 
      "+\t\t\t\t\talert(obj[0][nsp].expression.evaluate());", 
      "+\t\t\t\t\treturn false;", 
      "+\t\t\t\t});", 
      "+", 
      "+\t\t\t\t// Update status (update currentConditions object in memory)", 
      "+\t\t\t\t\t//negate element, group", 
      "+\t\t\t\t\t$('.constructor-el-negated input:checkbox, .constructor-group-negated input:checkbox', obj).click(function() {", 
      "+\t\t\t\t\t\t_.handlers.changeElement(obj[0], this.name, 'neg', this.checked);", 
      "+\t\t\t\t\t});", 
      "+", 
      "+\t\t\t\t\t//change left element", 
      "+\t\t\t\t\t$('.constructor-el-l input, .constructor-el-l select', obj).change(function() {", 
      "+\t\t\t\t\t\t_.handlers.changeElement(obj[0], this.name, 'left', $(this).val());", 
      "+\t\t\t\t\t});", 
      "+", 
      "+\t\t\t\t\t//change operator", 
      "+\t\t\t\t\t$('.constructor-el-op select', obj).change(function() {", 
      "+\t\t\t\t\t\t_.handlers.changeElement(obj[0], this.name, 'op', $(this).val());", 
      "+\t\t\t\t\t});", 
      "+", 
      "+\t\t\t\t\t//change right element", 
      "+\t\t\t\t\t$('.constructor-el-r input, .constructor-el-r select', obj).change(function() {", 
      "+\t\t\t\t\t\t_.handlers.changeElement(obj[0], this.name, 'right', $(this).val());", 
      "+\t\t\t\t\t});", 
      "+", 
      "+\t\t\t\t// Change tree", 
      "+\t\t\t\t\t// add element to group, tree", 
      "+\t\t\t\t\t$('.constructor-admin-add-el').click(function() {", 
      "+\t\t\t\t\t\t_.handlers.addElement(obj[0], $(this), 'el');", 
      "+\t\t\t\t\t\treturn false;", 
      "+\t\t\t\t\t});", 
      "+", 
      "+\t\t\t\t\t// group, tree add AND group", 
      "+\t\t\t\t\t$('.constructor-admin-add-and-group').click(function() {", 
      "+\t\t\t\t\t\t_.handlers.addElement(obj[0], $(this), 'and_expr');", 
      "+\t\t\t\t\t\treturn false;", 
      "+\t\t\t\t\t});", 
      "+", 
      "+\t\t\t\t\t// group, tree add OR group", 
      "+\t\t\t\t\t$('.constructor-admin-add-or-group').click(function() {", 
      "+\t\t\t\t\t\t_.handlers.addElement(obj[0], $(this), 'or_expr');", 
      "+\t\t\t\t\t\treturn false;", 
      "+\t\t\t\t\t});", 
      "+", 
      "+\t\t\t\t\t// delete el, group", 
      "+\t\t\t\t\t$('.constructor-admin-delete-el, .constructor-admin-delete-group').click(function() {", 
      "+\t\t\t\t\t\t_.handlers.deleteElement(obj[0], $(this));", 
      "+\t\t\t\t\t\treturn false;", 
      "+\t\t\t\t\t});", 
      "+\t\t\t}", 
      "+\t\t};", 
      "+", 
      "+\t\tif (!$(container).is('constructor')) {", 
      "+\t\t\t$(container).addClass('constructor');", 
      "+\t\t}", 
      "+", 
      "+\t\t_.buildConstructor(container);", 
      "+    };", 
      "+", 
      "+\t// _.getObjectFirstKey", 
      "+\t_.getObjectFirstKey =  function (data) {", 
      "+\t\tfor (var prop in data)", 
      "+\t\t\treturn prop;", 
      "+\t};", 
      "+", 
      "+    $[nsp].defaultOptions.constructor = {", 
      "+\t\tlOperandFormElement : 'input',", 
      "+\t\trOperandFormElement : 'input',", 
      "+\t\tavailableLOperands: null,", 
      "+\t\tavailableROperands: null,", 
      "+\t\tavailableOperators: {", 
      "+\t\t    opEqual: '=',", 
      "+\t\t    opLess: '&lt;',", 
      "+\t\t    opLessOrEqual: '&lt;=',", 
      "+\t\t    opGreater: '&gt;',", 
      "+\t\t    opGreaterOrEqual: '&gt;=',", 
      "+\t\t    opStartsFrom: 'starts from',", 
      "+\t\t    opEndsWith: 'ends with',", 
      "+\t\t    opContains: 'contains',", 
      "+\t\t    opEmpty: 'empty',", 
      "+\t\t    opOneOf: 'one of'", 
      "+\t\t},", 
      "+\t\tbuttonFlags: {", 
      "+\t\t\taddElement: true,", 
      "+\t\t\taddAndGroup: true,", 
      "+\t\t\taddOrGroup: true,", 
      "+\t\t\tshowExpression: true,", 
      "+\t\t\tevaluate: true", 
      "+\t\t},", 
      "+\t\tbuttons: null,", 
      "+\t\texpression : null,", 
      "+        defaultNewElement: function () {", 
      "+\t\t\treturn {", 
      "+\t\t\t    optype: 'el',", 
      "+\t\t\t    left: '',", 
      "+\t\t\t    op:  _.getObjectFirstKey($[nsp].defaultOptions.constructor.availableOperators),", 
      "+\t\t\t    right: '',", 
      "+\t\t\t    neg: false", 
      "+\t\t\t};", 
      "+\t\t},", 
      "+\t\tdefaultNewANDExpr: function () {", 
      "+\t\t\treturn {", 
      "+\t\t\t\toptype: 'expr',", 
      "+\t\t\t\ttype: 'AND',", 
      "+\t\t\t\tneg: false,", 
      "+\t\t\t\toperands: []", 
      "+\t\t\t};", 
      "+\t\t},", 
      "+\t\tdefaultNewORExpr: function () {", 
      "+\t\t\treturn {", 
      "+\t\t\t\toptype: 'expr',", 
      "+\t\t\t\ttype: 'OR',", 
      "+\t\t\t\tneg: false,", 
      "+\t\t\t\toperands: []", 
      "+\t\t\t};", 
      "+\t\t}", 
      "+    };", 
      "+\t// end of $[nsp].constructor class", 
      "+", 
      "+", 
      "+    // $(x).leConstructor(....)", 
      "+    $.fn[nsp+'Constructor'] = function(expression,opts) {", 
      "+        var localOpts = $.extend(", 
      "+            {},", 
      "+            $[nsp].defaultOptions.constructor,", 
      "+            opts", 
      "+        );", 
      "+", 
      "+        function constructor() {", 
      "+\t        // $this to access the jQuery object", 
      "+\t        var $this = $(this);", 
      "+", 
      "+\t         // lets you override the options", 
      "+\t        // inside the dom objects class property", 
      "+\t        // requires the jQuery metadata plugin", 
      "+\t        // <div class=\"hello {color: 'red'}\">ddd</div>", 
      "+\t\t\tvar metaOpts = $.meta ? $.extend({}, localOpts, $this.data()) : localOpts;", 
      "+\t\t\tvar expressionOpts = metaOpts.expression ? metaOpts.expression : {};", 
      "+", 
      "+\t       // per dom node context data", 
      "+\t\t\tif (!this[nsp]) {", 
      "+\t\t\t\tthis[nsp] = {};", 
      "+\t\t\t}", 
      "+\t        this[nsp].expression = new $[nsp].expression(expression, expressionOpts);", 
      "+\t\t\tthis[nsp].options = metaOpts;", 
      "+", 
      "+\t        $[nsp].constructor(this, this[nsp].expression, this[nsp].options);", 
      "+        };", 
      "+        // run the action for each matching node", 
      "+        return this.each(constructor);", 
      "+    };", 
      "+", 
      "+})(jQuery);"
    ]
  ]
]