Example #1
0
	function edit($option, $tabpane, $pkg, &$row, &$lists, $caller)
	{
		global $ff_mossite, $ff_admsite, $ff_config;
		$action = $row->id ? BFText::_('COM_BREEZINGFORMS_FORMS_EDIT') : BFText::_('COM_BREEZINGFORMS_FORMS_ADD');
?>
		<script type="text/javascript" src="<?php echo $ff_admsite; ?>/admin/areautils.js"></script>
		<script type="text/javascript">
		<!--
		function checkNumber(value, msg1, msg2)
		{
			var nonDigits = /\D/;
			var error = '';
			if (value == '')
				error += msg1;
			else
			if (nonDigits.test(value))
				error += msg2;
			return error;
		} // checkNumber

		function checkIdentifier(value, msg1, msg2)
		{
			var invalidChars = /\W/;
			var error = '';
			if (value == '')
				error += msg1;
			else
				if (invalidChars.test(value))
					error += msg2;
			return error;
		} // checkIdentifier

		var bf_submitbutton = function(pressbutton)
		{
			var form = document.adminForm;
			var error = '';
			if (pressbutton != 'cancel') {
				if (form.title.value == '')
					error += "<?php echo BFText::_('COM_BREEZINGFORMS_FORMS_TITLEEMPTY'); ?>\n";
				error += checkIdentifier(
					form.name.value,
					"<?php echo BFText::_('COM_BREEZINGFORMS_FORMS_NAMEEMPTY'); ?>\n",
					"<?php echo BFText::_('COM_BREEZINGFORMS_FORMS_NAMEIDENT'); ?>\n"
				);
				error += checkNumber(
					form.width.value,
					"<?php echo BFText::_('COM_BREEZINGFORMS_FORMS_WIDTHEMPTY'); ?>\n",
					"<?php echo BFText::_('COM_BREEZINGFORMS_FORMS_WIDTHNUMBER'); ?>\n"
				);
				error += checkNumber(
					form.height.value,
					"<?php echo BFText::_('COM_BREEZINGFORMS_FORMS_HEIGHTEMPTY'); ?>\n",
					"<?php echo BFText::_('COM_BREEZINGFORMS_FORMS_HEIGHTNUMBER'); ?>\n"
				);
			} // if
			if (error != '')
				alert(error);
			else{
				if( typeof parent != "undefined" && pressbutton == 'cancel'){
					if(typeof parent.SqueezeBox != "undefined"){
						parent.SqueezeBox.close();
					} else {
						submitform( pressbutton );
					}
				} else {
					submitform( pressbutton );
				}	
			}
		}; // submitbutton

                if(typeof Joomla != 'undefined'){
                    Joomla.submitbutton = bf_submitbutton;
                }

                submitbutton = bf_submitbutton;

		function createInitCode()
		{
			form = document.adminForm;
			name = form.name.value;
			if (name=='') {
				alert("<?php echo BFText::_('COM_BREEZINGFORMS_FORMS_ENTNAMEFIRST'); ?>");
				return;
			} // if
			if (!confirm("<?php echo BFText::_('COM_BREEZINGFORMS_FORMS_CREATEINITNOW'); ?>\n<?php echo BFText::_('COM_BREEZINGFORMS_FORMS_EXISTINGAPPENDED'); ?>")) return;
			code =
				"function ff_"+name+"_init()\n"+
				"{\n"+
				"} // ff_"+name+"_init\n";
			oldcode = form.script1code.value;
			if (oldcode != '')
				form.script1code.value =
					code+
					"\n// -------------- <?php echo BFText::_('COM_BREEZINGFORMS_FORMS_OLDCODEBELOW'); ?> --------------\n\n"+
					oldcode;
			else
				form.script1code.value = code;
			codeAreaChange(form.script1code);
		} // createInitCode

		function createSubmittedCode()
		{
			form = document.adminForm;
			name = form.name.value;
			if (name=='') {
				alert("<?php echo BFText::_('COM_BREEZINGFORMS_FORMS_ENTNAMEFIRST'); ?>");
				return;
			} // if
			if (!confirm("<?php echo BFText::_('COM_BREEZINGFORMS_FORMS_CREATESUBMITTEDNOW'); ?>\n<?php echo BFText::_('COM_BREEZINGFORMS_FORMS_EXISTINGAPPENDED'); ?>")) return;
			code =
				"function ff_"+name+"_submitted(status, message)\n"+
				"{\n"+
				"    switch (status) {\n"+
				"        case FF_STATUS_OK:\n"+
				"           // do whatever desired on success\n"+
				"           break;\n"+
				"        case FF_STATUS_UNPUBLISHED:\n"+
				"        case FF_STATUS_SAVERECORD_FAILED:\n"+
				"        case FF_STATUS_SAVESUBRECORD_FAILED:\n"+
				"        case FF_STATUS_UPLOAD_FAILED:\n"+
				"        case FF_STATUS_ATTACHMENT_FAILED:\n"+
				"        case FF_STATUS_SENDMAIL_FAILED:\n"+
				"        default:\n"+
				"           alert(message);\n"+
				"    } // switch\n"+
				"} // ff_"+name+"_submitted\n";
			oldcode = form.script2code.value;
			if (oldcode != '')
				form.script2code.value =
					code+
					"\n// -------------- <?php echo BFText::_('COM_BREEZINGFORMS_FORMS_OLDCODEBELOW'); ?> --------------\n\n"+
					oldcode;
			else
				form.script2code.value = code;
			codeAreaChange(form.script2code);
		} // createSubmittedCode

		function dispheight(value)
		{
			switch (value) {
				case '0':
					document.getElementById('heightmargin').style.display = 'none';
					break;
				default:
					document.getElementById('heightmargin').style.display = '';
			} // switch
		} // dispheight

		function dispprevwidth()
		{
			var form = document.adminForm;
			if (form.widthmode.value=='0' || form.prevmode.value=='0')
				document.getElementById('prevwidthvalue').style.display = 'none';
			else
				document.getElementById('prevwidthvalue').style.display = '';
		} // dispprevwidth

		function dispinit(value)
		{
			if(document.getElementById) {
				switch (value) {
					case '1':
						document.getElementById('initlib').style.display = '';
						document.getElementById('initcode').style.display = 'none';
						break;
					case '2':
						document.getElementById('initlib').style.display = 'none';
						document.getElementById('initcode').style.display = '';
						break;
					default:
						document.getElementById('initlib').style.display = 'none';
						document.getElementById('initcode').style.display = 'none';
				} // switch
			} // if
		} // dispinit

		function dispsubmitted(value)
		{
			if(document.getElementById) {
				switch (value) {
					case '1':
						document.getElementById('submittedlib').style.display = '';
						document.getElementById('submittedcode').style.display = 'none';
						break;
					case '2':
						document.getElementById('submittedlib').style.display = 'none';
						document.getElementById('submittedcode').style.display = '';
						break;
					default:
						document.getElementById('submittedlib').style.display = 'none';
						document.getElementById('submittedcode').style.display = 'none';
				} // switch
			} // if
		} // dispsubmitted

		function dispemail(value)
		{
			if(document.getElementById) {
				switch (value) {
					case '0':
						document.getElementById('emaillogging').style.display = 'none';
						document.getElementById('emailattachment').style.display = 'none';
						document.getElementById('emailaddress').style.display = 'none';
						break;
					case '1':
						document.getElementById('emaillogging').style.display = '';
						document.getElementById('emailattachment').style.display = '';
						document.getElementById('emailaddress').style.display = 'none';
						break;
					default:
						document.getElementById('emaillogging').style.display = '';
						document.getElementById('emailattachment').style.display = '';
						document.getElementById('emailaddress').style.display = '';
				} // switch
			} // if
		} // dispemail

		function dispp1(value)
		{
			if(document.getElementById) {
				switch (value) {
					case '1':
						document.getElementById('p1lib').style.display = '';
						document.getElementById('p1code').style.display = 'none';
						break;
					case '2':
						document.getElementById('p1lib').style.display = 'none';
						document.getElementById('p1code').style.display = '';
						break;
					default:
						document.getElementById('p1lib').style.display = 'none';
						document.getElementById('p1code').style.display = 'none';
				} // switch
			} // if
		} // dispp1

		function dispp2(value)
		{
			if(document.getElementById) {
				switch (value) {
					case '1':
						document.getElementById('p2lib').style.display = '';
						document.getElementById('p2code').style.display = 'none';
						break;
					case '2':
						document.getElementById('p2lib').style.display = 'none';
						document.getElementById('p2code').style.display = '';
						break;
					default:
						document.getElementById('p2lib').style.display = 'none';
						document.getElementById('p2code').style.display = 'none';
				} // switch
			} // if
		} // dispp2

		function dispp3(value)
		{
			if(document.getElementById) {
				switch (value) {
					case '1':
						document.getElementById('p3lib').style.display = '';
						document.getElementById('p3code').style.display = 'none';
						break;
					case '2':
						document.getElementById('p3lib').style.display = 'none';
						document.getElementById('p3code').style.display = '';
						break;
					default:
						document.getElementById('p3lib').style.display = 'none';
						document.getElementById('p3code').style.display = 'none';
				} // switch
			} // if
		} // dispp3

		function dispp4(value)
		{
			if(document.getElementById) {
				switch (value) {
					case '1':
						document.getElementById('p4lib').style.display = '';
						document.getElementById('p4code').style.display = 'none';
						break;
					case '2':
						document.getElementById('p4lib').style.display = 'none';
						document.getElementById('p4code').style.display = '';
						break;
					default:
						document.getElementById('p4lib').style.display = 'none';
						document.getElementById('p4code').style.display = 'none';
				} // switch
			} // if
		} // dispp4

		onload = function()
		{
<?php
			if ($row->script1cond!=0) echo "\t\t\tdispinit('".$row->script1cond."');\n";
			if ($row->script2cond!=0) echo "\t\t\tdispsubmitted('".$row->script2cond."');\n";
			if ($row->piece1cond !=0) echo "\t\t\tdispp1('".$row->piece1cond."');\n";
			if ($row->piece2cond !=0) echo "\t\t\tdispp2('".$row->piece2cond."');\n";
			if ($row->piece3cond !=0) echo "\t\t\tdispp3('".$row->piece3cond."');\n";
			if ($row->piece4cond !=0) echo "\t\t\tdispp4('".$row->piece4cond."');\n";
			switch ($tabpane) {
				case 1:
				case 2:
				case 3:
					echo "\t\t\ttabPane1.setSelectedIndex($tabpane);\n";
					break;
				default:
					echo "\t\t\tdocument.adminForm.title.focus();\n";
			} // switch
?>
			codeAreaAdd('script1code', 'script1lines');
			codeAreaAdd('script2code', 'script2lines');
			codeAreaAdd('piece1code',  'piece1lines');
			codeAreaAdd('piece2code',  'piece2lines');
			codeAreaAdd('piece3code',  'piece3lines');
			codeAreaAdd('piece4code',  'piece4lines');
		} // onload
		//-->
		</script>
		<div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>
		<script type="text/javascript" src="<?php echo $ff_mossite; ?>/includes/js/overlib_mini.js"></script>
		<form action="index.php?format=html" method="post" name="adminForm" id="adminForm" class="adminForm">
		<table cellpadding="4" cellspacing="1" border="0" class="adminform" style="width:780px;">
			<tr><th colspan="3" class="title">BreezingForms - <?php echo $action; ?></th></tr>
			<tr>
				<td></td>
				<td width="100%">
<?php
		$tabs = new BFTabs(0);
		$tabs->startPane('editPane');
		$tabs->startTab(BFText::_('COM_BREEZINGFORMS_FORMS_SETTINGS'),'tab_settings');
?>
			<table class="adminform">
			<tr>
				<td></td>
				<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_TITLE'); ?>:</td>
				<td nowrap>
					<input type="text" size="50" maxlength="50" name="title" value="<?php echo $row->title; ?>" class="inputbox"/>
<?php
					echo bf_ToolTip(BFText::_('COM_BREEZINGFORMS_FORMS_TIPTITLE'));
?>
				</td>
				<td></td>
			</tr>

			<tr>
				<td></td>
				<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_PACKAGE'); ?>:</td>
				<td nowrap>
					<input type="text" size="30" maxlength="30" id="package" name="package" value="<?php echo $row->package; ?>" class="inputbox"/>
				</td>
				<td></td>
			</tr>

			<tr>
				<td></td>
				<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_NAME'); ?>:</td>
				<td nowrap>
					<input type="text" size="30" maxlength="30" name="name" value="<?php echo $row->name; ?>" class="inputbox"/>
<?php
					echo bf_ToolTip(BFText::_('COM_BREEZINGFORMS_FORMS_TIPNAME'));
?>
				</td>
				<td></td>
			</tr>
			
			<tr>
				<td></td>
				<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_CLASSFOR'); ?> &lt;div&gt;:</td>
				<td nowrap>
					<input type="text" size="30" maxlength="30" name="class1" value="<?php echo $row->class1; ?>" class="inputbox"/>
				</td>
				<td></td>
			</tr>
			<tr>
				<td></td>
				<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_CLASSFOR'); ?> &lt;form&gt;:</td>
				<td nowrap>
					<input type="text" size="30" maxlength="30" name="class2" value="<?php echo $row->class2; ?>" class="inputbox"/>
				</td>
				<td></td>
			</tr>
			<tr>
				<td></td>
				<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_ORDERING'); ?>:</td>
				<td nowrap><?php echo $lists['ordering']; ?></td>
				<td></td>
			</tr>
			<tr>
				<td></td>
				<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_PUBLISHED'); ?>:</td>
				<td nowrap><?php echo JHTML::_('select.booleanlist',  "published", "", $row->published); ?></td>
				<td></td>
			</tr>
			<tr>
				<td></td>
				<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_RUNMODE'); ?>:</td>
				<td nowrap>
					<select name="runmode" size="1" class="inputbox">
						<option value="0"<?php if ($row->runmode==0) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_ANY'); ?></option>
						<option value="1"<?php if ($row->runmode==1) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_FRONTEND'); ?></option>
						<option value="2"<?php if ($row->runmode==2) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_BACKEND'); ?></option>
					</select>
				</td>
				<td></td>
			</tr>
			<tr>
				<td></td>
				<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_WIDTH'); ?>:</td>
				<td nowrap>
					<input size="6" maxlength="6" name="width" value="<?php echo $row->width; ?>" class="inputbox" /><select name="widthmode" size="1" onchange="dispprevwidth();" class="inputbox">
						<option value="0"<?php if ($row->widthmode==0) echo ' selected="selected"'; ?>>px</option>
						<option value="1"<?php if ($row->widthmode==1) echo ' selected="selected"'; ?>>%</option>
					</select>
				</td>
				<td></td>
			</tr>
			<tr>
				<td></td>
				<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_HEIGHT'); ?>:</td>
				<td nowrap>
					<select name="heightmode" size="1" onchange="dispheight(this.value);" class="inputbox">
						<option value="0"<?php if ($row->heightmode==0) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_FIXED'); ?></option>
						<option value="1"<?php if ($row->heightmode==1) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_AUTO'); ?></option>
						<option value="2"<?php if ($row->heightmode==2) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_AUTOMAX'); ?></option>
					</select><span id="heightmargin"<?php if ($row->heightmode==0) echo ' style="display:none;"'; ?>>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo BFText::_('COM_BREEZINGFORMS_FORMS_BOTTOMMARGIN'); ?>:
					</span><input size="6" maxlength="6" name="height" value="<?php echo $row->height; ?>" class="inputbox"/> px
				</td>
				<td></td>
			</tr>
<?php
if($row->template_code == ''){
?>
			<tr>
				<td></td>
				<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_PREVMODE'); ?>:</td>
				<td nowrap>
					<select name="prevmode" size="1" onchange="dispprevwidth();" class="inputbox">
						<option value="0"<?php if ($row->prevmode==0) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_NONE'); ?></option>
						<option value="1"<?php if ($row->prevmode==1) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_BELOW'); ?></option>
						<option value="2"<?php if ($row->prevmode==2) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_OVERLAYED'); ?></option>
					</select>
					<span id="prevwidthvalue"<?php if ($row->widthmode==0 || $row->prevmode==0) echo ' style="display:none;"'; ?>>
						&nbsp;&nbsp;&nbsp;&nbsp;<?php echo BFText::_('COM_BREEZINGFORMS_FORMS_WIDTH'); ?>: <input size="6" maxlength="6" name="prevwidth" value="<?php echo $row->prevwidth; ?>" class="inputbox" /> px
					</span>
				</td>
				<td></td>
			</tr>
<?php
}
?>
			<tr>
				<td></td>
				<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_LOGTODB'); ?>:</td>
				<td nowrap>
					<select name="dblog" size="1" class="inputbox">
						<option value="0"<?php if ($row->dblog==0) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_NO'); ?></option>
						<option value="1"<?php if ($row->dblog==1) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_NONEMPTY'); ?></option>
						<option value="2"<?php if ($row->dblog==2) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_ALLVALS'); ?></option>
					</select>
				</td>
				<td></td>
			</tr>
			

                        <tr>
				<td></td>
				<td colspan="2">
					<?php echo BFText::_('COM_BREEZINGFORMS_FORMS_DESCRIPTION'); ?>:
					<a href="#" onClick="textAreaResize('description',<?php echo $ff_config->areasmall; ?>);">[<?php echo $ff_config->areasmall; ?>]</a>
					<a href="#" onClick="textAreaResize('description',<?php echo $ff_config->areamedium; ?>);">[<?php echo $ff_config->areamedium; ?>]</a>
					<a href="#" onClick="textAreaResize('description',<?php echo $ff_config->arealarge; ?>);">[<?php echo $ff_config->arealarge; ?>]</a>
					<br/>
					<textarea wrap="off" name="description" style="width:700px;" rows="<?php echo $ff_config->areasmall; ?>" class="inputbox"><?php echo htmlspecialchars($row->description, ENT_QUOTES); ?></textarea>
				</td>
				<td></td>
			</tr>

			</table>

<?php

		$tabs->endTab();
		$tabs->startTab(BFText::_('COM_BREEZINGFORMS_ADMIN_EMAILS'),'tab_admin_emails');
?>
                <table class="adminform">
                <tr>
				
				<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_EMAILNOTIFY'); ?>:</td>
				<td>
					<select name="emailntf" size="1" onchange="dispemail(this.value);" class="inputbox">
						<option value="0"<?php if ($row->emailntf==0) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_NO'); ?></option>
						<option value="1"<?php if ($row->emailntf==1) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_DEFADDR'); ?></option>
						<option value="2"<?php if ($row->emailntf==2) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_CUSTADDR'); ?></option>
					</select>
				</td>
				<td></td>
			</tr>
			<tr>
				<td></td>
				<td>
					<table cellpadding="0" cellspacing="0" border="0">
						<tr id="emailaddress"<?php if ($row->emailntf!=2) echo ' style="display:none;"'; ?>>
							<td><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_EMAIL'); ?>:</td>
							<td><input size="50" name="emailadr" value="<?php echo $row->emailadr; ?>" class="inputbox"/></td>
						</tr>
						<tr id="emaillogging"<?php if ($row->emailntf==0) echo ' style="display:none;"'; ?>>
							<td><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_REPORT'); ?>:</td>
							<td>
								<select name="emaillog" size="1" class="inputbox">
									<option value="0"<?php if ($row->emaillog==0) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_HDRONLY'); ?></option>
									<option value="1"<?php if ($row->emaillog==1) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_NONEMPTY'); ?></option>
									<option value="2"<?php if ($row->emaillog==2) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_ALLVALS'); ?></option>
								</select>
							</td>
						</tr>
						<tr id="emailattachment"<?php if ($row->emailntf==0) echo ' style="display:none;"'; ?>>
							<td><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_ATTACHMENT'); ?>: </td>
							<td>
								<select name="emailxml" size="1" class="inputbox">
									<option value="0"<?php if ($row->emailxml==0) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_NO'); ?></option>
									<option value="1"<?php if ($row->emailxml==1) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_XML'); ?></option>
									<!--<option value="2"<?php if ($row->emailxml==2) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_XML_ALLVALS'); ?></option>-->
									<option value="3"<?php if ($row->emailxml==3) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_CSV'); ?></option>
									<option value="4"<?php if ($row->emailxml==4) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_PDF'); ?></option>
								</select>
							</td>
						</tr>
					</table>
				</td>
				<td></td>
			</tr>
                        <tr>
				
				<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_ALT_MAILFROM'); ?>:</td>
				<td>
					<input name="alt_mailfrom"  value="<?php echo $row->alt_mailfrom; ?>" size="50"  class="inputbox"/>
				</td>
				<td></td>
			</tr>
                        <tr>
				
				<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_ALT_FROMNAME'); ?>:</td>
				<td>
					<input name="alt_fromname"  value="<?php echo $row->alt_fromname; ?>" size="50"  class="inputbox"/>
				</td>
				<td></td>
			</tr>
			<tr>
				
				<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_CUSTOM_MAIL_SUBJECT'); ?>:</td>
				<td>
					<input name="custom_mail_subject"  value="<?php echo $row->custom_mail_subject; ?>" size="50"  class="inputbox"/>
				</td>
				<td></td>
			</tr>

                        <tr>
                            <td valign="top" nowrap><?php echo BFText::_('COM_BREEZINGFORMS_EDIT_EMAILS'); ?>:
                            <br/>
                            <br/>
                            <div style="height: 250px; overflow: auto;<?php echo $row->email_type == 0 ? ' display: none;' : '' ?>" id="email_custom_template_picker">
                            <?php echo bf_getFieldSelectorList($row->id,'email_custom_template');?>
                            </div>
                            </td>
                            <td valign="top">
					<input onclick="document.getElementById('email_custom_html').style.display='none';document.getElementById('email_custom_template').style.display='none';document.getElementById('email_custom_template_picker').style.display='none';" type="radio" name="email_type" value="0"<?php echo $row->email_type == 0 ? ' checked="checked"' : ''?>/> <?php echo BFText::_('COM_BREEZINGFORMS_EMAIL_TYPE_DEFAULT');?>
                                        <input onclick="document.getElementById('email_custom_html').style.display='';document.getElementById('email_custom_template').style.display='';document.getElementById('email_custom_template_picker').style.display='';" type="radio" name="email_type" value="1"<?php echo $row->email_type == 1 ? ' checked="checked"' : ''?>/> <?php echo BFText::_('COM_BREEZINGFORMS_EMAIL_TYPE_CUSTOM');?>
                                        <div id="email_custom_html" style="<?php echo $row->email_type == 0 ? ' display: none;' : '' ?>">
                                            <br/>
                                            <?php echo BFText::_('COM_BREEZINGFORMS_EMAIL_CUSTOM_HTML');?>:
                                            <input type="radio" name="email_custom_html" value="0"<?php echo $row->email_custom_html == 0 ? ' checked="checked"' : ''?>/> <?php echo BFText::_('COM_BREEZINGFORMS_NO');?>
                                            <input type="radio" name="email_custom_html" value="1"<?php echo $row->email_custom_html == 1 ? ' checked="checked"' : ''?>/> <?php echo BFText::_('COM_BREEZINGFORMS_YES');?>
                                        </div>
                                        <br/>
                                        <textarea style="width:100%; height: 500px;<?php echo $row->email_type == 0 ? ' display: none;' : '' ?>" name="email_custom_template" id="email_custom_template"><?php echo htmlentities($row->email_custom_template, ENT_QUOTES, 'UTF-8');?></textarea>
                            </td>
                            <td></td>
			</tr>

                </table>


<?php

		$tabs->endTab();
		$tabs->startTab(BFText::_('COM_BREEZINGFORMS_MAILBACK_EMAILS'),'tab_mailback_emails');
?>
                <table class="adminform">
			<tr>
                            <td valign="top" nowrap><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_EMAILNOTIFY'); ?>:</td>
				
				<td>
					<table cellpadding="0" cellspacing="0" border="0">
						<tr id="bf_emaillogging"<?php if ($row->mb_emailntf==0) echo ' style="display:none;"'; ?>>
							<td><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_REPORT'); ?>:</td>
							<td>
								<select name="mb_emaillog" size="1" class="inputbox">
									<option value="0"<?php if ($row->mb_emaillog==0) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_HDRONLY'); ?></option>
									<option value="1"<?php if ($row->mb_emaillog==1) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_NONEMPTY'); ?></option>
									<option value="2"<?php if ($row->mb_emaillog==2) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_ALLVALS'); ?></option>
								</select>
							</td>
						</tr>
						<tr id="bf_emailattachment"<?php if ($row->mb_emailntf==0) echo ' style="display:none;"'; ?>>
							<td><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_ATTACHMENT'); ?>: </td>
							<td>
								<select name="mb_emailxml" size="1" class="inputbox">
									<option value="0"<?php if ($row->mb_emailxml==0) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_NO'); ?></option>
									<option value="1"<?php if ($row->mb_emailxml==1) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_XML'); ?></option>
									<!--<option value="2"<?php if ($row->mb_emailxml==2) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_XML_ALLVALS'); ?></option>-->
									<option value="3"<?php if ($row->mb_emailxml==3) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_CSV'); ?></option>
									<option value="4"<?php if ($row->mb_emailxml==4) echo ' selected="selected"'; ?>><?php echo BFText::_('COM_BREEZINGFORMS_PDF'); ?></option>
								</select>
							</td>
						</tr>
					</table>
				</td>
				<td></td>
			</tr>
                        <tr>
				
				<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_ALT_MAILFROM'); ?>:</td>
				<td>
					<input name="mb_alt_mailfrom"  value="<?php echo $row->mb_alt_mailfrom; ?>" size="50"  class="inputbox"/>
				</td>
				<td></td>
			</tr>
                        <tr>
				
				<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_ALT_FROMNAME'); ?>:</td>
				<td>
					<input name="mb_alt_fromname"  value="<?php echo $row->mb_alt_fromname; ?>" size="50"  class="inputbox"/>
				</td>
				<td></td>
			</tr>
			<tr>
				
				<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_CUSTOM_MAIL_SUBJECT'); ?>:</td>
				<td>
					<input name="mb_custom_mail_subject"  value="<?php echo $row->mb_custom_mail_subject; ?>" size="50"  class="inputbox"/>
				</td>
				<td></td>
			</tr>

                        <tr>
                            <td valign="top" nowrap><?php echo BFText::_('COM_BREEZINGFORMS_EDIT_EMAILS'); ?>:
                            <br/>
                            <br/>
                            <div style="height: 250px; overflow: auto;<?php echo $row->mb_email_type == 0 ? ' display: none;' : '' ?>" id="mb_email_custom_template_picker">
                            <?php echo bf_getFieldSelectorList($row->id,'mb_email_custom_template');?>
                            </div>
                            </td>
                            <td valign="top">
					<input onclick="document.getElementById('mb_email_custom_html').style.display='none';document.getElementById('mb_email_custom_template').style.display='none';document.getElementById('mb_email_custom_template_picker').style.display='none';" type="radio" name="mb_email_type" value="0"<?php echo $row->mb_email_type == 0 ? ' checked="checked"' : ''?>/> <?php echo BFText::_('COM_BREEZINGFORMS_EMAIL_TYPE_DEFAULT');?>
                                        <input onclick="document.getElementById('mb_email_custom_html').style.display='';document.getElementById('mb_email_custom_template').style.display='';document.getElementById('mb_email_custom_template_picker').style.display='';" type="radio" name="mb_email_type" value="1"<?php echo $row->mb_email_type == 1 ? ' checked="checked"' : ''?>/> <?php echo BFText::_('COM_BREEZINGFORMS_EMAIL_TYPE_CUSTOM');?>
                                        <div id="mb_email_custom_html" style="<?php echo $row->mb_email_type == 0 ? ' display: none;' : '' ?>">
                                            <br/>
                                            <?php echo BFText::_('COM_BREEZINGFORMS_EMAIL_CUSTOM_HTML');?>:
                                            <input type="radio" name="mb_email_custom_html" value="0"<?php echo $row->mb_email_custom_html == 0 ? ' checked="checked"' : ''?>/> <?php echo BFText::_('COM_BREEZINGFORMS_NO');?>
                                            <input type="radio" name="mb_email_custom_html" value="1"<?php echo $row->mb_email_custom_html == 1 ? ' checked="checked"' : ''?>/> <?php echo BFText::_('COM_BREEZINGFORMS_YES');?>
                                        </div>
                                        <br/>
                                        <textarea style="width:100%; height: 500px;<?php echo $row->mb_email_type == 0 ? ' display: none;' : '' ?>" name="mb_email_custom_template" id="mb_email_custom_template"><?php echo htmlentities($row->mb_email_custom_template, ENT_QUOTES, 'UTF-8');?></textarea>
                            </td>
                            <td></td>
			</tr>

                </table>


<?php
		if($row->template_code != '' ){
?>
<input type="hidden" name="prevmode" value="2"/>
<input type="hidden" name="nonclassic" value="1"/>
<input type="hidden" name="quickmode" value="<?php echo $row->template_code_processed == 'QuickMode' ? '1' : '0'?>"/>
<?php			
		}

                $tabs->endTab();
		$tabs->startTab('MailChimp®','tab_mailchimp');
?>

                <table border="0" width="100%">

                                            <tr>
                                                <td><?php echo BFText::_('COM_BREEZINGFORMS_API_KEY'); ?></td>
                                                <td><input name="mailchimp_api_key"  value="<?php echo $row->mailchimp_api_key; ?>" size="50"  class="inputbox"/></td>
                                            </tr>

                                            <tr>
                                                <td><?php echo BFText::_('COM_BREEZINGFORMS_LIST_ID'); ?></td>
                                                <td><input name="mailchimp_list_id"  value="<?php echo $row->mailchimp_list_id; ?>" size="50"  class="inputbox"/></td>
                                            </tr>

                                            <tr>
                                                <td><?php echo BFText::_('COM_BREEZINGFORMS_EMAIL_FIELD'); ?></td>
                                                <td><input name="mailchimp_email_field"  value="<?php echo $row->mailchimp_email_field; ?>" size="50"  class="inputbox"/></td>
                                            </tr>

                                            <tr>
                                                <td><?php echo BFText::_('COM_BREEZINGFORMS_CHECKBOX_FIELD'); ?></td>
                                                <td><input name="mailchimp_checkbox_field"  value="<?php echo $row->mailchimp_checkbox_field; ?>" size="50"  class="inputbox"/></td>
                                            </tr>

                                            <tr>
                                                <td><?php echo BFText::_('COM_BREEZINGFORMS_UNSUBSCRIBE_FIELD'); ?></td>
                                                <td><input name="mailchimp_unsubscribe_field"  value="<?php echo $row->mailchimp_unsubscribe_field; ?>" size="50"  class="inputbox"/></td>
                                            </tr>

                                            <tr>
                                                <td><?php echo BFText::_('COM_BREEZINGFORMS_TEXT_HTML_MOBILE_FIELD'); ?></td>
                                                <td><input name="mailchimp_text_html_mobile_field"  value="<?php echo $row->mailchimp_text_html_mobile_field; ?>" size="50"  class="inputbox"/></td>
                                            </tr>

                                            <tr>
                                                <td><?php echo BFText::_('COM_BREEZINGFORMS_MERGE_VARS'); ?></td>
                                                <td><input name="mailchimp_mergevars"  value="<?php echo $row->mailchimp_mergevars; ?>" style="width:100%;"  class="inputbox"/></td>
                                            </tr>

                                            <tr>
                                                <td><?php echo BFText::_('COM_BREEZINGFORMS_DEFAULT_TYPE'); ?></td>
                                                <td>
                                                    <select name="mailchimp_default_type" class="inputbox">
                                                        <option value="text"<?php echo $row->mailchimp_default_type == 'text' ? ' selected="selected"' : '';?>>Text</option>
                                                        <option value="html"<?php echo $row->mailchimp_default_type == 'html' ? ' selected="selected"' : '';?>>HTML</option>
                                                        <option value="mobile"<?php echo $row->mailchimp_default_type == 'mobile' ? ' selected="selected"' : '';?>>Mobile</option>
                                                    </select>
                                                </td>
                                            </tr>

                                            <tr>
                                                <td><?php echo BFText::_('COM_BREEZINGFORMS_DOUBLE_OPTIN'); ?></td>
                                                <td><input type="radio" name="mailchimp_double_optin" class="inputbox"<?php echo $row->mailchimp_double_optin ? ' checked="checked"' : '';?> value="1"/> <?php echo BFText::_('COM_BREEZINGFORMS_YES');?> <input type="radio" name="mailchimp_double_optin"  class="inputbox"<?php echo !$row->mailchimp_double_optin ? ' checked="checked"' : '';?> value="0"/><?php echo BFText::_('COM_BREEZINGFORMS_NO');?></td>
                                            </tr>

                                            <tr>
                                                <td><?php echo BFText::_('COM_BREEZINGFORMS_UPDATE_EXISTING'); ?></td>
                                                <td><input type="radio" name="mailchimp_update_existing" class="inputbox"<?php echo $row->mailchimp_update_existing ? ' checked="checked"' : '';?> value="1"/> <?php echo BFText::_('COM_BREEZINGFORMS_YES');?> <input type="radio" name="mailchimp_update_existing"  class="inputbox"<?php echo !$row->mailchimp_update_existing ? ' checked="checked"' : '';?> value="0"/><?php echo BFText::_('COM_BREEZINGFORMS_NO');?></td>
                                            </tr>

                                            <tr>
                                                <td><?php echo BFText::_('COM_BREEZINGFORMS_REPLACE_INTERESTS'); ?></td>
                                                <td><input type="radio" name="mailchimp_replace_interests" class="inputbox"<?php echo $row->mailchimp_replace_interests ? ' checked="checked"' : '';?> value="1"/> <?php echo BFText::_('COM_BREEZINGFORMS_YES');?> <input type="radio" name="mailchimp_replace_interests"  class="inputbox"<?php echo !$row->mailchimp_replace_interests ? ' checked="checked"' : '';?> value="0"/><?php echo BFText::_('COM_BREEZINGFORMS_NO');?></td>
                                            </tr>

                                            <tr>
                                                <td><?php echo BFText::_('COM_BREEZINGFORMS_SEND_WELCOME'); ?></td>
                                                <td><input type="radio" name="mailchimp_send_welcome" class="inputbox"<?php echo $row->mailchimp_send_welcome ? ' checked="checked"' : '';?> value="1"/> <?php echo BFText::_('COM_BREEZINGFORMS_YES');?> <input type="radio" name="mailchimp_send_welcome"  class="inputbox"<?php echo !$row->mailchimp_send_welcome ? ' checked="checked"' : '';?> value="0"/><?php echo BFText::_('COM_BREEZINGFORMS_NO');?></td>
                                            </tr>

                                            <tr>
                                                <td><?php echo BFText::_('COM_BREEZINGFORMS_UNSUBSCRIBE_DELETE_MEMBER'); ?></td>
                                                <td><input type="radio" name="mailchimp_delete_member" class="inputbox"<?php echo $row->mailchimp_delete_member ? ' checked="checked"' : '';?> value="1"/> <?php echo BFText::_('COM_BREEZINGFORMS_YES');?> <input type="radio" name="mailchimp_delete_member"  class="inputbox"<?php echo !$row->mailchimp_delete_member ? ' checked="checked"' : '';?> value="0"/><?php echo BFText::_('COM_BREEZINGFORMS_NO');?></td>
                                            </tr>

                                            <tr>
                                                <td><?php echo BFText::_('COM_BREEZINGFORMS_UNSUBSCRIBE_SEND_GOODBYE'); ?></td>
                                                <td><input type="radio" name="mailchimp_send_goodbye" class="inputbox"<?php echo $row->mailchimp_send_goodbye ? ' checked="checked"' : '';?> value="1"/> <?php echo BFText::_('COM_BREEZINGFORMS_YES');?> <input type="radio" name="mailchimp_send_goodbye"  class="inputbox"<?php echo !$row->mailchimp_send_goodbye ? ' checked="checked"' : '';?> value="0"/><?php echo BFText::_('COM_BREEZINGFORMS_NO');?></td>
                                            </tr>

                                            <tr>
                                                <td><?php echo BFText::_('COM_BREEZINGFORMS_UNSUBSCRIBE_SEND_NOTIFY'); ?></td>
                                                <td><input type="radio" name="mailchimp_send_notify" class="inputbox"<?php echo $row->mailchimp_send_notify ? ' checked="checked"' : '';?> value="1"/> <?php echo BFText::_('COM_BREEZINGFORMS_YES');?> <input type="radio" name="mailchimp_send_notify"  class="inputbox"<?php echo !$row->mailchimp_send_notify ? ' checked="checked"' : '';?> value="0"/><?php echo BFText::_('COM_BREEZINGFORMS_NO');?></td>
                                            </tr>

                                            <tr>
                                                <td><?php echo BFText::_('COM_BREEZINGFORMS_SEND_ERRORS'); ?></td>
                                                <td><input type="radio" name="mailchimp_send_errors" class="inputbox"<?php echo $row->mailchimp_send_errors ? ' checked="checked"' : '';?> value="1"/> <?php echo BFText::_('COM_BREEZINGFORMS_YES');?> <input type="radio" name="mailchimp_send_errors"  class="inputbox"<?php echo !$row->mailchimp_send_errors ? ' checked="checked"' : '';?> value="0"/><?php echo BFText::_('COM_BREEZINGFORMS_NO');?></td>
                                            </tr>

                                        </table>
<?php
		$tabs->endTab();
		$tabs->startTab(BFText::_('COM_BREEZINGFORMS_FORMS_SCRIPTS'),'tab_scripts');
		$subsize = $initsize = $ff_config->areasmall;
		if ($row->script1cond==2)
			$initsize = $ff_config->areamedium;
		else
			if ($row->script2cond==2)
				$subsize = $ff_config->areamedium;
?>
			<table class="adminform">
			<tr>
				<td></td>
				<td colspan="2">
					<fieldset><legend><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_INITSCRIPT'); ?></legend>
						<table cellpadding="4" cellspacing="1" border="0">
							<tr>
								<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_TYPE'); ?>:</td>
								<td nowrap>
									<input type="radio" id="script1cond1" name="script1cond" value="0" onclick="dispinit(this.value)"<?php if ($row->script1cond==0) echo ' checked="checked"'; ?> /><label for="script1cond1"> <?php echo BFText::_('COM_BREEZINGFORMS_FORMS_NONE'); ?></label>
									<input type="radio" id="script1cond2" name="script1cond" value="1" onclick="dispinit(this.value)"<?php if ($row->script1cond==1) echo ' checked="checked"'; ?> /><label for="script1cond2"> <?php echo BFText::_('COM_BREEZINGFORMS_FORMS_LIBRARY'); ?></label>
									<input type="radio" id="script1cond3" name="script1cond" value="2" onclick="dispinit(this.value)"<?php if ($row->script1cond==2) echo ' checked="checked"'; ?> /><label for="script1cond3"> <?php echo BFText::_('COM_BREEZINGFORMS_FORMS_CUSTOM'); ?></label>
								</td>
								<td></td>
							</tr>
							<tr id="initlib" style="display:none;">
								<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_SCRIPT'); ?>:</td>
								<td nowrap>
									<select name="script1id" class="inputbox" size="1">
<?php
										$scripts = $lists['init'];
										for ($i = 0; $i < count($scripts); $i++) {
											$script = $scripts[$i];
											$selected = '';
											if ($script->id == $row->script1id) $selected = ' selected';
											echo '<option value="'.$script->id.'"'.$selected.'>'.$script->text.'</option>';
										} // for
?>
									</select>
								</td>
								<td></td>
							</tr>
							<tr id="initcode" style="display:none;">
								<td nowrap valign="top" colspan="2">
									<a href="#" onClick="codeAreaResize('script1code',<?php echo $ff_config->areasmall; ?>);">[<?php echo $ff_config->areasmall; ?>]</a>
									<a href="#" onClick="codeAreaResize('script1code',<?php echo $ff_config->areamedium; ?>);">[<?php echo $ff_config->areamedium; ?>]</a>
									<a href="#" onClick="codeAreaResize('script1code',<?php echo $ff_config->arealarge; ?>);">[<?php echo $ff_config->arealarge; ?>]</a>
									<a href="#" onClick="createInitCode();"><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_CREATEFRAME'); ?></a>
<?php
									echo bf_ToolTip(BFText::_('COM_BREEZINGFORMS_FORMS_TIPINITCODE'));
?>
									<br />
									<textarea onFocus="codeAreaFocus(this);" readonly="readonly" wrap="off" name="script1lines" style="width:60px;" rows="<?php echo $initsize; ?>" class="inputbox"></textarea>
									<textarea onFocus="codeAreaFocus(this);" onKeyUp="codeAreaChange(this,event);" wrap="off" name="script1code" style="width:610px;" rows="<?php echo $initsize; ?>" class="inputbox"><?php echo htmlspecialchars($row->script1code, ENT_QUOTES); ?></textarea>
								</td>
								<td></td>
							</tr>
						</table>
					</fieldset>
				</td>
				<td></td>
			</tr>
			<tr>
				<td></td>
				<td colspan="2">
					<fieldset><legend><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_SUBMITTEDSCRIPT'); ?></legend>
						<table cellpadding="4" cellspacing="1" border="0">
							<tr>
								<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_TYPE'); ?>:</td>
								<td nowrap>
									<input type="radio" id="script2cond1" name="script2cond" value="0" onclick="dispsubmitted(this.value)"<?php if ($row->script2cond==0) echo ' checked="checked"'; ?> /><label for="script2cond1"> <?php echo BFText::_('COM_BREEZINGFORMS_FORMS_NONE'); ?></label>
									<input type="radio" id="script2cond2" name="script2cond" value="1" onclick="dispsubmitted(this.value)"<?php if ($row->script2cond==1) echo ' checked="checked"'; ?> /><label for="script2cond2"> <?php echo BFText::_('COM_BREEZINGFORMS_FORMS_LIBRARY'); ?></label>
									<input type="radio" id="script2cond3" name="script2cond" value="2" onclick="dispsubmitted(this.value)"<?php if ($row->script2cond==2) echo ' checked="checked"'; ?> /><label for="script2cond3"> <?php echo BFText::_('COM_BREEZINGFORMS_FORMS_CUSTOM'); ?></label>
								</td>
								<td></td>
							</tr>
							<tr id="submittedlib" style="display:none;">
								<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_SCRIPT'); ?>:</td>
								<td nowrap>
									<select name="script2id" class="inputbox" size="1">
<?php
										$scripts = $lists['submitted'];
										for ($i = 0; $i < count($scripts); $i++) {
											$script = $scripts[$i];
											$selected = '';
											if ($script->id == $row->script2id) $selected = ' selected';
											echo '<option value="'.$script->id.'"'.$selected.'>'.$script->text.'</option>';
										} // for
?>
									</select>
								</td>
								<td></td>
							</tr>
							<tr id="submittedcode" style="display:none;">
								<td nowrap valign="top" colspan="2">
									<a href="#" onClick="codeAreaResize('script2code',<?php echo $ff_config->areasmall; ?>);">[<?php echo $ff_config->areasmall; ?>]</a>
									<a href="#" onClick="codeAreaResize('script2code',<?php echo $ff_config->areamedium; ?>);">[<?php echo $ff_config->areamedium; ?>]</a>
									<a href="#" onClick="codeAreaResize('script2code',<?php echo $ff_config->arealarge; ?>);">[<?php echo $ff_config->arealarge; ?>]</a>
									<a href="#" onClick="createSubmittedCode();"><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_CREATEFRAME'); ?></a>
<?php
									echo bf_ToolTip(BFText::_('COM_BREEZINGFORMS_FORMS_TIPSUBMITTEDCODE'));
?>
									<br />
									<textarea onFocus="codeAreaFocus(this);" readonly="readonly" wrap="off" name="script2lines" style="width:60px;" rows="<?php echo $subsize; ?>" class="inputbox"></textarea>
									<textarea onFocus="codeAreaFocus(this);" onKeyUp="codeAreaChange(this,event);" wrap="off" name="script2code" style="width:610px;" rows="<?php echo $subsize; ?>" class="inputbox"><?php echo htmlspecialchars($row->script2code, ENT_QUOTES); ?></textarea>
								</td>
								<td></td>
							</tr>
						</table>
					</fieldset>
				</td>
				<td></td>
			</tr>
			</table>
<?php
		$tabs->endTab();
		$tabs->startTab(BFText::_('COM_BREEZINGFORMS_FORMS_FORMPIECES'),'tab_formpieces');
		$p1size = $p2size = $ff_config->areasmall;
		if ($row->piece1cond==2)
			$p1size = $ff_config->areamedium;
		else
			if ($row->piece2cond==2)
				$p2size = $ff_config->areamedium;
?>
			<table class="adminform">
			<tr>
				<td></td>
				<td colspan="2">
					<fieldset><legend><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_BEFOREFORM'); ?></legend>
						<table cellpadding="4" cellspacing="1" border="0">
							<tr>
								<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_TYPE'); ?>:</td>
								<td nowrap>
									<input type="radio" id="piece1cond0" name="piece1cond" value="0" onclick="dispp1(this.value)"<?php if ($row->piece1cond==0) echo ' checked="checked"'; ?> /><label for="piece1cond0"> <?php echo BFText::_('COM_BREEZINGFORMS_FORMS_NONE'); ?></label>
									<input type="radio" id="piece1cond1" name="piece1cond" value="1" onclick="dispp1(this.value)"<?php if ($row->piece1cond==1) echo ' checked="checked"'; ?> /><label for="piece1cond1"> <?php echo BFText::_('COM_BREEZINGFORMS_FORMS_LIBRARY'); ?></label>
									<input type="radio" id="piece1cond2" name="piece1cond" value="2" onclick="dispp1(this.value)"<?php if ($row->piece1cond==2) echo ' checked="checked"'; ?> /><label for="piece1cond2"> <?php echo BFText::_('COM_BREEZINGFORMS_FORMS_CUSTOM'); ?></label>
								</td>
								<td></td>
							</tr>
							<tr id="p1lib" style="display:none;">
								<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_PIECE'); ?>:</td>
								<td nowrap>
									<select name="piece1id" class="inputbox" size="1">
<?php
										$pieces = $lists['piece1'];
										for ($i = 0; $i < count($pieces); $i++) {
											$piece = $pieces[$i];
											$selected = '';
											if ($piece->id == $row->piece1id) $selected = ' selected';
											echo '<option value="'.$piece->id.'"'.$selected.'>'.$piece->text.'</option>';
										} // for
?>
									</select>
								</td>
								<td></td>
							</tr>
							<tr id="p1code" style="display:none;">
								<td nowrap valign="top" colspan="2">
									<a href="#" onClick="codeAreaResize('piece1code',<?php echo $ff_config->areasmall; ?>);">[<?php echo $ff_config->areasmall; ?>]</a>
									<a href="#" onClick="codeAreaResize('piece1code',<?php echo $ff_config->areamedium; ?>);">[<?php echo $ff_config->areamedium; ?>]</a>
									<a href="#" onClick="codeAreaResize('piece1code',<?php echo $ff_config->arealarge; ?>);">[<?php echo $ff_config->arealarge; ?>]</a>
									<br/>
									<textarea onFocus="codeAreaFocus(this);" readonly="readonly" wrap="off" name="piece1lines" style="width:60px;" rows="<?php echo $p1size; ?>" class="inputbox"></textarea>
									<textarea onFocus="codeAreaFocus(this);" onKeyUp="codeAreaChange(this,event);" wrap="off" name="piece1code" style="width:610px;" rows="<?php echo $p1size; ?>" class="inputbox"><?php echo htmlspecialchars($row->piece1code, ENT_QUOTES); ?></textarea>
								</td>
								<td></td>
							</tr>
						</table>
					</fieldset>
				</td>
				<td></td>
			</tr>
			<tr>
				<td></td>
				<td colspan="2">
					<fieldset><legend><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_AFTERFORM'); ?></legend>
						<table cellpadding="4" cellspacing="1" border="0">
							<tr>
								<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_TYPE'); ?>:</td>
								<td nowrap>
									<input type="radio" id="piece2cond0" name="piece2cond" value="0" onclick="dispp2(this.value)"<?php if ($row->piece2cond==0) echo ' checked="checked"'; ?> /><label for="piece2cond0"> <?php echo BFText::_('COM_BREEZINGFORMS_FORMS_NONE'); ?></label>
									<input type="radio" id="piece2cond1" name="piece2cond" value="1" onclick="dispp2(this.value)"<?php if ($row->piece2cond==1) echo ' checked="checked"'; ?> /><label for="piece2cond1"> <?php echo BFText::_('COM_BREEZINGFORMS_FORMS_LIBRARY'); ?></label>
									<input type="radio" id="piece2cond2" name="piece2cond" value="2" onclick="dispp2(this.value)"<?php if ($row->piece2cond==2) echo ' checked="checked"'; ?> /><label for="piece2cond2"> <?php echo BFText::_('COM_BREEZINGFORMS_FORMS_CUSTOM'); ?></label>
								</td>
								<td></td>
							</tr>
							<tr id="p2lib" style="display:none;">
								<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_PIECE'); ?>:</td>
								<td nowrap>
									<select name="piece2id" class="inputbox" size="1">
<?php
										$pieces = $lists['piece2'];
										for ($i = 0; $i < count($pieces); $i++) {
											$piece = $pieces[$i];
											$selected = '';
											if ($piece->id == $row->piece2id) $selected = ' selected';
											echo '<option value="'.$piece->id.'"'.$selected.'>'.$piece->text.'</option>';
										} // for
?>
									</select>
								</td>
								<td></td>
							</tr>
							<tr id="p2code" style="display:none;">
								<td nowrap valign="top" colspan="2">
									<a href="#" onClick="codeAreaResize('piece2code',<?php echo $ff_config->areasmall; ?>);">[<?php echo $ff_config->areasmall; ?>]</a>
									<a href="#" onClick="codeAreaResize('piece2code',<?php echo $ff_config->areamedium; ?>);">[<?php echo $ff_config->areamedium; ?>]</a>
									<a href="#" onClick="codeAreaResize('piece2code',<?php echo $ff_config->arealarge; ?>);">[<?php echo $ff_config->arealarge; ?>]</a>
									<br/>
									<textarea onFocus="codeAreaFocus(this);" readonly="readonly" wrap="off" name="piece2lines" style="width:60px;" rows="<?php echo $p2size; ?>" class="inputbox"></textarea>
									<textarea onFocus="codeAreaFocus(this);" onKeyUp="codeAreaChange(this,event);" wrap="off" name="piece2code" style="width:610px;" rows="<?php echo $p2size; ?>" class="inputbox"><?php echo htmlspecialchars($row->piece2code, ENT_QUOTES); ?></textarea>
								</td>
								<td></td>
							</tr>
						</table>
					</fieldset>
				</td>
				<td></td>
			</tr>
			</table>
<?php
		$tabs->endTab();
		$tabs->startTab(BFText::_('COM_BREEZINGFORMS_FORMS_SUBMPIECES'),'tab_submpieces');
		$p3size = $p4size = $ff_config->areasmall;
		if ($row->piece3cond==2)
			$p3size = $ff_config->areamedium;
		else
			if ($row->piece4cond==2)
				$p4size = $ff_config->areamedium;
?>
			<table class="adminform">
			<tr>
				<td></td>
				<td colspan="2">
					<fieldset><legend><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_BEGINSUBMIT'); ?></legend>
						<table cellpadding="4" cellspacing="1" border="0">
							<tr>
								<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_TYPE'); ?>:</td>
								<td nowrap>
									<input type="radio" id="piece3cond0" name="piece3cond" value="0" onclick="dispp3(this.value)"<?php if ($row->piece3cond==0) echo ' checked="checked"'; ?> /><label for="piece3cond0"> <?php echo BFText::_('COM_BREEZINGFORMS_FORMS_NONE'); ?></label>
									<input type="radio" id="piece3cond1" name="piece3cond" value="1" onclick="dispp3(this.value)"<?php if ($row->piece3cond==1) echo ' checked="checked"'; ?> /><label for="piece3cond1"> <?php echo BFText::_('COM_BREEZINGFORMS_FORMS_LIBRARY'); ?></label>
									<input type="radio" id="piece3cond2" name="piece3cond" value="2" onclick="dispp3(this.value)"<?php if ($row->piece3cond==2) echo ' checked="checked"'; ?> /><label for="piece3cond2"> <?php echo BFText::_('COM_BREEZINGFORMS_FORMS_CUSTOM'); ?></label>
								</td>
								<td></td>
							</tr>
							<tr id="p3lib" style="display:none;">
								<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_PIECE'); ?>:</td>
								<td nowrap>
									<select name="piece3id" class="inputbox" size="1">
<?php
										$pieces = $lists['piece3'];
										for ($i = 0; $i < count($pieces); $i++) {
											$piece = $pieces[$i];
											$selected = '';
											if ($piece->id == $row->piece3id) $selected = ' selected';
											echo '<option value="'.$piece->id.'"'.$selected.'>'.$piece->text.'</option>';
										} // for
?>
									</select>
								</td>
								<td></td>
							</tr>
							<tr id="p3code" style="display:none;">
								<td nowrap valign="top" colspan="2">
									<a href="#" onClick="codeAreaResize('piece3code',<?php echo $ff_config->areasmall; ?>);">[<?php echo $ff_config->areasmall; ?>]</a>
									<a href="#" onClick="codeAreaResize('piece3code',<?php echo $ff_config->areamedium; ?>);">[<?php echo $ff_config->areamedium; ?>]</a>
									<a href="#" onClick="codeAreaResize('piece3code',<?php echo $ff_config->arealarge; ?>);">[<?php echo $ff_config->arealarge; ?>]</a>
									<br/>
									<textarea onFocus="codeAreaFocus(this);" readonly="readonly" wrap="off" name="piece3lines" style="width:60px;" rows="<?php echo $p3size; ?>" class="inputbox"></textarea>
									<textarea onFocus="codeAreaFocus(this);" onKeyUp="codeAreaChange(this,event);" wrap="off" name="piece3code" style="width:610px;" rows="<?php echo $p3size; ?>" class="inputbox"><?php echo htmlspecialchars($row->piece3code, ENT_QUOTES); ?></textarea>
								</td>
								<td></td>
							</tr>
						</table>
					</fieldset>
				</td>
				<td></td>
			</tr>
			<tr>
				<td></td>
				<td colspan="2">
					<fieldset><legend><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_ENDSUBMIT'); ?></legend>
						<table cellpadding="4" cellspacing="1" border="0">
							<tr>
								<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_TYPE'); ?>:</td>
								<td nowrap>
									<input type="radio" id="piece4cond0" name="piece4cond" value="0" onclick="dispp4(this.value)"<?php if ($row->piece4cond==0) echo ' checked="checked"'; ?> /><label for="piece4cond0"> <?php echo BFText::_('COM_BREEZINGFORMS_FORMS_NONE'); ?></label>
									<input type="radio" id="piece4cond1" name="piece4cond" value="1" onclick="dispp4(this.value)"<?php if ($row->piece4cond==1) echo ' checked="checked"'; ?> /><label for="piece4cond1"> <?php echo BFText::_('COM_BREEZINGFORMS_FORMS_LIBRARY'); ?></label>
									<input type="radio" id="piece4cond2" name="piece4cond" value="2" onclick="dispp4(this.value)"<?php if ($row->piece4cond==2) echo ' checked="checked"'; ?> /><label for="piece4cond2"> <?php echo BFText::_('COM_BREEZINGFORMS_FORMS_CUSTOM'); ?></label>
								</td>
								<td></td>
							</tr>
							<tr id="p4lib" style="display:none;">
								<td nowrap><?php echo BFText::_('COM_BREEZINGFORMS_FORMS_PIECE'); ?>:</td>
								<td nowrap>
									<select name="piece4id" class="inputbox" size="1">
<?php
										$pieces = $lists['piece4'];
										for ($i = 0; $i < count($pieces); $i++) {
											$piece = $pieces[$i];
											$selected = '';
											if ($piece->id == $row->piece4id) $selected = ' selected';
											echo '<option value="'.$piece->id.'"'.$selected.'>'.$piece->text.'</option>';
										} // for
?>
									</select>
								</td>
								<td></td>
							</tr>
							<tr id="p4code" style="display:none;">
								<td nowrap valign="top" colspan="2">
									<a href="#" onClick="codeAreaResize('piece4code',<?php echo $ff_config->areasmall; ?>);">[<?php echo $ff_config->areasmall; ?>]</a>
									<a href="#" onClick="codeAreaResize('piece4code',<?php echo $ff_config->areamedium; ?>);">[<?php echo $ff_config->areamedium; ?>]</a>
									<a href="#" onClick="codeAreaResize('piece4code',<?php echo $ff_config->arealarge; ?>);">[<?php echo $ff_config->arealarge; ?>]</a>
									<br/>
									<textarea onFocus="codeAreaFocus(this);" readonly="readonly" wrap="off" name="piece4lines" style="width:60px;" rows="<?php echo $p4size; ?>" class="inputbox"></textarea>
									<textarea onFocus="codeAreaFocus(this);" onKeyUp="codeAreaChange(this,event);" wrap="off" name="piece4code" style="width:610px;" rows="<?php echo $p4size; ?>" class="inputbox"><?php echo htmlspecialchars($row->piece4code, ENT_QUOTES); ?></textarea>
								</td>
								<td></td>
							</tr>
						</table>
					</fieldset>
				</td>
				<td></td>
			</tr>
			</table>
<?php
		$tabs->endTab();
		$tabs->endPane();
?>
				</td>
				<td></td>
			</tr>
			<tr>
				<td></td>
				<td nowrap style="text-align:right">
					
					<input onclick="submitbutton('save');" type="submit" value="<?php echo htmlentities(BFText::_('COM_BREEZINGFORMS_TOOLBAR_SAVE'), ENT_QUOTES, 'UTF-8'); ?>"/>
					&nbsp;&nbsp;
                    <input onclick="submitbutton('cancel');" type="submit" value="<?php echo htmlentities(BFText::_('COM_BREEZINGFORMS_TOOLBAR_CANCEL'), ENT_QUOTES, 'UTF-8'); ?>"/>
				
				</td>
				<td></td>
			</tr>
		</table>
		<input type="hidden" name="id" value="<?php echo $row->id; ?>" />
		<input type="hidden" name="pkg" value="<?php echo $pkg; ?>" />
		<input type="hidden" name="option" value="<?php echo $option; ?>" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="act" value="manageforms" />
		<input type="hidden" name="pages" value="<?php echo $row->pages; ?>" />
		<input type="hidden" name="caller_url" value="<?php echo htmlspecialchars($caller, ENT_QUOTES); ?>" />
		</form>
<?php
	} // edit
    static function edit($option, $tabpane, $pkg, &$row, &$lists)
    {
        global $ff_mossite, $ff_admsite, $ff_config;
        $mainframe = JFactory::getApplication();
        $ff_mossite = JURI::base();
        $action = $row->id ? BFText::_('COM_BREEZINGFORMS_ELEMENTS_EDIT') : BFText::_('COM_BREEZINGFORMS_ELEMENTS_ADD');
        $hasInit = false;
        switch ($row->type) {
            case 'Static Text/HTML':
            case 'Rectangle':
            case 'Image':
            case 'Tooltip':
            case 'Query List':
            case 'Regular Button':
            case 'Graphic Button':
            case 'Icon':
            case 'Captcha':
                break;
            default:
                $hasInit = true;
        }
        // switch
        $hasAction = false;
        switch ($row->type) {
            case 'Static Text/HTML':
            case 'Rectangle':
            case 'Image':
            case 'Tooltip':
            case 'Query List':
            case 'Hidden Input':
            case 'Captcha':
                break;
            default:
                $hasAction = true;
        }
        // switch
        $hasValidation = false;
        switch ($row->type) {
            case 'Static Text/HTML':
            case 'Rectangle':
            case 'Image':
            case 'Tooltip':
            case 'Query List':
            case 'Regular Button':
            case 'Graphic Button':
            case 'Icon':
            case 'Captcha':
                break;
            default:
                $hasValidation = true;
        }
        // switch
        ?>
		<script type="text/javascript" src="<?php 
        echo $ff_admsite;
        ?>
/admin/areautils.js"></script>
		<script type="text/javascript">
		<!--
		function checkIdentifier(value, name)
		{
			var invalidChars = /\W/;
			var error = '';
			if (value == '')
				error += "<?php 
        echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_ENTNAME');
        ?>
\n";
			else
				if (invalidChars.test(value))
					error += "<?php 
        echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_ENTIDENT');
        ?>
\n";
			return error;
		} // checkIdentifier

		var bf_submitbutton = function(pressbutton)
		{
			var form = document.adminForm;
			var error = '';
			if (pressbutton != 'cancel') {
				if (form.title.value == '')
					error += "<?php 
        echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_TITLEEMPTY');
        ?>
\n";
				error += checkIdentifier(form.name.value, 'name');
			} // if
			
			if (error != ''){
				alert(error);
			} else {
<?php 
        if ($row->type == 'Query List') {
            echo "\t\t\t\tsaveQueryList();\n";
        }
        if ($row->type == 'Static Text/HTML' && $ff_config->wysiwyg) {
            jimport('joomla.html.editor');
            $editor = JFactory::getEditor();
            echo $editor->save('data1');
        }
        ?>
				submitform( pressbutton );
			} // if
		}; // submitbutton

                if(typeof Joomla != "undefined"){
                    Joomla.submitbutton = bf_submitbutton;
                }

                submitbutton = bf_submitbutton;

<?php 
        if ($row->type == 'Graphic Button' || $row->type == 'Icon') {
            ?>
		function dispcaptiontext(value)
		{
			if(document.getElementById)
				if(document.getElementById('captiontext'))
					switch (value) {
						case '0':
							document.getElementById('captiontext').style.display = 'none';
							break;
						default:
							document.getElementById('captiontext').style.display = '';
					} // switch
		} // dispcaptiontext

<?php 
        }
        if ($row->type == 'Tooltip') {
            ?>
		function disptooltipurl(value)
		{
			if(document.getElementById)
				if(document.getElementById('tooltipurl'))
					switch (value) {
						case '0':
						case '1':
							document.getElementById('tooltipurl').style.display = 'none';
							break;
						default:
							document.getElementById('tooltipurl').style.display = '';
					} // switch
		} // disptooltipurl

<?php 
        }
        // if tooltip
        if ($row->type == 'Query List') {
            ?>
		function loadQueryList()
		{
			var form = document.adminForm;
			var text = trim(form.data1.value);
			var rows = text.split('\n');
			var rcnt = rows.length;
			var r;
			for (r = 0; r < rcnt; r++) rows[r] = trim(rows[r]);
			if (rcnt > 0) form.border.value         = rows[0];
			if (rcnt > 1) form.cellspacing.value    = rows[1];
			if (rcnt > 2) form.cellpadding.value    = rows[2];
			if (rcnt > 3) form.trhclass.value       = rows[3];
			if (rcnt > 4) form.tr1class.value       = rows[4];
			if (rcnt > 5) form.tr2class.value       = rows[5];
			if (rcnt > 6) form.trfclass.value       = rows[6];
			if (rcnt > 7) form.tdfclass.value       = rows[7];
			if (rcnt > 8 && rows[8]!='') form.pagenav.options[rows[8]].selected = true;
			qcolUnpack();
		} // loadQueryList

		function saveQueryList()
		{
			var form = document.adminForm;
			form.data1.value =
				trim(form.border.value)      +'\n'+
				trim(form.cellspacing.value) +'\n'+
				trim(form.cellpadding.value) +'\n'+
				trim(form.trhclass.value)    +'\n'+
				trim(form.tr1class.value)    +'\n'+
				trim(form.tr2class.value)    +'\n'+
				trim(form.trfclass.value)    +'\n'+
				trim(form.tdfclass.value)    +'\n'+
				trim(form.pagenav.value)     +'\n';
			qcolPack();
		} // saveQueryList

		function showpagenav(height)
		{
			if (parseInt(height))
				document.getElementById('pagenavrow').style.display = '';
			else
				document.getElementById('pagenavrow').style.display = 'none';
		} // showpagenav

		function createQueryCode()
		{
			form = document.adminForm;
			name = form.name.value;
			if (name=='') {
				alert('Please enter the element name first.');
				return;
			} // if
			if (!confirm("<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_ASKCREATEQUERY');
            ?>
\n<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_EXISTAPP');
            ?>
")) return;
			code =
				"global $database;\n"+
				"\n"+
				"$database->setQuery(\n"+
				"    \"select id, name, username, email \".\n"+
				"    \"from #__users \".\n"+
				"    \"order by id\"\n"+
				");\n"+
				"$rows = $database->loadObjectList();\n";
			oldcode = form.data2.value;
			if (oldcode != '')
				form.data2.value =
					code+
					"\n// -------------- <?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_OLDBELOW');
            ?>
 --------------\n\n"+
					oldcode;
			else
				form.data2.value = code;
			codeAreaChange(form.data2);
		} // createQueryCode

		function trim(s)
		{
			while (s.length>0 && (s.charAt(0)==' '||s.charAt(0)=='\n'||s.charAt(0)=='\r'))
				s = s.substr(1,s.length-1);
			while (s.length>0 && (s.charAt(s.length-1)==' '||s.charAt(s.length-1)=='\n'||s.charAt(s.length-1)=='\r'))
				s = s.substr(0,s.length-1);
			return s;
		} // trim

		function expstring(text)
		{
			text = trim(text);
			var i;
			var o = '';
			for(i = 0; i < text.length; i++) {
				c = text.charAt(i);
				switch(c) {
					case '&' : o += '\\x26'; break;
					case '<' : o += '\\x3C'; break;
					case '>' : o += '\\x3E'; break;
					case '\'': o += '\\x27'; break;
					case '\\': o += '\\x5C'; break;
					case '"' : o += '\\x22'; break;
					case '\n': o += '\\n'; break;
					case '\r': o += '\\r'; break;
					default: o += c;
				} // switch
			} // for
			return o;
		} // expstring

		function htmlchars(text)
		{
			var i;
			var o = '';
			for(i = 0; i < text.length; i++) {
				c = text.charAt(i);
				switch(c) {
					case '&' : o += '&amp;'; break;
					case '<' : o += '&lt;'; break;
					case '>' : o += '&gt;'; break;
					case '"' : o += '&quot;'; break;
					default: o += c;
				} // switch
			} // for
			return o;
		} // htmlchars

		function impstring(text)
		{
			var str = '';
			var ss = 0;
			var s;
			var tl = text.length;
			var hexdigs = "0123456789abcdefABCDEF";
			while (ss < tl) {
				s = text.charAt(ss++);
				if (s == '\\') {
					if (ss < tl) s = text.charAt(ss++); else s = 0;
					switch (s) {
						case 0   : break;
						case 'e' : str += '\33'; break;
						case 't' : str += '\t'; break;
						case 'r' : str += '\r'; break;
						case 'n' : str += '\n'; break;
						case 'f' : str += '\f'; break;
						case 'x' : {
							if (ss < tl) s = text.charAt(ss++); else s = 0;
							var ch = '';
							while (hexdigs.indexOf(s)>=0 && ch.length < 2) {
								ch += s;
								if (ss < tl) s = text.charAt(ss++); else s = 0;
							} // while
							while (ch.length < 2) ch = '0'+ch;
							str += unescape('%'+ch);
							if (s) ss--;
							break;
						}
						default:
							str += s;
					} // switch
				} else
					str += s;
			} // while
			return str;
		} // impstring

		var qcolRows    = new Array();
		var qcolRowCnt  = 0;
		var qcolIndex   = 0;

		var qcolTitle    = 0;
		var qcolName     = 1;
		var qcolClass1   = 2;
		var qcolClass2   = 3;
		var qcolClass3   = 4;
		var qcolWidth    = 5;
		var qcolWidthmd  = 6;
		var qcolThspan   = 7;
		var qcolThalign  = 8;
		var qcolThvalign = 9;
		var qcolThwrap   = 10;
		var qcolAlign    = 11;
		var qcolValign   = 12;
		var qcolWrap     = 13;
		var qcolValue    = 14;
		var qcolSize     = 15;

		var qcolCellCheckbox    = 0;
		var qcolCellTitle       = 1;
		var qcolCellName        = 2;
		var qcolCellThattribs   = 3;
		var qcolCellAttributes  = 4;
		var qcolCellWidth       = 5;
		var qcolCellOrderup     = 6;
		var qcolCellOrderdown   = 7;
		var qcolCellCount       = 8;

		function qcolPack()
		{
			var r;
			var text = '';
			for (r = 0; r < qcolRowCnt; r++) {
				var c;
				var row = qcolRows[r];
				for (c = 0; c < row.length; c++) {
					if (c > 0) text += '&';
					text += expstring(row[c]);
				} // for
				text += '\n';
			} // for
			document.adminForm.data3.value = text;
		} // qcolPack

		function qcolUnpack()
		{
			var text = trim(document.adminForm.data3.value);
			var rows = text.split('\n');
			var r;
			qcolRowCnt = 0;
			for (r = 0; r < rows.length; r++) {
				if (rows[r] != '') {
					var vals = rows[r].split('&');
					var v;
					for (v = 0; v < vals.length; v++)
						vals[v] = impstring(vals[v]);
					qcolRows[qcolRowCnt++] = vals;
				} // if
			} // for
			qcolDisplay();
		} // qcolUnpack

		function qcolCheckAll(checked)
		{
			var r;
			for (r = 0; r < qcolRowCnt; r++)
				document.getElementById('cb'+r).checked = checked;
			document.getElementById('qcolCbAll').checked = checked;
		} // qcolCheckAll

		function qcolSelects()
		{
			var r;
			var s = 0;
			for (r = 0; r < qcolRowCnt; r++)
				if (document.getElementById('cb'+r).checked) s++;
			return s;
		} // qcolSelects

		function qcolDisplay()
		{
			var form = document.QueryColForm;
			var table = document.getElementById("qcolTable");
			var oldRows = table.rows.length-1;
			var r;
			var skip = 0;
			for (r = 0; r < qcolRowCnt; r++) {
				// get or create table row
				var row;
				if (r >= oldRows) {
					row = table.insertRow(r+1);
					row.className = 'row'+(r%2+1);
					var c;
					for (c = 0; c < qcolCellCount; c++) {
						row.insertCell(c);
						row.cells[c].noWrap = 'true';
					} // for
					row.cells[qcolCellOrderup].style.textAlign = 'right';
				} else
					row = table.rows[r+1];

				var data = qcolRows[r];
				var title = data[qcolTitle];
				if (title.length > 50) title = title.substr(0,47)+'...';
				row.cells[qcolCellCheckbox].innerHTML = '<input type="checkbox" id="cb'+r+'" name="cb'+r+'" value="'+r+'"/>';
				row.cells[qcolCellTitle   ].innerHTML = '<a href="javascript:qcolEdit('+r+')">'+htmlchars(title)+'<\/a>';
				row.cells[qcolCellName    ].innerHTML = data[qcolName];

				// header attribs
				var attr = '';
				var span = parseInt(data[qcolThspan]);
				if (skip > 0 || span < 1) {
					attr = '-';
					skip--;
				} else {
					if (span > 1) {
						attr += '<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_SPAN');
            ?>
('+span+') ';
						skip = span-1;
					} // if
					switch (data[qcolThalign]) {
						case '1': attr += '<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_LEFT');
            ?>
 '; break;
						case '2': attr += '<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_CENTER');
            ?>
 '; break;
						case '3': attr += '<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_RIGHT');
            ?>
 '; break;
						case '4': attr += '<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_JUSTIFY');
            ?>
 '; break;
						default : ;
					} // switch
					switch (data[qcolThvalign]) {
						case '1': attr += '<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_TOP');
            ?>
 '; break;
						case '2': attr += '<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_MIDDLE');
            ?>
 '; break;
						case '3': attr += '<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_BOTTOM');
            ?>
 '; break;
						case '4': attr += '<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_BASELINE');
            ?>
 '; break;
						default : ;
					} // switch
					switch (data[qcolThwrap]) {
						case '1': attr += '<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_NOWRAP');
            ?>
