﻿

//焦点位置提醒
//说明,在需要验证和提示的地方给出4个参数,分别为normal_'objName',awake_'objName',wrong_'objName',right_'objName'


function doOnFocus(objName) 
{
    var trObj = document.getElementById("normal_" + objName);//常规信息
    if (trObj != null && typeof(trObj) == "object")
        trObj.style.display = "none";
       

    var trObj = document.getElementById("awake_" + objName);//提醒信息
    if (trObj != null && typeof(trObj) == "object")
        trObj.style.display = "";
       
        
    var trObj = document.getElementById("wrong_" + objName);//错误信息
    if (trObj != null && typeof(trObj) == "object")
        trObj.style.display = "none";
        
        
    var trObj = document.getElementById("right_" + objName);//符合填写要求的信息
    if (trObj != null && typeof(trObj) == "object")
        trObj.style.display = "none"; 
    //如果需要可以在这里添加详细信息的提醒信息特殊处理
}

//失去焦点时进行实时校验
//校验相关的函数，fieldType为要校验的类别

function doOnBlur(objName, isChecked)
{
    doOnBlurCommon(objName, isChecked);
}


function doOnBlurCommon(objName, isChecked) {
    var isWrong = false;
    if (isChecked) {
        isWrong = checkFieldValid(objName);
    }
    if (isWrong) {
        //如果出现错误，则去掉打勾图片，并显示相关错误信息
        
        var trObj = document.getElementById("normal_" + objName);
        if (trObj != null && typeof(trObj) == "object")
            trObj.style.display = "none";

        var trObj = document.getElementById("awake_" + objName);
        if (trObj != null && typeof(trObj) == "object")
            trObj.style.display = "none";

        var trObj = document.getElementById("right_" + objName);
        if (trObj != null && typeof(trObj) == "object")
            trObj.style.display = "none";

        var trObj = document.getElementById("wrong_" + objName);
        if (trObj != null && typeof(trObj) == "object")
            trObj.style.display = "";

        return true;
    } else {
        //显示打勾图片
        
        
        var trObj = document.getElementById("normal_" + objName);
        if (trObj != null && typeof(trObj) == "object")
            trObj.style.display = "none";

        var trObj = document.getElementById("awake_" + objName);
        if (trObj != null && typeof(trObj) == "object")
            trObj.style.display = "none";

        var trObj = document.getElementById("wrong_" + objName);
        if (trObj != null && typeof(trObj) == "object")
            trObj.style.display = "none";

        var trObj = document.getElementById("right_" + objName);
        if (trObj != null && typeof(trObj) == "object")
            trObj.style.display = "";


        //moveIcon(objName, false);
        //处理箭头
    }
    return false;
}
