
  /*
  ###############################################################################
  # myncsm.js               version 1.0.0

  # Written by:             Gino Bossetto
  # Of:                     www.stellaritsolutions.com
  # On:                     07-12-2010
  # Last update:            08-10-2011

  # Purpose:                Members Only Functionality
  #
  # Copyright (c) 2004-2011 Stellar IT Solutions
  ###############################################################################
  */

  function myncsm() {

    // Add the level to the links marked with class

    // Re-enable this for loop if we go back to the class="member" functionality
//    var anchor = document.getElementsByTagName('a');
//    for (var i = 0; i < anchor.length; i++) {
//      classes = ' ' + anchor[i].className + ' ';
//      if (classes.indexOf(' member ') != -1 && anchor[i].href.indexOf('/member/') == -1) {
//        anchor[i].href = anchor[i].href.replace(document.domain, document.domain + '/member');
//      }
//    }

    if (document.cookie.length > 0) {

      var cookie_name = "myncsm=";

      // Look for our cookie
      var cookie_start = document.cookie.indexOf(cookie_name);
      if (cookie_start != -1) {

        // Fix the top and bottom nav if the visitor is logged in
        var logout = '<a href="' + dirlev + 'login?action=logout">Logout</a>'
        var top_str = ' &nbsp; | &nbsp; ' + logout;
        var bottom_str = ' ' + logout + ' ||';

        if (document.getElementById('toplogin')) {
          document.getElementById('toplogin').innerHTML += top_str;
        }
        if (document.getElementById('bottomlogin')) {
          document.getElementById('bottomlogin').innerHTML += bottom_str;
        }

      }
    }
  }