'; break;
						default : ;
					} // switch
				} // if
				row.cells[qcolCellThattribs].innerHTML = attr;

				// data attribs
				attr = '';
				if (span < 1) {
					attr = '-';
					skip--;
				} else {
					switch (data[qcolAlign]) {
						case '1': attr += '<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_LEFT');
            ?>
 '; break;
						case '2': attr += '<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_CENTER');
            ?>
 '; break;
						case '3': attr += '<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_RIGHT');
            ?>
 '; break;
						case '4': attr += '<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_JUSTIFY');
            ?>
 '; break;
						default : ;
					} // switch
					switch (data[qcolValign]) {
						case '1': attr += '<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_TOP');
            ?>
 '; break;
						case '2': attr += '<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_MIDDLE');
            ?>
 '; break;
						case '3': attr += '<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_BOTTOM');
            ?>
 '; break;
						case '4': attr += '<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_BASELINE');
            ?>
 '; break;
						default : ;
					} // switch
					switch (data[qcolWrap]) {
						case '1': attr += '<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_NOWRAP');
            ?>
'; break;
						default : ;
					} // switch
				} // if
				row.cells[qcolCellAttributes].innerHTML = attr;

				// width
				attr = '';
				if (parseInt(data[qcolWidth]) > 0) {
					attr += data[qcolWidth];
					if (data[qcolWidthmd]=='1') attr += '%'; else attr += 'px';
				} // if
				row.cells[qcolCellWidth].innerHTML = attr;

				// ordering
				if (r > 0)
					row.cells[qcolCellOrderup].innerHTML = '<a href="javascript:qcolOrderup('+r+')"><img src="components/com_breezingforms/images/icons/uparrow.png" alt="^" border="0"/><\/a>';
				else
					row.cells[qcolCellOrderup].innerHTML = '';
				if (r < qcolRowCnt-1)
					row.cells[qcolCellOrderdown].innerHTML = '<a href="javascript:qcolOrderdown('+r+')"><img src="components/com_breezingforms/images/icons/downarrow.png" alt="v" border="0"/><\/a>';
				else
					row.cells[qcolCellOrderdown].innerHTML = '';
			} // for
			for (r = oldRows; r > qcolRowCnt; r--) table.deleteRow(r);
			qcolCheckAll(false);
		} // qcolDisplay

		function qcolEdit(index)
		{
			var form = document.QueryColForm;
			qcolIndex = index;
			var row = qcolRows[qcolIndex];
			var c = 0;
			form.colTitle.value    = row[qcolTitle   ];
			form.colName.value     = row[qcolName    ];
			form.colClass1.value   = row[qcolClass1  ];
			form.colClass2.value   = row[qcolClass2  ];
			form.colClass3.value   = row[qcolClass3  ];
			form.colWidth.value    = row[qcolWidth   ];
			form.colWidthmd.value  = row[qcolWidthmd ];
			form.colThspan.value   = row[qcolThspan  ];
			form.colThalign.value  = row[qcolThalign ];
			form.colThvalign.value = row[qcolThvalign];
			form.colThwrap.value   = row[qcolThwrap  ];
			form.colAlign.value    = row[qcolAlign   ];
			form.colValign.value   = row[qcolValign  ];
			form.colWrap.value     = row[qcolWrap    ];
			form.colValue.value    = row[qcolValue   ];
			document.getElementById('QueryColDialog').style.display = '';
			form.colTitle.focus();
			MM_swapImage('colSave','','images/save_f2.png',1);
			MM_swapImgRestore();
			MM_swapImage('colCancel','','images/cancel_f2.png',1);
			MM_swapImgRestore();
		} // qcolEdit

		function qcolAdd()
		{
			var form = document.QueryColForm;
			qcolIndex = qcolRowCnt;
			form.colTitle.value    = '';
			form.colName.value     = '';
			form.colClass1.value   = '';
			form.colClass2.value   = '';
			form.colClass3.value   = '';
			form.colWidth.value    = '';
			form.colWidthmd.value  = 0;
			form.colThspan.value   = 1;
			form.colThalign.value  = 0;
			form.colThvalign.value = 0;
			form.colThwrap.value   = 0;
			form.colAlign.value    = 0;
			form.colValign.value   = 0;
			form.colWrap.value     = 0;
			form.colValue.value    = '\x3C?php return $value; ?\x3E';
			document.getElementById('QueryColDialog').style.display = '';
			form.colTitle.focus();
			MM_swapImage('colSave','','images/save_f2.png',1);
			MM_swapImgRestore();
			MM_swapImage('colCancel','','images/cancel_f2.png',1);
			MM_swapImgRestore();
		} // qcolAdd

		function qcolCopy()
		{
			if (!qcolSelects()) {
				alert('<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_SELECTCOLUMNS');
            ?>
');
				return;
			} // if
			var r;
			var newcnt = qcolRowCnt;
			for (r = 0; r < qcolRowCnt; r++) {
				if (document.getElementById('cb'+r).checked) {
					qcolRows[newcnt] = new Array();
					var x;
					for (x = 0; x < qcolRows[r].length; x++)
						qcolRows[newcnt][x] = qcolRows[r][x];
					newcnt++;
				} // if
			} // for
			qcolRowCnt = newcnt;
			qcolDisplay();
		} // qcolCopy

		function qcolDelete()
		{
			if (!qcolSelects()) {
				alert('<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_SELECTCOLUMNS');
            ?>
');
				return;
			} // if
			if (!confirm('<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_ASKDELCOLUMNS');
            ?>
')) return;
			var r;
			for (r = qcolRowCnt-1; r >= 0; r--) {
				if (document.getElementById('cb'+r).checked) {
					var r2;
					qcolRowCnt--;
					for (r2 = r; r2 < qcolRowCnt; r2++) qcolRows[r2] = qcolRows[r2+1];
				} // if
			} // for
			qcolDisplay();
		} // qcolDelete

		function qcolOrderup(index)
		{
			var row = qcolRows[index];
			qcolRows[index] = qcolRows[index-1];
			qcolRows[index-1] = row;
			qcolDisplay();
		} // qcolOrderup

		function qcolOrderdown(index)
		{
			var row = qcolRows[index];
			qcolRows[index] = qcolRows[index+1];
			qcolRows[index+1] = row;
			qcolDisplay();
		} // qcolOrderdown

		function qcolOk()
		{
			var form = document.QueryColForm;
			var error = '';
			if (form.colTitle.value == '')
				error += "<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_TITLEEMPTY');
            ?>
\n";
			error += checkIdentifier(form.colName.value, 'name');
			if (error != '') {
				alert(error);
				return;
			} // if
			document.getElementById("QueryColDialog").style.display = 'none';

			if (qcolIndex >= qcolRowCnt) {
				// add a new row to the table
				qcolRows[qcolRowCnt++] = new Array(
					form.colTitle.value,
					form.colName.value,
					form.colClass1.value,
					form.colClass2.value,
					form.colClass3.value,
					form.colWidth.value,
					form.colWidthmd.value,
					form.colThspan.value,
					form.colThalign.value,
					form.colThvalign.value,
					form.colThwrap.value,
					form.colAlign.value,
					form.colValign.value,
					form.colWrap.value,
					form.colValue.value
				);
			} else {
				// udate existing row
				var row = qcolRows[qcolIndex];
				row[qcolTitle   ] = form.colTitle.value,
				row[qcolName    ] = form.colName.value,
				row[qcolClass1  ] = form.colClass1.value,
				row[qcolClass2  ] = form.colClass2.value,
				row[qcolClass3  ] = form.colClass3.value,
				row[qcolWidth   ] = form.colWidth.value,
				row[qcolWidthmd ] = form.colWidthmd.value,
				row[qcolThspan  ] = form.colThspan.value,
				row[qcolThalign ] = form.colThalign.value,
				row[qcolThvalign] = form.colThvalign.value,
				row[qcolThwrap  ] = form.colThwrap.value,
				row[qcolAlign   ] = form.colAlign.value,
				row[qcolValign  ] = form.colValign.value,
				row[qcolWrap    ] = form.colWrap.value,
				row[qcolValue   ] = form.colValue.value
			} // if
			qcolDisplay();
		} // qcolOk

		function qcolCancel()
		{
			document.getElementById("QueryColDialog").style.display = 'none';
		} // qcolCancel
<?php 
        }
        // if query list
        if ($hasInit) {
            ?>
		function dispinit(value)
		{
			if (document.getElementById('initexec'))
				switch (value) {
					case '1':
						document.getElementById('initexec').style.display = '';
						document.getElementById('initlib').style.display = '';
						document.getElementById('initcode').style.display = 'none';
						break;
					case '2':
						document.getElementById('initexec').style.display = '';
						document.getElementById('initlib').style.display = 'none';
						document.getElementById('initcode').style.display = '';
						break;
					default:
						document.getElementById('initexec').style.display = 'none';
						document.getElementById('initlib').style.display = 'none';
						document.getElementById('initcode').style.display = 'none';
				} // switch
		} // dispinit

		function createInitCode()
		{
			form = document.adminForm;
			name = form.name.value;
			if (name=='') {
				alert('Please enter the element name first.');
				return;
			} // if
			if (!confirm("<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_CREAINIT');
            ?>
\n<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_EXISTAPP');
            ?>
")) return;
			code =
				"function ff_"+name+"_init(element, condition)\n"+
				"{\n"+
				"    switch (condition) {\n";
			if (form.script1flag1.checked)
				code +=
					"        case 'formentry':\n"+
					"            break;\n";
			if (form.script1flag2.checked)
				code +=
					"        case 'pageentry':\n"+
					"            break;\n";
			code +=
				"        default:;\n"+
				"    } // switch\n"+
				"} // ff_"+name+"_init\n";
			oldcode = form.script1code.value;
			if (oldcode != '')
				form.script1code.value =
					code+
					"\n// -------------- <?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_OLDBELOW');
            ?>
 --------------\n\n"+
					oldcode;
			else
				form.script1code.value = code;
			codeAreaChange(form.script1code);
		} // createInitCode

<?php 
        }
        // if hasInit
        if ($hasAction) {
            ?>
		function dispaction(value)
		{
			if(document.getElementById)
				if(document.getElementById('actionact'))
					switch (value) {
						case '1':
							document.getElementById('actionact').style.display = '';
							document.getElementById('actionlib').style.display = '';
							document.getElementById('actioncode').style.display = 'none';
							break;
						case '2':
							document.getElementById('actionact').style.display = '';
							document.getElementById('actionlib').style.display = 'none';
							document.getElementById('actioncode').style.display = '';
							break;
						default:
							document.getElementById('actionact').style.display = 'none';
							document.getElementById('actionlib').style.display = 'none';
							document.getElementById('actioncode').style.display = 'none';
					} // switch
		} // dispaction

		function createActionCode()
		{
			form = document.adminForm;
			name = form.name.value;
			if (name=='') {
				alert('Please enter the element name first.');
				return;
			} // if
			if (!confirm("<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_CREAACTION');
            ?>
\n<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_EXISTAPP');
            ?>
")) return;
			code =
				"function ff_"+name+"_action(element, action)\n"+
				"{\n"+
				"    switch (action) {\n";
			if (form.script2flag1)
				if (form.script2flag1.checked)
					code +=
						"        case 'click':\n"+
						"            break;\n";
			if (form.script2flag2)
				if (form.script2flag2.checked)
					code +=
						"        case 'blur':\n"+
						"            break;\n";
			if (form.script2flag3)
				if (form.script2flag3.checked)
					code +=
						"        case 'change':\n"+
						"            break;\n";
			if (form.script2flag4)
				if (form.script2flag4.checked)
					code +=
						"        case 'focus':\n"+
						"            break;\n";
			if (form.script2flag5)
				if (form.script2flag5.checked)
					code +=
						"        case 'select':\n"+
						"            break;\n";
			code +=
				"        default:;\n"+
				"    } // switch\n"+
				"} // ff_"+name+"_action\n";
			oldcode = form.script2code.value;
			if (oldcode != '')
				form.script2code.value =
					code+
					"\n// -------------- <?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_OLDBELOW');
            ?>
 --------------\n\n"+
					oldcode;
			else
				form.script2code.value = code;
			codeAreaChange(form.script2code);
		} // createActionCode

<?php 
        }
        // if hasAction
        if ($hasValidation) {
            ?>
		function dispvalidation(value)
		{
			if(document.getElementById)
				if(document.getElementById('validationlib'))
					switch (value) {
						case '1':
							document.getElementById('validationmsg').style.display = '';
							document.getElementById('validationlib').style.display = '';
							document.getElementById('validationcode').style.display = 'none';
							break;
						case '2':
							document.getElementById('validationmsg').style.display = '';
							document.getElementById('validationlib').style.display = 'none';
							document.getElementById('validationcode').style.display = '';
							break;
						default:
							document.getElementById('validationmsg').style.display = 'none';
							document.getElementById('validationlib').style.display = 'none';
							document.getElementById('validationcode').style.display = 'none';
					} // switch
		} // dispvalidation

		function createValidationCode()
		{
			form = document.adminForm;
			name = form.name.value;
			if (name=='') {
				alert('Please enter the element name first.');
				return;
			} // if
			if (!confirm("<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_CREAVALID');
            ?>
\n<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_EXISTAPP');
            ?>
")) return;
			code =
				"function ff_"+name+"_validation(element, message)\n"+
				"{\n"+
				"    if (element_fails_my_test) {\n"+
				"        if (message=='') message = element.name+\" faild in my test.\\n\"\n"+
				"        ff_validationFocus(element.name);\n"+
				"        return message;\n"+
				"    } // if\n"+
				"    return '';\n"+
				"} // ff_"+name+"_validation\n";
			oldcode = form.script3code.value;
			if (oldcode != '')
				form.script3code.value =
					code+
					"\n// -------------- <?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_OLDBELOW');
            ?>
 --------------\n\n"+
					oldcode;
			else
				form.script3code.value = code;
			codeAreaChange(form.script3code);
		} // createValidationCode

<?php 
        }
        // if hasValidation
        if ($row->type == 'Select List') {
            ?>
		function addOption()
		{
			form = document.SelectOptionForm;
			form.optionText.value = '';
			form.optionValue.value = '';
			form.optionSelected[0].checked = true;
			document.getElementById("SelectOptionDialog").style.display = '';
			form.optionText.focus();
		} // addOption

		function okOption()
		{
			form = document.SelectOptionForm;
			if (form.optionText.value=='') {
				alert("Please enter a text.");
				form.optionText.focus();
				return;
			} // if
			data = document.adminForm.data2;
			value = data.value;
			if (value != '')
				if (value.substr(value.length-1,1)!="\n")
					value += "\n";
			sel = '0;';
			if (form.optionSelected[1].checked) sel = '1;';
			value +=
				sel +
				form.optionText.value + ';' +
				form.optionValue.value;
			data.value = value;
			form.optionText.value = '';
			form.optionValue.value = '';
			form.optionSelected[0].checked = true;
			form.optionText.focus();
		} // addOption

		function quitOption()
		{
			document.getElementById("SelectOptionDialog").style.display = 'none';
		} // addOption
<?php 
        }
        ?>
		onload = function()
		{
<?php 
        if ($row->type == 'Query List') {
            echo "\t\t\tloadQueryList();\n";
        }
        // because of mozilla browser problems, the widest elements must be shown first
        $s1size = $s2size = $s3size = $ff_config->areasmall;
        $nonbig = true;
        if ($hasInit && $row->script1cond == 2) {
            echo "\t\t\tdispinit('2');\n";
            $s1size = $ff_config->areamedium;
            $nonbig = false;
        }
        // if
        if ($hasAction && $row->script2cond == 2) {
            echo "\t\t\tdispaction('2');\n";
            if ($nonbig) {
                $s2size = $ff_config->areamedium;
                $nonbig = false;
            }
            // if
        }
        // if
        if ($hasValidation && $row->script3cond == 2) {
            echo "\t\t\tdispvalidation('2');\n";
            if ($nonbig) {
                $s3size = $ff_config->areamedium;
            }
        }
        // if
        if ($hasInit && $row->script1cond == 1) {
            echo "\t\t\tdispinit('1');\n";
        }
        if ($hasAction && $row->script2cond == 1) {
            echo "\t\t\tdispaction('1');\n";
        }
        if ($hasValidation && $row->script3cond == 1) {
            echo "\t\t\tdispvalidation('1');\n";
        }
        if (($row->type == 'Graphic Button' || $row->type == 'Icon') && $row->flag1 != 0) {
            echo "\t\t\tdispcaptiontext('" . $row->flag1 . "');\n";
        }
        if ($hasInit) {
            echo "\t\t\tcodeAreaAdd('script1code', 'script1lines');\n";
        }
        if ($hasAction) {
            echo "\t\t\tcodeAreaAdd('script2code', 'script2lines');\n";
        }
        if ($hasValidation) {
            echo "\t\t\tcodeAreaAdd('script3code', 'script3lines');\n";
        }
        if ($row->type == 'Query List') {
            echo "\t\t\tcodeAreaAdd('data2', 'data2lines');\n";
        }
        switch ($tabpane) {
            case 1:
            case 2:
                echo "\t\t\ttabPane1.setSelectedIndex({$tabpane});\n";
                break;
            default:
                echo "\t\t\tdocument.adminForm.title.focus();\n";
        }
        // switch
        ?>
		} // onload
		//-->
		</script>
                
		<div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>
		<script type="text/javascript" src="<?php 
        echo $ff_mossite;
        ?>
/components/com_breezingforms/libraries/js/overlib_mini.js"></script>

<?php 
        if ($row->type == 'Select List') {
            ?>
		<div id="SelectOptionDialog" style="position:absolute;top:380px;left:45%;z-index:100;display:none;">
			<table cellpadding="4" cellspacing="1" border="0" class="adminform" style="width:350px">
			<form name='SelectOptionForm' onsubmit='okOption();return false;'>
				<tr><th colspan="4" class="title">BreezingForms - <?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_NEWSELOPT');
            ?>
</th></tr>
				<tr>
					<td></td>
					<td><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_TEXT');
            ?>
:</td>
					<td><input type="text" size="50" value="" name="optionText" class="inputbox"/></td>
					<td></td>
				</tr>
				<tr>
					<td></td>
					<td><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_VALUE');
            ?>
:</td>
					<td><input type="text" size="50" value="" name="optionValue" class="inputbox"/></td>
					<td></td>
				</tr>
				<tr>
					<td></td>
					<td><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_SELECTED');
            ?>
:</td>
					<td><?php 
            echo JHTML::_('select.booleanlist', "optionSelected", "", 0);
            ?>
</td>
					<td></td>
				</tr>
				<tr>
					<td></td>
					<td colspan="2" style="text-align:right">
						<input type="button" value="<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_OKBUTTON');
            ?>
" onclick="okOption()" class="button btn btn-primary">
						&nbsp;&nbsp;
						<input type="button" value="<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_ABORTBUTT');
            ?>
" onclick="quitOption()" class="button btn btn-primary">
					</td>
					<td></td>
				</tr>
			</table>
			</form>
		</div>
<?php 
        }
        // if Select List
        if ($row->type == 'Query List') {
            ?>
		<div id="QueryColDialog" style="background-color: #cccccc; position:absolute;top:120px;left:30%;z-index:100;display:none;">
                    <form action="#" name='QueryColForm' onsubmit="return false;">
			<table cellpadding="4" cellspacing="1" border="0" class="adminform" style="width:550px">
				<tr><th colspan="4" class="title">BreezingForms - <?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_EDITQUERYCOL');
            ?>
</th></tr>
				<tr>
					<td></td>
					<td>
						<fieldset><legend><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_HEADER');
            ?>
</legend>
						<table class="adminform">
							<tr>
								<td nowrap><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_TITLE');
            ?>
:</td>
								<td nowrap>
									<input type="text" size="50" maxlength="500" name="colTitle" class="inputbox"/>
<?php 
            echo bf_ToolTip(BFText::_('COM_BREEZINGFORMS_ELEMENTS_QCOLTIPTITLE'));
            ?>
								</td>
							</tr>
							<tr>
								<td nowrap><?php 
            echo BFText::_('COM_BREEZINGFORMS_FORMS_CLASSFOR');
            ?>
 &lt;th&gt;:</td>
								<td nowrap>
									<input type="text" size="30" maxlength="30" name="colClass1" class="inputbox"/>
								</td>
							</tr>
							<tr>
								<td nowrap>&lt;th&gt; <?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_SPAN');
            ?>
:</td>
								<td nowrap>
									<input type="text" size="6" maxlength="6" name="colThspan" class="inputbox"/>
								</td>
							</tr>
							<tr>
								<td nowrap><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_ATTRIBUTES');
            ?>
:</td>
								<td nowrap>
									<select name="colThalign" size="1" class="inputbox">
										<option value="0" selected="selected"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_NONE');
            ?>
</option>
										<option value="1"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_LEFT');
            ?>
</option>
										<option value="2"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_CENTER');
            ?>
</option>
										<option value="3"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_RIGHT');
            ?>
</option>
										<option value="4"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_JUSTIFY');
            ?>
</option>
									</select>
									<select name="colThvalign" size="1" class="inputbox">
										<option value="0" selected="selected"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_NONE');
            ?>
</option>
										<option value="1"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_TOP');
            ?>
</option>
										<option value="2"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_MIDDLE');
            ?>
</option>
										<option value="3"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_BOTTOM');
            ?>
</option>
										<option value="4"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_BASELINE');
            ?>
</option>
									</select>
									<select name="colThwrap" size="1" class="inputbox">
										<option value="0" selected="selected"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_NONE');
            ?>
</option>
										<option value="1"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_NOWRAP');
            ?>
</option>
									</select>
								</td>
							</tr>
						</table>
						</fieldset>
					</td>
					<td></td>
				</tr>
				<tr>
					<td></td>
					<td>
						<fieldset><legend><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_DATA');
            ?>
</legend>
						<table class="adminform">
							<tr>
								<td nowrap><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_NAME');
            ?>
:</td>
								<td nowrap>
									<input type="text" size="30" maxlength="30" name="colName" class="inputbox"/>
<?php 
            echo bf_ToolTip(BFText::_('COM_BREEZINGFORMS_ELEMENTS_QCOLTIPNAME'));
            ?>
								</td>
							</tr>
							<tr>
								<td nowrap><?php 
            echo BFText::_('COM_BREEZINGFORMS_FORMS_CLASSFOR');
            ?>
 &lt;td(1)&gt;:</td>
								<td nowrap>
									<input type="text" size="30" maxlength="30" name="colClass2" class="inputbox"/>
								</td>
							</tr>
							<tr>
								<td nowrap><?php 
            echo BFText::_('COM_BREEZINGFORMS_FORMS_CLASSFOR');
            ?>
 &lt;td(2)&gt;:</td>
								<td nowrap>
									<input type="text" size="30" maxlength="30" name="colClass3" class="inputbox"/>
								</td>
							</tr>
							<tr>
								<td valign="top" nowrap><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_WIDTH');
            ?>
:</td>
								<td nowrap>
									<input type="text" size="6" maxlength="6" name="colWidth" class="inputbox"/>
                                                                        <br/>
                                                                        <select name="colWidthmd" size="1" class="inputbox">
										<option value="0" selected="selected">px</option>
										<option value="1">%</option>
									</select>
								</td>
							</tr>
							<tr>
								<td nowrap><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_ATTRIBUTES');
            ?>
:</td>
								<td nowrap>
									<select name="colAlign" size="1" class="inputbox">
										<option value="0" selected="selected"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_NONE');
            ?>
</option>
										<option value="1"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_LEFT');
            ?>
</option>
										<option value="2"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_CENTER');
            ?>
</option>
										<option value="3"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_RIGHT');
            ?>
</option>
										<option value="4"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_JUSTIFY');
            ?>
</option>
									</select>
									<select name="colValign" size="1" class="inputbox">
										<option value="0" selected="selected"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_NONE');
            ?>
</option>
										<option value="1"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_TOP');
            ?>
</option>
										<option value="2"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_MIDDLE');
            ?>
</option>
										<option value="3"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_BOTTOM');
            ?>
</option>
										<option value="4"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_BASELINE');
            ?>
</option>
									</select>
									<select name="colWrap" size="1" class="inputbox">
										<option value="0" selected="selected"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_NONE');
            ?>
</option>
										<option value="1"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_NOWRAP');
            ?>
</option>
									</select>
								</td>
							</tr>
							<tr>
								<td nowrap colspan="2">
									<?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_VALUE');
            ?>
:
									<a href="#" onClick="document.QueryColForm.colValue.rows=<?php 
            echo $ff_config->areasmall;
            ?>
;">[<?php 
            echo $ff_config->areasmall;
            ?>
]</a>
									<a href="#" onClick="document.QueryColForm.colValue.rows=<?php 
            echo $ff_config->areamedium;
            ?>
;">[<?php 
            echo $ff_config->areamedium;
            ?>
]</a>
									<a href="#" onClick="document.QueryColForm.colValue.rows=<?php 
            echo $ff_config->arealarge;
            ?>
;">[<?php 
            echo $ff_config->arealarge;
            ?>
]</a>
									<br/>
									<textarea wrap="off" name="colValue" style="width:500px;" rows="<?php 
            echo $ff_config->areasmall;
            ?>
" class="inputbox"></textarea>
								</td>
							</tr>
						</table>
						</fieldset>
					</td>
					<td></td>
				</tr>
				<tr>
					<td></td>
					<td nowrap colspan="2" style="text-align:right">
					
					<input class="btn btn-primary" onclick="qcolOk();" type="submit" value="<?php 
            echo htmlentities(BFText::_('COM_BREEZINGFORMS_TOOLBAR_SAVE'), ENT_QUOTES, 'UTF-8');
            ?>
"/>
					&nbsp;&nbsp;
                                        <input class="btn btn-primary" onclick="qcolCancel();" type="submit" value="<?php 
            echo htmlentities(BFText::_('COM_BREEZINGFORMS_TOOLBAR_CANCEL'), ENT_QUOTES, 'UTF-8');
            ?>
"/>
				
					</td>
					<td>&nbsp;</td>
				</tr>
			</table>
			</form>
                    <br/>
                    <br/>
		</div>
<?php 
        }
        // if Query List
        ?>
		<form action="index.php" method="post" name="adminForm" id="adminForm" class="adminForm">
		<table cellpadding="0" cellspacing="0" border="0" class="adminform" style="width:775px;">
			<tr><th colspan="3" class="title">BreezingForms - <?php 
        echo $action;
        ?>
 <?php 
        echo HTML_facileFormsElement::displayType($row->type);
        ?>
</th></tr>
			<tr>
				<td></td>
				<td width="100%">
<?php 
        $tabs = new BFTabs(0);
        $tabs->startPane("editPane");
        $tabs->startTab(BFText::_('COM_BREEZINGFORMS_ELEMENTS_SETTINGS'), "tab_settings");
        ?>
		<table cellpadding="0" cellspacing="0" border="0" class="adminform">

			<tr>
				<td></td>
				<td nowrap><?php 
        echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_TITLE');
        ?>
:</td>
				<td nowrap>
					<input type="text" size="50" maxlength="50" name="title" value="<?php 
        echo $row->title;
        ?>
" class="inputbox"/>
<?php 
        echo bf_ToolTip(BFText::_('COM_BREEZINGFORMS_ELEMENTS_TIPTITLE'));
        ?>
				</td>
				<td></td>
			</tr>
			<tr>
				<td></td>
				<td nowrap><?php 
        echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_NAME');
        ?>
:</td>
				<td nowrap>
					<input type="text" size="30" maxlength="30" name="name" value="<?php 
        echo $row->name;
        ?>
" class="inputbox"/>
<?php 
        echo bf_ToolTip(BFText::_('COM_BREEZINGFORMS_ELEMENTS_TIPNAME'));
        ?>
				</td>
				<td></td>
			</tr>

<?php 
        switch ($row->type) {
            case 'Hidden Input':
                break;
            default:
                ?>
			<tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_FORMS_CLASSFOR');
                ?>
 &lt;div&gt;:</td>
				<td nowrap>
					<input type="text" size="30" maxlength="30" name="class1" value="<?php 
                echo $row->class1;
                ?>
" class="inputbox"/>
				</td>
				<td></td>
			</tr>
<?php 
                break;
        }
        // switch
        $elemname = '';
        switch ($row->type) {
            case 'Image':
            case 'Tooltip':
            case 'Icon':
                $elemname = 'img';
                break;
            case 'Checkbox':
            case 'Radio Button':
            case 'Regular Button':
            case 'Text':
            case 'File Upload':
                $elemname = 'input';
                break;
            case 'Graphic Button':
                $elemname = 'button';
                break;
            case 'Select List':
                $elemname = 'select';
                break;
            case 'Textarea':
                $elemname = 'textarea';
                break;
            case 'Query List':
                $elemname = 'table';
                break;
            default:
        }
        // switch
        if ($elemname != '') {
            ?>
			<tr>
				<td></td>
				<td nowrap><?php 
            echo BFText::_('COM_BREEZINGFORMS_FORMS_CLASSFOR');
            ?>
 &lt;<?php 
            echo $elemname;
            ?>
&gt;:</td>
				<td nowrap>
					<input type="text" size="30" maxlength="30" name="class2" value="<?php 
            echo $row->class2;
            ?>
" class="inputbox"/>
				</td>
				<td></td>
			</tr>
<?php 
        }
        // if
        switch ($row->type) {
            case 'Query List':
                ?>
			<tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_FORMS_CLASSFOR');
                ?>
 &lt;tr(header)&gt;:</td>
				<td nowrap>
					<input type="text" size="30" maxlength="30" name="trhclass" class="inputbox"/>
				</td>
				<td></td>
			</tr>
			<tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_FORMS_CLASSFOR');
                ?>
 &lt;tr(data1)&gt;:</td>
				<td nowrap>
					<input type="text" size="30" maxlength="30" name="tr1class" class="inputbox"/>
				</td>
				<td></td>
			</tr>
			<tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_FORMS_CLASSFOR');
                ?>
 &lt;tr(data2)&gt;:</td>
				<td nowrap>
					<input type="text" size="30" maxlength="30" name="tr2class" class="inputbox"/>
				</td>
				<td></td>
			</tr>
			<tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_FORMS_CLASSFOR');
                ?>
 &lt;tr(footer)&gt;:</td>
				<td nowrap>
					<input type="text" size="30" maxlength="30" name="trfclass" class="inputbox"/>
				</td>
				<td></td>
			</tr>
			<tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_FORMS_CLASSFOR');
                ?>
 &lt;td(footer)&gt;:</td>
				<td nowrap>
					<input type="text" size="30" maxlength="30" name="tdfclass" class="inputbox"/>
				</td>
				<td></td>
			</tr>
<?php 
            default:
        }
        // switch
        ?>
			<tr>
				<td></td>
				<td nowrap><?php 
        echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_ORDERING');
        ?>
:</td>
				<td nowrap><?php 
        echo $lists['ordering'];
        ?>
</td>
				<td></td>
			</tr>

			<tr>
				<td></td>
				<td nowrap><?php 
        echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_PUBLISHED');
        ?>
:</td>
				<td nowrap><?php 
        echo JHTML::_('select.booleanlist', "published", "", $row->published);
        ?>
</td>
				<td></td>
			</tr>
<?php 
        switch ($row->type) {
            case 'Checkbox':
            case 'Radio Button':
            case 'Select List':
            case 'Query List':
            case 'Text':
            case 'File Upload':
            case 'Textarea':
            case 'Hidden Input':
                ?>
			<tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_INCINLOG');
                ?>
:</td>
				<td nowrap><?php 
                echo JHTML::_('select.booleanlist', "logging", "", $row->logging);
                ?>
</td>
				<td></td>
			</tr>
<?php 
                break;
            default:
                break;
        }
        // switch
        switch ($row->type) {
            case 'Hidden Input':
                break;
            default:
                ?>
			<tr>
				<td></td>
				<td valign="top" nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_POSITION');
                ?>
 X:</td>
				<td nowrap>
					<input type="text" size="6" maxlength="6" name="posx" value="<?php 
                echo $row->posx;
                ?>
" class="inputbox"/>
                                        <br/>
                                        <select name="posxmode" size="1" class="inputbox">
						<option value="0"<?php 
                if ($row->posxmode == 0) {
                    echo ' selected="selected"';
                }
                ?>
>px</option>
						<option value="1"<?php 
                if ($row->posxmode == 1) {
                    echo ' selected="selected"';
                }
                ?>
>%</option>
					</select>
				</td>
				<td></td>
			</tr>
                        
                        <tr>
				<td></td>
				<td valign="top" nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_POSITION');
                ?>
 Y:</td>
				<td nowrap>
					<input type="text" size="6" maxlength="6" name="posy" value="<?php 
                echo $row->posy;
                ?>
" class="inputbox"/>
                                        <br/>
                                        <select name="posymode" size="1" class="inputbox">
						<option value="0"<?php 
                if ($row->posymode == 0) {
                    echo ' selected="selected"';
                }
                ?>
>px</option>
						<option value="1"<?php 
                if ($row->posymode == 1) {
                    echo ' selected="selected"';
                }
                ?>
>%</option>
					</select>
				</td>
				<td></td>
			</tr>
<?php 
                break;
        }
        // switch
        switch ($row->type) {
            case 'Hidden Input':
                break;
            case 'Textarea':
                ?>
			<tr>
				<td></td>
				<td valign="top" nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_WIDTH');
                ?>
:</td>
				<td nowrap>
					<input type="text" size="6" maxlength="6" name="width" value="<?php 
                echo $row->width;
                ?>
" class="inputbox"/>
                                        <br/>
                                        <select name="widthmode" size="1" class="inputbox">
						<option value="0"<?php 
                if ($row->widthmode == 0) {
                    echo ' selected="selected"';
                }
                ?>
><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_COLUMNS');
                ?>
</option>
						<option value="1"<?php 
                if ($row->widthmode == 1) {
                    echo ' selected="selected"';
                }
                ?>
>px</option>
					</select>
				</td>
				<td></td>
			</tr>
                        
                        <tr>
				<td></td>
				<td valign="top" nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_HEIGHT');
                ?>
:</td>
				<td nowrap>
					<input type="text" size="6" maxlength="6" name="height" value="<?php 
                echo $row->height;
                ?>
" class="inputbox"/>
                                        <br/>
                                        <select name="heightmode" size="1" class="inputbox">
						<option value="0"<?php 
                if ($row->heightmode == 0) {
                    echo ' selected="selected"';
                }
                ?>
><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_ROWS');
                ?>
</option>
						<option value="1"<?php 
                if ($row->heightmode == 1) {
                    echo ' selected="selected"';
                }
                ?>
>px</option>
					</select>
				</td>
				<td></td>
			</tr>
<?php 
                break;
            case 'Captcha':
                ?>
			<tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_WIDTH');
                ?>
:</td>
				<td nowrap>
					<input type="text" size="6" maxlength="6" name="width" value="<?php 
                echo $row->width;
                ?>
" class="inputbox"/> px
					<input type="hidden" name="widthmode" value="1"/>
				</td>
				<td></td>
			</tr>
			<tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_HEIGHT');
                ?>
:</td>
				<td nowrap>
					<input type="text" size="6" maxlength="6" name="height" value="<?php 
                echo $row->height;
                ?>
" class="inputbox"/> px
				</td>
				<td></td>
			</tr>
<?php 
                break;
            case 'Text':
                ?>
			<tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_WIDTH');
                ?>
:</td>
				<td nowrap>
					<input type="text" size="6" maxlength="6" name="width" value="<?php 
                echo $row->width;
                ?>
" class="inputbox"/>
                                        <br/>
                                        <select name="widthmode" size="1" class="inputbox">
						<option value="0"<?php 
                if ($row->widthmode == 0) {
                    echo ' selected="selected"';
                }
                ?>
><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_COLUMNS');
                ?>
</option>
						<option value="1"<?php 
                if ($row->widthmode == 1) {
                    echo ' selected="selected"';
                }
                ?>
>px</option>
					</select>
                                </td>
				<td></td>
			</tr>
                        <tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_MAXLENGTH');
                ?>
:</td>
				<td nowrap>
					<input type="text" size="6" maxlength="6" name="height" value="<?php 
                echo $row->height;
                ?>
" class="inputbox"/> <?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_COLUMNS');
                ?>
				</td>
				<td></td>
			</tr>
			<tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_MAILBACK');
                ?>
:</td>
				<td nowrap>
					<?php 
                echo JHTML::_('select.booleanlist', "mailback", "", $row->mailback);
                ?>
                                </td>
				<td></td>
			</tr>
<?php 
                break;
            case 'Select List':
                ?>
			<tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_WIDTH');
                ?>
:</td>
				<td nowrap>
					<input type="text" size="6" maxlength="6" name="width" value="<?php 
                echo $row->width;
                ?>
" class="inputbox"/> px
                                </td>
				<td></td>
			</tr>
                        
                        <tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_HEIGHT');
                ?>
:</td>
				<td nowrap>
					<input type="text" size="6" maxlength="6" name="height" value="<?php 
                echo $row->height;
                ?>
" class="inputbox"/> px
				</td>
				<td></td>
			</tr>
<?php 
                break;
            case 'File Upload':
                ?>
			<tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_FIELDSZ');
                ?>
:</td>
				<td nowrap>
					<input type="text" size="6" maxlength="6" name="width" value="<?php 
                echo $row->width;
                ?>
" class="inputbox"/>
				</td>
				<td></td>
			</tr>
                        
                        <tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_MAXFILESIZE');
                ?>
:</td>
				<td nowrap>
					<input type="text" size="8" maxlength="8" name="height" value="<?php 
                echo $row->height;
                ?>
" class="inputbox"/>
				</td>
				<td></td>
			</tr>
<?php 
                break;
            case 'Static Text/HTML':
            case 'Rectangle':
            case 'Image':
                ?>
			<tr>
				<td></td>
				<td valign="top" nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_WIDTH');
                ?>
:</td>
				<td nowrap>
					<input type="text" size="6" maxlength="6" name="width" value="<?php 
                echo $row->width;
                ?>
" class="inputbox"/>
                                        <br/>
                                        <select name="widthmode" size="1" class="inputbox">
						<option value="0"<?php 
                if ($row->widthmode == 0) {
                    echo ' selected="selected"';
                }
                ?>
>px</option>
						<option value="1"<?php 
                if ($row->widthmode == 1) {
                    echo ' selected="selected"';
                }
                ?>
>%</option>
					</select>
				</td>
				<td></td>
			</tr>
                        <tr>
				<td></td>
				<td valign="top" nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_HEIGHT');
                ?>
:</td>
				<td nowrap>
					<input type="text" size="6" maxlength="6" name="height" value="<?php 
                echo $row->height;
                ?>
" class="inputbox"/>
                                        <br/>
                                        <select name="heightmode" size="1" class="inputbox">
						<option value="0"<?php 
                if ($row->heightmode == 0) {
                    echo ' selected="selected"';
                }
                ?>
>px</option>
						<option value="1"<?php 
                if ($row->heightmode == 1) {
                    echo ' selected="selected"';
                }
                ?>
>%</option>
					</select>
<?php 
                if ($row->type == 'Image') {
                    echo bf_ToolTip(BFText::_('COM_BREEZINGFORMS_ELEMENTS_IMAGE0'));
                } else {
                    echo bf_ToolTip(BFText::_('COM_BREEZINGFORMS_ELEMENTS_OTHER0'));
                }
                ?>
				</td>
				<td></td>
			</tr>
<?php 
                break;
            case 'Query List':
                ?>
			<tr>
				<td></td>
				<td valign="top" nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_WIDTH');
                ?>
:</td>
				<td nowrap>
					<input type="text" size="6" maxlength="6" name="width" value="<?php 
                echo $row->width;
                ?>
" class="inputbox"/>
                                        <br/>
                                        <select name="widthmode" size="1" class="inputbox">
						<option value="0"<?php 
                if ($row->widthmode == 0) {
                    echo ' selected="selected"';
                }
                ?>
>px</option>
						<option value="1"<?php 
                if ($row->widthmode == 1) {
                    echo ' selected="selected"';
                }
                ?>
>%</option>
					</select>
				</td>
				<td></td>
			</tr>
                        <tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_ROWSPERPAGE');
                ?>
:</td>
				<td nowrap>
					<input type="text" size="6" maxlength="6" name="height" value="<?php 
                echo $row->height;
                ?>
" class="inputbox" onchange="showpagenav(this.value)"/>
				</td>
				<td></td>
			</tr>
			<tr id="pagenavrow"<?php 
                if ($row->height == 0) {
                    echo ' style="display:none"';
                }
                ?>
>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_PAGENAV');
                ?>
:</td>
				<td nowrap>
					<select name="pagenav" size="1" class="inputbox">
						<option value="0">none</option>
						<option value="1" selected="selected">&lt;&lt; <?php 
                echo BFText::_('COM_BREEZINGFORMS_PROCESS_PAGESTART');
                ?>
 &lt; <?php 
                echo BFText::_('COM_BREEZINGFORMS_PROCESS_PAGEPREV');
                ?>
 1 2 3 <?php 
                BFText::_('COM_BREEZINGFORMS_PROCESS_PAGENEXT');
                ?>
 &gt; <?php 
                BFText::_('COM_BREEZINGFORMS_PROCESS_PAGEEND');
                ?>
 &gt;&gt;</option>
						<option value="2">&lt;&lt; <?php 
                echo BFText::_('COM_BREEZINGFORMS_PROCESS_PAGESTART');
                ?>
 &lt; <?php 
                echo BFText::_('COM_BREEZINGFORMS_PROCESS_PAGEPREV');
                ?>
 <?php 
                echo BFText::_('COM_BREEZINGFORMS_PROCESS_PAGENEXT');
                ?>
 &gt; <?php 
                echo BFText::_('COM_BREEZINGFORMS_PROCESS_PAGEEND');
                ?>
 &gt;&gt;</option>
						<option value="3">&lt;&lt; &lt; 1 2 3 &gt; &gt;&gt;</option>
						<option value="4">&lt;&lt; &lt; &gt; &gt;&gt;</option>
						<option value="5">1 2 3</option>
					</select>
				</td>
				<td></td>
			</tr>
<?php 
                break;
            default:
                break;
        }
        // switch
        switch ($row->type) {
            case 'Checkbox':
            case 'Radio Button':
                ?>
			<tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_CHECKED');
                ?>
:</td>
				<td nowrap><?php 
                echo JHTML::_('select.booleanlist', "flag1", "", $row->flag1);
                ?>
</td>
				<td></td>
			</tr>
<?php 
                break;
            case 'Select List':
                ?>
			<tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_MULTIPLE');
                ?>
:</td>
				<td nowrap><?php 
                echo JHTML::_('select.booleanlist', "flag1", "", $row->flag1);
                ?>
</td>
				<td></td>
			</tr>
<?php 
                break;
            case 'Query List':
                ?>
			<tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_SHOWHEADER');
                ?>
:</td>
				<td nowrap><?php 
                echo JHTML::_('select.booleanlist', "flag1", "", $row->flag1);
                ?>
</td>
				<td></td>
			</tr>
<?php 
                break;
            case 'Text':
                ?>
			<tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_PASSWORD');
                ?>
:</td>
				<td nowrap><?php 
                echo JHTML::_('select.booleanlist', "flag1", "", $row->flag1);
                ?>
</td>
				<td></td>
			</tr>
<?php 
                break;
            case 'File Upload':
                ?>
			<tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_UPLDTIMESTAMP');
                ?>
:</td>
				<td nowrap><?php 
                echo JHTML::_('select.booleanlist', "flag1", "", $row->flag1);
                ?>
</td>
				<td></td>
			</tr>
<?php 
                break;
            case 'Tooltip':
                ?>
			<tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_TYPE');
                ?>
:</td>
				<td nowrap>
					<input type="radio" id="flag10" name="flag1" value="0"<?php 
                if ($row->flag1 == 0) {
                    echo ' checked="checked"';
                }
                ?>
 onclick="disptooltipurl(this.value)"/><label for="flag10"> <img src="<?php 
                echo $ff_mossite;
                ?>
components/com_breezingforms/images/js/ThemeOffice/tooltip.png" alt="" border="0"/></label>&nbsp;&nbsp;&nbsp;&nbsp;
					<input type="radio" id="flag11" name="flag1" value="1"<?php 
                if ($row->flag1 == 1) {
                    echo ' checked="checked"';
                }
                ?>
 onclick="disptooltipurl(this.value)"/><label for="flag11"> <img src="<?php 
                echo $ff_mossite;
                ?>
components/com_breezingforms/images/js/ThemeOffice/warning.png" alt="" border="0"/></label>&nbsp;&nbsp;&nbsp;&nbsp;
					<input type="radio" id="flag12" name="flag1" value="2"<?php 
                if ($row->flag1 == 2) {
                    echo ' checked="checked"';
                }
                ?>
 onclick="disptooltipurl(this.value)"/><label for="flag12"> <?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_CUSTOM');
                ?>
</label>
				<td></td>
			</tr>
<?php 
            default:
                break;
        }
        // switch
        switch ($row->type) {
            case 'Checkbox':
            case 'Radio Button':
            case 'Regular Button':
            case 'Graphic Button':
            case 'Select List':
            case 'File Upload':
                ?>
			<tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_TYPE');
                ?>
:</td>
				<td nowrap>
					<select name="flag2" size="1" class="inputbox">
						<option value="0"<?php 
                if ($row->flag2 == 0) {
                    echo ' selected="selected"';
                }
                ?>
><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_ENABLED');
                ?>
</option>
						<option value="1"<?php 
                if ($row->flag2 == 1) {
                    echo ' selected="selected"';
                }
                ?>
><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_DISABLED');
                ?>
</option>
					</select>
				<td></td>
			</tr>
<?php 
                break;
            case 'Icon':
                ?>
			<tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_BORDER');
                ?>
:</td>
				<td nowrap><?php 
                echo JHTML::_('select.booleanlist', "flag2", "", $row->flag2);
                ?>
</td>
				<td></td>
			</tr>
<?php 
                break;
            case 'Text':
            case 'Textarea':
                ?>
			<tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_TYPE');
                ?>
:</td>
				<td nowrap>
					<select name="flag2" size="1" class="inputbox">
						<option value="0"<?php 
                if ($row->flag2 == 0) {
                    echo ' selected="selected"';
                }
                ?>
><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_ENABLED');
                ?>
</option>
						<option value="1"<?php 
                if ($row->flag2 == 1) {
                    echo ' selected="selected"';
                }
                ?>
><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_DISABLED');
                ?>
</option>
						<option value="2"<?php 
                if ($row->flag2 == 2) {
                    echo ' selected="selected"';
                }
                ?>
><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_READONLY');
                ?>
</option>
					</select>
				<td></td>
			</tr>
<?php 
                break;
            case 'Query List':
                ?>
			<tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_FIRSTCOLUMN');
                ?>
:</td>
				<td nowrap>
					<select name="flag2" size="1" class="inputbox">
						<option value="0"<?php 
                if ($row->flag2 == 0) {
                    echo ' selected="selected"';
                }
                ?>
><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_NORMAL');
                ?>
</option>
						<option value="1"<?php 
                if ($row->flag2 == 1) {
                    echo ' selected="selected"';
                }
                ?>
><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_CHECKBOXES');
                ?>
</option>
						<option value="2"<?php 
                if ($row->flag2 == 2) {
                    echo ' selected="selected"';
                }
                ?>
><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_RADIOBUTTONS');
                ?>
</option>
					</select>
				</td>
				<td></td>
			</tr>
<?php 
                break;
            default:
                break;
        }
        // switch
        switch ($row->type) {
            case 'File Upload':
                ?>
			<tr>
				<td></td>
				<td nowrap colspan="2">
					<?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_UPLDIR');
                ?>
:
					<a href="#" onClick="textAreaResize('data1',<?php 
                echo $ff_config->areasmall;
                ?>
);">[<?php 
                echo $ff_config->areasmall;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data1',<?php 
                echo $ff_config->areamedium;
                ?>
);">[<?php 
                echo $ff_config->areamedium;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data1',<?php 
                echo $ff_config->arealarge;
                ?>
);">[<?php 
                echo $ff_config->arealarge;
                ?>
]</a>
					<br/>
					<textarea wrap="off" name="data1" style="width:700px;" rows="<?php 
                echo $ff_config->areasmall;
                ?>
