<?php use_helper('UrlFunctions'); ?>
<script>
mostrarCargaImg = function(){ $('#s_ImagenLoad')[0].style.display = 'inline'; }
ocultarCargaImg = function(){ $('#s_ImagenLoad')[0].style.display = 'none'; }

mostrarMensajeError = function( s_MensajeError )
{
    $( "#resultContent" ).html( '<div id="mensaje_error_content" class="error">' + s_MensajeError + '</div>' );
    setTimeout( function(){ $( "#mensaje_error_content" ).fadeOut( 800 ).fadeIn( 800 ).fadeOut( 500 ).fadeIn( 500 ).fadeOut( 300 ); }, 4000 );
}
</script>
<script>
ejecutarGuardar = function()
{
	mostrarCargaImg();
	var strFormSerialize = $( 'form' ).serialize();
	
    //a_Params = [];
    //a_Params.push( "i_IdOrder=" + i_IdOrder );
    //a_Params.push( "s_MensajeVarios=" + s_MensajeVarios );
    /*executeAjaxUpdater( 
                            "resultContent", 
                            "<?php echo buildUrl( 'addemp/SaveCompania', "block=001" ) ?>", 
                            strFormSerialize,
                            function( response )
                            {
                            
                            } 
                      );*/
                      /*
    executeAjaxJson( 
                        "<?php echo buildUrl( 'addemp/saveCompania', "block=001" ) ?>", 
                        //a_Params.join( "&" ), 
                        strFormSerialize,
                        function( o_json )
                        {
                            //console.log( o_json );
                            if( o_json.error )
                            {
                                ocultarCargaImg();
                                mostrarMensajeError( o_json.mensaje_error );
                                return false;
                            }
                            if( o_json.type_sub )
                            {
                                location.href = "<?=buildUrl( 'addemp/list', "block=001")?>";
                            }
                            else
                            {
                                location.href = "<?=buildUrl( 'addemp/addCrianza', "block=001&i_Id=")?>" + o_json.id;
                            }
                        } 
                   );*/
}
</script>
<table class="cuerpo" width="97%" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td valign="top">
            <form id="form1" name="form1" method="POST" onsubmit=""  enctype="multipart/form-data">
                <input type="hidden" name="TypeProc" id="TypeProc" value="1">
                <table class="" width="100%" style="margin-left: 20px;">
                    <tr>
                        <td valign="top">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">                                
                                <tr>
                                    <td class="marco marcoTitle">
                                        <table class="" width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                                <td width="100%" valign="top">
                                                
                                                    <table width="100%">
                                                        <tr>
                                                            <td width="50%" valign="top" >
                                                            
                                                                <fieldset class="formGen" style="margin-top:0px">
                                                                    <!--<legend class="fielsettex">Datos Generales</legend> -->
                                                                    
                                                                    <div id="resultContent" style=""></div>
                                                                    
                                                                    <table border="0" cellspacing="6" cellpadding="0">
                                                                        <tr>
                                                                            <td nowrap="nowrap" width="10%" class="cabecera"><label class="label req" for="Ruc" >RUC</label></td>
                                                                            <td nowrap="nowrap"><input class="text required" type="text" name="Ruc" id="Ruc" size="15" maxlength="11" value=""  onblur="this.value=this.value.toUpperCase();"/></td>
                                                                            <td nowrap="nowrap" width="8%" class="cabecera">&nbsp;</td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td nowrap="nowrap" width="10%" class="cabecera"><label class="label req" for="DescripcionCorta" >Nombre</label></td>
                                                                            <td nowrap="nowrap"><input class="text required" type="text" name="DescripcionCorta" id="DescripcionCorta" size="45" maxlength="200" value=""  onblur="this.value=this.value.toUpperCase();"/></td>
                                                                            <td nowrap="nowrap" width="8%" class="cabecera">&nbsp;</td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td nowrap="nowrap" width="10%" class="cabecera"><label class="label req" for="Codigo" >C&oacute;digo</label></td>
                                                                            <td nowrap="nowrap"><input class="text required" type="text" name="Codigo" id="Codigo" size="45" maxlength="20" value=""  onblur="this.value=this.value.toUpperCase();"/></td>
                                                                            <td nowrap="nowrap" width="8%" class="cabecera">&nbsp;</td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td nowrap="nowrap" width="10%" class="cabecera"><label class="label req" for="Telefono1" >Tel&eacute;fono</label></td>
                                                                            <td nowrap="nowrap"><input class="text" type="text" name="Telefono1" id="Telefono1" size="45" maxlength="200" value=""  onblur="this.value=this.value.toUpperCase();"/></td>
                                                                            <td nowrap="nowrap" width="8%" class="cabecera">&nbsp;</td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td nowrap="nowrap" width="10%" class="cabecera"><label class="label req" for="PlanoUnidadCrianza" >Plano Crianza</label></td>
                                                                            <td nowrap="nowrap">
                                                                                <input type="file" class="text required" name="filexplorer" id="filexplorer" maxlength="" size="35" style="height: 25px;" title="Seleccione archivo."/>
                                                                                <!--<input class="text" type="text" name="PlanoUnidadCrianza" id="PlanoUnidadCrianza" size="45" maxlength="200" value=""  onblur="this.value=this.value.toUpperCase();"/>-->
                                                                            </td>
                                                                            <td nowrap="nowrap" width="8%" class="cabecera">&nbsp;</td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td nowrap="nowrap" width="10%" class="cabecera"><label class="label req" for="PaginaWeb" >Pagina Web</label></td>
                                                                            <td nowrap="nowrap"><input class="text" type="text" name="PaginaWeb" id="PaginaWeb" size="45" maxlength="200" value=""  onblur="this.value=this.value.toUpperCase();"/></td>
                                                                            <td nowrap="nowrap" width="8%" class="cabecera">&nbsp;</td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td nowrap="nowrap" width="10%" class="cabecera"><label class="label req" for="DireccionComun" >Direcci&oacute;n</label></td>
                                                                            <td nowrap="nowrap"><textarea class="" name="DireccionComun" id="descripcioncDireccionComunmpleta" rows="3"cols="40"  onblur="this.value=this.value.toUpperCase();"></textarea></td>
                                                                            <td nowrap="nowrap" width="8%" class="cabecera">&nbsp;</td>
                                                                        </tr>
                                                                    </table>
                                                                </fieldset>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                    
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <table width="100%" border="0" style="margin-top: 10px;">
                                            <tr>
                                                <td align="right" width="55%">
                                                    <input type="hidden" name="TypeSub" id="TypeSub" value="1"/>
                                                    <input type="button" class="button" value="Cancelar" onclick="">
                                                    <input type="submit" class="button" value="Grabar" onclick="">
                                                </td>
                                                <td width="45%">
                                                    <div id="s_ImagenLoad" style="display: none;"><img src="<?php echo Constantes::ROOT_DIR_APP ?>web/images/progress.gif" border="0"/>&nbsp;<label class="laber req">Grabando...</label></div>
                                                    &nbsp;
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </form>
        </td>
    </tr>
    
    
</table>

<script>
$.validator.setDefaults
(
    {
        submitHandler: function( form ) 
        {
            ejecutarGuardar();
        }
    }
);
$( "#form1" ).validate();
</script>