</span></h3>
  <div class="inside">   
     <div class="form-builder-error-messages"><?php 
global $cff_structure_error;
if (!empty($cff_structure_error)) {
    echo $cff_structure_error;
}
?>
</div>
     <input type="hidden" name="form_structure_crc" id="form_structure_crc" />
     <input type="hidden" name="form_structure" id="form_structure" value="<?php 
print esc_attr(json_encode(cp_calculatedfieldsf_get_option('form_structure', CP_CALCULATEDFIELDSF_DEFAULT_form_structure)));
?>
" />
     <input type="hidden" name="templates" id="templates" value="<?php 
print esc_attr(json_encode(cp_calculatedfieldsf_available_templates()));
?>
" />
     
     <link href="<?php 
echo plugins_url('css/style.css', __FILE__);
?>
" type="text/css" rel="stylesheet" />   
     <link href="<?php 
echo plugins_url('css/cupertino/jquery-ui-1.8.20.custom.css', __FILE__);
?>
" type="text/css" rel="stylesheet" />   
     <script type="text/javascript">
		try
		{
			// Flags
                    $object->list->{$object->active} = $datasourceObject;
                }
                $form_data[0][$key] = $object;
            }
        }
    }
    $form_data[1]['formid'] = "cp_calculatedfieldsf_pform" . $CP_CFF_global_form_count;
    if (get_option('CP_CALCULATEDFIELDSF_FORM_CACHE', false)) {
        $form_cache = cp_calculatedfieldsf_get_option('cache', '', $id);
        $form_data[1]['cache'] = $form_data[1]['setCache'] = empty($form_cache) ? true : false;
    } else {
        $form_data[1]['cache'] = $form_data[1]['setCache'] = false;
    }
    // PROCESS LAYOUT
    if (isset($form_data[1]) && isset($form_data[1][0]) && isset($form_data[1][0]->formtemplate)) {
        $templatelist = cp_calculatedfieldsf_available_templates();
        if (isset($templatelist[$form_data[1][0]->formtemplate])) {
            wp_enqueue_style('cpcff_template_css' . $form_data[1][0]->formtemplate, $templatelist[$form_data[1][0]->formtemplate]['file'], array(), 'pro');
            print '<link href="' . esc_attr(esc_url($templatelist[$form_data[1][0]->formtemplate]['file'])) . '?ver=pro" type="text/css" rel="stylesheet" />';
            if (isset($templatelist[$form_data[1][0]->formtemplate]['js'])) {
                print '<script src="' . esc_attr(esc_url($templatelist[$form_data[1][0]->formtemplate]['js'])) . '"></script>';
            }
        }
    }
    ?>
	<script type="text/javascript">
	 function doValidate<?php 
    echo $CP_CFF_global_form_count;
    ?>
(form)
	 {
   
<div id="normal-sortables" class="meta-box-sortables">

 <h2>Form Settings:</h2>
 <hr />
 <div>* Different form styles available on the tab Form Settings &gt;&gt; Form Template</div>
 <div id="metabox_basic_settings" class="postbox" >
  <h3 class='hndle' style="padding:5px;"><span>Form Builder</span></h3>
  <div class="inside">
     <p style="border:1px solid #F0AD4E;background:#FBE6CA;padding:10px;">If you need also the form to be sent to the server side for processing (for example to deliver emails) then the <a href="http://wordpress.dwbooster.com/forms/calculated-fields-form#download">Professional or Developer versions</a> of the plugin will be required.</p>
     <input type="hidden" name="form_structure" id="form_structure" value="<?php 
echo str_replace('"', '&quot;', str_replace("\r", "", str_replace("\n", "", esc_attr(cp_calculatedfieldsf_cleanJSON(cp_calculatedfieldsf_get_option('form_structure', CP_CALCULATEDFIELDSF_DEFAULT_form_structure))))));
?>
" />
	 <input type="hidden" name="templates" id="templates" value="<?php 
echo str_replace('"', '&quot;', esc_attr(json_encode(cp_calculatedfieldsf_available_templates())));
?>
" /> 	
     <link href="<?php 
echo plugins_url('css/style.css', __FILE__);
?>
" type="text/css" rel="stylesheet" />   
     <link href="<?php 
echo plugins_url('css/cupertino/jquery-ui-1.8.20.custom.css', __FILE__);
?>
" type="text/css" rel="stylesheet" />   

     <script type="text/javascript">          
       try{$calculatedfieldsfQuery = jQuery.noConflict();window.jQuery = window.$ = jQuery;} catch (e) {}
       if (typeof $calculatedfieldsfQuery == 'undefined')
       {