" class="inputbox"><?php 
                echo htmlspecialchars($row->data1, ENT_QUOTES);
                ?>
</textarea>
				</td>
				<td></td>
			</tr>
<?php 
                break;
            case 'Static Text/HTML':
                ?>
			<tr>
				<td></td>
				<td nowrap colspan="2">
					<?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_TEXTHTML');
                ?>
:
<?php 
                if ($ff_config->wysiwyg) {
                    echo '<br/>';
                    jimport('joomla.html.editor');
                    $editor = JFactory::getEditor();
                    echo $editor->display('data1', $row->data1, 'data1', '500', '100%', '45', '10');
                } else {
                    echo '<a href="#" onClick="textAreaResize(\'data1\',' . $ff_config->areasmall . ');">[' . $ff_config->areasmall . ']</a> ' . '<a href="#" onClick="textAreaResize(\'data1\',' . $ff_config->areamedium . ');">[' . $ff_config->areamedium . ']</a> ' . '<a href="#" onClick="textAreaResize(\'data1\',' . $ff_config->arealarge . ');">[' . $ff_config->arealarge . ']</a>' . '<br/>' . '<textarea wrap="off" name="data1" style="width:700px;" rows="' . $ff_config->areasmall . '" class="inputbox">' . htmlspecialchars($row->data1, ENT_QUOTES) . '</textarea>';
                }
                // if
                ?>
				</td>
				<td></td>
			</tr>
