function pe_popup ( url ) {
    var width = 800;
    var height = 600;
    var features = 'height='+height+',width='+width+',menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no';
    features += ',left=' + ((screen.width-width)/2>0 ? (screen.width-width)/2 : 0) + ',top=' + ((screen.height-height)/2>0 ? (screen.height-height)/2 : 0);
    open(url, '_blank', features);
    return false;
}

function pe_show(id) { 
    if ( document.getElementById(id) ) {
        document.getElementById(id).style.display='block' ;
    }
}

function pe_hide(id) { 
    if ( document.getElementById(id) ) {
        document.getElementById(id).style.display='none' ;
    }
}

function ShowNKOBlock(id) {    
    var r = document.add_news_form.region_auth;
    
    for ( i = 0; i < r.options.length; i++ ) {
        pe_hide('nko_reg_'+r.options[i].value);
    }    
    pe_show('nko_reg_'+id);
    if ( id == '0' ) {
        document.getElementById('nko_select_desc').style.display = 'none';
    } else {
        document.getElementById('nko_select_desc').style.display = 'block';
        document.getElementById('nko_select_'+id).name = 'nko_select';
    }
}

function DoActionOnToPortalCheckbox () {
    if ( document.add_news_form.to_portal.checked == true ) {
        document.getElementById('comment_block').style.display = 'block';
    } else {
        document.getElementById('comment_block').style.display = 'none';
    }
}