// vim: expandtab ts=8 sw=8


function listSpecificInit() {
        var listStart = parseInt( tinyMCEPopup.getWindowArg('listStart') );
        if( listStart ) {
                if( listStart < 1 ) { listStart = 1; }
        } else {
                listStart = '';
        }
//         document.getElementById("listStartId").value = listStart || '';
}

function listSpecificNonIEInit() {
}

function listSpecificSwitch( formObj, listStyleType ) {
        switch (listStyleType) {
                case "decimal":
                        formObj.decimalId.checked = true;
                        break;
                case "lower-alpha":
                        formObj.lowerAlphaId.checked = true;
                        break;
                case "upper-alpha":
                        formObj.upperAlphaId.checked = true;
                        break;
                case "lower-roman":
                        formObj.lowerRomanId.checked = true;
                        break;
                case "upper-roman":
                        formObj.upperRomanId.checked = true;
                        break;
                case "none":
                        formObj.noneId.checked = true;
                        break;
                default:
                        formObj.decimalId.checked = true;
                        listStyleType = 'decimal';
        }
        return listStyleType;
}

/**
 * This function is called from the onsubmit form handler "okAction()".
 */
function listSpecificOkayAction( formObj, listNode ) {

        var listStart = 1;//parseInt(formObj.listStart.value); // may be NaN !
        if( listStart < 1) {
                listStart = 1;
        };

        if (listNode) {
                if( listStart ) {
                        listNode.start = listStart;
                } else {
                        listNode.removeAttribute('start');
                }
        }
}

