var SYMBOL_DATE_NUM = 47;							//Para el '/'
var SYMBOL_DATE_NUM_CONV = 45;						//Para el '-'

var SYMBOL_DATE = "/";								//Puede ser '-' o '/'
var SYMBOL_DATE_CONV = "-";							//Para uso de la BD Oracle solamente
var SYMBOL_DATE_NUMOUT = SYMBOL_DATE_NUM_CONV;		//Para el algoritmo de validación de fecha


/* CENTRADO DE LOS FORMULARIOS*/

//<script>

function centrar() {
    iz=(screen.width-document.body.clientWidth) / 2;
    de=(screen.height-document.body.clientHeight) / 2;
    moveTo(iz,de);
}
//</script>

function open_window(url,name,param) {
		newWindow = window.open(url, name, param)
}

function contactenos(pagina)
{
   window.open (pagina,'titulo','scrollbars=yes,status=no,resizable=no,toolbars=0,location=0,directories=0,menubar=0,width=617,height=392');
}

function formulario(pagina)
{
   window.open (pagina,'titulo','scrollbars=yes,status=no,resizable=no,toolbars=0,location=0,directories=0,menubar=0,width=480,height=615');
}

function form800x600(pagina)
{
   window.open (pagina,'titulo','scrollbars=yes,status=no,resizable=yes,toolbars=0,location=0,directories=0,menubar=0,width=700,height=700');
}


function banner(pagina)
{
   window.open (pagina,'titulo','scrollbars=no,status=no,resizable=no,toolbars=0,location=0,directories=0,menubar=0,width=500,height=360');
}

