<?xml version="1.0"?>
<ZopeData>
  <record id="1" aka="AAAAAAAAAAE=">
    <pickle>
      <tuple>
        <global name="DTMLMethod" module="OFS.DTMLMethod"/>
        <tuple/>
      </tuple>
    </pickle>
    <pickle>
      <dictionary>
        <item>
            <key> <string>__ac_local_roles__</string> </key>
            <value>
              <none/>
            </value>
        </item>
        <item>
            <key> <string>__name__</string> </key>
            <value> <string>erp5.js</string> </value>
        </item>
        <item>
            <key> <string>_owner</string> </key>
            <value>
              <none/>
            </value>
        </item>
        <item>
            <key> <string>_vars</string> </key>
            <value>
              <dictionary/>
            </value>
        </item>
        <item>
            <key> <string>globals</string> </key>
            <value>
              <dictionary/>
            </value>
        </item>
        <item>
            <key> <string>raw</string> </key>
            <value> <string encoding="cdata"><![CDATA[

/*\n
Copyright (c) 20xx-2006 Nexedi SARL and Contributors. All Rights Reserved.\n
\n
This program is Free Software; you can redistribute it and/or\n
modify it under the terms of the GNU General Public License\n
as published by the Free Software Foundation; either version 2\n
of the License, or (at your option) any later version.\n
\n
This program is distributed in the hope that it will be useful,\n
but WITHOUT ANY WARRANTY; without even the implied warranty of\n
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n
GNU General Public License for more details.\n
\n
You should have received a copy of the GNU General Public License\n
along with this program; if not, write to the Free Software\n
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.\n
*/\n
\n
function submitAction(form, act) {\n
  form.action = act;\n
  form.submit();\n
}\n
\n
// This function will be called when the user click the save button. As \n
// submitAction function may have changed the action before, it\'s better to\n
// reset the form action to it\'s original behaviour. This is actually\n
// usefull when the user click the back button.\n
function clickSaveButton(act) {\n
  document.forms[0].action = act;\n
}\n
\n
\n
// The first input element with an "autofocus" class will get the focus,\n
// else if no element have autofocus class, the first element which is not the\n
// search field will get the focus. This is generally the title input text of\n
// a view\n
function autoFocus() {\n
  var first_autofocus_expr = ".//input[@class=\'autofocus\']"\n
  var FIRST_RESULT = XPathResult.FIRST_ORDERED_NODE_TYPE\n
\n
  var input = document.evaluate(first_autofocus_expr, document, null, FIRST_RESULT, null).singleNodeValue;\n
  if (input) {\n
    input.focus();\n
  }else{\n
    // The following is disabled, because it is too annoying to have an auto focus at everywhere.\n
    //var first_text_input_expr = ".//input[@type=\'text\'][@name != \'field_your_search_text\']"\n
    //var first_text_input = document.evaluate(first_text_input_expr, document, null, FIRST_RESULT, null).singleNodeValue;\n
    //if (first_text_input){\n
    //  first_text_input.focus();\n
    //}\n
  }\n
}\n
\n
function fixLeftRightHeight(){\n
  var lh = 0;\n
  var lfieldset;\n
  var rh = 0;\n
  var rfieldset;\n
  var list=document.getElementsByTagName(\'fieldset\');\n
  for(i=0; i<list.length; i=i+1){\n
    list_parts = list[i].id.split(\'_\');\n
    for(j=1; j<list_parts.length; j=j+1){\n
      if(list_parts[j] == "left"){\n
        lfieldset = list[i];\n
        lh = lfieldset.offsetHeight;\n
        break;\n
      }else{\n
        if(list_parts[j] == "right"){\n
          rfieldset = list[i];\n
          rh = rfieldset.offsetHeight;\n
          break;\n
        }\n
      }\n
    }\n
    if(lh && rh){\n
      break;\n
    }\n
  }\n
  if(lh && rh){\n
    lfieldset.style.height = (lh>rh)? lh+"px" : rh+"px";\n
    rfieldset.style.height = (lh>rh)? lh+"px" : rh+"px";\n
    lfieldset.style.borderRightWidth = 0;\n
    rfieldset.style.borderLeftWidth = 0;\n
    /* XXX: hardcoded values required unless there is a way to compute "12px"-"1px" in js */\n
    lfieldset.style.marginRight = "-11px";\n
    rfieldset.style.marginLeft = "-11px";\n
  }\n
}\n
\n
function fixLeftRightHeightAndFocus(fix_height) {\n
  if (fix_height == 1) {\n
    fixLeftRightHeight();\n
  }\n
  autoFocus();\n
}\n


]]></string> </value>
        </item>
        <item>
            <key> <string>title</string> </key>
            <value> <string></string> </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
