function toupper(elmid)
{
        var elm = getElm(elmid);
        elm.value=elm.value.toUpperCase();
        return;
}

function getElm(elmid)
{
        return document.getElementById(elmid);
}

function error_message(elmid, message)
{
        alert(message);
        getElm(elmid).focus();
        return;
}

function openClose(divID,finalHeight) {
    thisDiv = getElm(divID);
    thisSpeed = parseInt(finalHeight / 20);
    if(thisDiv.style.display == 'block' || thisDiv.style.display == 'inline'){
        thisHeight = thisDiv.offsetHeight;
        collapseDiv(divID,thisHeight,thisSpeed);

        //thisDiv.style.display = 'none';
    } else {
        thisDiv.style.display = 'block';
        thisHeight = 0;
        expandDiv(divID,thisHeight,finalHeight,thisSpeed)
    }

}

function collapseDiv(divID,thisHeight,thisSpeed) {
    thisHeight = thisHeight - thisSpeed;
    collapstThisDiv = getElm(divID);
    collapstThisDiv.style.height = thisHeight+"px";

    if(thisHeight > 0){
        setTimeout("collapseDiv('"+divID+"',"+thisHeight+","+thisSpeed+")",10);
    } else {
        collapstThisDiv.style.display = 'none';
    }
}

function expandDiv(divID,thisHeight,finalHeight,thisSpeed) {
    thisHeight = thisHeight + thisSpeed;
    collapstThisDiv = getElm(divID);
    collapstThisDiv.style.height = thisHeight+"px";

    if(thisHeight < finalHeight){
        setTimeout("expandDiv('"+divID+"',"+thisHeight+","+finalHeight+","+thisSpeed+")",10);
    }
}

