<link rel="stylesheet" type="text/css" href="{sugar_getjspath file='include/javascript/yui/build/fonts/fonts.css"}>
 
 
 
{literal}
 
 
.yui-carousel-element li {
height: 158px;
text-align: left;
}
 
#container {
font-size: 13px;
margin: 0 auto;
}
 
#container a {
text-decoration: none;
}
 
#container .intro {
display: inline;
margin: 0px 14px 0px 4px;
width: 202px;
}
 
#container .item {
display: inline;
margin: 0 22px 0 12px;
overflow: hidden;
padding-right: 80px;
width: 106px;
}
 
#container .item .authimg {
bottom: 2px;
margin-left: 61px;
position: absolute;
z-index: 1;
}
 
#container .item h3 {
line-height: 85%;
margin-top: 4px;
}
 
#container .item h3 a {
font: 77% Arial, sans-serif;
position: relative;
text-transform: uppercase;
z-index: 2;
}
 
#container .item h3 a:link {
color:#35a235;
}
 
#container .item h4 {
margin-top:5px;
}
 
#container .item h4 a {
font: 100% Georgia, Times, serif;
position: relative;
z-index:2;
}
 
#container .item h4 a:link {
color:#00639b;
}
 
#container .item cite {
color: #888;
display: block;
font-size: 77%;
line-height: normal;
margin-bottom: 30px;
}
 
#container .item p.all {
bottom: 25px;
position: absolute;
z-index: 2;
}
 
#container .item p.all a {
font-weight: bold;
font-size: 85%;
}
 
{/literal}
<div class="yui-skin-sam">
    <div id="container">
        <table width=100% class='list view'>
            <tr>
                <!--<th>Nombre</th>-->
                <th>Contacto</th>
                <th>Tel. casas</th>
                <th>Móvil</th>
                <th>Tel. Oficina</th>	
                <th>Proxima Llamada</th>
                <th>Referencia1</th>
                <th>Referencia1 Tel</th>
                <th>Referencia1 cel</th>
                <th>Gestion</th>
                <th>Descripci&oacute;n</th>
            </tr>
            {foreach name=rowIteration from=$data key=id item=rowData}
                {counter name="oCount" assign="oCount" start=0}
                <tr class='oddListRowS1'>
                    {foreach from=$displayColumns key=col item=params}
                        {assign var="vals" value='^,^'|explode:$params.$col}
                        
                        {if $oCount==0 || $oCount==10 || $oCount==9}
                        {else}
                            <td>
                                {if $oCount==0}
                                    <a href="index.php?module={$pageData.bean.moduleDir}&amp;action=detailview&amp;record={$rowData.ID}">
                                        {$rowData.$col}
                                    </a>
                                {elseif $oCount==1}
                                    <a href="index.php?module=Contacts&amp;action=DetailView&amp;record={$rowData.CONTACT_ID_C}">
                                        {$rowData.$col}
                                    </a>
                                {elseif $oCount == 2 || $oCount == 4}
                                    <center>
                                        {$rowData.$col}
                                        <a href='javascript:void(0)' onclick='fnShowDialogRespuestas("{$rowData.ID}","{$rowData.CONTACT_ID_C}","{$rowData.CONTACTO_C}","{$rowData.PHONE_HOME_C}","{$rowData.PHONE_MOBILE_C}","{$rowData.PHONE_WORK_C}");'>
                                        <!--<a href='javascript:void(0)' onclick='fnShowDialogRespuestas("{$rowData.ID}","{$rowData.CONTACT_ID_C}","{$rowData.CONTACTO_C}","{$rowData.PHONE_HOME_C}","{$rowData.PHONE_MOBILE_C}","{$rowData.PHONE_WORK_C}");'>-->
                                            <img src='themes/default/images/icon_AdminMobile.gif' title='Realizar Llamada'/>
                                        </a>   
                                    </center>
                                {elseif $oCount == 5}
                                    {counter name="h_a" assign="h_a" start=$rowData.$col|@date_format:"%H"}
                                    {counter name="m_a" assign="m_a" start=$rowData.$col|@date_format:"%M"}
                                    {counter name="s_a" assign="s_a" start=$rowData.$col|@date_format:"%S"}
                                    {counter name="Y_a" assign="Y_a" start=$rowData.$col|@date_format:"%Y"}
                                    {counter name="M_a" assign="M_a" start=$rowData.$col|@date_format:"%m"}
                                    {counter name="D_a" assign="D_a" start=$rowData.$col|@date_format:"%e"}
                                    {$rowData.$col|@date_format:"%m/%d/%Y"}
                                    {if $rowData.$col!= ""}{if $h_a+5 <10}0{$h_a+5}{else}{if $h_a+5 > 24}{if $h_a+5-24 <10}0{$h_a+5-24}{else}{$h_a+5-24}{/if}{else}{$h_a+5}{/if}{/if}:{if $m_a <10}0{$m_a}{else}{$m_a}{/if}:{if $s_a <10}0{$s_a}{else}{$s_a}{/if}
                                    {/if}
                                {else}
                                    {$rowData.$col}
                                {/if}
                            </td>
                        {/if}
                        {counter name="oCount"}
                   {/foreach}
                </tr>
            {/foreach}
            
            
            <pre> 
{php} 
    /*print_r(get_defined_vars());*/
    