<?php 
                break;
            case 'Textarea':
                ?>
			<tr>
				<td></td>
				<td nowrap colspan="2">
					<?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_VALUE');
                ?>
:
					<a href="#" onClick="textAreaResize('data1',<?php 
                echo $ff_config->areasmall;
                ?>
);">[<?php 
                echo $ff_config->areasmall;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data1',<?php 
                echo $ff_config->areamedium;
                ?>
);">[<?php 
                echo $ff_config->areamedium;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data1',<?php 
                echo $ff_config->arealarge;
                ?>
);">[<?php 
                echo $ff_config->arealarge;
                ?>
]</a>
					<br/>
					<textarea wrap="off" name="data1" style="width:700px;" rows="<?php 
                echo $ff_config->areasmall;
                ?>
" class="inputbox"><?php 
                echo htmlspecialchars($row->data1, ENT_QUOTES);
                ?>
</textarea>
				</td>
				<td></td>
			</tr>
<?php 
                break;
            case 'Hidden Input':
            case 'Checkbox':
            case 'Radio Button':
            case 'Text':
                ?>
			<tr>
				<td></td>
				<td nowrap colspan="2">
					<?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_VALUE');
                ?>
:
					<a href="#" onClick="textAreaResize('data1',<?php 
                echo $ff_config->areasmall;
                ?>
);">[<?php 
                echo $ff_config->areasmall;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data1',<?php 
                echo $ff_config->areamedium;
                ?>
);">[<?php 
                echo $ff_config->areamedium;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data1',<?php 
                echo $ff_config->arealarge;
                ?>
);">[<?php 
                echo $ff_config->arealarge;
                ?>
]</a>
					<br/>
					<textarea wrap="off" name="data1" style="width:700px" rows="<?php 
                echo $ff_config->areasmall;
                ?>
