<?php

cs()->registerScript('editRenameToggle', '$("#toggleRename").click(function(){$(this).parent().toggleClass("active");$("#renameFields").toggle()});');

$headerTitle = CHtml::encode($model->name).__('FORWARD_PRESET_UPDATE_HEADER');
$headerTranslationId = 'FORWARD_PRESET_UPDATE_HEADER';
if($model->isNewRecord){
    $headerTitle = __('FORWARD_PRESET_CREATE_HEADER');
    $headerTranslationId = 'FORWARD_PRESET_CREATE_HEADER';
}

$this->widget('ext.PlNavbar', array(
    'brand'=> $headerTitle,
    'htmlOptions'=>array(
        'data-translation-id'=>$headerTranslationId,
    ),
    'collapse'=>true, // requires bootstrap-responsive.css
    'items'=>array(
        array(
            'class'=>'bootstrap.widgets.TbMenu',
            'items'=>array(
                array(
                    'type' => 'raw',
                    'label'=>__("FORWARD_PRESET_SHOW_RENAME_CONTROLLS"),
                    'icon' => 'pencil',
                    'url'=>'',
                    'active'=>false,
                    'visible' => !$model->isNewRecord && $model->forwardType != ForwardType::Disabled,
                    'linkOptions' => array(
                        'id' => 'toggleRename',
                        'data-translation-id'=>'FORWARD_PRESET_SHOW_RENAME_CONTROLLS'
                    ),
                ),
            ),
        ),
    ),
));


echo '<div class="well">';
if($write){
    $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
        //'id'=>'verticalForm',
        'htmlOptions'=>array(),
        'type'=>'horizontal',
        'id' => 'forward-form',
    ));

    $renameFieldsCss = $model->isNewRecord || $model->forwardType == ForwardType::Disabled ? '' : 'style="display:none"';
    echo '<div id="renameFields" '.$renameFieldsCss.'>';
    echo $form->textFieldRow(
        $model,
        'name',
        array(
            'class'=>'span3',
            'data-translation-id' => 'FORWARD_PRESET_MODEL_NAME',
        )
    );

    echo $form->textFieldRow(
        $model,
        'description',
        array(
            'class'=>'span3',
            'data-translation-id' => 'FORWARD_PRESET_MODEL_DESCRIPTION',
        )
    );
    if($model->isNewRecord){
        echo $form->dropDownListRow(
            $model,
            'forwardType',
            $this->getForwardTypeDropdownListData(),
            array(
                'class'=>'span3',
                'data-translation-id' => 'FORWARD_PRESET_MODEL_FORWARD_TYPE',
                'data-translation-target' => 'FORWARD_PRESET_MODEL_FORWARD_TYPE',
            )
        );
    }

    if(Yii::app()->user->translateMode){
        echo '<i data-translation-target="FORWARD_PRESET_MODEL_FORWARD_TYPE" data-translation-id="CALLFORWARD_TYPE_DISABLED"></i>';
        echo '<i data-translation-target="FORWARD_PRESET_MODEL_FORWARD_TYPE" data-translation-id="CALLFORWARD_TYPE_IMMEDIATELY"></i>';
        echo '<i data-translation-target="FORWARD_PRESET_MODEL_FORWARD_TYPE" data-translation-id="CALLFORWARDT_TYPE_CUSTOM"></i>';
    }

    if(!$model->isNewRecord && $model->forwardType != ForwardType::Disabled){
        echo "<hr>";
    }

    echo '</div>';

    if($model->isNewRecord || $model->forwardType == ForwardType::Disabled){
        echo '<div class="form-actions">';
        $this->widget('bootstrap.widgets.TbButton', array(
            'buttonType'=>'submit',
            'label'=> $model->isNewRecord ? __('GLOBAL_CREATE_BUTTON') : __('GLOBAL_SAVE_BUTTON'),
            'type' => 'primary',
            'htmlOptions' => array(
                'data-translation-id' => $model->isNewRecord ? 'GLOBAL_CREATE_BUTTON' : 'GLOBAL_SAVE_BUTTON'
            )
        ));
        echo "</div>";
    }

    echo "";
    $this->endWidget();
}

if($model->isNewRecord || $model->forwardType == ForwardType::Disabled){
    echo '</div>';
    return;
}





