PageRenderTime 195ms CodeModel.GetById 121ms app.highlight 15ms RepoModel.GetById 45ms app.codeStats 2ms

/promotor.php

https://bitbucket.org/izubizarreta/https-bitbucket.org-bityvip-alpes
PHP | 2938 lines | 2535 code | 322 blank | 81 comment | 697 complexity | 5c0b524c01f67522ce2ce29a2e80a4c9 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1<?php
  2
  3define( '_JEXEC', 1 );
  4
  5define('JPATH_BASE', dirname(__FILE__) );
  6
  7define( 'DS', DIRECTORY_SEPARATOR );
  8
  9require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
 10
 11require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
 12
 13
 14$mainframe =& JFactory::getApplication('site');
 15
 16?>
 17
 18<script src="/media/system/js/mootools-core.js" type="text/javascript"></script>
 19  <script src="/media/system/js/core.js" type="text/javascript"></script>
 20  <script src="/media/system/js/mootools-more.js" type="text/javascript"></script>
 21  <script src="/components/com_breezingforms/libraries/jquery/jq.min.js" type="text/javascript"></script>
 22  <script src="/components/com_breezingforms/libraries/jquery/tooltip.js" type="text/javascript"></script>
 23  <script src="/templates/beez5/javascript/md_stylechanger.js" type="text/javascript" defer="defer"></script>
 24  <script type="text/javascript">
 25<!--
 26			var inlineErrorElements = new Array();
 27			var bfSummarizers = new Array();
 28			var bfDeactivateField = new Array();
 29			var bfDeactivateSection = new Array();
 30			
 31			var toggleFieldsArray = [{ action: "turn", state: "off", tCat: "section", tName: "socio1", statement: "if", sName: "numero_socios", condition: "is", value: "value0" },{ action: "turn", state: "off", tCat: "section", tName: "socio2", statement: "if", sName: "numero_socios", condition: "is", value: "value0" },{ action: "turn", state: "off", tCat: "section", tName: "socio3", statement: "if", sName: "numero_socios", condition: "is", value: "value0" },{ action: "turn", state: "off", tCat: "section", tName: "socio4", statement: "if", sName: "numero_socios", condition: "is", value: "value0" },{ action: "turn", state: "off", tCat: "section", tName: "socio5", statement: "if", sName: "numero_socios", condition: "is", value: "value0" },{ action: "turn", state: "off", tCat: "section", tName: "socio6", statement: "if", sName: "numero_socios", condition: "is", value: "value0" },{ action: "turn", state: "off", tCat: "section", tName: "socio7", statement: "if", sName: "numero_socios", condition: "is", value: "value0" },{ action: "turn", state: "off", tCat: "section", tName: "socio8", statement: "if", sName: "numero_socios", condition: "is", value: "value0" },{ action: "turn", state: "off", tCat: "section", tName: "socio9", statement: "if", sName: "numero_socios", condition: "is", value: "value0" },{ action: "turn", state: "off", tCat: "section", tName: "socio10", statement: "if", sName: "numero_socios", condition: "is", value: "value0" },{ action: "turn", state: "off", tCat: "section", tName: "socio11", statement: "if", sName: "numero_socios", condition: "is", value: "value0" },{ action: "turn", state: "off", tCat: "section", tName: "socio12", statement: "if", sName: "numero_socios", condition: "is", value: "value0" },{ action: "turn", state: "on", tCat: "section", tName: "socio1", statement: "if", sName: "numero_socios", condition: "is", value: "value1" },{ action: "turn", state: "off", tCat: "section", tName: "socio2", statement: "if", sName: "numero_socios", condition: "is", value: "value1" },{ action: "turn", state: "off", tCat: "section", tName: "socio3", statement: "if", sName: "numero_socios", condition: "is", value: "value1" },{ action: "turn", state: "off", tCat: "section", tName: "socio4", statement: "if", sName: "numero_socios", condition: "is", value: "value1" },{ action: "turn", state: "off", tCat: "section", tName: "socio5", statement: "if", sName: "numero_socios", condition: "is", value: "value1" },{ action: "turn", state: "off", tCat: "section", tName: "socio6", statement: "if", sName: "numero_socios", condition: "is", value: "value1" },{ action: "turn", state: "off", tCat: "section", tName: "socio7", statement: "if", sName: "numero_socios", condition: "is", value: "value1" },{ action: "turn", state: "off", tCat: "section", tName: "socio8", statement: "if", sName: "numero_socios", condition: "is", value: "value1" },{ action: "turn", state: "off", tCat: "section", tName: "socio9", statement: "if", sName: "numero_socios", condition: "is", value: "value1" },{ action: "turn", state: "off", tCat: "section", tName: "socio10", statement: "if", sName: "numero_socios", condition: "is", value: "value1" },{ action: "turn", state: "off", tCat: "section", tName: "socio11", statement: "if", sName: "numero_socios", condition: "is", value: "value1" },{ action: "turn", state: "off", tCat: "section", tName: "socio12", statement: "if", sName: "numero_socios", condition: "is", value: "value1" },{ action: "turn", state: "on", tCat: "section", tName: "socio1", statement: "if", sName: "numero_socios", condition: "is", value: "value2" },{ action: "turn", state: "on", tCat: "section", tName: "socio2", statement: "if", sName: "numero_socios", condition: "is", value: "value2" },{ action: "turn", state: "off", tCat: "section", tName: "socio3", statement: "if", sName: "numero_socios", condition: "is", value: "value2" },{ action: "turn", state: "off", tCat: "section", tName: "socio4", statement: "if", sName: "numero_socios", condition: "is", value: "value2" },{ action: "turn", state: "off", tCat: "section", tName: "socio5", statement: "if", sName: "numero_socios", condition: "is", value: "value2" },{ action: "turn", state: "off", tCat: "section", tName: "socio6", statement: "if", sName: "numero_socios", condition: "is", value: "value2" },{ action: "turn", state: "off", tCat: "section", tName: "socio7", statement: "if", sName: "numero_socios", condition: "is", value: "value2" },{ action: "turn", state: "off", tCat: "section", tName: "socio8", statement: "if", sName: "numero_socios", condition: "is", value: "value2" },{ action: "turn", state: "off", tCat: "section", tName: "socio9", statement: "if", sName: "numero_socios", condition: "is", value: "value2" },{ action: "turn", state: "off", tCat: "section", tName: "socio10", statement: "if", sName: "numero_socios", condition: "is", value: "value2" },{ action: "turn", state: "off", tCat: "section", tName: "socio11", statement: "if", sName: "numero_socios", condition: "is", value: "value2" },{ action: "turn", state: "off", tCat: "section", tName: "socio12", statement: "if", sName: "numero_socios", condition: "is", value: "value2" },{ action: "turn", state: "on", tCat: "section", tName: "socio1", statement: "if", sName: "numero_socios", condition: "is", value: "value3" },{ action: "turn", state: "on", tCat: "section", tName: "socio2", statement: "if", sName: "numero_socios", condition: "is", value: "value3" },{ action: "turn", state: "on", tCat: "section", tName: "socio3", statement: "if", sName: "numero_socios", condition: "is", value: "value3" },{ action: "turn", state: "off", tCat: "section", tName: "socio4", statement: "if", sName: "numero_socios", condition: "is", value: "value3" },{ action: "turn", state: "off", tCat: "section", tName: "socio5", statement: "if", sName: "numero_socios", condition: "is", value: "value3" },{ action: "turn", state: "off", tCat: "section", tName: "socio6", statement: "if", sName: "numero_socios", condition: "is", value: "value3" },{ action: "turn", state: "off", tCat: "section", tName: "socio7", statement: "if", sName: "numero_socios", condition: "is", value: "value3" },{ action: "turn", state: "off", tCat: "section", tName: "socio8", statement: "if", sName: "numero_socios", condition: "is", value: "value3" },{ action: "turn", state: "off", tCat: "section", tName: "socio9", statement: "if", sName: "numero_socios", condition: "is", value: "value3" },{ action: "turn", state: "off", tCat: "section", tName: "socio10", statement: "if", sName: "numero_socios", condition: "is", value: "value3" },{ action: "turn", state: "off", tCat: "section", tName: "socio11", statement: "if", sName: "numero_socios", condition: "is", value: "value3" },{ action: "turn", state: "off", tCat: "section", tName: "socio12", statement: "if", sName: "numero_socios", condition: "is", value: "value3" },{ action: "turn", state: "on", tCat: "section", tName: "socio1", statement: "if", sName: "numero_socios", condition: "is", value: "value4" },{ action: "turn", state: "on", tCat: "section", tName: "socio2", statement: "if", sName: "numero_socios", condition: "is", value: "value4" },{ action: "turn", state: "on", tCat: "section", tName: "socio3", statement: "if", sName: "numero_socios", condition: "is", value: "value4" },{ action: "turn", state: "on", tCat: "section", tName: "socio4", statement: "if", sName: "numero_socios", condition: "is", value: "value4" },{ action: "turn", state: "off", tCat: "section", tName: "socio5", statement: "if", sName: "numero_socios", condition: "is", value: "value4" },{ action: "turn", state: "off", tCat: "section", tName: "socio6", statement: "if", sName: "numero_socios", condition: "is", value: "value4" },{ action: "turn", state: "off", tCat: "section", tName: "socio7", statement: "if", sName: "numero_socios", condition: "is", value: "value4" },{ action: "turn", state: "off", tCat: "section", tName: "socio8", statement: "if", sName: "numero_socios", condition: "is", value: "value4" },{ action: "turn", state: "off", tCat: "section", tName: "socio9", statement: "if", sName: "numero_socios", condition: "is", value: "value4" },{ action: "turn", state: "off", tCat: "section", tName: "socio10", statement: "if", sName: "numero_socios", condition: "is", value: "value4" },{ action: "turn", state: "off", tCat: "section", tName: "socio11", statement: "if", sName: "numero_socios", condition: "is", value: "value4" },{ action: "turn", state: "off", tCat: "section", tName: "socio12", statement: "if", sName: "numero_socios", condition: "is", value: "value4" },{ action: "turn", state: "on", tCat: "section", tName: "socio1", statement: "if", sName: "numero_socios", condition: "is", value: "value5" },{ action: "turn", state: "on", tCat: "section", tName: "socio2", statement: "if", sName: "numero_socios", condition: "is", value: "value5" },{ action: "turn", state: "on", tCat: "section", tName: "socio3", statement: "if", sName: "numero_socios", condition: "is", value: "value5" },{ action: "turn", state: "on", tCat: "section", tName: "socio4", statement: "if", sName: "numero_socios", condition: "is", value: "value5" },{ action: "turn", state: "on", tCat: "section", tName: "socio5", statement: "if", sName: "numero_socios", condition: "is", value: "value5" },{ action: "turn", state: "off", tCat: "section", tName: "socio6", statement: "if", sName: "numero_socios", condition: "is", value: "value5" },{ action: "turn", state: "off", tCat: "section", tName: "socio7", statement: "if", sName: "numero_socios", condition: "is", value: "value5" },{ action: "turn", state: "off", tCat: "section", tName: "socio8", statement: "if", sName: "numero_socios", condition: "is", value: "value5" },{ action: "turn", state: "off", tCat: "section", tName: "socio9", statement: "if", sName: "numero_socios", condition: "is", value: "value5" },{ action: "turn", state: "off", tCat: "section", tName: "socio10", statement: "if", sName: "numero_socios", condition: "is", value: "value5" },{ action: "turn", state: "off", tCat: "section", tName: "socio11", statement: "if", sName: "numero_socios", condition: "is", value: "value5" },{ action: "turn", state: "off", tCat: "section", tName: "socio12", statement: "if", sName: "numero_socios", condition: "is", value: "value5" },{ action: "turn", state: "on", tCat: "section", tName: "socio1", statement: "if", sName: "numero_socios", condition: "is", value: "value6" },{ action: "turn", state: "on", tCat: "section", tName: "socio2", statement: "if", sName: "numero_socios", condition: "is", value: "value6" },{ action: "turn", state: "on", tCat: "section", tName: "socio3", statement: "if", sName: "numero_socios", condition: "is", value: "value6" },{ action: "turn", state: "on", tCat: "section", tName: "socio4", statement: "if", sName: "numero_socios", condition: "is", value: "value6" },{ action: "turn", state: "on", tCat: "section", tName: "socio5", statement: "if", sName: "numero_socios", condition: "is", value: "value6" },{ action: "turn", state: "on", tCat: "section", tName: "socio6", statement: "if", sName: "numero_socios", condition: "is", value: "value6" },{ action: "turn", state: "off", tCat: "section", tName: "socio7", statement: "if", sName: "numero_socios", condition: "is", value: "value6" },{ action: "turn", state: "off", tCat: "section", tName: "socio8", statement: "if", sName: "numero_socios", condition: "is", value: "value6" },{ action: "turn", state: "off", tCat: "section", tName: "socio9", statement: "if", sName: "numero_socios", condition: "is", value: "value6" },{ action: "turn", state: "off", tCat: "section", tName: "socio10", statement: "if", sName: "numero_socios", condition: "is", value: "value6" },{ action: "turn", state: "off", tCat: "section", tName: "socio11", statement: "if", sName: "numero_socios", condition: "is", value: "value6" },{ action: "turn", state: "off", tCat: "section", tName: "socio12", statement: "if", sName: "numero_socios", condition: "is", value: "value6" },{ action: "turn", state: "on", tCat: "section", tName: "socio1", statement: "if", sName: "numero_socios", condition: "is", value: "value7" },{ action: "turn", state: "on", tCat: "section", tName: "socio2", statement: "if", sName: "numero_socios", condition: "is", value: "value7" },{ action: "turn", state: "on", tCat: "section", tName: "socio3", statement: "if", sName: "numero_socios", condition: "is", value: "value7" },{ action: "turn", state: "on", tCat: "section", tName: "socio4", statement: "if", sName: "numero_socios", condition: "is", value: "value7" },{ action: "turn", state: "on", tCat: "section", tName: "socio5", statement: "if", sName: "numero_socios", condition: "is", value: "value7" },{ action: "turn", state: "on", tCat: "section", tName: "socio6", statement: "if", sName: "numero_socios", condition: "is", value: "value7" },{ action: "turn", state: "on", tCat: "section", tName: "socio7", statement: "if", sName: "numero_socios", condition: "is", value: "value7" },{ action: "turn", state: "off", tCat: "section", tName: "socio8", statement: "if", sName: "numero_socios", condition: "is", value: "value7" },{ action: "turn", state: "off", tCat: "section", tName: "socio9", statement: "if", sName: "numero_socios", condition: "is", value: "value7" },{ action: "turn", state: "off", tCat: "section", tName: "socio10", statement: "if", sName: "numero_socios", condition: "is", value: "value7" },{ action: "turn", state: "off", tCat: "section", tName: "socio11", statement: "if", sName: "numero_socios", condition: "is", value: "value7" },{ action: "turn", state: "off", tCat: "section", tName: "socio12", statement: "if", sName: "numero_socios", condition: "is", value: "value7" },{ action: "turn", state: "on", tCat: "section", tName: "socio1", statement: "if", sName: "numero_socios", condition: "is", value: "value8" },{ action: "turn", state: "on", tCat: "section", tName: "socio2", statement: "if", sName: "numero_socios", condition: "is", value: "value8" },{ action: "turn", state: "on", tCat: "section", tName: "socio3", statement: "if", sName: "numero_socios", condition: "is", value: "value8" },{ action: "turn", state: "on", tCat: "section", tName: "socio4", statement: "if", sName: "numero_socios", condition: "is", value: "value8" },{ action: "turn", state: "on", tCat: "section", tName: "socio5", statement: "if", sName: "numero_socios", condition: "is", value: "value8" },{ action: "turn", state: "on", tCat: "section", tName: "socio6", statement: "if", sName: "numero_socios", condition: "is", value: "value8" },{ action: "turn", state: "on", tCat: "section", tName: "socio7", statement: "if", sName: "numero_socios", condition: "is", value: "value8" },{ action: "turn", state: "on", tCat: "section", tName: "socio8", statement: "if", sName: "numero_socios", condition: "is", value: "value8" },{ action: "turn", state: "off", tCat: "section", tName: "socio9", statement: "if", sName: "numero_socios", condition: "is", value: "value8" },{ action: "turn", state: "off", tCat: "section", tName: "socio10", statement: "if", sName: "numero_socios", condition: "is", value: "value8" },{ action: "turn", state: "off", tCat: "section", tName: "socio11", statement: "if", sName: "numero_socios", condition: "is", value: "value8" },{ action: "turn", state: "off", tCat: "section", tName: "socio12", statement: "if", sName: "numero_socios", condition: "is", value: "value8" },{ action: "turn", state: "on", tCat: "section", tName: "socio1", statement: "if", sName: "numero_socios", condition: "is", value: "value9" },{ action: "turn", state: "on", tCat: "section", tName: "socio2", statement: "if", sName: "numero_socios", condition: "is", value: "value9" },{ action: "turn", state: "on", tCat: "section", tName: "socio3", statement: "if", sName: "numero_socios", condition: "is", value: "value9" },{ action: "turn", state: "on", tCat: "section", tName: "socio4", statement: "if", sName: "numero_socios", condition: "is", value: "value9" },{ action: "turn", state: "on", tCat: "section", tName: "socio5", statement: "if", sName: "numero_socios", condition: "is", value: "value9" },{ action: "turn", state: "on", tCat: "section", tName: "socio6", statement: "if", sName: "numero_socios", condition: "is", value: "value9" },{ action: "turn", state: "on", tCat: "section", tName: "socio7", statement: "if", sName: "numero_socios", condition: "is", value: "value9" },{ action: "turn", state: "on", tCat: "section", tName: "socio8", statement: "if", sName: "numero_socios", condition: "is", value: "value9" },{ action: "turn", state: "on", tCat: "section", tName: "socio9", statement: "if", sName: "numero_socios", condition: "is", value: "value9" },{ action: "turn", state: "off", tCat: "section", tName: "socio10", statement: "if", sName: "numero_socios", condition: "is", value: "value9" },{ action: "turn", state: "off", tCat: "section", tName: "socio11", statement: "if", sName: "numero_socios", condition: "is", value: "value9" },{ action: "turn", state: "off", tCat: "section", tName: "socio12", statement: "if", sName: "numero_socios", condition: "is", value: "value9" },{ action: "turn", state: "on", tCat: "section", tName: "socio1", statement: "if", sName: "numero_socios", condition: "is", value: "value10" },{ action: "turn", state: "on", tCat: "section", tName: "socio2", statement: "if", sName: "numero_socios", condition: "is", value: "value10" },{ action: "turn", state: "on", tCat: "section", tName: "socio3", statement: "if", sName: "numero_socios", condition: "is", value: "value10" },{ action: "turn", state: "on", tCat: "section", tName: "socio4", statement: "if", sName: "numero_socios", condition: "is", value: "value10" },{ action: "turn", state: "on", tCat: "section", tName: "socio5", statement: "if", sName: "numero_socios", condition: "is", value: "value10" },{ action: "turn", state: "on", tCat: "section", tName: "socio6", statement: "if", sName: "numero_socios", condition: "is", value: "value10" },{ action: "turn", state: "on", tCat: "section", tName: "socio7", statement: "if", sName: "numero_socios", condition: "is", value: "value10" },{ action: "turn", state: "on", tCat: "section", tName: "socio8", statement: "if", sName: "numero_socios", condition: "is", value: "value10" },{ action: "turn", state: "on", tCat: "section", tName: "socio9", statement: "if", sName: "numero_socios", condition: "is", value: "value10" },{ action: "turn", state: "on", tCat: "section", tName: "socio10", statement: "if", sName: "numero_socios", condition: "is", value: "value10" },{ action: "turn", state: "off", tCat: "section", tName: "socio11", statement: "if", sName: "numero_socios", condition: "is", value: "value10" },{ action: "turn", state: "off", tCat: "section", tName: "socio12", statement: "if", sName: "numero_socios", condition: "is", value: "value10" },{ action: "turn", state: "on", tCat: "section", tName: "socio1", statement: "if", sName: "numero_socios", condition: "is", value: "value11" },{ action: "turn", state: "on", tCat: "section", tName: "socio2", statement: "if", sName: "numero_socios", condition: "is", value: "value11" },{ action: "turn", state: "on", tCat: "section", tName: "socio3", statement: "if", sName: "numero_socios", condition: "is", value: "value11" },{ action: "turn", state: "on", tCat: "section", tName: "socio4", statement: "if", sName: "numero_socios", condition: "is", value: "value11" },{ action: "turn", state: "on", tCat: "section", tName: "socio5", statement: "if", sName: "numero_socios", condition: "is", value: "value11" },{ action: "turn", state: "on", tCat: "section", tName: "socio6", statement: "if", sName: "numero_socios", condition: "is", value: "value11" },{ action: "turn", state: "on", tCat: "section", tName: "socio7", statement: "if", sName: "numero_socios", condition: "is", value: "value11" },{ action: "turn", state: "on", tCat: "section", tName: "socio8", statement: "if", sName: "numero_socios", condition: "is", value: "value11" },{ action: "turn", state: "on", tCat: "section", tName: "socio9", statement: "if", sName: "numero_socios", condition: "is", value: "value11" },{ action: "turn", state: "on", tCat: "section", tName: "socio10", statement: "if", sName: "numero_socios", condition: "is", value: "value11" },{ action: "turn", state: "on", tCat: "section", tName: "socio11", statement: "if", sName: "numero_socios", condition: "is", value: "value11" },{ action: "turn", state: "off", tCat: "section", tName: "socio12", statement: "if", sName: "numero_socios", condition: "is", value: "value11" },{ action: "turn", state: "on", tCat: "section", tName: "socio1", statement: "if", sName: "numero_socios", condition: "is", value: "value12" },{ action: "turn", state: "on", tCat: "section", tName: "socio2", statement: "if", sName: "numero_socios", condition: "is", value: "value12" },{ action: "turn", state: "on", tCat: "section", tName: "socio3", statement: "if", sName: "numero_socios", condition: "is", value: "value12" },{ action: "turn", state: "on", tCat: "section", tName: "socio4", statement: "if", sName: "numero_socios", condition: "is", value: "value12" },{ action: "turn", state: "on", tCat: "section", tName: "socio5", statement: "if", sName: "numero_socios", condition: "is", value: "value12" },{ action: "turn", state: "on", tCat: "section", tName: "socio6", statement: "if", sName: "numero_socios", condition: "is", value: "value12" },{ action: "turn", state: "on", tCat: "section", tName: "socio7", statement: "if", sName: "numero_socios", condition: "is", value: "value12" },{ action: "turn", state: "on", tCat: "section", tName: "socio8", statement: "if", sName: "numero_socios", condition: "is", value: "value12" },{ action: "turn", state: "on", tCat: "section", tName: "socio9", statement: "if", sName: "numero_socios", condition: "is", value: "value12" },{ action: "turn", state: "on", tCat: "section", tName: "socio10", statement: "if", sName: "numero_socios", condition: "is", value: "value12" },{ action: "turn", state: "on", tCat: "section", tName: "socio11", statement: "if", sName: "numero_socios", condition: "is", value: "value12" },{ action: "turn", state: "on", tCat: "section", tName: "socio12", statement: "if", sName: "numero_socios", condition: "is", value: "value12" }];
 32			String.prototype.beginsWith = function(t, i) { if (i==false) { return
 33			(t == this.substring(0, t.length)); } else { return (t.toLowerCase()
 34			== this.substring(0, t.length).toLowerCase()); } } 
 35			function bfDeactivateSectionFields(){
 36				for( var i = 0; i < bfDeactivateSection.length; i++ ){
 37                                        bfSetFieldValue(bfDeactivateSection[i], "off");
 38					JQuery("#"+bfDeactivateSection[i]+" .ff_elem").each(function(i){
 39                                            if( JQuery(this).get(0).name && JQuery(this).get(0).name.beginsWith("ff_nm_", true) ){
 40                                                bfDeactivateField[JQuery(this).get(0).name] = true;
 41                                            }
 42					});
 43				}
 44                                for( var i = 0; i < toggleFieldsArray.length; i++ ){
 45                                    if(toggleFieldsArray[i].state == "turn"){
 46                                        bfSetFieldValue(toggleFieldsArray[i].tName, "off");
 47                                    }
 48                                }
 49			}
 50			function bfToggleFields(state, tCat, tName, thisBfDeactivateField){
 51                                // maybe a little to harsh, but currently no other workaround
 52				// file uploads will be removed for the complete form if a rule is executed
 53				// make sure you offer file uploads at the end of your form if you have visibility rules!
 54				if(typeof bfFlashUploadInterval != "undefined"){
 55					window.clearInterval( bfFlashUploadInterval );
 56					for(qID in bfFlashUploadAll){
 57						try{
 58							JQuery(bfFlashUploadAll[qID]).uploadifyCancel(qID);
 59						}catch(e){}
 60					}
 61					bfFlashUploadTooLarge = {};
 62					bfFlashUploadAll = {};
 63					JQuery("#bfFileQueue").html("")
 64					JQuery(".bfFlashFileQueueClass").html("");
 65				}
 66				if(state == "on"){
 67					if(tCat == "element"){
 68                                                if( typeof JQuery("[name=\"ff_nm_"+tName+"[]\"]") != "undefined" && JQuery("[name=\"ff_nm_"+tName+"[]\"]").parent().attr("class").substr(0, 10) == "bfElemWrap" ){
 69                                                    JQuery("[name=\"ff_nm_"+tName+"[]\"]").parent().css("display", "");
 70                                                } else if(JQuery("[name=\"ff_nm_"+tName+"[]\"]").get(0).type == "checkbox" || JQuery("[name=\"ff_nm_"+tName+"[]\"]").get(0).type == "radio"){
 71                                                    JQuery("[name=\"ff_nm_"+tName+"[]\"]").parent().parent().css("display", "");
 72                                                }
 73						thisBfDeactivateField["ff_nm_"+tName+"[]"] = false;
 74                                                bfSetFieldValue(tName, "on");
 75					} else {
 76						JQuery("#"+tName).css("display", "");
 77                                                bfSetFieldValue(tName, "on");
 78						JQuery("#"+tName).find(".ff_elem").each(function(i){
 79                                                    if( JQuery(this).get(0).name && JQuery(this).get(0).name.beginsWith("ff_nm_", true) ){
 80                                                        thisBfDeactivateField[JQuery(this).get(0).name] = false;
 81                                                    }
 82						});
 83					}
 84				} else {
 85					if(tCat == "element"){
 86                                                if( typeof JQuery("[name=\"ff_nm_"+tName+"[]\"]") != "undefined" && JQuery("[name=\"ff_nm_"+tName+"[]\"]").parent().attr("class").substr(0, 10) == "bfElemWrap" ){
 87                                                    JQuery("[name=\"ff_nm_"+tName+"[]\"]").parent().css("display", "none");
 88                                                } else if(JQuery("[name=\"ff_nm_"+tName+"[]\"]").get(0).type == "checkbox" || JQuery("[name=\"ff_nm_"+tName+"[]\"]").get(0).type == "radio"){
 89                                                    JQuery("[name=\"ff_nm_"+tName+"[]\"]").parent().parent().css("display", "none");
 90                                                }
 91						thisBfDeactivateField["ff_nm_"+tName+"[]"] = true;
 92                                                bfSetFieldValue(tName, "off");
 93					} else {
 94						JQuery("#"+tName).css("display", "none");
 95                                                bfSetFieldValue(tName, "off");
 96						JQuery("#"+tName+" .ff_elem").each(function(i){
 97                                                    if( JQuery(this).get(0).name && JQuery(this).get(0).name.beginsWith("ff_nm_", true) ){
 98                                                        thisBfDeactivateField[JQuery(this).get(0).name] = true;
 99                                                    }
100						});
101					}
102				}
103			}
104                        function bfSetFieldValue(name, condition){
105                            for( var i = 0; i < toggleFieldsArray.length; i++ ){
106                                if( toggleFieldsArray[i].action == "if" ) {
107                                    if(name == toggleFieldsArray[i].tCat && condition == toggleFieldsArray[i].statement){
108
109                                        var element = JQuery("[name=\"ff_nm_"+toggleFieldsArray[i].condition+"[]\"]");
110                                        
111                                        switch(element.get(0).type){
112                                            case "text":
113                                            case "textarea":
114                                                if(toggleFieldsArray[i].value == "!empty"){
115                                                    element.val("");
116                                                } else {
117                                                    element.val(toggleFieldsArray[i].value);
118                                                }
119                                            break;
120                                            case "select-multiple":
121                                            case "select-one":
122                                                if(toggleFieldsArray[i].value == "!empty"){
123                                                    for(var j = 0; j < element.get(0).options.length; j++){
124                                                        element.get(0).options[j].selected = false;
125                                                    }
126                                                }
127                                                for(var j = 0; j < element.get(0).options.length; j++){
128                                                    if(element.get(0).options[j].value == toggleFieldsArray[i].value){
129                                                        element.get(0).options[j].selected = true;
130                                                    }
131                                                }
132                                            break;
133                                            case "radio":
134                                            case "checkbox":
135                                                var radioLength = element.size();
136                                                if(toggleFieldsArray[i].value == "!empty"){
137                                                    for(var j = 0; j < radioLength; j++){
138                                                        element.get(j).checked = false;
139                                                    }
140                                                }
141						for(var j = 0; j < radioLength; j++){
142                                                    if( element.get(j).value == toggleFieldsArray[i].value ){
143                                                        element.get(j).checked = true;
144                                                    }
145                                                }
146                                            break;
147                                        }
148                                    }
149                                }
150                            }
151                        }
152			function bfRegisterToggleFields(){
153                        
154                                var offset = 0;
155                                var last_offset = 0;
156                                var limit  = 10;
157                                var limit_cnt = 0;
158                                
159                                if( arguments.length == 1 ){
160                                    offset = arguments[0];
161                                }
162
163                                var thisToggleFieldsArray = toggleFieldsArray;
164				var thisBfDeactivateField = bfDeactivateField;
165                                var thisBfToggleFields = bfToggleFields;
166                                
167				for( var i = offset; limit_cnt < limit && i < toggleFieldsArray.length; i++ ){
168                                //  for( var i = 0; i < toggleFieldsArray.length; i++ ){
169                                              if( toggleFieldsArray[i].action == "turn" && (toggleFieldsArray[i].tCat == "element" || toggleFieldsArray[i].tCat == "section") ){
170						var toggleField = toggleFieldsArray[i];
171						var element = JQuery("[name=\"ff_nm_"+toggleFieldsArray[i].sName+"[]\"]");
172						if(element.get(0)){
173							switch(element.get(0).type){
174								case "text":
175								case "textarea":
176                                                                        JQuery("[name=\"ff_nm_"+toggleField.sName+"[]\"]").unbind("blur");
177									JQuery("[name=\"ff_nm_"+toggleField.sName+"[]\"]").blur(
178										function(){
179											for( var k = 0; k < thisToggleFieldsArray.length; k++ ){
180												var regExp = "";
181												if(thisToggleFieldsArray[k].value.beginsWith("!", true) && JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]"){
182										 			regExp = thisToggleFieldsArray[k].value.substring(1, thisToggleFieldsArray[k].value.length);
183										 		}
184
185                                                                                                if(thisToggleFieldsArray[k].condition == "isnot"){
186                                                                                                    if(
187                                                                                                            ( ( regExp != "" && JQuery(this).val().test(regExp) <= 0 ) || JQuery(this).val() != thisToggleFieldsArray[k].value ) && JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]"
188                                                                                                    ){
189                                                                                                            var names = thisToggleFieldsArray[k].tName.split(",");
190                                                                                                            for(var n = 0; n < names.length; n++){
191                                                                                                                thisBfToggleFields(thisToggleFieldsArray[k].state, thisToggleFieldsArray[k].tCat, JQuery.trim(names[n]), thisBfDeactivateField);
192                                                                                                            }
193                                                                                                            //break;
194                                                                                                    }
195                                                                                                } else if(thisToggleFieldsArray[k].condition == "is"){
196                                                                                                    if(
197                                                                                                            ( ( regExp != "" && JQuery(this).val().test(regExp) > 0 ) || JQuery(this).val() == thisToggleFieldsArray[k].value ) && JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]"
198                                                                                                    ){
199                                                                                                            var names = thisToggleFieldsArray[k].tName.split(",");
200                                                                                                            for(var n = 0; n < names.length; n++){
201                                                                                                                thisBfToggleFields(thisToggleFieldsArray[k].state, thisToggleFieldsArray[k].tCat, JQuery.trim(names[n]), thisBfDeactivateField);
202                                                                                                            }
203                                                                                                            //break;
204                                                                                                    }
205                                                                                                }
206											}
207										}
208									);
209									break;
210								case "select-multiple":
211								case "select-one":
212                                                                        JQuery("[name=\"ff_nm_"+toggleField.sName+"[]\"]").unbind("change");
213									JQuery("[name=\"ff_nm_"+toggleField.sName+"[]\"]").change(
214										function(){
215											var res = JQuery.isArray( JQuery(this).val() ) == false ? [ JQuery(this).val() ] : JQuery(this).val();
216											for( var k = 0; k < thisToggleFieldsArray.length; k++ ){
217												
218												// The or-case in lists 
219												var found = false;
220												var chkGrpValues = new Array();
221										 		if(thisToggleFieldsArray[k].value.beginsWith("#", true) && JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]"){
222										 			chkGrpValues = thisToggleFieldsArray[k].value.substring(1, thisToggleFieldsArray[k].value.length).split("|");
223										 			for(var l = 0; l < chkGrpValues.length; l++){
224										 				if( JQuery.inArray(chkGrpValues[l], res) != -1 ){
225										 					found = true;
226										 					break;
227										 				}
228										 			}
229										 		}
230												// the and-case in lists
231												var foundCount = 0;
232												chkGrpValues2 = new Array();
233										 		if(thisToggleFieldsArray[k].value.beginsWith("#", true) && JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]"){
234										 			chkGrpValues2 = thisToggleFieldsArray[k].value.substring(1, thisToggleFieldsArray[k].value.length).split(";");
235										 			for(var l = 0; l < res.length; l++){
236										 				if( JQuery.inArray(res[l], chkGrpValues2) != -1 ){
237										 					foundCount++;
238										 				}
239										 			}
240										 		}
241                                                                                                
242                                                                                                if(thisToggleFieldsArray[k].condition == "isnot"){
243                                                                                                
244                                                                                                    if(
245                                                                                                            (
246                                                                                                                    !JQuery.isArray(res) && JQuery(this).val() != thisToggleFieldsArray[k].value && JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]"
247                                                                                                            )
248                                                                                                            ||
249                                                                                                            (
250                                                                                                                    JQuery.isArray(res) && ( JQuery.inArray(thisToggleFieldsArray[k].value, res) == -1 || !found || ( foundCount == 0 || foundCount != chkGrpValues2.length ) ) && JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]"
251                                                                                                            )
252                                                                                                     ){
253                                                                                                            var names = thisToggleFieldsArray[k].tName.split(",");
254                                                                                                            for(var n = 0; n < names.length; n++){
255                                                                                                                thisBfToggleFields(thisToggleFieldsArray[k].state, thisToggleFieldsArray[k].tCat, JQuery.trim(names[n]), thisBfDeactivateField);
256                                                                                                            }
257                                                                                                            //break;
258                                                                                                    }
259                                                                                                } else if(thisToggleFieldsArray[k].condition == "is"){
260                                                                                                    if(
261                                                                                                            (
262                                                                                                                    !JQuery.isArray(res) && JQuery(this).val() == thisToggleFieldsArray[k].value && JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]"
263                                                                                                            )
264                                                                                                            ||
265                                                                                                            (
266                                                                                                                    JQuery.isArray(res) && ( JQuery.inArray(thisToggleFieldsArray[k].value, res) != -1 || found || ( foundCount != 0 && foundCount == chkGrpValues2.length ) ) && JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]"
267                                                                                                            )
268                                                                                                     ){
269                                                                                                            var names = thisToggleFieldsArray[k].tName.split(",");
270                                                                                                            for(var n = 0; n < names.length; n++){
271                                                                                                                thisBfToggleFields(thisToggleFieldsArray[k].state, thisToggleFieldsArray[k].tCat, JQuery.trim(names[n]), thisBfDeactivateField);
272                                                                                                            }
273                                                                                                            //break;
274                                                                                                    }
275                                                                                                }
276											}
277										}
278									);
279									break;
280								case "radio":
281								case "checkbox":
282									var radioLength = JQuery("[name=\"ff_nm_"+toggleField.sName+"[]\"]").size();
283									for(var j = 0; j < radioLength; j++){
284                                                                                 JQuery("#" + JQuery("[name=\"ff_nm_"+toggleField.sName+"[]\"]").get(j).id ).unbind("click");
285										 JQuery("#" + JQuery("[name=\"ff_nm_"+toggleField.sName+"[]\"]").get(j).id ).click(										 	
286										 	function(){
287										 		// NOT O(n^2) since its ony executed on click event!
288										 		for( var k = 0; k < thisToggleFieldsArray.length; k++ ){
289										 			
290										 			// used for complex checkbox group case below
291										 			var chkGrpValues = new Array();
292										 			if(JQuery(this).get(0).checked && thisToggleFieldsArray[k].value.beginsWith("#", true) && JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]"){
293										 				chkGrpValues = thisToggleFieldsArray[k].value.substring(1, thisToggleFieldsArray[k].value.length).split("|");
294										 			}
295
296                                                                                                        if(thisToggleFieldsArray[k].condition == "isnot"){
297
298                                                                                                            if(
299                                                                                                                    // simple radio case for selected value
300                                                                                                                    ( JQuery(this).get(0).type == "radio" && JQuery(this).get(0).checked && JQuery(this).val() != thisToggleFieldsArray[k].value && JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]" )
301                                                                                                                    ||
302                                                                                                                    // single checkbox case for checked/unchecked
303                                                                                                                    (
304                                                                                                                            JQuery(this).get(0).type == "checkbox" &&
305                                                                                                                            JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]" &&
306                                                                                                                            ( JQuery(this).get(0).checked && thisToggleFieldsArray[k].value != "!checked"
307                                                                                                                             ||
308                                                                                                                              JQuery(this).get(0).checked && thisToggleFieldsArray[k].value == "!unchecked"
309                                                                                                                            )
310                                                                                                                    )
311                                                                                                                    ||
312                                                                                                                    // complex checkbox/radio group case by multiple values
313                                                                                                                    (
314                                                                                                                            JQuery(this).get(0).checked && JQuery.inArray(JQuery(this).val(), chkGrpValues) == -1 && JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]"
315                                                                                                                    )
316                                                                                                                    ||
317                                                                                                                    // simple checkbox group case by single value
318                                                                                                                    (
319                                                                                                                            JQuery(this).get(0).type == "checkbox" && JQuery(this).get(0).checked && JQuery(this).val() != thisToggleFieldsArray[k].value && JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]"
320                                                                                                                    )
321                                                                                                            ){
322                                                                                                                    var names = thisToggleFieldsArray[k].tName.split(",");
323                                                                                                                    for(var n = 0; n < names.length; n++){
324                                                                                                                        thisBfToggleFields(thisToggleFieldsArray[k].state, thisToggleFieldsArray[k].tCat, JQuery.trim(names[n]), thisBfDeactivateField);
325                                                                                                                    }
326                                                                                                                    //break;
327                                                                                                            }
328                                                                                                        }
329                                                                                                        else
330                                                                                                        if(thisToggleFieldsArray[k].condition == "is"){
331                                                                                                            if(
332                                                                                                                    // simple radio case for selected value
333                                                                                                                    ( JQuery(this).get(0).type == "radio" && JQuery(this).get(0).checked && JQuery(this).val() == thisToggleFieldsArray[k].value && JQuery(this).get(0).name == "ff_nm_"+thisTog…

Large files files are truncated, but you can click here to view the full file