" class="inputbox"><?php 
                echo htmlspecialchars($row->data1, ENT_QUOTES);
                ?>
</textarea>
				</td>
				<td></td>
			</tr>
<?php 
                break;
            case 'Rectangle':
                ?>
			<tr>
				<td></td>
				<td nowrap colspan="2">
					<?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_BORDER');
                ?>
:
					<a href="#" onClick="textAreaResize('data1',<?php 
                echo $ff_config->areasmall;
                ?>
);">[<?php 
                echo $ff_config->areasmall;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data1',<?php 
                echo $ff_config->areamedium;
                ?>
);">[<?php 
                echo $ff_config->areamedium;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data1',<?php 
                echo $ff_config->arealarge;
                ?>
);">[<?php 
                echo $ff_config->arealarge;
                ?>
]</a>
					<br/>
					<textarea wrap="off" name="data1" style="width:700px;" rows="<?php 
                echo $ff_config->areasmall;
                ?>
" class="inputbox"><?php 
                echo htmlspecialchars($row->data1, ENT_QUOTES);
                ?>
</textarea>
				</td>
				<td></td>
			</tr>
<?php 
                break;
            case 'Image':
            case 'Graphic Button':
            case 'Icon':
                ?>
			<tr>
				<td></td>
				<td nowrap colspan="2">
					<?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_IMGURL');
                ?>
:
					<a href="#" onClick="textAreaResize('data1',<?php 
                echo $ff_config->areasmall;
                ?>
);">[<?php 
                echo $ff_config->areasmall;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data1',<?php 
                echo $ff_config->areamedium;
                ?>
);">[<?php 
                echo $ff_config->areamedium;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data1',<?php 
                echo $ff_config->arealarge;
                ?>
);">[<?php 
                echo $ff_config->arealarge;
                ?>
]</a>
					<br/>
					<textarea wrap="off" name="data1" style="width:700px;" rows="<?php 
                echo $ff_config->areasmall;
                ?>
" class="inputbox"><?php 
                echo htmlspecialchars($row->data1, ENT_QUOTES);
                ?>
</textarea>
				</td>
				<td></td>
			</tr>
<?php 
                break;
            case 'Tooltip':
                ?>
			<tr id="tooltipurl" style="display:none;">
				<td></td>
				<td nowrap colspan="2">
					<?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_IMGURL');
                ?>
:
					<a href="#" onClick="textAreaResize('data1',<?php 
                echo $ff_config->areasmall;
                ?>
);">[<?php 
                echo $ff_config->areasmall;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data1',<?php 
                echo $ff_config->areamedium;
                ?>
);">[<?php 
                echo $ff_config->areamedium;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data1',<?php 
                echo $ff_config->arealarge;
                ?>
);">[<?php 
                echo $ff_config->arealarge;
                ?>
]</a>
					<br/>
					<textarea wrap="off" name="data1" style="width:700px;" rows="<?php 
                echo $ff_config->areasmall;
                ?>
" class="inputbox"><?php 
                echo htmlspecialchars($row->data1, ENT_QUOTES);
                ?>
</textarea>
				</td>
				<td></td>
			</tr>
<?php 
                break;
            case 'Select List':
                ?>
			<tr>
				<td></td>
				<td nowrap colspan="2">
					<?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_SIZE');
                ?>
:
					<a href="#" onClick="textAreaResize('data1',<?php 
                echo $ff_config->areasmall;
                ?>
);">[<?php 
                echo $ff_config->areasmall;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data1',<?php 
                echo $ff_config->areamedium;
                ?>
);">[<?php 
                echo $ff_config->areamedium;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data1',<?php 
                echo $ff_config->arealarge;
                ?>
);">[<?php 
                echo $ff_config->arealarge;
                ?>
]</a>
					<br/>
					<textarea wrap="off" name="data1" style="width:700px;" rows="<?php 
                echo $ff_config->areasmall;
                ?>
" class="inputbox"><?php 
                echo htmlspecialchars($row->data1, ENT_QUOTES);
                ?>
</textarea>
				</td>
				<td></td>
			</tr>
<?php 
                break;
            case 'Query List':
                ?>
			<tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_BORDERWIDTH');
                ?>
:</td>
				<td nowrap>
					<input type="text" size="3" maxlength="2" name="border" class="inputbox"/>
				</td>
				<td></td>
			</tr>
                        
                        <tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_CELLSPACING');
                ?>
:</td>
				<td nowrap>
					<input type="text" size="3" maxlength="2" name="cellspacing" class="inputbox"/>
				</td>
				<td></td>
			</tr>
                        
                        <tr>
				<td></td>
				<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_CELLPADDING');
                ?>
:</td>
				<td nowrap>
					<input type="text" size="3" maxlength="2" name="cellpadding" class="inputbox"/>
				</td>
				<td></td>
			</tr>
<?php 
                break;
            default:
                break;
        }
        // switch
        switch ($row->type) {
            case 'Icon':
                ?>
			<tr>
				<td></td>
				<td nowrap colspan="2">
					<?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_IMGURLF2');
                ?>
:
					<a href="#" onClick="textAreaResize('data3',<?php 
                echo $ff_config->areasmall;
                ?>
);">[<?php 
                echo $ff_config->areasmall;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data3',<?php 
                echo $ff_config->areamedium;
                ?>
);">[<?php 
                echo $ff_config->areamedium;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data3',<?php 
                echo $ff_config->arealarge;
                ?>
);">[<?php 
                echo $ff_config->arealarge;
                ?>
]</a>
					<br/>
					<textarea wrap="off" name="data3" style="width:700px;" rows="<?php 
                echo $ff_config->areasmall;
                ?>
" class="inputbox"><?php 
                echo htmlspecialchars($row->data3, ENT_QUOTES);
                ?>
</textarea>
				</td>
				<td></td>
			</tr>
<?php 
                break;
            default:
                break;
        }
        // switch
        switch ($row->type) {
            case 'File Upload':
                ?>
			<tr>
				<td></td>
				<td nowrap colspan="2">
					<?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_MIMETYPES');
                ?>
:
					<a href="#" onClick="textAreaResize('data2',<?php 
                echo $ff_config->areasmall;
                ?>
);">[<?php 
                echo $ff_config->areasmall;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data2',<?php 
                echo $ff_config->areamedium;
                ?>
);">[<?php 
                echo $ff_config->areamedium;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data2',<?php 
                echo $ff_config->arealarge;
                ?>
);">[<?php 
                echo $ff_config->arealarge;
                ?>
]</a>
					<br/>
					<textarea wrap="off" name="data2" style="width:700px;" rows="<?php 
                echo $ff_config->areasmall;
                ?>
" class="inputbox"><?php 
                echo htmlspecialchars($row->data2, ENT_QUOTES);
                ?>
</textarea>
				</td>
				<td></td>
			</tr>
<?php 
                break;
            case 'Graphic Button':
            case 'Icon':
                ?>
			<tr>
				<td></td>
				<td colspan="2">
					<fieldset><legend><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_CAPTION');
                ?>
</legend>
						<table cellpadding="4" cellspacing="1" border="0">
							<tr>
								<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_TYPE');
                ?>
:</td>
								<td nowrap>
									<input type="radio" id="flag10" name="flag1" value="0"<?php 
                if ($row->flag1 == 0) {
                    echo ' checked="checked"';
                }
                ?>
 onclick="dispcaptiontext(this.value)"/><label for="flag10"> <?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_NONE');
                ?>
</label>
									<input type="radio" id="flag11" name="flag1" value="1"<?php 
                if ($row->flag1 == 1) {
                    echo ' checked="checked"';
                }
                ?>
 onclick="dispcaptiontext(this.value)"/><label for="flag11"> <?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_BELOW');
                ?>
</label>
									<input type="radio" id="flag12" name="flag1" value="2"<?php 
                if ($row->flag1 == 2) {
                    echo ' checked="checked"';
                }
                ?>
 onclick="dispcaptiontext(this.value)"/><label for="flag12"> <?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_ABOVE');
                ?>
</label>
									<input type="radio" id="flag13" name="flag1" value="3"<?php 
                if ($row->flag1 == 3) {
                    echo ' checked="checked"';
                }
                ?>
 onclick="dispcaptiontext(this.value)"/><label for="flag13"> <?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_LEFT');
                ?>
</label>
									<input type="radio" id="flag14" name="flag1" value="4"<?php 
                if ($row->flag1 == 4) {
                    echo ' checked="checked"';
                }
                ?>
 onclick="dispcaptiontext(this.value)"/><label for="flag14"> <?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_RIGHT');
                ?>
</label>
								</td>
							</tr>
							<tr id="captiontext" style="display:none;">
								<td nowrap colspan="2">
									<?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_TEXT');
                ?>
:
									<a href="#" onClick="textAreaResize('data2',<?php 
                echo $ff_config->areasmall;
                ?>
);">[<?php 
                echo $ff_config->areasmall;
                ?>
]</a>
									<a href="#" onClick="textAreaResize('data2',<?php 
                echo $ff_config->areamedium;
                ?>
);">[<?php 
                echo $ff_config->areamedium;
                ?>
]</a>
									<a href="#" onClick="textAreaResize('data2',<?php 
                echo $ff_config->arealarge;
                ?>
);">[<?php 
                echo $ff_config->arealarge;
                ?>
]</a>
									<br/>
									<textarea wrap="off" name="data2" style="width:680px;" rows="<?php 
                echo $ff_config->areasmall;
                ?>
" class="inputbox"><?php 
                echo htmlspecialchars($row->data2, ENT_QUOTES);
                ?>
</textarea>
								</td>
							</tr>
						</table>
					</fieldset>
				</td>
				<td></td>
			</tr>
<?php 
                break;
            case 'Tooltip':
                ?>
			<tr>
				<td></td>
				<td nowrap colspan="2">
					<?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_TEXT');
                ?>
:
					<a href="#" onClick="textAreaResize('data2',<?php 
                echo $ff_config->areasmall;
                ?>
);">[<?php 
                echo $ff_config->areasmall;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data2',<?php 
                echo $ff_config->areamedium;
                ?>
);">[<?php 
                echo $ff_config->areamedium;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data2',<?php 
                echo $ff_config->arealarge;
                ?>
);">[<?php 
                echo $ff_config->arealarge;
                ?>
]</a>
					<br/>
					<textarea wrap="off" name="data2" style="width:700px;" rows="<?php 
                echo $ff_config->areasmall;
                ?>
" class="inputbox"><?php 
                echo htmlspecialchars($row->data2, ENT_QUOTES);
                ?>
</textarea>
				</td>
				<td></td>
			</tr>
<?php 
                break;
            case 'Radio Button':
                ?>
			<tr>
				<td></td>
				<td nowrap colspan="2">
					<?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_CAPTION');
                ?>
:
					<a href="#" onClick="textAreaResize('data2',<?php 
                echo $ff_config->areasmall;
                ?>
);">[<?php 
                echo $ff_config->areasmall;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data2',<?php 
                echo $ff_config->areamedium;
                ?>
);">[<?php 
                echo $ff_config->areamedium;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data2',<?php 
                echo $ff_config->arealarge;
                ?>
);">[<?php 
                echo $ff_config->arealarge;
                ?>
]</a>
					<br/>
					<textarea wrap="off" name="data2" style="width:700px;" rows="<?php 
                echo $ff_config->areasmall;
                ?>
" class="inputbox"><?php 
                echo htmlspecialchars($row->data2, ENT_QUOTES);
                ?>
</textarea>
				</td>
				<td></td>
			</tr>
<?php 
                break;
            case 'Checkbox':
            case 'Regular Button':
                ?>
			<tr>
				<td></td>
				<td nowrap colspan="2">
					<?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_LABEL');
                ?>
:
					<a href="#" onClick="textAreaResize('data2',<?php 
                echo $ff_config->areasmall;
                ?>
);">[<?php 
                echo $ff_config->areasmall;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data2',<?php 
                echo $ff_config->areamedium;
                ?>
);">[<?php 
                echo $ff_config->areamedium;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data2',<?php 
                echo $ff_config->arealarge;
                ?>
);">[<?php 
                echo $ff_config->arealarge;
                ?>
]</a>
					<br/>
					<textarea wrap="off" name="data2" style="width:700px;" rows="<?php 
                echo $ff_config->areasmall;
                ?>
" class="inputbox"><?php 
                echo htmlspecialchars($row->data2, ENT_QUOTES);
                ?>
</textarea>
				</td>
				<td></td>
			</tr>
<?php 
                break;
            case 'Rectangle':
                ?>
			<tr>
				<td></td>
				<td nowrap colspan="2">
					<?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_BKGCOLOR');
                ?>
:
					<a href="#" onClick="textAreaResize('data2',<?php 
                echo $ff_config->areasmall;
                ?>
);">[<?php 
                echo $ff_config->areasmall;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data2',<?php 
                echo $ff_config->areamedium;
                ?>
);">[<?php 
                echo $ff_config->areamedium;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data2',<?php 
                echo $ff_config->arealarge;
                ?>
);">[<?php 
                echo $ff_config->arealarge;
                ?>
]</a>
					<br/>
					<textarea wrap="off" name="data2" style="width:700px;" rows="<?php 
                echo $ff_config->areasmall;
                ?>
" class="inputbox"><?php 
                echo htmlspecialchars($row->data2, ENT_QUOTES);
                ?>
</textarea>
				</td>
				<td></td>
			</tr>
<?php 
                break;
            case 'Image':
                ?>
			<tr>
				<td></td>
				<td nowrap colspan="2">
					<?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_ALTTEXT');
                ?>
:
					<a href="#" onClick="textAreaResize('data2',<?php 
                echo $ff_config->areasmall;
                ?>
);">[<?php 
                echo $ff_config->areasmall;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data2',<?php 
                echo $ff_config->areamedium;
                ?>
);">[<?php 
                echo $ff_config->areamedium;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data2',<?php 
                echo $ff_config->arealarge;
                ?>
);">[<?php 
                echo $ff_config->arealarge;
                ?>
]</a>
					<br/>
					<textarea wrap="off" name="data2" style="width:700px;" rows="<?php 
                echo $ff_config->areasmall;
                ?>
" class="inputbox"><?php 
                echo htmlspecialchars($row->data2, ENT_QUOTES);
                ?>
</textarea>
				</td>
				<td></td>
			</tr>
<?php 
                break;
            case 'Select List':
                ?>
			<tr>
				<td></td>
				<td nowrap colspan="2">
					<?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_OPTIONS');
                ?>
:
					<a href="#" onClick="textAreaResize('data2',<?php 
                echo $ff_config->areasmall;
                ?>
);">[<?php 
                echo $ff_config->areasmall;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data2',<?php 
                echo $ff_config->areamedium;
                ?>
);">[<?php 
                echo $ff_config->areamedium;
                ?>
]</a>
					<a href="#" onClick="textAreaResize('data2',<?php 
                echo $ff_config->arealarge;
                ?>
);">[<?php 
                echo $ff_config->arealarge;
                ?>
]</a>
					<a href="#" onClick="addOption();"><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_ADDOPTIONS');
                ?>
</a>
					<br/>
					<textarea wrap="off" name="data2" style="width:700px;" rows="<?php 
                echo $ff_config->areasmall;
                ?>
" class="inputbox"><?php 
                echo htmlspecialchars($row->data2, ENT_QUOTES);
                ?>
</textarea>
<?php 
                echo bf_ToolTip(BFText::_('COM_BREEZINGFORMS_ELEMENTS_OPTINFO'));
                ?>
				</td>
				<td></td>
			</tr>
<?php 
                break;
            default:
                break;
        }
        // switch
        ?>
		</table>
