function initPage() {
    if( !document.getElementsByTagName ) return;
    
    // Get a reference to each of the Select Elements
    var selects = document.getElementsByTagName("select");
    for( var i = 0; i < selects.length; i++ ) {
        if( !selects[i].getAttribute("maxCharacters") ) continue;
        
        var options = selects[i].options;
        var maxLength = Number(selects[i].getAttribute("maxCharacters"));
        
        if( !maxLength || maxLength <= 0 ) continue;
        
        for( var j = 0; j < options.length; j++ ) {
            
            
            if( options[j].text ) {
                if( options[j].text.length <= maxLength ) continue;
                options[j].text = options[j].text.substr(0,maxLength-3)+"...";
            } else if( options[j].innerText ) {
                if( options[j].innerText.length <= maxLength ) continue;
                options[j].innerText = options[j].innerText.substr(0,maxLength-3)+"...";
            }
        }
    }
}


// Attach the DomReady Event
if( window.addEventListener ) {
    window.addEventListener("load",initPage,false);
} else if( window.attachEvent ) {
    window.attachEvent("onload",initPage);
}
