﻿// JScript File

//------------------------------------------------------------------------------------------------------------
//this is to delete or display keyword 

function deleteOrDisplayKeyword(obj,sKeyWord,sWhenCalled)
{
    if (sWhenCalled.toLowerCase() == 'onfocus')
    {    
        if (trim(obj.value) == sKeyWord)
        {   
            obj.value = '';            
        }
    }
//    else (sWhenCalled.toLowerCase() == 'onfocusout')
//    {    
//        if (trim(obj.value) == '')
//        {
//            //alert('LostFocus');
//            obj.value = sKeyWord;
//        }
//    }   
}

/* This function remove trailing spaces around a given string */
function trim(str) { 
    return( ("" + str).replace(/^\s+/,'').replace(/[\s]+/g,' ').replace(/\s+$/,'') ); 
}

/* This function is used to visible false of particular object. But u need to pass 
client Id of that object like:- 'ctl00_ContentPlaceHolder1_lblUsrNm' */
function VisibleFalse(objId)
{   
    if (document.getElementById(objId))
    {
        document.getElementById(objId).style.display = 'none'                
    }
}


//-------------------------------------------------------------------------------------------------------------