{/php} 
</pre>
            
            
            {assign var="alt_start" value=$navStrings.start}
            {assign var="alt_next" value=$navStrings.next}
            {assign var="alt_prev" value=$navStrings.previous}
            {assign var="alt_end" value=$navStrings.end}
            <tr class='pagination'>
                <td colspan='{if $prerow}{$colCount+1}{else}{$colCount}{/if}'>
                    <table border='0' cellpadding='0' cellspacing='0' width='100%' class='paginationTable'>
                        <tr>
                            <td nowrap="nowrap" width='2%' class='paginationActionButtons'>
                                {$actionsLink}&nbsp;
                                &nbsp;{$selectedObjectsSpan}
                            </td>
                            <td  nowrap='nowrap' width='1%' align="right" class='paginationChangeButtons'>
                                {if $pageData.urls.startPage}
                                    <button type='button' id='listViewStartButton' name='listViewStartButton' title='{$navStrings.start}' class='button' {if $prerow}onclick='return sListView.save_checks(0, "{$moduleString}");'{else} onClick='location.href="{$pageData.urls.startPage}"' {/if}>
                                        <img src='{sugar_getimagepath file='start.png'}' alt='{$navStrings.start}' align='absmiddle' border='0'>
                                    </button>
                                {else}
                                    <button type='button' id='listViewStartButton' name='listViewStartButton' title='{$navStrings.start}' class='button' disabled='disabled'>
                                        <img src='{sugar_getimagepath file='start_off.png'}' alt='{$navStrings.start}' align='absmiddle' border='0'>
                                    </button>
                                {/if}
                                
                                
                                {if $pageData.urls.prevPage}
                                    <button type='button' id='listViewPrevButton' name='listViewPrevButton' title='{$navStrings.previous}' class='button' {if $prerow}onclick='return sListView.save_checks({$pageData.offsets.prev}, "{$moduleString}")' {else} onClick='location.href="{$pageData.urls.prevPage}"'{/if}>
                                        <img src='{sugar_getimagepath file='previous.png'}' alt='{$navStrings.previous}' align='absmiddle' border='0'>
                                    </button>
                                {else}
                                    <button type='button' id='listViewPrevButton' name='listViewPrevButton' class='button' title='{$navStrings.previous}' disabled='disabled'>
                                        <img src='{sugar_getimagepath file='previous_off.png'}' alt='{$navStrings.previous}' align='absmiddle' border='0'>
                                    </button>
                                {/if}
                                
                                
                                    <span class='pageNumbers'>({if $pageData.offsets.lastOffsetOnPage == 0}0{else}{$pageData.offsets.current+1}{/if} - {$pageData.offsets.lastOffsetOnPage} {$navStrings.of} {if $pageData.offsets.totalCounted}{$pageData.offsets.total}{else}{$pageData.offsets.total}{if $pageData.offsets.lastOffsetOnPage != $pageData.offsets.total}+{/if}{/if})</span>
                                
                                    
                               {if $pageData.urls.nextPage}
                                    <button type='button' id='listViewNextButton' name='listViewNextButton' title='{$navStrings.next}' class='button' {if $prerow}onclick='return sListView.save_checks({$pageData.offsets.next}, "{$moduleString}")' {else} onClick='location.href="{$pageData.urls.nextPage}"'{/if}>
                                        <img src='{sugar_getimagepath file='next.png'}' alt='{$navStrings.next}' align='absmiddle' border='0'>
                                    </button>
                                {else}
                                    <button type='button' id='listViewNextButton' name='listViewNextButton' class='button' title='{$navStrings.next}' disabled='disabled'>
                                        <img src='{sugar_getimagepath file='next_off.png'}' alt='{$navStrings.next}' align='absmiddle' border='0'>
                                    </button>
                                {/if}
                                
                                
                                {if $pageData.urls.endPage  && $pageData.offsets.total != $pageData.offsets.lastOffsetOnPage}
                                    <button type='button' id='listViewEndButton' name='listViewEndButton' title='{$navStrings.end}' class='button' {if $prerow}onclick='return sListView.save_checks("end", "{$moduleString}")' {else} onClick='location.href="{$pageData.urls.endPage}"'{/if}>
                                        <img src='{sugar_getimagepath file='end.png'}' alt='{$navStrings.end}' align='absmiddle' border='0'>                         
                                    </button>
                                {elseif !$pageData.offsets.totalCounted || $pageData.offsets.total == $pageData.offsets.lastOffsetOnPage}
                                    <button type='button' id='listViewEndButton' name='listViewEndButton' title='{$navStrings.end}' class='button' disabled='disabled'>
                                        <img src='{sugar_getimagepath file='end_off.png'}' alt='{$navStrings.end}' align='absmiddle'>
                                    </button>
                                {/if}
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>

            
        </table>
    </div>