//    $this->widget('bootstrap.widgets.TbButtonGroup', array(
//        'htmlOptions' => array(
//            'style' => !$write ? 'display:none' : ''
//        ),
//        //'type' => 'primary',
//        'toggle' => 'radio', // 'checkbox' or 'radio'
//        'buttons' => array(
//            array(
//                'htmlOptions' => array(
//                    'value' => 'simple',
//                    'id' => 'immediatelyRedirect',
//                    'name' => 'redirectType'
//                ),
//                'label'=>__('PHONESETTINGSCALLFORWARD_IMMEDIATELY_REDIRECT')
//            ),
//            array(
//                'htmlOptions' => array(
//                    'value' => 'advanced',
//                    'id' => 'customRedirect',
//                    'name' => 'redirectType'
//                ),
//                'label'=>__('PHONESETTINGSCALLFORWARD_CUSTOM_REDIRECT')
//            ),
//        ),
//    ));





//echo '</div>';
echo '<ul id="forwardsDisplayArea"></ul>';

if($write){
    if($model->forwardType == ForwardType::Custom){
        $this->widget('bootstrap.widgets.TbButton', array(
            'label'=> __('PHONESETTINGSCALLFORWARD_CUSTOM_FORWAD_ADD_NEW_RULE'),
            'icon' => 'plus',
            'htmlOptions' => array(
                'data-translation-id' => 'PHONESETTINGSCALLFORWARD_CUSTOM_FORWAD_ADD_NEW_RULE',
                'onclick' => "addAdvancedForward()",
            ),
        ));
        echo "<br>";
    }



    $this->widget('bootstrap.widgets.TbButton', array(
        'label'=> __('GLOBAL_SAVE_BUTTON'),
        'type'=>'primary', // null, 'primary', 'info', 'success', 'warning', 'danger' or 'inverse'
        'htmlOptions' => array(
            'style' => 'margin-top:5px',
            'id' => 'submittButton',
            'data-translation-id' => 'GLOBAL_SAVE_BUTTON',
        ),
    ));
}

echo '</div>';






Yii::app()->clientScript->registerCoreScript('jquery.ui');