<?php 
        if ($row->type == 'Query List') {
            $tabs->endTab();
            $tabs->startTab(BFText::_('COM_BREEZINGFORMS_ELEMENTS_QUERY'), "tab_query");
            ?>
		<table class="adminform">
			<tr>
				<td></td>
				<td nowrap colspan="2">
					<a href="#" onClick="codeAreaResize('data2',<?php 
            echo $ff_config->areasmall;
            ?>
);">[<?php 
            echo $ff_config->areasmall;
            ?>
]</a>
					<a href="#" onClick="codeAreaResize('data2',<?php 
            echo $ff_config->areamedium;
            ?>
);">[<?php 
            echo $ff_config->areamedium;
            ?>
]</a>
					<a href="#" onClick="codeAreaResize('data2',<?php 
            echo $ff_config->arealarge;
            ?>
);">[<?php 
            echo $ff_config->arealarge;
            ?>
]</a>
					<a href="#" onClick="createQueryCode();"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_CREATEQUERY');
            ?>
</a>
					<?php 
            echo bf_ToolTip(BFText::_('COM_BREEZINGFORMS_ELEMENTS_TIPQUERY'));
            ?>
					<br />
					<textarea onFocus="codeAreaFocus(this);" readonly="readonly" wrap="off" name="data2lines" style="width:60px;" rows="<?php 
            echo $ff_config->areamedium;
            ?>
" class="inputbox"></textarea>
					<textarea onFocus="codeAreaFocus(this);" onKeyUp="codeAreaChange(this,event);" wrap="off" name="data2" style="width:630px;" rows="<?php 
            echo $ff_config->areamedium;
            ?>
" class="inputbox"><?php 
            echo htmlspecialchars($row->data2, ENT_QUOTES);
            ?>
</textarea>
				</td>
				<td></td>
			</tr>
		</table>
<?php 
            $tabs->endTab();
            $tabs->startTab(BFText::_('COM_BREEZINGFORMS_ELEMENTS_QUERYCOLS'), "tab_querycols");
            ?>
		<table width="100%" class="adminform">
			<tr>
				<td></td>
				<td nowrap colspan="2">
					<div style="text-align:right;">
						<input type="button" value="<?php 
            echo BFText::_('COM_BREEZINGFORMS_TOOLBAR_NEW');
            ?>
" onclick="qcolAdd()" class="button btn btn-primary"/>
						<input type="button" value="<?php 
            echo BFText::_('COM_BREEZINGFORMS_TOOLBAR_COPY');
            ?>
" onclick="qcolCopy()" class="button btn btn-primary"/>
						<input type="button" value="<?php 
            echo BFText::_('COM_BREEZINGFORMS_TOOLBAR_DELETE');
            ?>
" onclick="qcolDelete()" class="button btn btn-primary"/>
					</div><br/>
					<table id="qcolTable" width="100%" class="adminlist table table-striped">
						<tr>
							<th nowrap valign="top" align="center"><input id="qcolCbAll" name="qcolCbAll" type="checkbox" value="1" onclick="qcolCheckAll(this.checked);" /></th>
							<th width="100%" valign="top" align="left"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_TITLE');
            ?>
</th>
							<th nowrap valign="top" align="left"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_NAME');
            ?>
</th>
							<th nowrap valign="top" align="left"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_HEADER') . ' ' . BFText::_('COM_BREEZINGFORMS_ELEMENTS_ATTRIBUTES');
            ?>
</th>
							<th nowrap valign="top" align="left"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_DATA') . ' ' . BFText::_('COM_BREEZINGFORMS_ELEMENTS_ATTRIBUTES');
            ?>
</th>
							<th nowrap valign="top" align="left"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_WIDTH');
            ?>
</th>
							<th nowrap valign="top" align="center" colspan="2"><?php 
            echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_REORDER');
            ?>
</th>
						</tr>
					</table>
				</td>
				<td></td>
			</tr>
		</table>
<?php 
        }
        // if
        if ($hasInit || $hasAction || $hasValidation) {
            $tabs->endTab();
            $tabs->startTab(BFText::_('COM_BREEZINGFORMS_ELEMENTS_SCRIPTS'), "tab_scripts");
            ?>
		<table class="adminform">
<?php 
            if ($hasInit) {
                ?>
			<tr>
				<td></td>
				<td colspan="2">
					<fieldset><legend><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_INITSCRIPT');
                ?>
</legend>
						<table cellpadding="4" cellspacing="1" border="0">
							<tr>
								<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_TYPE');
                ?>
:</td>
								<td nowrap>
									<input type="radio" id="script1cond1" name="script1cond" value="0" onclick="dispinit(this.value)"<?php 
                if ($row->script1cond == 0) {
                    echo ' checked="checked"';
                }
                ?>
 /><label for="script1cond1"> <?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_NONE');
                ?>
</label>
									<input type="radio" id="script1cond2" name="script1cond" value="1" onclick="dispinit(this.value)"<?php 
                if ($row->script1cond == 1) {
                    echo ' checked="checked"';
                }
                ?>
 /><label for="script1cond2"> <?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_LIBRARY');
                ?>
</label>
									<input type="radio" id="script1cond3" name="script1cond" value="2" onclick="dispinit(this.value)"<?php 
                if ($row->script1cond == 2) {
                    echo ' checked="checked"';
                }
                ?>
 /><label for="script1cond3"> <?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_CUSTOM');
                ?>
</label>
								</td>
								<td></td>
							</tr>
							<tr id="initexec" style="display:none;">
								<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_CONDITIONS');
                ?>
:</td>
								<td nowrap>
									<input type="checkbox" id="script1flag1" name="script1flag1" value="1"<?php 
                if ($row->script1flag1 == 1) {
                    echo ' checked="checked"';
                }
                ?>
 /><label for="script1flag1"> <?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_FORMENTRY');
                ?>
</label>
									<input type="checkbox" id="script1flag2" name="script1flag2" value="1"<?php 
                if ($row->script1flag2 == 1) {
                    echo ' checked="checked"';
                }
                ?>
 /><label for="script1flag2"> <?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_PAGEENTRY');
                ?>
</label>
								</td>
								<td></td>
							</tr>
							<tr id="initlib" style="display:none;">
								<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_SCRIPT');
                ?>
:</td>
								<td nowrap>
									<select name="script1id" size="1" class="inputbox">
<?php 
                $scripts = $lists['scripts1'];
                for ($i = 0; $i < count($scripts); $i++) {
                    $script = $scripts[$i];
                    $selected = '';
                    if ($script->id == $row->script1id) {
                        $selected = ' selected';
                    }
                    echo '<option value="' . $script->id . '"' . $selected . '>' . $script->text . '</option>';
                }
                // for
                ?>
									</select>
								</td>
								<td></td>
							</tr>
							<tr id="initcode" style="display:none;">
								<td nowrap valign="top" colspan="2">
									<a href="#" onClick="codeAreaResize('script1code',<?php 
                echo $ff_config->areasmall;
                ?>
);">[<?php 
                echo $ff_config->areasmall;
                ?>
]</a>
									<a href="#" onClick="codeAreaResize('script1code',<?php 
                echo $ff_config->areamedium;
                ?>
);">[<?php 
                echo $ff_config->areamedium;
                ?>
]</a>
									<a href="#" onClick="codeAreaResize('script1code',<?php 
                echo $ff_config->arealarge;
                ?>
);">[<?php 
                echo $ff_config->arealarge;
                ?>
]</a>
									<a href="#" onClick="createInitCode();"><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_CREATECODE');
                ?>
</a>
<?php 
                echo bf_ToolTip(BFText::_('COM_BREEZINGFORMS_ELEMENTS_TIPINIT')) . "\n";
                ?>
									<br />
									<textarea onFocus="codeAreaFocus(this);" readonly="readonly" wrap="off" name="script1lines" style="width:60px;" rows="<?php 
                echo $s1size;
                ?>
" class="inputbox"></textarea>
									<textarea onFocus="codeAreaFocus(this);" onKeyUp="codeAreaChange(this,event);" wrap="off" name="script1code" style="width:610px;" rows="<?php 
                echo $s1size;
                ?>
" class="inputbox"><?php 
                echo htmlspecialchars($row->script1code, ENT_QUOTES);
                ?>
</textarea>
								</td>
								<td></td>
							</tr>
						</table>
					</fieldset>
				</td>
				<td></td>
			</tr>
<?php 
            }
            // if hasInit
            if ($hasAction) {
                ?>
			<tr>
				<td></td>
				<td colspan="2">
					<fieldset><legend><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_ACTIONSCRIPT');
                ?>
</legend>
						<table cellpadding="4" cellspacing="1" border="0">
							<tr>
								<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_TYPE');
                ?>
:</td>
								<td nowrap>
									<input type="radio" id="script2cond1" name="script2cond" value="0" onclick="dispaction(this.value)"<?php 
                if ($row->script2cond == 0) {
                    echo ' checked="checked"';
                }
                ?>
 /><label for="script2cond1"> <?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_NONE');
                ?>
</label>
									<input type="radio" id="script2cond2" name="script2cond" value="1" onclick="dispaction(this.value)"<?php 
                if ($row->script2cond == 1) {
                    echo ' checked="checked"';
                }
                ?>
 /><label for="script2cond2"> <?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_LIBRARY');
                ?>
</label>
									<input type="radio" id="script2cond3" name="script2cond" value="2" onclick="dispaction(this.value)"<?php 
                if ($row->script2cond == 2) {
                    echo ' checked="checked"';
                }
                ?>
 /><label for="script2cond3"> <?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_CUSTOM');
                ?>
</label>
								</td>
								<td></td>
							</tr>
							<tr id="actionact" style="display:none;">
								<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_ACTIONS');
                ?>
:</td>
								<td nowrap>
<?php 
                switch ($row->type) {
                    case 'Regular Button':
                    case 'Graphic Button':
                    case 'Icon':
                        ?>
									<input type="checkbox" id="script2flag1" name="script2flag1" value="1"<?php 
                        if ($row->script2flag1 == 1) {
                            echo ' checked="checked"';
                        }
                        ?>
/><label for="script2flag1"> <?php 
                        echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_CLICK');
                        ?>
</label>
<?php 
                        break;
                    default:
                        ?>
									<input type="checkbox" id="script2flag1" name="script2flag1" value="1"<?php 
                        if ($row->script2flag1 == 1) {
                            echo ' checked="checked"';
                        }
                        ?>
/><label for="script2flag1"> <?php 
                        echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_CLICK');
                        ?>
</label>
									<input type="checkbox" id="script2flag2" name="script2flag2" value="1"<?php 
                        if ($row->script2flag2 == 1) {
                            echo ' checked="checked"';
                        }
                        ?>
/><label for="script2flag2"> <?php 
                        echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_BLUR');
                        ?>
</label>
									<input type="checkbox" id="script2flag3" name="script2flag3" value="1"<?php 
                        if ($row->script2flag3 == 1) {
                            echo ' checked="checked"';
                        }
                        ?>
/><label for="script2flag3"> <?php 
                        echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_CHANGE');
                        ?>
</label>
									<input type="checkbox" id="script2flag4" name="script2flag4" value="1"<?php 
                        if ($row->script2flag4 == 1) {
                            echo ' checked="checked"';
                        }
                        ?>
/><label for="script2flag4"> <?php 
                        echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_FOCUS');
                        ?>
</label>
									<input type="checkbox" id="script2flag5" name="script2flag5" value="1"<?php 
                        if ($row->script2flag5 == 1) {
                            echo ' checked="checked"';
                        }
                        ?>
/><label for="script2flag5"> <?php 
                        echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_SELECTION');
                        ?>
</label>
<?php 
                        break;
                }
                // switch
                ?>
								</td>
								<td></td>
							</tr>
							<tr id="actionlib" style="display:none;">
								<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_SCRIPT');
                ?>
:</td>
								<td nowrap>
									<select name="script2id" size="1" class="inputbox">
<?php 
                $scripts = $lists['scripts2'];
                for ($i = 0; $i < count($scripts); $i++) {
                    $script = $scripts[$i];
                    $selected = '';
                    if ($script->id == $row->script2id) {
                        $selected = ' selected';
                    }
                    echo '<option value="' . $script->id . '"' . $selected . '>' . $script->text . '</option>';
                }
                // for
                ?>
									</select>
								</td>
								<td></td>
							</tr>
							<tr id="actioncode" style="display:none;">
								<td nowrap valign="top" colspan="2">
									<a href="#" onClick="codeAreaResize('script2code',<?php 
                echo $ff_config->areasmall;
                ?>
);">[<?php 
                echo $ff_config->areasmall;
                ?>
]</a>
									<a href="#" onClick="codeAreaResize('script2code',<?php 
                echo $ff_config->areamedium;
                ?>
);">[<?php 
                echo $ff_config->areamedium;
                ?>
]</a>
									<a href="#" onClick="codeAreaResize('script2code',<?php 
                echo $ff_config->arealarge;
                ?>
);">[<?php 
                echo $ff_config->arealarge;
                ?>
]</a>
									<a href="#" onClick="createActionCode();"><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_CREATECODE');
                ?>
</a>
<?php 
                echo bf_ToolTip(BFText::_('COM_BREEZINGFORMS_ELEMENTS_TIPACTION')) . "\n";
                ?>
									<br />
									<textarea onFocus="codeAreaFocus(this);" readonly="readonly" wrap="off" name="script2lines" style="width:60px;" rows="<?php 
                echo $s2size;
                ?>
" class="inputbox"></textarea>
									<textarea onFocus="codeAreaFocus(this);" onKeyUp="codeAreaChange(this,event);" wrap="off" name="script2code" style="width:610px;" rows="<?php 
                echo $s2size;
                ?>
" class="inputbox"><?php 
                echo htmlspecialchars($row->script2code, ENT_QUOTES);
                ?>
</textarea>
								</td>
								<td></td>
							</tr>
						</table>
					</fieldset>
				</td>
				<td></td>
			</tr>
<?php 
            }
            // if hasAction
            if ($hasValidation) {
                ?>
			<tr>
				<td></td>
				<td colspan="2">
					<fieldset><legend><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_VALIDSCRIPT');
                ?>
</legend>
						<table cellpadding="4" cellspacing="1" border="0">
							<tr>
								<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_TYPE');
                ?>
:</td>
								<td nowrap>
									<input type="radio" id="script3cond1" name="script3cond" value="0" onclick="dispvalidation(this.value)"<?php 
                if ($row->script3cond == 0) {
                    echo ' checked="checked"';
                }
                ?>
 /><label for="script3cond1"> <?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_NONE');
                ?>
</label>
									<input type="radio" id="script3cond2" name="script3cond" value="1" onclick="dispvalidation(this.value)"<?php 
                if ($row->script3cond == 1) {
                    echo ' checked="checked"';
                }
                ?>
 /><label for="script3cond2"> <?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_LIBRARY');
                ?>
</label>
									<input type="radio" id="script3cond3" name="script3cond" value="2" onclick="dispvalidation(this.value)"<?php 
                if ($row->script3cond == 2) {
                    echo ' checked="checked"';
                }
                ?>
 /><label for="script3cond3"> <?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_CUSTOM');
                ?>
</label>
								</td>
								<td></td>
							</tr>
							<tr id="validationmsg" style="display:none;">
								<td nowrap valign="top"><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_MESSAGE');
                ?>
:</td>
								<td nowrap valign="top">
									<input type="text" size="50" maxlength="255" name="script3msg" value="<?php 
                echo $row->script3msg;
                ?>
" class="inputbox"/>
<?php 
                echo bf_ToolTip(BFText::_('COM_BREEZINGFORMS_ELEMENTS_TIPMESSAGE')) . "\n";
                ?>
								</td>
								<td></td>
							</tr>
							<tr id="validationlib" style="display:none;">
								<td nowrap><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_SCRIPT');
                ?>
:</td>
								<td nowrap>
									<select name="script3id" size="1" class="inputbox">
<?php 
                $scripts = $lists['scripts3'];
                for ($i = 0; $i < count($scripts); $i++) {
                    $script = $scripts[$i];
                    $selected = '';
                    if ($script->id == $row->script3id) {
                        $selected = ' selected';
                    }
                    echo '<option value="' . $script->id . '"' . $selected . '>' . $script->text . '</option>';
                }
                // for
                ?>
									</select>
								</td>
								<td></td>
							</tr>
							<tr id="validationcode" style="display:none;">
								<td nowrap valign="top" colspan="2">
									<a href="#" onClick="codeAreaResize('script3code',<?php 
                echo $ff_config->areasmall;
                ?>
);">[<?php 
                echo $ff_config->areasmall;
                ?>
]</a>
									<a href="#" onClick="codeAreaResize('script3code',<?php 
                echo $ff_config->areamedium;
                ?>
);">[<?php 
                echo $ff_config->areamedium;
                ?>
]</a>
									<a href="#" onClick="codeAreaResize('script3code',<?php 
                echo $ff_config->arealarge;
                ?>
);">[<?php 
                echo $ff_config->arealarge;
                ?>
]</a>
									<a href="#" onClick="createValidationCode();"><?php 
                echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_CREATECODE');
                ?>
</a>
<?php 
                echo bf_ToolTip(BFText::_('COM_BREEZINGFORMS_ELEMENTS_TIPVALID')) . "\n";
                ?>
									<br />
									<textarea onFocus="codeAreaFocus(this);" readonly="readonly" wrap="off" name="script3lines" style="width:60px;" rows="<?php 
                echo $s3size;
                ?>
" class="inputbox"></textarea>
									<textarea onFocus="codeAreaFocus(this);" onKeyUp="codeAreaChange(this,event);" wrap="off" name="script3code" style="width:610px;" rows="<?php 
                echo $s3size;
                ?>
" class="inputbox"><?php 
                echo htmlspecialchars($row->script3code, ENT_QUOTES);
                ?>
</textarea>
								</td>
								<td></td>
							</tr>
						</table>
					</fieldset>
				</td>
				<td></td>
			</tr>
<?php 
            }
            // if hasValidation
            ?>
		</table>
<?php 
        }
        // if hasInit, hasAction or hasValidation
        $tabs->endTab();
        $tabs->endPane();
        ?>
		</td>
		<td></td>
		</tr>
                <tr>
			<td></td>
			<td><br/>
			</td>
			<td></td>
		</tr>
		<tr>
			<td></td>
			<td nowrap style="text-align:right">
				 <input class="btn btn-primary" type="submit" onclick="<?php 
        if ($row->type == 'Query List') {
            echo "\t\t\t\tsaveQueryList();";
        }
        ?>
document.getElementById('task').value='save';" value="<?php 
        echo BFText::_('COM_BREEZINGFORMS_TOOLBAR_SAVE');
        ?>
"/>&nbsp;&nbsp;
				 <input class="btn btn-primary" type="submit" onclick="document.getElementById('task').value='cancel';" value="<?php 
        echo BFText::_('COM_BREEZINGFORMS_TOOLBAR_CANCEL');
        ?>
"/>
			</td>
			<td></td>
		</tr>
		</table>
<?php 
        if ($row->type == 'Query List') {
            ?>
		<input type="hidden" name="data1" value="<?php 
            echo htmlspecialchars($row->data1, ENT_QUOTES);
            ?>
"/>
		<input type="hidden" name="data3" value="<?php 
            echo htmlspecialchars($row->data3, ENT_QUOTES);
            ?>
"/>
<?php 
        }
        // if
        ?>
		<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
		<input type="hidden" name="pkg" value="<?php 
        echo $pkg;
        ?>
" />
		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" id="task" name="task" value="" />
		<input type="hidden" name="act" value="editpage" />
		<input type="hidden" name="form" value="<?php 
        echo $row->form;
        ?>
" />
		<input type="hidden" name="page" value="<?php 
        echo $row->page;
        ?>
" />
		<input type="hidden" name="type" value="<?php 
        echo $row->type;
        ?>
" />
		</form>
<?php 
    }
