﻿// Archivo JScript

///Aplica el estilo al campo texto del control
///de Fecha
debugger;
function aplicarEstilo()
{   
    if(document.getElementById('wcFechaNacimiento_txtFecha'))
    {         
        document.getElementById('wcFechaNacimiento_txtFecha').className = "inpCampo01";
        document.getElementById('wcFechaNacimiento_txtFecha').style.textAlign = "left";
    }
           
    if(document.getElementById('wcFechaNacimientoGeneral_txtFecha'))
    {         
        document.getElementById('wcFechaNacimientoGeneral_txtFecha').className = "inpCampo01";
        document.getElementById('wcFechaNacimientoGeneral_txtFecha').style.textAlign = "left";
    }
} 

//Deshabilita el Menu de Copiar y pegar al presionar
//el clic
function noCopyMouse(e) 
{
    var isRight = (e.button) ? (e.button == 2) : (e.which == 3);    

    if(isRight) {
        //alert('You are prompted to type this twice for a reason!');
        return false;
    }
    return true;
} 

//Deshabilita el copiar, cortar y pegar con las teclas
function noCopyKey(e) 
{
    var forbiddenKeys = new Array('c','x','v');
    var keyCode = (e.keyCode) ? e.keyCode : e.which;
    var isCtrl;

    if(window.event)
        isCtrl = e.ctrlKey
    else
        isCtrl = (window.Event) ? ((e.modifiers & Event.CTRL_MASK) == Event.CTRL_MASK) : false;

    if(isCtrl) 
    {
        for(i = 0; i < forbiddenKeys.length; i++) 
        {
            if(forbiddenKeys[i] == String.fromCharCode(keyCode).toLowerCase()) 
            {
                //alert('You are prompted to type this twice for a reason!');
                return false;
            }
        }
    }
    return true;
}

////Llamar la funcion aplicar estilo
//if (window.addEventListener)
//    window.addEventListener("load", aplicarEstilo, false)
//else if (window.attachEvent)
//    window.attachEvent("onload", aplicarEstilo)