if(Yii::app()->user->translateMode){
echo '<div class="well">';
        
        echo '<h3 data-translation-id="PHONESETTINGSCALLFORWARD_TRANSLATION_GENERAL">'.__("PHONESETTINGSCALLFORWARD_TRANSLATION_GENERAL").'</h3>'; 
        echo '<table width="100%">';
        
        echo '<tr>';
	        echo '<td>';
		        echo '<h5 data-translation-id="PHONESETTINGSCALLFORWARD_REDIRECT_TYPES_GENERAL">'.__("PHONESETTINGSCALLFORWARD_REDIRECT_TYPES_GENERAL").'</h5>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_NO_REDIRECT">'.__('PHONESETTINGSCALLFORWARD_NO_REDIRECT').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_IMMEDIATELY_REDIRECT">'.__('PHONESETTINGSCALLFORWARD_IMMEDIATELY_REDIRECT').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_CUSTOM_REDIRECT">'.__('PHONESETTINGSCALLFORWARD_CUSTOM_REDIRECT').'</p>';
	        echo '</td>';
   
	        echo '<td>';
		        echo '<h5 data-translation-id="PHONESETTINGSCALLFORWARD_JABBERSTATE_GENERAL">'.__("PHONESETTINGSCALLFORWARD_JABBERSTATE_GENERAL").'</h5>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_JABBERSTATE_IS">'.__('PHONESETTINGSCALLFORWARD_JABBERSTATE_IS').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_JABBERSTATE_ONLINE">'.__('PHONESETTINGSCALLFORWARD_JABBERSTATE_ONLINE').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_JABBERSTATE_AWAY">'.__('PHONESETTINGSCALLFORWARD_JABBERSTATE_AWAY').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_JABBERSTATE_DND">'.__('PHONESETTINGSCALLFORWARD_JABBERSTATE_DND').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_JABBERSTATE_OFFLINE">'.__('PHONESETTINGSCALLFORWARD_JABBERSTATE_OFFLINE').'</p>';
	        echo '</td>';

	        echo '<td>';
		        echo '<h5 data-translation-id="PHONESETTINGSCALLFORWARD_IN_CALLSOURCE_GENERAL">'.__("PHONESETTINGSCALLFORWARD_IN_CALLSOURCE_GENERAL").'</h5>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_CALLSOURCE_IS">'.__('PHONESETTINGSCALLFORWARD_CALLSOURCE_IS').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_CALLSOURCE_INTERNAL">'.__('PHONESETTINGSCALLFORWARD_CALLSOURCE_INTERNAL').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_CALLSOURCE_EXTERNAL">'.__('PHONESETTINGSCALLFORWARD_CALLSOURCE_EXTERNAL').'</p>';
	        echo '</td>';
        echo '</tr>';
        
        echo '<tr>'; 
	        echo '<td>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_CHOOSE_CRITERIA">'.__('PHONESETTINGSCALLFORWARD_CHOOSE_CRITERIA').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_TIMEOUT_SECONDS">'.__('PHONESETTINGSCALLFORWARD_TIMEOUT_SECONDS').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_ADD__NEW_FILTER">'.__('PHONESETTINGSCALLFORWARD_ADD__NEW_FILTER').'</p>';
	        echo '</td>';
        
	        echo '<td>';
		        echo '<h5 data-translation-id="PHONESETTINGSCALLFORWARD_TIMERULE_GENERAL">'.__("PHONESETTINGSCALLFORWARD_TIMERULE_GENERAL").'</h5>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_TIMERULE_FROM">'.__('PHONESETTINGSCALLFORWARD_TIMERULE_FROM').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_TIMERULE_TO">'.__('PHONESETTINGSCALLFORWARD_TIMERULE_TO').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_TIMERULE_DAILY">'.__('PHONESETTINGSCALLFORWARD_TIMERULE_DAILY').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_TIMERULE_WEEKDAYS">'.__('PHONESETTINGSCALLFORWARD_TIMERULE_WEEKDAYS').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_TIMERULE_WEEKEND">'.__('PHONESETTINGSCALLFORWARD_TIMERULE_WEEKEND').'</p>';
	        echo '</td>';
        
	        echo '<td>';
		        echo '<h5 data-translation-id="PHONESETTINGSCALLFORWARD_CALENDAR_STATE_GENERAL">'.__("PHONESETTINGSCALLFORWARD_CALENDAR_STATE_GENERAL").'</h5>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_FREE_IN_CALENDAR_GENERAL">'.__('PHONESETTINGSCALLFORWARD_FREE_IN_CALENDAR_GENERAL').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_NOT_FREE_IN_CALENDAR_GENERAL">'.__('PHONESETTINGSCALLFORWARD_NOT_FREE_IN_CALENDAR_GENERAL').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_ADDRESSBOOK_CALENDAR_USER_IS_FREE">'.__('PHONESETTINGSCALLFORWARD_ADDRESSBOOK_CALENDAR_USER_IS_FREE').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_ADDRESSBOOK_CALENDAR_USER_IS_NOT_FREE">'.__('PHONESETTINGSCALLFORWARD_ADDRESSBOOK_CALENDAR_USER_IS_NOT_FREE').'</p>';
	        echo '</td>';      
        echo '</tr>';
        
        echo '<tr>';
	        echo '<td>';
		        echo '<h5 data-translation-id="PHONESETTINGSCALLFORWARD_TARGET_GENERAL">'.__("PHONESETTINGSCALLFORWARD_TARGET_GENERAL").'</h5>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_TARGET_PHONENUMBER">'.__('PHONESETTINGSCALLFORWARD_TARGET_PHONENUMBER').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_TARGET_VOICE_MAIL">'.__('PHONESETTINGSCALLFORWARD_TARGET_VOICE_MAIL').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_TARGET_ANNONCEMENT">'.__('PHONESETTINGSCALLFORWARD_TARGET_ANNONCEMENT').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_TARGET_ANNOUNCEMENT_SYSTEM_STANDARD">'.__('PHONESETTINGSCALLFORWARD_TARGET_ANNOUNCEMENT_SYSTEM_STANDARD').'</p>';
	        echo '</td>';
        
	        echo '<td>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_TIMERULE_DAY_0">'.__('PHONESETTINGSCALLFORWARD_TIMERULE_DAY_0').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_TIMERULE_DAY_1">'.__('PHONESETTINGSCALLFORWARD_TIMERULE_DAY_1').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_TIMERULE_DAY_2">'.__('PHONESETTINGSCALLFORWARD_TIMERULE_DAY_2').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_TIMERULE_DAY_3">'.__('PHONESETTINGSCALLFORWARD_TIMERULE_DAY_3').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_TIMERULE_DAY_4">'.__('PHONESETTINGSCALLFORWARD_TIMERULE_DAY_4').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_TIMERULE_DAY_5">'.__('PHONESETTINGSCALLFORWARD_TIMERULE_DAY_5').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_TIMERULE_DAY_6">'.__('PHONESETTINGSCALLFORWARD_TIMERULE_DAY_6').'</p>';
	        echo '</td>';
        
	        echo "<td>";
		        echo '<h5 data-translation-id="PHONESETTINGSCALLFORWARD_MESSAGES_GENERAL">'.__("PHONESETTINGSCALLFORWARD_MESSAGES_GENERAL").'</h5>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_MESSAGES_EXTENSION">'.__('PHONESETTINGSCALLFORWARD_MESSAGES_EXTENSION').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_MESSAGES_NO_EXTENSION_ERROR">'.__('PHONESETTINGSCALLFORWARD_MESSAGES_NO_EXTENSION_ERROR').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_MESSAGES_ENTRY_MUST_NOT_EMPTY">'.__('PHONESETTINGSCALLFORWARD_MESSAGES_ENTRY_MUST_NOT_EMPTY').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_MESSAGES_NO_RECORD_FOUND">'.__('PHONESETTINGSCALLFORWARD_MESSAGES_NO_RECORD_FOUND').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_MESSAGES_NEED_USER_DEFINED_CALL_FORWARD">'.__('PHONESETTINGSCALLFORWARD_MESSAGES_NEED_USER_DEFINED_CALL_FORWARD').'</p>';
		        echo '<p data-translation-id="CALLFORWARDUNG_ERROR_COULD_NOT_DELETE_LAST_FILTER">'.__('CALLFORWARDUNG_ERROR_COULD_NOT_DELETE_LAST_FILTER').'</p>';
		    echo "</td>";
        echo '</tr>';
        
        echo '<tr>';
	        echo '<td>';
		        echo '<h5 data-translation-id="PHONESETTINGSCALLFORWARD_PHONESTATE_GENERAL">'.__("PHONESETTINGSCALLFORWARD_PHONESTATE_GENERAL").'</h5>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_PHONESTATE_IS">'.__('PHONESETTINGSCALLFORWARD_PHONESTATE_IS').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_PHONESTATE_SIGNED_OUT">'.__('PHONESETTINGSCALLFORWARD_PHONESTATE_SIGNED_OUT').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_PHONESTATE_BUSY">'.__('PHONESETTINGSCALLFORWARD_PHONESTATE_BUSY').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_PHONESTATE_CALLTIMEOUT">'.__('PHONESETTINGSCALLFORWARD_PHONESTATE_CALLTIMEOUT').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_PHONESTATE_TIMEOUT">'.__('PHONESETTINGSCALLFORWARD_PHONESTATE_TIMEOUT').'</p>';
	        echo '</td>';
        
        
	        echo '<td>';
		        echo '<h5 data-translation-id="PHONESETTINGSCALLFORWARD_IN_ADDRESSBOOK_GENERAL">'.__("PHONESETTINGSCALLFORWARD_IN_ADDRESSBOOK_GENERAL").'</h5>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_NOT_IN_ADDRESSBOOK_GENERAL">'.__('PHONESETTINGSCALLFORWARD_NOT_IN_ADDRESSBOOK_GENERAL').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_ADDRESSBOOK_CONTACT_TYPE_IS">'.__('PHONESETTINGSCALLFORWARD_ADDRESSBOOK_CONTACT_TYPE_IS').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_ADDRESSBOOK_CONTACT_TYPE_IS_NOT">'.__('PHONESETTINGSCALLFORWARD_ADDRESSBOOK_CONTACT_TYPE_IS_NOT').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_IN_ADDRESSBOOK">'.__('PHONESETTINGSCALLFORWARD_IN_ADDRESSBOOK').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_CRITERIA_CALLER">'.__('PHONESETTINGSCALLFORWARD_CRITERIA_CALLER').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_CRITERIA_CONTACT_TYPE">'.__('PHONESETTINGSCALLFORWARD_CRITERIA_CONTACT_TYPE').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_CRITERIA_ADDRESSBOOK_ID">'.__('PHONESETTINGSCALLFORWARD_CRITERIA_ADDRESSBOOK_ID').'</p>';
	        echo '</td>';
	        
	        
	        echo '<td>';
		        echo '<h5 data-translation-id="PHONESETTINGSCALLFORWARD_IN_NIGHTCIRCUTSTATE_GENERAL">'.__("PHONESETTINGSCALLFORWARD_IN_NIGHTCIRCUTSTATE_GENERAL").'</h5>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_CALLSOURCE_NIGHTCIRCUTSTATE_GENERAL_ENABLED">'.__('PHONESETTINGSCALLFORWARD_CALLSOURCE_NIGHTCIRCUTSTATE_GENERAL_ENABLED').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_CALLSOURCE_NIGHTCIRCUTSTATE_GENERAL_DISABLED">'.__('PHONESETTINGSCALLFORWARD_CALLSOURCE_NIGHTCIRCUTSTATE_GENERAL_DISABLED').'</p>';
		        echo '<p data-translation-id="PHONESETTINGSCALLFORWARD_GROUP">'.__('PHONESETTINGSCALLFORWARD_GROUP').'</p>';
	        echo '</td>';
        echo '</tr>';      
        echo '</table>';  
        
        echo '</div>';

}
?>



    <script type="text/javascript">
        var hasForwardWritePermission = <?php echo json_encode($write);?>;
        <?php
            $getJsonUrl = url('phonesettingsCallforward/default/getJson', array('id' => $model->id));

            $setJsonUrl = '';
            if($write){
                $setJsonUrl = url('phonesettingsCallforward/default/setJson', array('id' => $model->id));
            }

        ?>

        var getJsonURL = "<?php echo $getJsonUrl;?>";
        var setJsonURL = "<?php echo $setJsonUrl;?>";

        var sampleAdvancedForward = '{"id":1,"type":"advanced","position":0,"target":{"type":"number","title":"Rufnummer","desc":"Rufnummer 1","properties":{"number":"1"}},"criterias":{"1":{"name":"PhoneStatus","properties":{"phonestatus":"offline"}}}}';
        var sampleCriteria = '{"name":"PhoneStatus","properties":{"phonestatus":"offline"}}';
    </script>

    <script src="<?php echo url('phonesettingsCallforward/default/script', array('id' => $model->id));?>"></script>

    <style>

        #forwardsDisplayArea{
            padding: 0;
            margin: 0;
        }

        #forwardForm label{
            line-height: 20px;
            margin-left: 5px;
        }

        .newForwardRule br{
            display: none;
        }

        .newForwardRule select{
            height: 22px;
            width: 150px;
            margin: 0 3px;
            outline: none;
        }

        .newForwardRule input{
            height: 12px;
        }

        .newForwardRule label{
            min-width: 100px;
        }

        .newForwardRule div.form-inline{
            padding: 2px 0;
        }

        .newForwardRule a img{
            margin: 0 0 -4px 0;
        }

        #criteria-list ul{
            list-style-type: none!important;
        }

        #criteria-list li{
            border: 0 none!important;
            padding: 0 15px !important;
            margin: 10px 0 !important;
            background: url('img/arrow_state_blue_right.png') no-repeat!important;

            background-position: 0px 0px;
            list-style-type: none;
        }

        .addButton{
            margin: 5px 40px;
        }

        #saveRule img{
            margin: 0 8px -4px;
        }

        .lrBorder{
            border-left: 1px solid #C7CACC;
            border-right: 1px solid #C7CACC;
            padding: 0 10px;
        }

        .removeLinkToggle{
            opacity: 0.1;
            /* Firefox */
            -moz-transition: opacity 0.7s ease 0s;
            /* WebKit */
            -webkit-transition: opacity 0.7s ease 0s;
            /* Opera */
            -o-transition: opacity 0.7s ease 0s;
            /* Standard */
            transition: opacity 0.7s ease 0s;
        }

        #criteria-list li:hover a{
            opacity: 1;
        }

        #forwardsDisplayArea{
            font-size: 13px;
        }


        #forwardsDisplayArea li{
            border: 1px solid #C7CACC;
            border-radius: 2px;
            margin: 5px 10px 10px;
            padding: 5px;
            list-style: none;
            background: #ECECEC;
        }

        .ui-sortable-helper{
            background: #eaf1fc!important;
        }


        #forwardsDisplayArea button{
            border: 1px solid #C7CACC;
            background: #C7CACC;
            margin: 2px 4px;
            border-radius: 2px;
        }

        #forwardsDisplayArea li table tr td:first-child{
            padding: 0 5px 0 0;
        }

        #forwardsDisplayArea button img{
            /* width: 20px; */
        }

        .iconButton{
            width:35px;
            height:19px;
            text-align: center;
        }
        .iconButton img{
            vertical-align: text-bottom;
            padding: 0px;
            margin: 0px;
        }

        .forwardTarget{
            border-top: 1px solid #C7CACC;
            padding-top: 5px;
            margin-top: 5px;
        }

        .forwardTarget i{
            margin: 0 4px;
        }

        .forwardTarget img{
            vertical-align: text-bottom;
            margin-right: 3px;
        }

        #redirectTypes label, #redirectTypes input{
            margin: 0;
            vertical-align: baseline;
        }

        #redirectTypes select{
            margin: 0 5px;
        }

        #forwardsDisplayArea table{
            width: 100%;
        }
    </style>
    <form id="redirectTypes">





    </form>



    <div id="edit"></div>


<?php
if(!$write){
    ?>
    <style>
        #forwardsDisplayArea button{
            display: none;
            opacity: 0;
        }
    </style>
<?php
}