Example #3
0
    static function edit($option, $tabpane, $pkg, &$row, &$lists, $caller)
    {
        global $ff_mossite, $ff_admsite, $ff_config;
        $action = $row->id ? BFText::_('COM_BREEZINGFORMS_FORMS_EDIT') : BFText::_('COM_BREEZINGFORMS_FORMS_ADD');
        ?>
		<script type="text/javascript" src="<?php 
        echo $ff_admsite;
        ?>
/admin/areautils.js"></script>
		<script type="text/javascript">
		<!--
		function checkNumber(value, msg1, msg2)
		{
			var nonDigits = /\D/;
			var error = '';
			if (value == '')
				error += msg1;
			else
			if (nonDigits.test(value))
				error += msg2;
			return error;
		} // checkNumber

		function checkIdentifier(value, msg1, msg2)
		{
			var invalidChars = /\W/;
			var error = '';
			if (value == '')
				error += msg1;
			else
				if (invalidChars.test(value))
					error += msg2;
			return error;
		} // checkIdentifier

		var bf_submitbutton = function(pressbutton)
		{
			var form = document.adminForm;
			var error = '';
			if (pressbutton != 'cancel') {
				if (form.title.value == '')
					error += "<?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_TITLEEMPTY');
        ?>
\n";
				error += checkIdentifier(
					form.name.value,
					"<?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NAMEEMPTY');
        ?>
\n",
					"<?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NAMEIDENT');
        ?>
\n"
				);
				error += checkNumber(
					form.width.value,
					"<?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_WIDTHEMPTY');
        ?>
\n",
					"<?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_WIDTHNUMBER');
        ?>
\n"
				);
				error += checkNumber(
					form.height.value,
					"<?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_HEIGHTEMPTY');
        ?>
\n",
					"<?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_HEIGHTNUMBER');
        ?>
\n"
				);
			} // if
			if (error != '')
				alert(error);
			else{
				submitform( pressbutton );	
			}
		}; // submitbutton

                if(typeof Joomla != 'undefined'){
                    Joomla.submitbutton = bf_submitbutton;
                }

                submitbutton = bf_submitbutton;

		function createInitCode()
		{
			form = document.adminForm;
			name = form.name.value;
			if (name=='') {
				alert("<?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_ENTNAMEFIRST');
        ?>
");
				return;
			} // if
			if (!confirm("<?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_CREATEINITNOW');
        ?>
\n<?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_EXISTINGAPPENDED');
        ?>
")) return;
			code =
				"function ff_"+name+"_init()\n"+
				"{\n"+
				"} // ff_"+name+"_init\n";
			oldcode = form.script1code.value;
			if (oldcode != '')
				form.script1code.value =
					code+
					"\n// -------------- <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_OLDCODEBELOW');
        ?>
 --------------\n\n"+
					oldcode;
			else
				form.script1code.value = code;
			codeAreaChange(form.script1code);
		} // createInitCode

		function createSubmittedCode()
		{
			form = document.adminForm;
			name = form.name.value;
			if (name=='') {
				alert("<?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_ENTNAMEFIRST');
        ?>
");
				return;
			} // if
			if (!confirm("<?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_CREATESUBMITTEDNOW');
        ?>
\n<?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_EXISTINGAPPENDED');
        ?>
")) return;
			code =
				"function ff_"+name+"_submitted(status, message)\n"+
				"{\n"+
				"    switch (status) {\n"+
				"        case FF_STATUS_OK:\n"+
				"           // do whatever desired on success\n"+
				"           break;\n"+
				"        case FF_STATUS_UNPUBLISHED:\n"+
				"        case FF_STATUS_SAVERECORD_FAILED:\n"+
				"        case FF_STATUS_SAVESUBRECORD_FAILED:\n"+
				"        case FF_STATUS_UPLOAD_FAILED:\n"+
				"        case FF_STATUS_ATTACHMENT_FAILED:\n"+
				"        case FF_STATUS_SENDMAIL_FAILED:\n"+
				"        default:\n"+
				"           alert(message);\n"+
				"    } // switch\n"+
				"} // ff_"+name+"_submitted\n";
			oldcode = form.script2code.value;
			if (oldcode != '')
				form.script2code.value =
					code+
					"\n// -------------- <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_OLDCODEBELOW');
        ?>
 --------------\n\n"+
					oldcode;
			else
				form.script2code.value = code;
			codeAreaChange(form.script2code);
		} // createSubmittedCode

		function dispheight(value)
		{
			switch (value) {
				case '0':
					document.getElementById('heightmargin').style.display = 'none';
					break;
				default:
					document.getElementById('heightmargin').style.display = '';
			} // switch
		} // dispheight

		function dispprevwidth()
		{
			var form = document.adminForm;
			if (form.widthmode.value=='0' || form.prevmode.value=='0')
				document.getElementById('prevwidthvalue').style.display = 'none';
			else
				document.getElementById('prevwidthvalue').style.display = '';
		} // dispprevwidth

		function dispinit(value)
		{
			if(document.getElementById) {
				switch (value) {
					case '1':
						document.getElementById('initlib').style.display = '';
						document.getElementById('initcode').style.display = 'none';
						break;
					case '2':
						document.getElementById('initlib').style.display = 'none';
						document.getElementById('initcode').style.display = '';
						break;
					default:
						document.getElementById('initlib').style.display = 'none';
						document.getElementById('initcode').style.display = 'none';
				} // switch
			} // if
		} // dispinit

		function dispsubmitted(value)
		{
			if(document.getElementById) {
				switch (value) {
					case '1':
						document.getElementById('submittedlib').style.display = '';
						document.getElementById('submittedcode').style.display = 'none';
						break;
					case '2':
						document.getElementById('submittedlib').style.display = 'none';
						document.getElementById('submittedcode').style.display = '';
						break;
					default:
						document.getElementById('submittedlib').style.display = 'none';
						document.getElementById('submittedcode').style.display = 'none';
				} // switch
			} // if
		} // dispsubmitted

		function dispemail(value)
		{
			if(document.getElementById) {
				switch (value) {
					case '0':
						document.getElementById('emaillogging').style.display = 'none';
						document.getElementById('emailattachment').style.display = 'none';
						document.getElementById('emailaddress').style.display = 'none';
						break;
					case '1':
						document.getElementById('emaillogging').style.display = '';
						document.getElementById('emailattachment').style.display = '';
						document.getElementById('emailaddress').style.display = 'none';
						break;
					default:
						document.getElementById('emaillogging').style.display = '';
						document.getElementById('emailattachment').style.display = '';
						document.getElementById('emailaddress').style.display = '';
				} // switch
			} // if
		} // dispemail

		function dispp1(value)
		{
			if(document.getElementById) {
				switch (value) {
					case '1':
						document.getElementById('p1lib').style.display = '';
						document.getElementById('p1code').style.display = 'none';
						break;
					case '2':
						document.getElementById('p1lib').style.display = 'none';
						document.getElementById('p1code').style.display = '';
						break;
					default:
						document.getElementById('p1lib').style.display = 'none';
						document.getElementById('p1code').style.display = 'none';
				} // switch
			} // if
		} // dispp1

		function dispp2(value)
		{
			if(document.getElementById) {
				switch (value) {
					case '1':
						document.getElementById('p2lib').style.display = '';
						document.getElementById('p2code').style.display = 'none';
						break;
					case '2':
						document.getElementById('p2lib').style.display = 'none';
						document.getElementById('p2code').style.display = '';
						break;
					default:
						document.getElementById('p2lib').style.display = 'none';
						document.getElementById('p2code').style.display = 'none';
				} // switch
			} // if
		} // dispp2

		function dispp3(value)
		{
			if(document.getElementById) {
				switch (value) {
					case '1':
						document.getElementById('p3lib').style.display = '';
						document.getElementById('p3code').style.display = 'none';
						break;
					case '2':
						document.getElementById('p3lib').style.display = 'none';
						document.getElementById('p3code').style.display = '';
						break;
					default:
						document.getElementById('p3lib').style.display = 'none';
						document.getElementById('p3code').style.display = 'none';
				} // switch
			} // if
		} // dispp3

		function dispp4(value)
		{
			if(document.getElementById) {
				switch (value) {
					case '1':
						document.getElementById('p4lib').style.display = '';
						document.getElementById('p4code').style.display = 'none';
						break;
					case '2':
						document.getElementById('p4lib').style.display = 'none';
						document.getElementById('p4code').style.display = '';
						break;
					default:
						document.getElementById('p4lib').style.display = 'none';
						document.getElementById('p4code').style.display = 'none';
				} // switch
			} // if
		} // dispp4

		onload = function()
		{
<?php 
        if ($row->script1cond != 0) {
            echo "\t\t\tdispinit('" . $row->script1cond . "');\n";
        }
        if ($row->script2cond != 0) {
            echo "\t\t\tdispsubmitted('" . $row->script2cond . "');\n";
        }
        if ($row->piece1cond != 0) {
            echo "\t\t\tdispp1('" . $row->piece1cond . "');\n";
        }
        if ($row->piece2cond != 0) {
            echo "\t\t\tdispp2('" . $row->piece2cond . "');\n";
        }
        if ($row->piece3cond != 0) {
            echo "\t\t\tdispp3('" . $row->piece3cond . "');\n";
        }
        if ($row->piece4cond != 0) {
            echo "\t\t\tdispp4('" . $row->piece4cond . "');\n";
        }
        switch ($tabpane) {
            case 1:
            case 2:
            case 3:
                echo "\t\t\ttabPane1.setSelectedIndex({$tabpane});\n";
                break;
            default:
                echo "\t\t\tdocument.adminForm.title.focus();\n";
        }
        // switch
        ?>
			codeAreaAdd('script1code', 'script1lines');
			codeAreaAdd('script2code', 'script2lines');
			codeAreaAdd('piece1code',  'piece1lines');
			codeAreaAdd('piece2code',  'piece2lines');
			codeAreaAdd('piece3code',  'piece3lines');
			codeAreaAdd('piece4code',  'piece4lines');
		} // onload
		//-->
		</script>
                <?php 
        jimport('joomla.version');
        $version = new JVersion();
        if (version_compare($version->getShortVersion(), '3.0', '>=')) {
            ?>
                <style type="text/css">
                    #bftab {
                        float: left !important;
                        margin-right: 20px !important;
                        margin-top: -20px !important;
                    }
                    .adminlist{
                        width: 70% !important;
                    }
                </style>
                <?php 
        }
        ?>
                <?php 
        //echo bf_alert('Get BreezingForms Full Version', 'http://crosstec.de/en/extensions/joomla-forms-download.html');
        ?>
                <?php 
        //echo bf_alert('More features, no footers, no messages', 'http://crosstec.de/en/extensions/joomla-forms-download.html');
        ?>
                
                <fieldset><legend><?php 
        echo JText::_('COM_BREEZINGFORMS_FORMSETUP');
        ?>
: <?php 
        echo htmlentities($row->title, ENT_QUOTES, 'UTF-8');
        ?>
</legend>
                <div style="float: right;">
                <input class="btn btn-primary" onclick="submitbutton('save');" type="submit" value="<?php 
        echo htmlentities(BFText::_('COM_BREEZINGFORMS_TOOLBAR_SAVE'), ENT_QUOTES, 'UTF-8');
        ?>
"/>
                &nbsp;&nbsp;
                <input class="btn btn-primary" onclick="submitbutton('cancel');" type="submit" value="<?php 
        echo htmlentities(BFText::_('COM_BREEZINGFORMS_TOOLBAR_CANCEL'), ENT_QUOTES, 'UTF-8');
        ?>
"/>
                </div>
                <div style="clear:both;"></div>
		<form action="index.php?format=html" method="post" name="adminForm" id="adminForm" class="adminForm">
                <table cellpadding="4" cellspacing="1" border="0" style="width: 100%;" width="100%">
			<tr><td colspan="3" class="title"></td></tr>
			<tr>
				<td></td>
				<td width="100%">
<?php 
        $tabs = new BFTabs(0);
        $tabs->startPane('editPane');
        $tabs->startTab(BFText::_('COM_BREEZINGFORMS_FORMS_SETTINGS'), 'tab_settings');
        ?>
                      <fieldset><legend><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_SETTINGS');
        ?>
</legend>
			<table width="100%" cellpadding="4" cellspacing="1" border="0">
			<tr>
				<td style="width: 200px;" valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_TITLE');
        ?>
</td>
				<td valign="top">
					<input type="text" size="30" maxlength="50" name="title" value="<?php 
        echo $row->title;
        ?>
" class="inputbox"/>
				</td>
				<td></td>
			</tr>

			<tr>
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_PACKAGE');
        ?>
</td>
				<td valign="top">
					<input type="text" size="30" maxlength="30" id="package" name="package" value="<?php 
        echo $row->package;
        ?>
" class="inputbox"/>
				</td>
				<td></td>
			</tr>

			<tr>
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NAME');
        ?>
</td>
				<td valign="top">
					<input type="text" size="30" maxlength="30" name="name" value="<?php 
        echo $row->name;
        ?>
" class="inputbox"/>
				</td>
				<td></td>
			</tr>
			
			<tr>
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_CLASSFOR');
        ?>
 &lt;div&gt;</td>
				<td valign="top">
					<input type="text" size="30" maxlength="30" name="class1" value="<?php 
        echo $row->class1;
        ?>
" class="inputbox"/>
				</td>
				<td></td>
			</tr>
			<tr>
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_CLASSFOR');
        ?>
 &lt;form&gt;</td>
				<td valign="top">
					<input type="text" size="30" maxlength="30" name="class2" value="<?php 
        echo $row->class2;
        ?>
" class="inputbox"/>
				</td>
				<td></td>
			</tr>
			<tr>
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_ORDERING');
        ?>
</td>
				<td valign="top"><?php 
        echo $lists['ordering'];
        ?>
</td>
				<td></td>
			</tr>
			<tr>
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_PUBLISHED');
        ?>
</td>
				<td valign="top"><?php 
        echo JHTML::_('select.booleanlist', "published", "", $row->published);
        ?>
</td>
				<td></td>
			</tr>
			<tr>
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_RUNMODE');
        ?>
</td>
				<td valign="top">
					<select name="runmode" size="1" class="inputbox">
						<option value="0"<?php 
        if ($row->runmode == 0) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_ANY');
        ?>
</option>
						<option value="1"<?php 
        if ($row->runmode == 1) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_FRONTEND');
        ?>
</option>
						<option value="2"<?php 
        if ($row->runmode == 2) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_BACKEND');
        ?>
</option>
					</select>
				</td>
				<td></td>
			</tr>
			<tr>
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_WIDTH');
        ?>
</td>
				<td valign="top">
					<input type="text" size="6" maxlength="6" name="width" value="<?php 
        echo $row->width;
        ?>
" class="inputbox" />
                                        <br/>
                                        <select name="widthmode" size="1" onchange="dispprevwidth();" class="inputbox">
						<option value="0"<?php 
        if ($row->widthmode == 0) {
            echo ' selected="selected"';
        }
        ?>
>px</option>
						<option value="1"<?php 
        if ($row->widthmode == 1) {
            echo ' selected="selected"';
        }
        ?>
>%</option>
					</select>
				</td>
				<td></td>
			</tr>
			<tr>
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_HEIGHT');
        ?>
</td>
				<td valign="top">
                                        <input type="text" size="6" maxlength="6" name="height" value="<?php 
        echo $row->height;
        ?>
" class="inputbox"/> px
<?php 
        if ($row->template_code_processed != 'QuickMode') {
            ?>
                                        <br/>
					<select name="heightmode" size="1" onchange="dispheight(this.value);" class="inputbox">
						<option value="0"<?php 
            if ($row->heightmode == 0) {
                echo ' selected="selected"';
            }
            ?>
><?php 
            echo BFText::_('COM_BREEZINGFORMS_FORMS_FIXED');
            ?>
</option>
						<option value="1"<?php 
            if ($row->heightmode == 1) {
                echo ' selected="selected"';
            }
            ?>
><?php 
            echo BFText::_('COM_BREEZINGFORMS_FORMS_AUTO');
            ?>
</option>
						<option value="2"<?php 
            if ($row->heightmode == 2) {
                echo ' selected="selected"';
            }
            ?>
><?php 
            echo BFText::_('COM_BREEZINGFORMS_FORMS_AUTOMAX');
            ?>
</option>
					</select><span id="heightmargin"<?php 
            if ($row->heightmode == 0) {
                echo ' style="display:none;"';
            }
            ?>
>
					</span>
<?php 
        } else {
            ?>
                                        <input type="hidden" name="heightmode" value="0"/>
<?php 
        }
        ?>
				</td>
				<td></td>
			</tr>
<?php 
        if ($row->template_code_processed == 'QuickMode' || $row->template_code != '') {
            ?>
                      <tr>
				<td valign="top"><?php 
            echo BFText::_('COM_BREEZINGFORMS_AUTOHEIGHT');
            ?>
</td>
				<td valign="top">
                                        <select name="autoheight" class="inputbox">
						<option value="0"<?php 
            if ($row->autoheight == 0) {
                echo ' selected="selected"';
            }
            ?>
><?php 
            echo BFText::_('COM_BREEZINGFORMS_AUTOHEIGHT_OFF');
            ?>
</option>
						<option value="1"<?php 
            if ($row->autoheight == 1) {
                echo ' selected="selected"';
            }
            ?>
><?php 
            echo BFText::_('COM_BREEZINGFORMS_AUTOHEIGHT_ON');
            ?>
</option>
					</select>
                                        <br/>
                                        <i><?php 
            echo BFText::_('COM_BREEZINGFORMS_AUTOHEIGHT_INFO');
            ?>
</i>
				</td>
				<td></td>
			</tr>  
<?php 
        }
        if ($row->template_code == '') {
            ?>
			<tr>
				<td valign="top"><?php 
            echo BFText::_('COM_BREEZINGFORMS_FORMS_PREVMODE');
            ?>
</td>
				<td valign="top">
					<select name="prevmode" size="1" onchange="dispprevwidth();" class="inputbox">
						<option value="0"<?php 
            if ($row->prevmode == 0) {
                echo ' selected="selected"';
            }
            ?>
><?php 
            echo BFText::_('COM_BREEZINGFORMS_FORMS_NONE');
            ?>
</option>
						<option value="1"<?php 
            if ($row->prevmode == 1) {
                echo ' selected="selected"';
            }
            ?>
><?php 
            echo BFText::_('COM_BREEZINGFORMS_FORMS_BELOW');
            ?>
</option>
						<option value="2"<?php 
            if ($row->prevmode == 2) {
                echo ' selected="selected"';
            }
            ?>
><?php 
            echo BFText::_('COM_BREEZINGFORMS_FORMS_OVERLAYED');
            ?>
</option>
					</select>
					<span id="prevwidthvalue"<?php 
            if ($row->widthmode == 0 || $row->prevmode == 0) {
                echo ' style="display:none;"';
            }
            ?>
>
						&nbsp;&nbsp;&nbsp;&nbsp;<?php 
            echo BFText::_('COM_BREEZINGFORMS_FORMS_WIDTH');
            ?>
: <input size="6" maxlength="6" name="prevwidth" value="<?php 
            echo $row->prevwidth;
            ?>
" class="inputbox" /> px
					</span>
				</td>
				<td></td>
			</tr>
<?php 
        }
        ?>
			<tr>
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_LOGTODB');
        ?>
</td>
				<td valign="top">
					<select name="dblog" size="1" class="inputbox">
						<option value="0"<?php 
        if ($row->dblog == 0) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NO');
        ?>
</option>
						<option value="1"<?php 
        if ($row->dblog == 1) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NONEMPTY');
        ?>
</option>
						<option value="2"<?php 
        if ($row->dblog == 2) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_ALLVALS');
        ?>
</option>
					</select>
				</td>
				<td></td>
			</tr>
			

                        <tr>
				<td colspan="2" valign="top">
					<?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_DESCRIPTION');
        ?>
					<a href="#" onClick="textAreaResize('description',<?php 
        echo $ff_config->areasmall;
        ?>
);">[<?php 
        echo $ff_config->areasmall;
        ?>
]</a>
					<a href="#" onClick="textAreaResize('description',<?php 
        echo $ff_config->areamedium;
        ?>
);">[<?php 
        echo $ff_config->areamedium;
        ?>
]</a>
					<a href="#" onClick="textAreaResize('description',<?php 
        echo $ff_config->arealarge;
        ?>
);">[<?php 
        echo $ff_config->arealarge;
        ?>
]</a>
					<br/>
					<textarea wrap="off" name="description" style="width:100%;" rows="<?php 
        echo $ff_config->areasmall;
        ?>
" class="inputbox"><?php 
        echo htmlspecialchars($row->description, ENT_QUOTES);
        ?>
</textarea>
				</td>
				<td></td>
			</tr>

			</table>
                    </fieldset>
<?php 
        $tabs->endTab();
        jimport('joomla.version');
        $version = new JVersion();
        if (version_compare($version->getShortVersion(), '3.1', '>=')) {
            $tabs->startTab(BFText::_('COM_BREEZINGFORMS_TAGS_AND_CONTENT'), 'tab_tags');
            JHtml::_('tag.ajaxfield', '#tags_form', true);
            JHtml::_('tag.ajaxfield', '#tags_content', true);
            $tags = JHtml::_('tag.options');
            // incredible....
            foreach ($tags as $tag) {
                JFactory::getDbo()->setQuery("Select path From #__tags Where id = " . intval($tag->value));
                $tag->path = JFactory::getDbo()->loadResult();
            }
            $tags = JHelperTags::convertPathsToNames($tags);
            ?>
              <fieldset><legend><?php 
            echo BFText::_('COM_BREEZINGFORMS_TAGS_AND_CONTENT');
            ?>
</legend>
                <?php 
            echo bf_alert('Joomla! tagging is supported in the full version only', 'http://crosstec.de/en/extensions/joomla-forms-download.html');
            ?>
               
                </fieldset>
<?php 
            $tabs->endTab();
        }
        $tabs->startTab(BFText::_('COM_BREEZINGFORMS_ADMIN_EMAILS'), 'tab_admin_emails');
        ?>
                <fieldset><legend><?php 
        echo BFText::_('COM_BREEZINGFORMS_ADMIN_EMAILS');
        ?>
</legend>
                <table width="80%" cellpadding="4" cellspacing="1" border="0">
                <tr>
				
				<td style="width: 200px;" valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_EMAILNOTIFY');
        ?>
</td>
				<td valign="top">
					<select style="width: 335px;" name="emailntf" size="1" onchange="dispemail(this.value);" class="inputbox">
						<option value="0"<?php 
        if ($row->emailntf == 0) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NO');
        ?>
</option>
						<option value="1"<?php 
        if ($row->emailntf == 1) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_DEFADDR');
        ?>
</option>
						<option value="2"<?php 
        if ($row->emailntf == 2) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_CUSTADDR');
        ?>
</option>
					</select>
				</td>
				<td></td>
			</tr>
			<tr>
				<td valign="top"></td>
				<td valign="top">
					<table cellpadding="4" cellspacing="4" border="0">
						<tr id="emailaddress"<?php 
        if ($row->emailntf != 2) {
            echo ' style="display:none;"';
        }
        ?>
>
							<td><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_EMAIL');
        ?>
</td>
							<td><input type="text" size="30" name="emailadr" value="<?php 
        echo $row->emailadr;
        ?>
" class="inputbox"/></td>
						</tr>
						<tr id="emaillogging"<?php 
        if ($row->emailntf == 0) {
            echo ' style="display:none;"';
        }
        ?>
>
							<td><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_REPORT');
        ?>
</td>
							<td>
								<select name="emaillog" size="1" class="inputbox">
									<option value="0"<?php 
        if ($row->emaillog == 0) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_HDRONLY');
        ?>
</option>
									<option value="1"<?php 
        if ($row->emaillog == 1) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NONEMPTY');
        ?>
</option>
									<option value="2"<?php 
        if ($row->emaillog == 2) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_ALLVALS');
        ?>
</option>
								</select>
							</td>
						</tr>
						<tr id="emailattachment"<?php 
        if ($row->emailntf == 0) {
            echo ' style="display:none;"';
        }
        ?>
>
							<td><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_ATTACHMENT');
        ?>
 </td>
							<td>
								<select name="emailxml" size="1" class="inputbox">
									<option value="0"<?php 
        if ($row->emailxml == 0) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NO');
        ?>
</option>
									<option value="1"<?php 
        if ($row->emailxml == 1) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_XML');
        ?>
</option>
									<!--<option value="2"<?php 
        if ($row->emailxml == 2) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_XML_ALLVALS');
        ?>
</option>-->
									<option value="3"<?php 
        if ($row->emailxml == 3) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_CSV');
        ?>
</option>
									<option value="4"<?php 
        if ($row->emailxml == 4) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_PDF');
        ?>
</option>
								</select>
							</td>
						</tr>
					</table>
				</td>
				<td></td>
			</tr>
                        <tr>
				
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_ALT_MAILFROM');
        ?>
</td>
				<td valign="top">
					<input type="text" name="alt_mailfrom"  value="<?php 
        echo $row->alt_mailfrom;
        ?>
" size="50"  class="inputbox"/>
				</td>
				<td></td>
			</tr>
                        <tr>
				
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_ALT_FROMNAME');
        ?>
</td>
				<td valign="top">
					<input type="text" name="alt_fromname"  value="<?php 
        echo $row->alt_fromname;
        ?>
" size="50"  class="inputbox"/>
				</td>
				<td></td>
			</tr>
			<tr>
				
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_CUSTOM_MAIL_SUBJECT');
        ?>
</td>
				<td valign="top">
					<input type="text" name="custom_mail_subject"  value="<?php 
        echo $row->custom_mail_subject;
        ?>
" size="50"  class="inputbox"/>
				</td>
				<td></td>
			</tr>

                        <tr>
                            <td valign="top" nowrap><?php 
        echo BFText::_('COM_BREEZINGFORMS_EDIT_EMAILS');
        ?>
                            <br/>
                            <br/>
                            <div style="height: 250px; overflow: auto;<?php 
        echo $row->email_type == 0 ? ' display: none;' : '';
        ?>
" id="email_custom_template_picker">
                            <?php 
        echo bf_getFieldSelectorList($row->id, 'email_custom_template');
        ?>
                            </div>
                            </td>
                            <td valign="top">
					<input onclick="document.getElementById('email_custom_html').style.display='none';document.getElementById('email_custom_template').style.display='none';document.getElementById('email_custom_template_picker').style.display='none';" type="radio" name="email_type" value="0"<?php 
        echo $row->email_type == 0 ? ' checked="checked"' : '';
        ?>
/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_EMAIL_TYPE_DEFAULT');
        ?>
                                        <input onclick="document.getElementById('email_custom_html').style.display='';document.getElementById('email_custom_template').style.display='';document.getElementById('email_custom_template_picker').style.display='';" type="radio" name="email_type" value="1"<?php 
        echo $row->email_type == 1 ? ' checked="checked"' : '';
        ?>
/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_EMAIL_TYPE_CUSTOM');
        ?>
                                        <div id="email_custom_html" style="<?php 
        echo $row->email_type == 0 ? ' display: none;' : '';
        ?>
">
                                            <br/>
                                            <?php 
        echo BFText::_('COM_BREEZINGFORMS_EMAIL_CUSTOM_HTML');
        ?>
                                            <input type="radio" name="email_custom_html" value="0"<?php 
        echo $row->email_custom_html == 0 ? ' checked="checked"' : '';
        ?>
/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_NO');
        ?>
                                            <input type="radio" name="email_custom_html" value="1"<?php 
        echo $row->email_custom_html == 1 ? ' checked="checked"' : '';
        ?>
/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_YES');
        ?>
                                        </div>
                                        <br/>
                                        <textarea style="width:100%; height: 500px;<?php 
        echo $row->email_type == 0 ? ' display: none;' : '';
        ?>
" name="email_custom_template" id="email_custom_template"><?php 
        echo htmlentities($row->email_custom_template, ENT_QUOTES, 'UTF-8');
        ?>
</textarea>
                            </td>
                            <td></td>
			</tr>
                </table>
                </fieldset>

<?php 
        $tabs->endTab();
        $tabs->startTab(BFText::_('COM_BREEZINGFORMS_MAILBACK_EMAILS'), 'tab_mailback_emails');
        ?>
                <fieldset><legend><?php 
        echo BFText::_('COM_BREEZINGFORMS_MAILBACK_EMAILS');
        ?>
</legend>
                <table width="80%" cellpadding="4" cellspacing="1" border="0">
			<tr>
                            <td style="width: 200px;" valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_EMAILNOTIFY');
        ?>
</td>
				
				<td valign="top">
					<table cellpadding="4" cellspacing="1" border="0">
						<tr id="bf_emaillogging"<?php 
        if ($row->mb_emailntf == 0) {
            echo ' style="display:none;"';
        }
        ?>
>
							<td><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_REPORT');
        ?>
</td>
							<td>
								<select name="mb_emaillog" size="1" class="inputbox">
									<option value="0"<?php 
        if ($row->mb_emaillog == 0) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_HDRONLY');
        ?>
</option>
									<option value="1"<?php 
        if ($row->mb_emaillog == 1) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NONEMPTY');
        ?>
</option>
									<option value="2"<?php 
        if ($row->mb_emaillog == 2) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_ALLVALS');
        ?>
</option>
								</select>
							</td>
						</tr>
						<tr id="bf_emailattachment"<?php 
        if ($row->mb_emailntf == 0) {
            echo ' style="display:none;"';
        }
        ?>
>
							<td><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_ATTACHMENT');
        ?>
 </td>
							<td>
								<select name="mb_emailxml" size="1" class="inputbox">
									<option value="0"<?php 
        if ($row->mb_emailxml == 0) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NO');
        ?>
</option>
									<option value="1"<?php 
        if ($row->mb_emailxml == 1) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_XML');
        ?>
</option>
									<!--<option value="2"<?php 
        if ($row->mb_emailxml == 2) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_XML_ALLVALS');
        ?>
</option>-->
									<option value="3"<?php 
        if ($row->mb_emailxml == 3) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_CSV');
        ?>
</option>
									<option value="4"<?php 
        if ($row->mb_emailxml == 4) {
            echo ' selected="selected"';
        }
        ?>
><?php 
        echo BFText::_('COM_BREEZINGFORMS_PDF');
        ?>
</option>
								</select>
							</td>
						</tr>
					</table>
				</td>
				<td valign="top"></td>
			</tr>
                        <tr>
				
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_ALT_MAILFROM');
        ?>
</td>
				<td>
					<input type="text" name="mb_alt_mailfrom"  value="<?php 
        echo $row->mb_alt_mailfrom;
        ?>
" size="50"  class="inputbox"/>
				</td>
				<td valign="top"></td>
			</tr>
                        <tr>
				
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_ALT_FROMNAME');
        ?>
</td>
				<td>
					<input type="text" name="mb_alt_fromname"  value="<?php 
        echo $row->mb_alt_fromname;
        ?>
" size="50"  class="inputbox"/>
				</td>
				<td valign="top"></td>
			</tr>
			<tr>
				
				<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_CUSTOM_MAIL_SUBJECT');
        ?>
</td>
				<td>
					<input type="text" name="mb_custom_mail_subject"  value="<?php 
        echo $row->mb_custom_mail_subject;
        ?>
" size="50"  class="inputbox"/>
				</td>
				<td valign="top"></td>
			</tr>

                        <tr>
                            <td valign="top" nowrap><?php 
        echo BFText::_('COM_BREEZINGFORMS_EDIT_EMAILS');
        ?>
                            <br/>
                            <br/>
                            <div style="height: 250px; overflow: auto;<?php 
        echo $row->mb_email_type == 0 ? ' display: none;' : '';
        ?>
" id="mb_email_custom_template_picker">
                            <?php 
        echo bf_getFieldSelectorList($row->id, 'mb_email_custom_template');
        ?>
                            </div>
                            </td>
                            <td valign="top">
					<input onclick="document.getElementById('mb_email_custom_html').style.display='none';document.getElementById('mb_email_custom_template').style.display='none';document.getElementById('mb_email_custom_template_picker').style.display='none';" type="radio" name="mb_email_type" value="0"<?php 
        echo $row->mb_email_type == 0 ? ' checked="checked"' : '';
        ?>
/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_EMAIL_TYPE_DEFAULT');
        ?>
                                        <input onclick="document.getElementById('mb_email_custom_html').style.display='';document.getElementById('mb_email_custom_template').style.display='';document.getElementById('mb_email_custom_template_picker').style.display='';" type="radio" name="mb_email_type" value="1"<?php 
        echo $row->mb_email_type == 1 ? ' checked="checked"' : '';
        ?>
/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_EMAIL_TYPE_CUSTOM');
        ?>
                                        <div id="mb_email_custom_html" style="<?php 
        echo $row->mb_email_type == 0 ? ' display: none;' : '';
        ?>
">
                                            <br/>
                                            <?php 
        echo BFText::_('COM_BREEZINGFORMS_EMAIL_CUSTOM_HTML');
        ?>
                                            <input type="radio" name="mb_email_custom_html" value="0"<?php 
        echo $row->mb_email_custom_html == 0 ? ' checked="checked"' : '';
        ?>
/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_NO');
        ?>
                                            <input type="radio" name="mb_email_custom_html" value="1"<?php 
        echo $row->mb_email_custom_html == 1 ? ' checked="checked"' : '';
        ?>
/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_YES');
        ?>
                                        </div>
                                        <br/>
                                        <textarea style="width:100%; height: 500px;<?php 
        echo $row->mb_email_type == 0 ? ' display: none;' : '';
        ?>
" name="mb_email_custom_template" id="mb_email_custom_template"><?php 
        echo htmlentities($row->mb_email_custom_template, ENT_QUOTES, 'UTF-8');
        ?>
</textarea>
                            </td>
                            <td></td>
			</tr>

                </table>
               </fieldset>

<?php 
        if ($row->template_code != '') {
            ?>
<input type="hidden" name="prevmode" value="2"/>
<input type="hidden" name="nonclassic" value="1"/>
<input type="hidden" name="quickmode" value="<?php 
            echo $row->template_code_processed == 'QuickMode' ? '1' : '0';
            ?>
"/>
<?php 
        }
        $tabs->endTab();
        $tabs->startTab(BFText::_('COM_BREEZINGFORMS_FORMS_SCRIPTS'), 'tab_scripts');
        $subsize = $initsize = $ff_config->areasmall;
        if ($row->script1cond == 2) {
            $initsize = $ff_config->areamedium;
        } else {
            if ($row->script2cond == 2) {
                $subsize = $ff_config->areamedium;
            }
        }
        ?>
                        <fieldset><legend><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_SCRIPTS');
        ?>
</legend>
			<table width="80%" cellpadding="4" cellspacing="1" border="0">
			<tr>
				<td valign="top"></td>
				<td valign="top">
					<fieldset><legend><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_INITSCRIPT');
        ?>
</legend>
						<table width="100%" cellpadding="4" cellspacing="1" border="0">
							<tr>
								<td style="width: 200px;" valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_TYPE');
        ?>
</td>
								<td valign="top">
									<input type="radio" id="script1cond1" name="script1cond" value="0" onclick="dispinit(this.value)"<?php 
        if ($row->script1cond == 0) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="script1cond1"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NONE');
        ?>
</label>
									<input type="radio" id="script1cond2" name="script1cond" value="1" onclick="dispinit(this.value)"<?php 
        if ($row->script1cond == 1) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="script1cond2"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_LIBRARY');
        ?>
</label>
									<input type="radio" id="script1cond3" name="script1cond" value="2" onclick="dispinit(this.value)"<?php 
        if ($row->script1cond == 2) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="script1cond3"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_CUSTOM');
        ?>
</label>
								</td>
								<td></td>
							</tr>
							<tr id="initlib" style="display:none;">
								<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_SCRIPT');
        ?>
</td>
								<td valign="top">
									<select name="script1id" class="inputbox">
