<? global $vis_language; ?>
<div class="vis_main_window vis_shadow vis_round_corner">
    <div class="vis_main_header"><? echo $vis_language['TXTINTEGRATIONS']; ?></div>
    <div class="vis_main_window_content vis_round_corner" align="left"><form id="vis_integration_form" name="vis_integration_form" method="post"><table width="100%" cellspacing="5" cellpadding="3">
        <tr><td width="150"><? echo $vis_language['TXTDOMAIN']; ?></td><td><select class="vis_input" name="vis_department" id="vis_department" onchange="vis_change_integration(this)"><option value="0">-- <? echo $vis_language['TXTSELECTDOMAIN']; ?> --</option><?
            for($i=0;$i<count($department);$i++) echo '<option value="'.$department[$i]['domain_id'].'">'.$department[$i]['domain_name'].'</option>'; ?></select></td></tr>
        <tr><td colspan="2"><div id="vis_smtp_area_<?= $operation['vis_integration_id']?>"></div></td></tr>
     </table></form></div>
</div>
<script>
    function vis_change_integration(e){
        if(e.value==0) $("#vis_smtp_area_<?= $operation['vis_integration_id']?>").hide();
        else $('#vis_smtp_area_<?= $operation['vis_integration_id']?>').visExecution('load_area', {'vis_module':'setting', 'vis_operation':'integration_domain_details', 'vis_integration_id':'<?= $operation['vis_integration_id']?>', 'vis_department':e.value});
    }
</script>