 // z_general.js
 //             {StylesDebugMisc.js}

 // --------------------
 // :h- Debug

 // E.g.,  Debug_dumpObjectFieldValues(temp.currentStyle,'font')
function Debug_dumpObjectFieldValues(id,testPref) {
        var padding = '........................'
        var key
        document.write('<span style="font-family:courier">');  // (style layout-grid-type:fixed does not work)
        for( key in id) {
          if( key.substr(0,testPref.length) == testPref)
            document.write( '<br>' + (key+padding).substr(0,Math.max(padding.length,key.length)) + ' "' + id[key] + '"')
        }
        document.write('</span>')
}

 // E.g.,  Debug_dumpObjectFieldNames(temp.currentStyle,'font')
function Debug_dumpObjectFieldNames(id,testPref) {
        var key
        for( key in id) {
          if( key.substr(0,testPref.length) == testPref)
            document.write( ' ' + key)
        }
}

 // --------------------
 // :h- Forwarders

function changeUrlAllowingBackup(newHref) {
        if( window.location.search.search('forward=no') == -1)
          window.setTimeout('window.location.href = "' + newHref + '"', 300)
}

 // --------------------
 // :h- index.heml

function Index_forwardIf() {
        if( window.location.search == '?AW=salescomp')
          window.setTimeout('window.location.href = "services_sales_compensation_planning.html"', 300);
        if( window.location.search == '?AW=leadership')
          window.setTimeout('window.location.href = "leadership_artful.html"', 300);
        if( window.location.search == '?AW=meetings')
          window.setTimeout('window.location.href = "services_meeting_facilitation.html"', 300);
}

 // --------------------
 // :h- clients_....html

var x_clientURLs = [ 'clients_meeting_facilitation.html'               ,
                     'clients_services_marketing.html'                 ,
                     'clients_integrated_marketing_strategy.html'      ,
                     'clients_entry_into_a_new_market.html'            ,
                     'clients_sales_compensation_plans.html'           ,
                     'clients_sales_process_and_education.html'        ,
                     'clients_worldwide_sales_information_system.html' ]
function endsWith(whole,part) {
        return whole.substr(whole.length - part.length) == part
}
function Array_find(whole,element) {
        var ii
        for( ii=0; ii<whole.length; ++ii) {
          if( endsWith( element, whole[ii]))
            return ii                                                           // <=========
          }
        return null
        }
function activeIfIsPrev(inputObj) {
        prev_next_p_id.style.display = 'block'
        var ix = Array_find(x_clientURLs, window.location.pathname)
        if( ix == null)                                                         // Not found
          inputObj.disabled = true
        else
          inputObj.disabled = ix == 0 ? true : false
}
function prevClient(inputObj) {
        var ix = Array_find(x_clientURLs, window.location.pathname)
        if( ix == null)                                                         // Not found
          return                                                                // <=========
        window.location.href = x_clientURLs[ix-1]
}
function activeIfIsNext(inputObj) {
        var ix = Array_find(x_clientURLs, window.location.pathname)
        if( ix == null)                                                         // Not found
          inputObj.disabled = true
        else
          inputObj.disabled = ix == x_clientURLs.length-1 ? true : false
}
function nextClient(inputObj) {
        var ix = Array_find(x_clientURLs, window.location.pathname)
        if( ix == null)                                                         // Not found
          return                                                                // <=========
        window.location.href = x_clientURLs[ix+1]
}

 // -------------------
 // :h- In-line, immediate stuff

var  amLocalTf = window.location.protocol=='file:';

if( amLocalTf)
  document.write("<script type='text/javascript' src='../Here/MPG_local.js'></script>");

function  handleEndOfBody() {
        if( amLocalTf)
          MPG_localize();
}

 // eof