function noClick()
{
   var a;
   if(event.type == 'mousedown' && event.button == 2)
   {
     alert("Elaborado en los talleres de Mundo IT S.A.C.");
   }
}

        function fn_AYUD_GEN_FECHA(opcion) {
                switch (opcion)
                {
                        case 1 : {
                                                fecha=document.wfrmPropuestaServicio.txtFecInicio;
                                                break;
                                         }
                        case 2 : {
                                                fecha=document.wfrmPropuestaServicio.txtFecFin;
                                                break;
                                         }
                        case 3 : {
                                                fecha=document.wfrmRegVoluntarios.txtFechaNac;
                                                break;
                                         }
                        case 4 : {
                                                fecha=document.wfrmTerminoReferencia.txtFecha;
                                                break;
                                         }
                        case 5 : {
                                                fecha=document.wfrmProfReq.txtFecIni;
                                                break;
                                         }
                        case 6 : {
                                                fecha=document.wfrmProfReq.txtFecFin;
                                                break;
                                         }
                        case 9 : {
                                                fecha=document.listado.txt_fec_inicio;
                                                break;
                                         }
                        case 10 : {
                                                fecha=document.listado.txt_fec_fin;
                                                break;
                                         }
                        case 11 : {
                                                fecha=document.listado.txt_fec_inicio1;
                                                break;
                                         }
                        case 12 : {
                                                fecha=document.listado.txt_fec_fin1;
                                                break;
                                         }
                        case 13 : {
                                                fecha=document.llenado.txt_fec_inicio;
                                                break;
                                         }
                        case 14 : {
                                                fecha=document.llenado.txt_fec_fin;
                                                break;
                                         }
                        case 15 : {
                                        fecha=document.llenado.txt_fecinicioest;
                           break;
                        }
                        case 16 : {
                                        fecha=document.llenado.txt_fecfinest;
                           break;
                        }
                        case 17 : {
                                        fecha=document.listado.txt_fecinicio
                           break;
                        }
                        case 18 : {
                                        fecha=document.listado.txt_fecfin;
                           break;
                        }
                        case 19 : {
                                        fecha=document.listado.txt_fec_creaini;
                           break;
                        }
                        case 20 : {
                                        fecha=document.listado.txt_fec_creafin;
                           break;
                        }
                }

                var myWindow=window.open('calendario.htm','windowref','location=no,width=250,height=295,scrollbars=no,top=140,left=250');
                myWindow.location.href = 'calendario.htm';
                if (!myWindow.opener)
                        myWindow.opener=self;

        }

        function fn_AYUD_GEN_MES_Y_ANO(opcion) {
                switch (opcion)
                {
                        case 2 : {
                                                fecha=document.listado.txt_fec_publicacion;
                                                break;
                                         }
                                                 case 4 : {
                                                fecha=document.llenado.txt_fecinicioest;
                                                break;
                                                                                                 }                                 
                        case 5 : {
                                                fecha=document.llenado.txt_fecfinest;
                                                break;
                                         }
                                                case 6 : {
                                                fecha=document.listado.txt_fec_retiro1;
                                                break;
                                         }
                                                case 7 : {
                                                fecha=document.listado.txt_fecinicio;
                                                break;
                                                                                                 }                                 
                        case 8 : {
                                                fecha=document.listado.txt_fecfin;
                                                break;
                                         }
                                                
                                                                                 
                }

                var myWindow=window.open('mya_picker.htm','windowref','location=no,width=160,height=10,scrollbars=no,top=140,left=250');
                myWindow.location.href = 'mya_picker.htm';
                if (!myWindow.opener)
                        myWindow.opener=self;

        }


        function aceptaEntero(evt){
        // NOTA: Backspace = 8, Enter = 13, '0' = 48, '9' = 57
                var key = evt.keyCode;
                if (!(key <= 13 || (key >= 48 && key <= 57))) {
                        window.event.keyCode="";
                }
        }

        function aceptaFlotante(evt,obj){
        // NOTA: Backspace = 8, Enter = 13, '0' = 48, '9' = 57, '.' = 46
                var key = evt.keyCode;
                var cad = obj.value;
                if (!(key <= 13 || (key >= 48 && key <= 57) || key == 46)) {
                        window.event.keyCode="";
                }
                if ((cad.indexOf('.')>0) && (key == 46)) {
                        window.event.keyCode="";
                }
        }

        function aceptaCadena(evt){
        // NOTA: Backspace = 8, Enter = 13, 'A' = 65, 'Z' = 90 , 'a' = 97 , 'z' = 122 , '.' = 46 , '-' = 45
        //       '_' = 95 , '(' = 40, ')' = 41, '0' = 48, '9' = 57 , SPACE = 32
                var key = evt.keyCode;
                if (!(key <= 13 || (key == 32) || (key >= 47 && key <= 57) || (key >= 65 && key <= 90) || (key >= 97 && key <= 122) || key == 46 || key == 45 || key == 95 || key == 40 || key == 41  || key == 241 || key == 109 || key == 130 || (key >= 160 && key <=163) || key == 225 || key == 233 || key == 237 || key == 243 || key == 250 || key == 44 || key == 46 || key == 43 || key == 58 || key == 209  )) {
                        window.event.keyCode="";
                }
        }

        function aceptaCadenaNoEnter(evt){
        // NOTA: Backspace = 8, Enter = 13, 'A' = 65, 'Z' = 90 , 'a' = 97 , 'z' = 122 , '.' = 46 , '-' = 45
        //       '_' = 95 , '(' = 40, ')' = 41, '0' = 48, '9' = 57 , SPACE = 32
                var key = evt.keyCode;
                if (!(key < 13 || (key == 32) || (key >= 48 && key <= 57) || (key >= 65 && key <= 90) || (key >= 97 && key <= 122) || key == 46 || key == 45 || key == 95 || key == 40 || key == 41  || key == 241 || key == 109 || key == 130 || (key >= 160 && key <=163) || key == 225 || key == 233 || key == 237 || key == 243 || key == 250 || key == 44 || key == 46 || key == 43 || key == 58 || key == 209 )) {
                        window.event.keyCode="";
                }
        }

        function aceptaMail(evt){
        // NOTA: Backspace = 8, Enter = 13, 'A' = 65, 'Z' = 90 , 'a' = 97 , 'z' = 122 , '.' = 46 , '-' = 45
        //       '_' = 95 , '(' = 40, ')' = 41, '0' = 48, '9' = 57 , SPACE = 32
                var key = evt.keyCode;
                if (!(key <= 13 || (key >= 48 && key <= 57) || key == 64 || (key >= 97 && key <= 122) ||  key == 95 || key == 46)) {
                        window.event.keyCode="";
                }
        }

    function noEscritura(evt){
                window.event.keyCode="";
        }

    function aceptaCodigo(evt){
        // NOTA: Backspace = 8, Enter = 13, 'A' = 65, 'Z' = 90 , 'a' = 97 , 'z' = 122 , '0' = 48, '9' = 57
                var key = evt.keyCode;
                if (!(key <= 13 || (key >= 48 && key <= 57) || (key >= 65 && key <= 90) || (key >= 97 && key <= 122))) {
                        window.event.keyCode="";
        }
    }
    function validaEmail(email)
        {
                var re  = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
                if (!re.test(email)) {
                        return false;
                }
                return true;
        }
		
	function habilita()
	{	
		
		document.frm.dom.disabled = false;
		document.frm.des.disabled = false;
		document.frm.hos.value="0";
		document.frm.dom.value="2";
		document.frm.des.value="3";
		
		document.frm.valhos.value="$ " +35.00;
		document.frm.valdom.value="$ " +0;
		document.frm.valdes.value="$ " +0;		
		document.frm.answer.value="$ " +35.00;
		
		res1=35;
		res2=0;
		res3=0;

	}
	
	function deshabilita()
	{ 
		
		document.frm.dom.disabled = true;
		document.frm.des.disabled = true;
		document.frm.hos.value="0";
		document.frm.valhos.value="$ " +170;
		document.frm.valdom.value="$ " +0;
		document.frm.valdes.value="$ " +0;		
		document.frm.answer.value="$ " +170;

		res1=170;
		res2=0;
		res3=0;

	}
	