</div>
<script>

{literal}
var dialog = null;
/***/
function fnShowDialogRespuestas(record,record_contact,name_contact,lblTel1,lblCel1,lblTel2){
    document.getElementById('lblNombreContacto').innerHTML = name_contact.toUpperCase();
    document.getElementById('lblTel1').innerHTML = lblTel1;
    document.getElementById('lblCel1').innerHTML = lblCel1;
    document.getElementById('lblTel2').innerHTML = lblTel2;
    document.getElementById('hdnrecord').value = record;
    document.getElementById('hdnrecord_contact').value = record_contact;
    document.getElementById('hdnname_contact').value = name_contact;
    dialog.show();
}
/***/
function fnChangeOpcionesRespuesta(id,opc){
    document.getElementById('trFechaProxima').style.display='none';
    switch(opc){
        case "PROGRAMAR_LLAMADA":
            document.getElementById('trFechaProxima').removeAttribute('style');
            document.getElementById('hdngestion_callcenter').value='LLAMADA_PENDIENTE';
            break;
        case "VENTA":
            document.getElementById('hdngestion_callcenter').value='VENTA';
            break;
        default:
            document.getElementById('hdngestion_callcenter').value='GESTIONADO';
    }
}
/***/
function fnValidarOpcionesRespuestas(){
    // validamos la opcion //
    if(document.getElementById('selOpciones_respuesta').value==''){
        alert('Debe seleccionar una opcion de respuesta');
        document.getElementById('selOpciones_respuesta').focus();
        return false;
    }
    // verificamos si la opc es programar llamada //
    if(document.getElementById('selOpciones_respuesta').value == 'PROGRAMAR_LLAMADA'){
        // validamos la fecha de la prox llamada //
        if(document.getElementById('txtFechaProxima_respuesta').value==''){
            alert('Debe ingresar la (FECHA) de la proxima llamada');
            return false;
        }
    }
    if(document.getElementById('selOpciones_respuesta').value != 'VENTA' &&
       document.getElementById('selOpciones_respuesta').value != 'PROGRAMAR_LLAMADA'
      ){
        // validamos las observaciones //
        if(document.getElementById('tarObservacionesRespuesta').value==''){
            alert('Debe ingresar la descripcion del evento');
            document.getElementById('tarObservacionesRespuesta').focus();
            return false;
        }
    }
    return true;
}
(function () {
    // llenamos el list de estados //
    var html_estado = "";
        html_estado += "<option value=''>TODOS</option>";
        html_estado += "<option value='CONTACT_NEW'>Contactos Nuevos</option>";
        html_estado += "<option value='CONTACT_DATE_BEFORE'>Contactos con gestion y fecha sin vencer</option>";
        html_estado += "<option value='CONTAC_DATE_AFTER'>Contactos con gestion y fecha vencida</option>";
    document.getElementById('estado_contacto_basic').innerHTML = html_estado;
    
    document.getElementById('estado_contacto_basic').value = '{/literal}{$smarty.request.estado_contacto_basic[0]}{literal}';
    
    document.getElementById('start_range_proxima_llamada_c_basic').setAttribute('style','width:70px !important;');
    document.getElementById('end_range_proxima_llamada_c_basic').setAttribute('style','width:70px !important;');
    
    
    var fecha_all_ini = '';
    {/literal}{if !empty($smarty.request.start_range_proxima_llamada_c_basic)}{literal}
        fecha_all_ini = {/literal}{$smarty.request.start_range_proxima_llamada_c_basic}{literal};
    {/literal}{/if}{literal}
    
    var fecha_all_fin = '';
    {/literal}{if !empty($smarty.request.end_range_proxima_llamada_c_basic)}{literal}
        fecha_all_fin = {/literal}{$smarty.request.end_range_proxima_llamada_c_basic}{literal};
    {/literal}{/if}{literal}
    
    

    if(fecha_all_ini!=''){
        var mes_ini = {/literal}{if empty($smarty.request.start_range_proxima_llamada_c_basic)}{literal}
                          '';
                      {/literal}{else}{literal}
                      {/literal}{$smarty.request.start_range_proxima_llamada_c_basic|@date_format:"%m"}{literal};
                      {/literal}{/if}{literal}
            mes_ini = (parseInt(mes_ini)<10?'0'+parseInt(mes_ini):mes_ini);
        var dia_ini = {/literal}{if empty($smarty.request.start_range_proxima_llamada_c_basic)}{literal}
                          '';
                      {/literal}{else}{literal}
                      {/literal}{$smarty.request.start_range_proxima_llamada_c_basic|@date_format:"%d"}{literal};
                      {/literal}{/if}{literal}
            dia_ini = (parseInt(dia_ini)<10?'0'+parseInt(dia_ini):dia_ini);
        var anio_ini = {/literal}{if empty($smarty.request.start_range_proxima_llamada_c_basic)}{literal}
                           '';
                       {/literal}{else}{literal}
                       {/literal}{$smarty.request.start_range_proxima_llamada_c_basic|@date_format:"%Y"}{literal};
                       {/literal}{/if}{literal}
    }
    if(fecha_all_fin!=''){
        var mes_fin = {/literal}{if empty($smarty.request.end_range_proxima_llamada_c_basic)}{literal}
                          '';
                      {/literal}{else}{literal}
                      {/literal}{$smarty.request.end_range_proxima_llamada_c_basic|@date_format:"%m"}{literal};
                      {/literal}{/if}{literal}
            mes_fin = (parseInt(mes_fin)<10?'0'+parseInt(mes_fin):mes_fin);
        var dia_fin = {/literal}{if empty($smarty.request.end_range_proxima_llamada_c_basic)}{literal}
                          '';
                      {/literal}{else}{literal}
                      {/literal}{$smarty.request.end_range_proxima_llamada_c_basic|@date_format:"%d"}{literal};
                      {/literal}{/if}{literal}
            dia_fin = (parseInt(dia_fin)<10?'0'+parseInt(dia_fin):dia_fin);
        var anio_fin = {/literal}{if empty($smarty.request.end_range_proxima_llamada_c_basic)}{literal}
                           '';
                       {/literal}{else}{literal}
                       {/literal}{$smarty.request.end_range_proxima_llamada_c_basic|@date_format:"%Y"}{literal};
                       {/literal}{/if}{literal}
    }
    
    if(fecha_all_ini!=''){
        document.getElementById('start_range_proxima_llamada_c_basic').value = mes_ini+'/'+dia_ini+'/'+anio_ini;
    }else{
        document.getElementById('start_range_proxima_llamada_c_basic').value = '';
    }
    if(fecha_all_fin!=''){
        document.getElementById('end_range_proxima_llamada_c_basic').value = mes_fin+'/'+dia_fin+'/'+anio_fin;
    }else{
        document.getElementById('end_range_proxima_llamada_c_basic').value = '';
    }
    
        
    //document.getElementById('start_range_proxima_llamada_c_basic').setAttribute('readonly',true);
    //document.getElementById('end_range_proxima_llamada_c_basic').setAttribute('readonly',true);
    var html_add = '';
    if(fecha_all_ini=='' && fecha_all_fin==''){
        html_add = '<option value=""></option>';
    }
    document.getElementById('proxima_llamada_c_basic_range_choice').innerHTML = html_add+'<option value="between" label="Está entre">Está entre</option>';
    proxima_llamada_c_basic_range_change(document.getElementById('proxima_llamada_c_basic_range_choice').value);
    
    //
    var newSel_1 = document.createElement('select'); // create new textarea
    var targetElement = document.getElementById('start_range_proxima_llamada_c_basic_trigger');
    insertAfter(newSel_1,targetElement);
    newSel_1.id = 'start_proxima_llamada_c_basic_hours';
    newSel_1.name = 'start_proxima_llamada_c_basic_hours';
    document.getElementById(newSel_1.id).setAttribute('style','width:40px !important;');
    var html = '';
        for(var i=0;i<=23;i++){
            html += "   <option value='"+(i<10?'0'+i:i)+"'>"+(i<10?'0'+i:i)+"</option>";
        }
        document.getElementById(newSel_1.id).innerHTML = html;
        nuevoEvento(newSel_1,'change',fn_utilidades_validate_gea_Callcenter);
        var hora_ini = {/literal}{if empty($smarty.request.start_proxima_llamada_c_basic_hours)}{literal}
                        '0';
                   {/literal}{else}{literal}
                   {/literal}{$smarty.request.start_proxima_llamada_c_basic_hours}{literal};
                   {/literal}{/if}{literal}
        hora_ini = (parseInt(hora_ini)<10?'0'+hora_ini:hora_ini);
    newSel_1.value = hora_ini;
    
    var newSel_2 = document.createElement('select'); // create new textarea
    var targetElement = document.getElementById(newSel_1.id);
    insertAfter(newSel_2,targetElement);
    newSel_2.id = 'start_proxima_llamada_c_basic_minutes';
    newSel_2.name = 'start_proxima_llamada_c_basic_minutes';
    document.getElementById(newSel_2.id).setAttribute('style','width:40px !important;');
    var html = '';
        for(var i=0;i<=59;i++){
            html += "   <option value='"+(i<10?'0'+i:i)+"'>"+(i<10?'0'+i:i)+"</option>";
        }
        document.getElementById(newSel_2.id).innerHTML = html;
        nuevoEvento(newSel_2,'change',fn_utilidades_validate_gea_Callcenter);
        var minu_ini = {/literal}{if empty($smarty.request.start_proxima_llamada_c_basic_minutes)}{literal}
                            '0';
                       {/literal}{else}{literal}
                       {/literal}{$smarty.request.start_proxima_llamada_c_basic_minutes}{literal};
                       {/literal}{/if}{literal}
            minu_ini = (parseInt(minu_ini)<10?'0'+minu_ini:minu_ini);
        newSel_2.value = minu_ini;
    ///
    
    var newSel_1 = document.createElement('select'); // create new textarea
    var targetElement = document.getElementById('end_range_proxima_llamada_c_basic_trigger');
    insertAfter(newSel_1,targetElement);
    newSel_1.id = 'end_proxima_llamada_c_basic_hours';
    newSel_1.name = 'end_proxima_llamada_c_basic_hours';
    document.getElementById(newSel_1.id).setAttribute('style','width:40px !important;');
    var html = '';
        for(var i=0;i<=23;i++){
            html += "   <option value='"+(i<10?'0'+i:i)+"'>"+(i<10?'0'+i:i)+"</option>";
        }
        document.getElementById(newSel_1.id).innerHTML = html;
        nuevoEvento(newSel_1,'change',fn_utilidades_validate_gea_Callcenter);
        var hora_ini = {/literal}{if empty($smarty.request.end_proxima_llamada_c_basic_hours)}{literal}
                        '0';
                   {/literal}{else}{literal}
                   {/literal}{$smarty.request.end_proxima_llamada_c_basic_hours}{literal};
                   {/literal}{/if}{literal}
            hora_ini = (parseInt(hora_ini)<10?'0'+hora_ini:hora_ini);
        newSel_1.value = hora_ini;
    
    var newSel_2 = document.createElement('select'); // create new textarea
    var targetElement = document.getElementById(newSel_1.id);
    insertAfter(newSel_2,targetElement);
    newSel_2.id = 'end_proxima_llamada_c_basic_minutes';
    newSel_2.name = 'end_proxima_llamada_c_basic_minutes';
    document.getElementById(newSel_2.id).setAttribute('style','width:40px !important;');
    var html = '';
        for(var i=0;i<=59;i++){
            html += "   <option value='"+(i<10?'0'+i:i)+"'>"+(i<10?'0'+i:i)+"</option>";
        }
        document.getElementById(newSel_2.id).innerHTML = html;
        nuevoEvento(newSel_2,'change',fn_utilidades_validate_gea_Callcenter);
        var minu_ini = {/literal}{if empty($smarty.request.end_proxima_llamada_c_basic_minutes)}{literal}
                            '0';
                       {/literal}{else}{literal}
                       {/literal}{$smarty.request.end_proxima_llamada_c_basic_minutes}{literal};
                       {/literal}{/if}{literal}
            minu_ini = (parseInt(minu_ini)<10?'0'+minu_ini:minu_ini);
        newSel_2.value = minu_ini;
    //
    
    var input_h = document.createElement('input'); // create new textarea
    var targetElement = document.getElementById('end_proxima_llamada_c_basic_minutes');
    insertAfter(input_h,targetElement);
    input_h.id = 'hdn_validate_calendar_gea_Callcenter';
    input_h.type = 'hidden';
/***/
YAHOO.util.Event.onDOMReady(function (ev) {
    /* update opciones respuesta */
    var callback_update = {
        success: function(result) {
            $('#divPreloadOpcionesRespuesta').html('');
            result = eval('['+result.responseText+']');
            
            if(result!=null){
                //alert(result[0].msj);
                $('#divPreloadOpcionesRespuesta').html('<div style="border-style:solid;border-width:1px;"><b>'+result[0].msj+'</b></div>');
                if(result[0].error==false){
                    location.reload();
                }
            }else{
                alert('Error guardando las observaciones');
            }
        }
    }
    /* dialogo respuesta llamada */
    var callback_opciones = {
      success: function(result) {
        result = eval('['+result.responseText+']');
        dialog = new YAHOO.widget.Dialog('dialog1', {
                width: '400px',
                fixedcenter : "contained",
                visible : false,
                draggable: true,
                effect:[{effect:YAHOO.widget.ContainerEffect.SLIDE, duration:0.2},
                        {effect:YAHOO.widget.ContainerEffect.FADE,duration:0.2}],
                modal:true
            });

         var html = "";
            html += "<div id='dialog1' class='yui-pe-content'>";
            html += "<b>Contacto: <label id='lblNombreContacto'></label></b><br/>";
            html += "<b>Tel 1: <label id='lblTel1'></label></b><br/>";
            html += "<b>Cel 1: <label id='lblCel1'></label></b><br/>";
            html += "<b>Tel 2: <label id='lblTel2'></label></b><br/>";
            html += "<div id='divPreloadOpcionesRespuesta' align='center'></div>";
            html += "<form id='frmOpcionesRespuesta'>";
            html += "<input type='hidden' id='hdnrecord' name='hdnrecord'/>";
            html += "<input type='hidden' id='hdnrecord_contact' name='hdnrecord_contact'/>";
            html += "<input type='hidden' id='hdnname_contact' name='hdnname_contact'/>";
            html += "<input type='hidden' id='hdngestion_callcenter' name='hdngestion_callcenter'/>";
            html += "<table>";
            html += "   <tr>";
            html += "       <td>Opciones:</td>";
            html += "       <td>";
            html += "           <select id='selOpciones_respuesta' name='selOpciones_respuesta' onchange='fnChangeOpcionesRespuesta(this.id,this.value)'>";
            if(result!=null){
                for (var k in result[0].rows){
                    html += "<option value='"+k+"'>"+result[0].rows[k]+"</option>";
                }
            }
            html += "           </select>";
            html += "       </td>";
            html += "   </tr>";
            html += "   <tr id='trFechaProxima' style='display:none;'>";
            html += "       <td>Fecha Proxima:</td>";
            html += "       <td>";
            html += "           <input type='text' id='txtFechaProxima_respuesta' name='txtFechaProxima_respuesta' size='10' readonly='readonly'/>";
            html += "           <img id='txtFechaProxima_respuesta_trigger' border='0' src='themes/Sugar5/images/jscalendar.gif?v=3'/>";
            html += "           <select id='selHoraProxima_respuesta' name='selHoraProxima_respuesta'>";
            for(var i=0;i<=23;i++){
                html += "   <option value='"+(i<10?'0'+i:i)+"'>"+(i<10?'0'+i:i)+"</option>";
            }
            html += "           </select>";
            html += "           <select id='selMinutosProxima_respuesta' name='selMinutosProxima_respuesta'>";
            for(var i=0;i<=59;i++){
                html += "   <option value='"+(i<10?'0'+i:i)+"'>"+(i<10?'0'+i:i)+"</option>";
            }
            html += "           </select>";
            html += "       </td>";
            html += "   </tr>";
            html += "   <tr>";
            html += "       <td>Descripci&oacute;n:</td>";
            html += "       <td><textarea id='tarObservacionesRespuesta' name='tarObservacionesRespuesta'></textarea></td>";
            html += "   </tr>";
            html += "   <tr>";
            html += "       <td>Se hablo con:</td>";
            html += "       <td><input type='text' id='txtSeHabloCon' name='txtSeHabloCon' /></td>";
            html += "   </tr>";
            html += "</table>";
            html += "</form>";
            html += "</div>";

         dialog.setHeader('Opciones Respuesta');
         dialog.setBody(html);

         var handleCancel = function() {
            this.cancel();
         };
         var handleSubmit = function() {
            // validamos las opciones //
            if(fnValidarOpcionesRespuestas()){
                $('#divPreloadOpcionesRespuesta').html('<img src="themes/Sugar5/images/bar_loader.gif"/><br/>Guardando informaci&oacute;n...');
                var connectionObject = YAHOO.util.Connect.asyncRequest ("POST", "index.php?module=gea_Callcenter&action=get_update_opciones_respuesta&to_pdf=1&"+serialize(document.getElementById('frmOpcionesRespuesta')), callback_update);
                //this.submit();
                if(document.getElementById('selOpciones_respuesta').value=='VENTA'){
                    var record_contact = document.getElementById('hdnrecord_contact').value;
                    var name_contact = document.getElementById('hdnname_contact').value;
                    window.open('index.php?module=AOS_Invoices&action=EditView&return_module=AOS_Invoices&return_action=DetailView&record_contact='+record_contact+'&name_contact='+encodeURI(name_contact),'_blank');
                }
            }
         };
         var myButtons = [{ text: "Guardar", handler: handleSubmit, isDefault: true },
                         { text: "Cancelar", handler:handleCancel }];
         dialog.cfg.queueProperty("buttons", myButtons);
         dialog.render(document.body);
         //dialog.show();
         //document.getElementById('hdnrecord').value = id.value;
         //eval(document.getElementById('script').innerHTML);
         // add calendar //
         Calendar.setup ({
            inputField : "txtFechaProxima_respuesta",
            daFormat : "%m/%d/%Y",
            button : "txtFechaProxima_respuesta_trigger",
            singleClick : true,
            dateStr : "",
            step : 1,
            weekNumbers:false
         });
      }
    }
    var connectionObject = YAHOO.util.Connect.asyncRequest ("POST", "index.php?module=gea_Callcenter&action=get_opciones_agenda_llamada&to_pdf=1", callback_opciones);
     /******************************/
});
})();

{/literal}
</script>