function changeDisplay( elementId, setTo ) {
    var theElement;
    if( document.getElementById ) {
        theElement = document.getElementById( elementId );
    } else if( document.all ) {
        theElement = document.all[ elementId ];
    }
    if( !theElement ) {
        return;
    }
    //Reference the style ...
    if( theElement.style ) { theElement = theElement.style; }
    if( typeof( theElement.display ) == 'undefined' ) {
        return;
    }
    theElement.display = setTo;
}

function changeClass( elementId, setTo ) {
    var theElement;
    if( document.getElementById ) {
        theElement = document.getElementById( elementId );
    } else if( document.all ) {
        theElement = document.all[ elementId ];
    }
    if( !theElement ) {
        return;
    }
    if(theElement.getAttribute('class') != undefined) {
        theElement.setAttribute('class', setTo); 
    } else {
        theElement.className = setTo;
    }
}

function changeValue( elementId, setTo ) {
    var theElement;
    if( document.getElementById ) {
        theElement = document.getElementById( elementId );
    } else if( document.all ) {
        theElement = document.all[ elementId ];
    }
    if( !theElement ) {
        return;
    }
    theElement.value = setTo;
}

function isThereWithId( elementId ) {
    var theElement;
    if( document.getElementById ) {
        theElement = document.getElementById( elementId );
    } else if( document.all ) {
        theElement = document.all[ elementId ];
    }
    if( !theElement ) {
        return false;
    }
    return true;
}

function getWithId( elementId ) {
    var theElement;
    if( document.getElementById ) {
        theElement = document.getElementById( elementId );
    } else if( document.all ) {
        theElement = document.all[ elementId ];
    }
    if( !theElement ) {
        return false;
    }
    return theElement;
}

function trim12 (str) {
    var    str = str.replace(/^\s\s*/, ''),
        ws = /\s/,
        i = str.length;
    while (ws.test(str.charAt(--i)));
    return str.slice(0, i + 1);
}

