function FindControl(objId){
    var frm = document.forms[0];
    if (frm != undefined){
        for(var i = 0; i < frm.length; i++){
            e = frm.elements[i];
            if (e.id.indexOf(objId) != -1){
                return e;
            }
        }
    }
    
    return null;
}

function FindTagControl(tagName, objId){
    var frmElements = document.getElementsByTagName(tagName);
    if (frmElements != undefined){
        for(var i = 0; i < frmElements.length; i++){
            e = frmElements[i];
            if (e.id.indexOf(objId) != -1){
                return e;
            }
        }
    }
    
    return null;
}

var previousRowId = "";
function HideShowRows(showRowId){
    if (previousRowId != "" && previousRowId != showRowId){
        var rowObj = document.getElementById(previousRowId);
        if (rowObj != undefined){
            rowObj.style.display = "none";
        }
    }
    
    var rowObj = document.getElementById(showRowId);
    if (rowObj != undefined){
        if (rowObj.style.display == ""){
            rowObj.style.display = "none";
        }else{
            rowObj.style.display = "";
        }
        
        previousRowId = showRowId;
    }
}

function SearchTextBoxBlur(objId){
    var searchTextBox = document.getElementById(objId);
    if (searchTextBox != undefined){
        if (searchTextBox.value == "Search this site..."){
            searchTextBox.value = "";
        }else{
            if (searchTextBox.value == ""){
                searchTextBox.value = "Search this site...";
            }
        }
    }
}