<?php 
        $scripts = $lists['init'];
        for ($i = 0; $i < count($scripts); $i++) {
            $script = $scripts[$i];
            $selected = '';
            if ($script->id == $row->script1id) {
                $selected = ' selected';
            }
            echo '<option value="' . $script->id . '"' . $selected . '>' . $script->text . '</option>';
        }
        // for
        ?>
									</select>
								</td>
								<td></td>
							</tr>
							<tr id="initcode" style="display:none;">
								<td valign="top" colspan="2">
									<a href="#" onClick="codeAreaResize('script1code',<?php 
        echo $ff_config->areasmall;
        ?>
);">[<?php 
        echo $ff_config->areasmall;
        ?>
]</a>
									<a href="#" onClick="codeAreaResize('script1code',<?php 
        echo $ff_config->areamedium;
        ?>
);">[<?php 
        echo $ff_config->areamedium;
        ?>
]</a>
									<a href="#" onClick="codeAreaResize('script1code',<?php 
        echo $ff_config->arealarge;
        ?>
);">[<?php 
        echo $ff_config->arealarge;
        ?>
]</a>
									<a href="#" onClick="createInitCode();"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_CREATEFRAME');
        ?>
</a>

									<br />
									<textarea onFocus="codeAreaFocus(this);" readonly="readonly" wrap="off" name="script1lines" style="display: none; width:60px;" rows="<?php 
        echo $initsize;
        ?>
" class="inputbox"></textarea>
									<textarea onFocus="codeAreaFocus(this);" onKeyUp="codeAreaChange(this,event);" wrap="off" name="script1code" style="width:100%;" rows="<?php 
        echo $initsize;
        ?>
" class="inputbox"><?php 
        echo htmlspecialchars($row->script1code, ENT_QUOTES);
        ?>
</textarea>
								</td>
								<td></td>
							</tr>
						</table>
					</fieldset>
				</td>
				<td></td>
			</tr>
			<tr>
				<td></td>
				<td colspan="2">
					<fieldset><legend><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_SUBMITTEDSCRIPT');
        ?>
</legend>
						<table width="100%" cellpadding="4" cellspacing="1" border="0">
							<tr>
								<td style="width: 200px;" valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_TYPE');
        ?>
</td>
								<td valign="top">
									<input type="radio" id="script2cond1" name="script2cond" value="0" onclick="dispsubmitted(this.value)"<?php 
        if ($row->script2cond == 0) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="script2cond1"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NONE');
        ?>
</label>
									<input type="radio" id="script2cond2" name="script2cond" value="1" onclick="dispsubmitted(this.value)"<?php 
        if ($row->script2cond == 1) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="script2cond2"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_LIBRARY');
        ?>
</label>
									<input type="radio" id="script2cond3" name="script2cond" value="2" onclick="dispsubmitted(this.value)"<?php 
        if ($row->script2cond == 2) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="script2cond3"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_CUSTOM');
        ?>
</label>
								</td>
								<td></td>
							</tr>
							<tr id="submittedlib" style="display:none;">
								<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_SCRIPT');
        ?>
</td>
								<td valign="top">
									<select name="script2id" class="inputbox" size="1">
<?php 
        $scripts = $lists['submitted'];
        for ($i = 0; $i < count($scripts); $i++) {
            $script = $scripts[$i];
            $selected = '';
            if ($script->id == $row->script2id) {
                $selected = ' selected';
            }
            echo '<option value="' . $script->id . '"' . $selected . '>' . $script->text . '</option>';
        }
        // for
        ?>
									</select>
								</td>
								<td></td>
							</tr>
							<tr id="submittedcode" style="display:none;">
								<td valign="top" colspan="2">
									<a href="#" onClick="codeAreaResize('script2code',<?php 
        echo $ff_config->areasmall;
        ?>
);">[<?php 
        echo $ff_config->areasmall;
        ?>
]</a>
									<a href="#" onClick="codeAreaResize('script2code',<?php 
        echo $ff_config->areamedium;
        ?>
);">[<?php 
        echo $ff_config->areamedium;
        ?>
]</a>
									<a href="#" onClick="codeAreaResize('script2code',<?php 
        echo $ff_config->arealarge;
        ?>
);">[<?php 
        echo $ff_config->arealarge;
        ?>
]</a>
									<a href="#" onClick="createSubmittedCode();"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_CREATEFRAME');
        ?>
</a>
									<br />
									<textarea onFocus="codeAreaFocus(this);" readonly="readonly" wrap="off" name="script2lines" style="display:none; width:60px;" rows="<?php 
        echo $subsize;
        ?>
" class="inputbox"></textarea>
									<textarea onFocus="codeAreaFocus(this);" onKeyUp="codeAreaChange(this,event);" wrap="off" name="script2code" style="width:100%;" rows="<?php 
        echo $subsize;
        ?>
" class="inputbox"><?php 
        echo htmlspecialchars($row->script2code, ENT_QUOTES);
        ?>
</textarea>
								</td>
								<td valign="top"></td>
							</tr>
						</table>
					</fieldset>
				</td>
				<td></td>
			</tr>
			</table>
                        </fieldset>
<?php 
        $tabs->endTab();
        $tabs->startTab(BFText::_('COM_BREEZINGFORMS_FORMS_FORMPIECES'), 'tab_formpieces');
        $p1size = $p2size = $ff_config->areasmall;
        if ($row->piece1cond == 2) {
            $p1size = $ff_config->areamedium;
        } else {
            if ($row->piece2cond == 2) {
                $p2size = $ff_config->areamedium;
            }
        }
        ?>
                        <fieldset><legend><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_FORMPIECES');
        ?>
</legend>
			<table width="80%" cellpadding="4" cellspacing="1" border="0">
			<tr>
				<td></td>
				<td colspan="2">
					<fieldset><legend><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_BEFOREFORM');
        ?>
</legend>
						<table width="100%" cellpadding="4" cellspacing="1" border="0">
							<tr>
								<td style="width: 200px;" valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_TYPE');
        ?>
</td>
								<td valign="top">
									<input type="radio" id="piece1cond0" name="piece1cond" value="0" onclick="dispp1(this.value)"<?php 
        if ($row->piece1cond == 0) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="piece1cond0"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NONE');
        ?>
</label>
									<input type="radio" id="piece1cond1" name="piece1cond" value="1" onclick="dispp1(this.value)"<?php 
        if ($row->piece1cond == 1) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="piece1cond1"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_LIBRARY');
        ?>
</label>
									<input type="radio" id="piece1cond2" name="piece1cond" value="2" onclick="dispp1(this.value)"<?php 
        if ($row->piece1cond == 2) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="piece1cond2"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_CUSTOM');
        ?>
</label>
								</td>
								<td></td>
							</tr>
							<tr id="p1lib" style="display:none;">
								<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_PIECE');
        ?>
</td>
								<td valign="top">
									<select name="piece1id" class="inputbox" size="1">
<?php 
        $pieces = $lists['piece1'];
        for ($i = 0; $i < count($pieces); $i++) {
            $piece = $pieces[$i];
            $selected = '';
            if ($piece->id == $row->piece1id) {
                $selected = ' selected';
            }
            echo '<option value="' . $piece->id . '"' . $selected . '>' . $piece->text . '</option>';
        }
        // for
        ?>
									</select>
								</td>
								<td></td>
							</tr>
							<tr id="p1code" style="display:none;">
								<td valign="top" colspan="2">
									<a href="#" onClick="codeAreaResize('piece1code',<?php 
        echo $ff_config->areasmall;
        ?>
);">[<?php 
        echo $ff_config->areasmall;
        ?>
]</a>
									<a href="#" onClick="codeAreaResize('piece1code',<?php 
        echo $ff_config->areamedium;
        ?>
);">[<?php 
        echo $ff_config->areamedium;
        ?>
]</a>
									<a href="#" onClick="codeAreaResize('piece1code',<?php 
        echo $ff_config->arealarge;
        ?>
);">[<?php 
        echo $ff_config->arealarge;
        ?>
]</a>
									<br/>
									<textarea onFocus="codeAreaFocus(this);" readonly="readonly" wrap="off" name="piece1lines" style="display: none; width:60px;" rows="<?php 
        echo $p1size;
        ?>
" class="inputbox"></textarea>
									<textarea onFocus="codeAreaFocus(this);" onKeyUp="codeAreaChange(this,event);" wrap="off" name="piece1code" style="width:100%;" rows="<?php 
        echo $p1size;
        ?>
" class="inputbox"><?php 
        echo htmlspecialchars($row->piece1code, ENT_QUOTES);
        ?>
</textarea>
								</td>
								<td></td>
							</tr>
						</table>
					</fieldset>
				</td>
				<td></td>
			</tr>
			<tr>
				<td></td>
				<td colspan="2">
					<fieldset><legend><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_AFTERFORM');
        ?>
</legend>
						<table width="100%" cellpadding="4" cellspacing="1" border="0">
							<tr>
								<td style="width: 200px;" valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_TYPE');
        ?>
</td>
								<td valign="top">
									<input type="radio" id="piece2cond0" name="piece2cond" value="0" onclick="dispp2(this.value)"<?php 
        if ($row->piece2cond == 0) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="piece2cond0"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NONE');
        ?>
</label>
									<input type="radio" id="piece2cond1" name="piece2cond" value="1" onclick="dispp2(this.value)"<?php 
        if ($row->piece2cond == 1) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="piece2cond1"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_LIBRARY');
        ?>
</label>
									<input type="radio" id="piece2cond2" name="piece2cond" value="2" onclick="dispp2(this.value)"<?php 
        if ($row->piece2cond == 2) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="piece2cond2"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_CUSTOM');
        ?>
</label>
								</td>
								<td></td>
							</tr>
							<tr id="p2lib" style="display:none;">
								<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_PIECE');
        ?>
</td>
								<td valign="top">
									<select name="piece2id" class="inputbox" size="1">
<?php 
        $pieces = $lists['piece2'];
        for ($i = 0; $i < count($pieces); $i++) {
            $piece = $pieces[$i];
            $selected = '';
            if ($piece->id == $row->piece2id) {
                $selected = ' selected';
            }
            echo '<option value="' . $piece->id . '"' . $selected . '>' . $piece->text . '</option>';
        }
        // for
        ?>
									</select>
								</td>
								<td></td>
							</tr>
							<tr id="p2code" style="display:none;">
								<td valign="top" colspan="2">
									<a href="#" onClick="codeAreaResize('piece2code',<?php 
        echo $ff_config->areasmall;
        ?>
);">[<?php 
        echo $ff_config->areasmall;
        ?>
]</a>
									<a href="#" onClick="codeAreaResize('piece2code',<?php 
        echo $ff_config->areamedium;
        ?>
);">[<?php 
        echo $ff_config->areamedium;
        ?>
]</a>
									<a href="#" onClick="codeAreaResize('piece2code',<?php 
        echo $ff_config->arealarge;
        ?>
);">[<?php 
        echo $ff_config->arealarge;
        ?>
]</a>
									<br/>
									<textarea onFocus="codeAreaFocus(this);" readonly="readonly" wrap="off" name="piece2lines" style="display: none; width:60px;" rows="<?php 
        echo $p2size;
        ?>
" class="inputbox"></textarea>
									<textarea onFocus="codeAreaFocus(this);" onKeyUp="codeAreaChange(this,event);" wrap="off" name="piece2code" style="width:100%;" rows="<?php 
        echo $p2size;
        ?>
" class="inputbox"><?php 
        echo htmlspecialchars($row->piece2code, ENT_QUOTES);
        ?>
</textarea>
								</td>
								<td></td>
							</tr>
						</table>
					</fieldset>
				</td>
				<td></td>
			</tr>
			</table>
                        </fieldset>
<?php 
        $tabs->endTab();
        $tabs->startTab(BFText::_('COM_BREEZINGFORMS_FORMS_SUBMPIECES'), 'tab_submpieces');
        $p3size = $p4size = $ff_config->areasmall;
        if ($row->piece3cond == 2) {
            $p3size = $ff_config->areamedium;
        } else {
            if ($row->piece4cond == 2) {
                $p4size = $ff_config->areamedium;
            }
        }
        ?>
                        <fieldset><legend><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_SUBMPIECES');
        ?>
</legend>
			<table width="80%" cellpadding="4" cellspacing="1" border="0">
			<tr>
				<td></td>
				<td colspan="2">
					<fieldset><legend><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_BEGINSUBMIT');
        ?>
</legend>
						<table width="100%" cellpadding="4" cellspacing="1" border="0">
							<tr>
								<td style="width: 200px;" valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_TYPE');
        ?>
</td>
								<td valign="top">
									<input type="radio" id="piece3cond0" name="piece3cond" value="0" onclick="dispp3(this.value)"<?php 
        if ($row->piece3cond == 0) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="piece3cond0"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NONE');
        ?>
</label>
									<input type="radio" id="piece3cond1" name="piece3cond" value="1" onclick="dispp3(this.value)"<?php 
        if ($row->piece3cond == 1) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="piece3cond1"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_LIBRARY');
        ?>
</label>
									<input type="radio" id="piece3cond2" name="piece3cond" value="2" onclick="dispp3(this.value)"<?php 
        if ($row->piece3cond == 2) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="piece3cond2"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_CUSTOM');
        ?>
</label>
								</td>
								<td></td>
							</tr>
							<tr id="p3lib" style="display:none;">
								<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_PIECE');
        ?>
</td>
								<td valign="top">
									<select name="piece3id" class="inputbox" size="1">
<?php 
        $pieces = $lists['piece3'];
        for ($i = 0; $i < count($pieces); $i++) {
            $piece = $pieces[$i];
            $selected = '';
            if ($piece->id == $row->piece3id) {
                $selected = ' selected';
            }
            echo '<option value="' . $piece->id . '"' . $selected . '>' . $piece->text . '</option>';
        }
        // for
        ?>
									</select>
								</td>
								<td></td>
							</tr>
							<tr id="p3code" style="display:none;">
								<td valign="top" colspan="2">
									<a href="#" onClick="codeAreaResize('piece3code',<?php 
        echo $ff_config->areasmall;
        ?>
);">[<?php 
        echo $ff_config->areasmall;
        ?>
]</a>
									<a href="#" onClick="codeAreaResize('piece3code',<?php 
        echo $ff_config->areamedium;
        ?>
);">[<?php 
        echo $ff_config->areamedium;
        ?>
]</a>
									<a href="#" onClick="codeAreaResize('piece3code',<?php 
        echo $ff_config->arealarge;
        ?>
);">[<?php 
        echo $ff_config->arealarge;
        ?>
]</a>
									<br/>
									<textarea onFocus="codeAreaFocus(this);" readonly="readonly" wrap="off" name="piece3lines" style="display: none; width:60px;" rows="<?php 
        echo $p3size;
        ?>
" class="inputbox"></textarea>
									<textarea onFocus="codeAreaFocus(this);" onKeyUp="codeAreaChange(this,event);" wrap="off" name="piece3code" style="width:100%;" rows="<?php 
        echo $p3size;
        ?>
" class="inputbox"><?php 
        echo htmlspecialchars($row->piece3code, ENT_QUOTES);
        ?>
</textarea>
								</td>
								<td></td>
							</tr>
						</table>
					</fieldset>
				</td>
				<td></td>
			</tr>
			<tr>
				<td></td>
				<td colspan="2">
					<fieldset><legend><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_ENDSUBMIT');
        ?>
</legend>
						<table width="100%" cellpadding="4" cellspacing="1" border="0">
							<tr>
								<td style="width: 200px;" valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_TYPE');
        ?>
</td>
								<td valign="top">
									<input type="radio" id="piece4cond0" name="piece4cond" value="0" onclick="dispp4(this.value)"<?php 
        if ($row->piece4cond == 0) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="piece4cond0"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_NONE');
        ?>
</label>
									<input type="radio" id="piece4cond1" name="piece4cond" value="1" onclick="dispp4(this.value)"<?php 
        if ($row->piece4cond == 1) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="piece4cond1"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_LIBRARY');
        ?>
</label>
									<input type="radio" id="piece4cond2" name="piece4cond" value="2" onclick="dispp4(this.value)"<?php 
        if ($row->piece4cond == 2) {
            echo ' checked="checked"';
        }
        ?>
 /><label for="piece4cond2"> <?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_CUSTOM');
        ?>
</label>
								</td>
								<td></td>
							</tr>
							<tr id="p4lib" style="display:none;">
								<td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_PIECE');
        ?>
</td>
								<td valign="top">
									<select name="piece4id" class="inputbox" size="1">
<?php 
        $pieces = $lists['piece4'];
        for ($i = 0; $i < count($pieces); $i++) {
            $piece = $pieces[$i];
            $selected = '';
            if ($piece->id == $row->piece4id) {
                $selected = ' selected';
            }
            echo '<option value="' . $piece->id . '"' . $selected . '>' . $piece->text . '</option>';
        }
        // for
        ?>
									</select>
								</td>
								<td></td>
							</tr>
							<tr id="p4code" style="display:none;">
								<td nowrap valign="top" colspan="2">
									<a href="#" onClick="codeAreaResize('piece4code',<?php 
        echo $ff_config->areasmall;
        ?>
);">[<?php 
        echo $ff_config->areasmall;
        ?>
]</a>
									<a href="#" onClick="codeAreaResize('piece4code',<?php 
        echo $ff_config->areamedium;
        ?>
);">[<?php 
        echo $ff_config->areamedium;
        ?>
]</a>
									<a href="#" onClick="codeAreaResize('piece4code',<?php 
        echo $ff_config->arealarge;
        ?>
);">[<?php 
        echo $ff_config->arealarge;
        ?>
]</a>
									<br/>
									<textarea onFocus="codeAreaFocus(this);" readonly="readonly" wrap="off" name="piece4lines" style="display: none; width:60px;" rows="<?php 
        echo $p4size;
        ?>
" class="inputbox"></textarea>
									<textarea onFocus="codeAreaFocus(this);" onKeyUp="codeAreaChange(this,event);" wrap="off" name="piece4code" style="width:100%;" rows="<?php 
        echo $p4size;
        ?>
" class="inputbox"><?php 
        echo htmlspecialchars($row->piece4code, ENT_QUOTES);
        ?>
</textarea>
								</td>
								<td></td>
							</tr>
						</table>
					</fieldset>
				</td>
				<td></td>
			</tr>
			</table>
                        </fieldset>
<?php 
        $tabs->endTab();
        $tabs->startTab('MailChimp®', 'tab_mailchimp');
        ?>

                <fieldset><legend>MailChimp®</legend>
			<table width="100%" cellpadding="4" cellspacing="1" border="0">

                                            <tr>
                                                <td valign="top" style="width: 200px;"><?php 
        echo BFText::_('COM_BREEZINGFORMS_API_KEY');
        ?>
</td>
                                                <td valign="top"><input type="text" name="mailchimp_api_key"  value="<?php 
        echo $row->mailchimp_api_key;
        ?>
" size="50"  class="inputbox"/></td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_LIST_ID');
        ?>
</td>
                                                <td valign="top"><input type="text" name="mailchimp_list_id"  value="<?php 
        echo $row->mailchimp_list_id;
        ?>
" size="50"  class="inputbox"/></td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_EMAIL_FIELD');
        ?>
</td>
                                                <td valign="top"><input type="text" name="mailchimp_email_field"  value="<?php 
        echo $row->mailchimp_email_field;
        ?>
" size="50"  class="inputbox"/></td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_CHECKBOX_FIELD');
        ?>
</td>
                                                <td valign="top"><input type="text" name="mailchimp_checkbox_field"  value="<?php 
        echo $row->mailchimp_checkbox_field;
        ?>
" size="50"  class="inputbox"/></td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_UNSUBSCRIBE_FIELD');
        ?>
</td>
                                                <td valign="top"><input type="text" name="mailchimp_unsubscribe_field"  value="<?php 
        echo $row->mailchimp_unsubscribe_field;
        ?>
" size="50"  class="inputbox"/></td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_TEXT_HTML_MOBILE_FIELD');
        ?>
</td>
                                                <td valign="top"><input type="text" name="mailchimp_text_html_mobile_field"  value="<?php 
        echo $row->mailchimp_text_html_mobile_field;
        ?>
" size="50"  class="inputbox"/></td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_MERGE_VARS');
        ?>
</td>
                                                <td valign="top"><input type="text" name="mailchimp_mergevars"  value="<?php 
        echo $row->mailchimp_mergevars;
        ?>
" style="width:90%;"  class="inputbox"/></td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_DEFAULT_TYPE');
        ?>
</td>
                                                <td valign="top">
                                                    <select name="mailchimp_default_type" class="inputbox">
                                                        <option value="text"<?php 
        echo $row->mailchimp_default_type == 'text' ? ' selected="selected"' : '';
        ?>
>Text</option>
                                                        <option value="html"<?php 
        echo $row->mailchimp_default_type == 'html' ? ' selected="selected"' : '';
        ?>
>HTML</option>
                                                        <option value="mobile"<?php 
        echo $row->mailchimp_default_type == 'mobile' ? ' selected="selected"' : '';
        ?>
>Mobile</option>
                                                    </select>
                                                </td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_DOUBLE_OPTIN');
        ?>
</td>
                                                <td valign="top"><input type="radio" name="mailchimp_double_optin" class="inputbox"<?php 
        echo $row->mailchimp_double_optin ? ' checked="checked"' : '';
        ?>
 value="1"/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_YES');
        ?>
 <input type="radio" name="mailchimp_double_optin"  class="inputbox"<?php 
        echo !$row->mailchimp_double_optin ? ' checked="checked"' : '';
        ?>
 value="0"/><?php 
        echo BFText::_('COM_BREEZINGFORMS_NO');
        ?>
</td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_UPDATE_EXISTING');
        ?>
</td>
                                                <td valign="top"><input type="radio" name="mailchimp_update_existing" class="inputbox"<?php 
        echo $row->mailchimp_update_existing ? ' checked="checked"' : '';
        ?>
 value="1"/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_YES');
        ?>
 <input type="radio" name="mailchimp_update_existing"  class="inputbox"<?php 
        echo !$row->mailchimp_update_existing ? ' checked="checked"' : '';
        ?>
 value="0"/><?php 
        echo BFText::_('COM_BREEZINGFORMS_NO');
        ?>
</td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_REPLACE_INTERESTS');
        ?>
</td>
                                                <td valign="top"><input type="radio" name="mailchimp_replace_interests" class="inputbox"<?php 
        echo $row->mailchimp_replace_interests ? ' checked="checked"' : '';
        ?>
 value="1"/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_YES');
        ?>
 <input type="radio" name="mailchimp_replace_interests"  class="inputbox"<?php 
        echo !$row->mailchimp_replace_interests ? ' checked="checked"' : '';
        ?>
 value="0"/><?php 
        echo BFText::_('COM_BREEZINGFORMS_NO');
        ?>
</td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_SEND_WELCOME');
        ?>
</td>
                                                <td valign="top"><input type="radio" name="mailchimp_send_welcome" class="inputbox"<?php 
        echo $row->mailchimp_send_welcome ? ' checked="checked"' : '';
        ?>
 value="1"/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_YES');
        ?>
 <input type="radio" name="mailchimp_send_welcome"  class="inputbox"<?php 
        echo !$row->mailchimp_send_welcome ? ' checked="checked"' : '';
        ?>
 value="0"/><?php 
        echo BFText::_('COM_BREEZINGFORMS_NO');
        ?>
</td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_UNSUBSCRIBE_DELETE_MEMBER');
        ?>
</td>
                                                <td valign="top"><input type="radio" name="mailchimp_delete_member" class="inputbox"<?php 
        echo $row->mailchimp_delete_member ? ' checked="checked"' : '';
        ?>
 value="1"/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_YES');
        ?>
 <input type="radio" name="mailchimp_delete_member"  class="inputbox"<?php 
        echo !$row->mailchimp_delete_member ? ' checked="checked"' : '';
        ?>
 value="0"/><?php 
        echo BFText::_('COM_BREEZINGFORMS_NO');
        ?>
</td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_UNSUBSCRIBE_SEND_GOODBYE');
        ?>
</td>
                                                <td valign="top"><input type="radio" name="mailchimp_send_goodbye" class="inputbox"<?php 
        echo $row->mailchimp_send_goodbye ? ' checked="checked"' : '';
        ?>
 value="1"/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_YES');
        ?>
 <input type="radio" name="mailchimp_send_goodbye"  class="inputbox"<?php 
        echo !$row->mailchimp_send_goodbye ? ' checked="checked"' : '';
        ?>
 value="0"/><?php 
        echo BFText::_('COM_BREEZINGFORMS_NO');
        ?>
</td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_UNSUBSCRIBE_SEND_NOTIFY');
        ?>
</td>
                                                <td valign="top"><input type="radio" name="mailchimp_send_notify" class="inputbox"<?php 
        echo $row->mailchimp_send_notify ? ' checked="checked"' : '';
        ?>
 value="1"/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_YES');
        ?>
 <input type="radio" name="mailchimp_send_notify"  class="inputbox"<?php 
        echo !$row->mailchimp_send_notify ? ' checked="checked"' : '';
        ?>
 value="0"/><?php 
        echo BFText::_('COM_BREEZINGFORMS_NO');
        ?>
</td>
                                            </tr>

                                            <tr>
                                                <td valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_SEND_ERRORS');
        ?>
</td>
                                                <td valign="top"><input type="radio" name="mailchimp_send_errors" class="inputbox"<?php 
        echo $row->mailchimp_send_errors ? ' checked="checked"' : '';
        ?>
 value="1"/> <?php 
        echo BFText::_('COM_BREEZINGFORMS_YES');
        ?>
 <input type="radio" name="mailchimp_send_errors"  class="inputbox"<?php 
        echo !$row->mailchimp_send_errors ? ' checked="checked"' : '';
        ?>
 value="0"/><?php 
        echo BFText::_('COM_BREEZINGFORMS_NO');
        ?>
</td>
                                            </tr>

                                        </table>
                </fieldset>
<?php 
        $tabs->endTab();
        $tabs->startTab('Salesforce®', 'tab_salesforce');
        ?>
			<fieldset><legend>Salesforce®</legend>
			<?php 
        echo bf_alert('Salesforce® is supported in the full version only', 'http://crosstec.de/en/extensions/joomla-forms-download.html');
        ?>
                     </fieldset>
<?php 
        $tabs->endTab();
        $tabs->startTab('Dropbox®', 'tab_dropbox');
        ?>
                <fieldset><legend>Dropbox®</legend>
			<?php 
        echo bf_alert('Dropbox® is supported in the full version only', 'http://crosstec.de/en/extensions/joomla-forms-download.html');
        ?>
                </fieldset>
<?php 
        $tabs->endTab();
        // calling addon plugins
        JPluginHelper::importPlugin('breezingforms_addons');
        $dispatcher = JDispatcher::getInstance();
        $addons = $dispatcher->trigger('onPropertiesDisplay', array(JRequest::getInt('form', 0), $tabs));
        foreach ($addons as $addon) {
            echo $addon;
        }
        $tabs->endPane();
        ?>
				</td>
				<td></td>
			</tr>
		</table>
                    
		<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
		<input type="hidden" name="pkg" value="<?php 
        echo $pkg;
        ?>
" />
		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="act" value="manageforms" />
		<input type="hidden" name="pages" value="<?php 
        echo $row->pages;
        ?>
" />
		<input type="hidden" name="caller_url" value="<?php 
        echo htmlspecialchars($caller, ENT_QUOTES);
        ?>
" />
		</form>
                
                <div style="float: right;">
                <input class="btn btn-primary" onclick="submitbutton('save');" type="submit" value="<?php 
        echo htmlentities(BFText::_('COM_BREEZINGFORMS_TOOLBAR_SAVE'), ENT_QUOTES, 'UTF-8');
        ?>
"/>
                &nbsp;&nbsp;
                <input class="btn btn-primary" onclick="submitbutton('cancel');" type="submit" value="<?php 
        echo htmlentities(BFText::_('COM_BREEZINGFORMS_TOOLBAR_CANCEL'), ENT_QUOTES, 'UTF-8');
        ?>
"/>
                </div>
                <div style="clear:both;"></div>
                </fieldset>
<?php 
    }