function checkCapsLock( oForm )
{
		//var pwd = document.getElementById("oPwdItem").value.length;
		var pwd = oForm.oPwdItem.value.length;
        var e = event;
        var myKeyCode=0;
        var myShiftKey=false;

        if ( document.all ) {                   // Internet Explorer 4+
            myKeyCode=e.keyCode; myShiftKey=e.shiftKey;
        } else if ( document.layers ) {         // Netscape 4
            myKeyCode=e.which;  myShiftKey=( myKeyCode == 16 ) ? true : false;
        } else if ( document.getElementById ) { // Netscape 6
            myKeyCode=e.which; myShiftKey=( myKeyCode == 16 ) ? true : false;
        }
	
        // Upper case letters are seen without depressing the Shift key, therefore Caps Lock is on
        if ( ( myKeyCode >= 65 && myKeyCode <= 90 ) && !myShiftKey ) {
            setCapslockInfoOn( oForm );
        // Lower case letters are seen while depressing the Shift key, therefore Caps Lock is on
        } else if ( ( myKeyCode >= 97 && myKeyCode <= 122 ) && myShiftKey ) {
            setCapslockInfoOn();
        }
}

function setCapslockInfoOn( oForm ) {
        position( oForm );
        document.getElementById('idCapslockInfo').style.display  = "inline";
        setTimeout("setCapslockInfoOff()", 4000);
}

function setCapslockInfoOff() {
        document.getElementById('idCapslockInfo').style.display  = "none";
}

function position( oForm ) 
{
        var o = document.getElementById("idCapslockInfo");
        //var ref = document.getElementById("oPwdItem");
		var ref = oForm.oPwdItem;
        if ( typeof(o)=="object" && typeof(ref)=="object" ) {
            var x = getRealX(ref);
            var y = getRealY(ref);
            o.style.pixelLeft = x-5;
            o.style.pixelTop = y+20;
        }
}

function getRealX(obj) {
	if ( obj.offsetParent == null ) return 0;
	return obj.offsetLeft + obj.clientLeft + getRealX(obj.offsetParent);
}

function getRealY(obj) {
	if ( obj.offsetParent == null ) return 0;
	return obj.offsetTop + obj.clientTop + getRealY(obj.offsetParent);
}

function capslockNotice()
{
	//document.all.idCLNotice.innerHTML = '<img src=/imgs/icon_capslockinfo.gif>';
}
