var CustomHeader   = '';
var NumSideButtons = 0;
var NumTopButtons  = 0;

//---------------------------------------------------------------------------------------------------------//
// set_object()                                                                                            //
//---------------------------------------------------------------------------------------------------------//
function set_object(ObjArg) {
if ( ! parent.frames['botFrame'] )
  return(0);
parent.frames['botFrame'].document.ObjectForm.Object.value = ObjArg;
var WinObj =    parent.frames['botFrame'].WinPtr

// first check to see if the window already exists
if (WinObj != null) {
  // the window has already been created, but did the user close it?
  // if so, then reopen it. Otherwise make it the active window.
  if (! WinObj.closed) {
    WinObj.focus();
    } 
  }
}

//---------------------------------------------------------------------------------------------------------//
// set_attribute_id()                                                                                      //
//---------------------------------------------------------------------------------------------------------//
function set_attribute_id(ObjIdArg,AttributeArg,ValueArg) {
StyleObj = new get_obj(ObjIdArg);
StyleObj.style[AttributeArg] = ValueArg;
}

//---------------------------------------------------------------------------------------------------------//
// set_high()                                                                                              //
//---------------------------------------------------------------------------------------------------------//
function set_high(ElementID) {
  StyleObj = new get_obj(ElementID);
  StyleObj.obj.className = "navBarSideHigh";
  //StyleObj.style.borderWidth     = '4px';
  //document.getElementById(ElementID).className = 'navBarSideHigh';
  }

//---------------------------------------------------------------------------------------------------------//
// set_norm()                                                                                              //
//---------------------------------------------------------------------------------------------------------//
function set_norm(ElementID) {
  StyleObj = new get_obj(ElementID);
  StyleObj.obj.className = "navBarSideNorm";
  }

//---------------------------------------------------------------------------------------------------------//
// get_obj()                                                                                              -//
//---------------------------------------------------------------------------------------------------------//
function get_obj(name) {
  if ( ! name ) {
    alert(name);
    return;
    }
  if (document.getElementById) {
    this.obj   = document.getElementById(name);
    if ( this.obj ) {
      //alert(name);
      this.style = document.getElementById(name).style;
      }
    }
  else if (document.all) {
    this.obj   = document.all[name];
    if ( this.obj )
      this.style = document.all[name].style;
    }
  else if (document.layers) {
    this.obj   = document.layers[name];
    if ( this.obj )
      this.style = document.layers[name];
   }
}

//---------------------------------------------------------------------------------------------------------//
// get_style()                                                                                             //
//---------------------------------------------------------------------------------------------------------//
function get_style(StyleNameArg) {
//TopDoc = new parent.frames['topFrame'].document
if (  document.styleSheets[0].rules ) {
  for ( i=0;i<=100;i++ ) {
    if ( ! document.styleSheets[0].rules[i] )
       break
    if (  document.styleSheets[0].rules[i].selectorText  == StyleNameArg ) {
      this.ruleSet = document.styleSheets[0].rules[i].style;
      break;
      }
    }
  }
else if (  document.styleSheets[0].cssRules ) {
  for ( i=0;i<=100;i++ ) {
    if ( ! document.styleSheets[0].cssRules[i] )
       break
    if (  document.styleSheets[0].cssRules[i].selectorText  == StyleNameArg ) {
      this.ruleSet = document.styleSheets[0].cssRules[i].style;
      break;
      }
    }
  }
else {
  alert("There was a problem finding your style objects.");
  }
}

//---------------------------------------------------------------------------------------------------------//
// set_attribute()                                                                                         //
//---------------------------------------------------------------------------------------------------------//
function set_attribute(StyleArg, Attribute, Value) {
StyleName = "." + StyleArg
var StyleObj = new get_style(StyleName);
StyleObj.ruleSet[Attribute] = Value;
}

//----------------------------------------------------------------------------------------------------------//
// test_func()                                                                                              //
//----------------------------------------------------------------------------------------------------------//
function test_func() {
var cssText    = "";
var cssTextAll = "";

StyleObj       = new get_obj('pageheader');

//alert("className:      " + StyleObj.obj.className);
//alert(document.styleSheets[0].rules[6].selectorText);
//alert(document.styleSheets[0].rules[6].style.color);
//alert(document.styleSheets[0].rules[6].style.border);
//document.styleSheets[0].rules[6].style.color = 'orange';
//This is the cssText string for the entire styleSheet
//var cssText = document.styleSheets[0].cssText;
//alert(cssText);
//parent.frames['botFrame'].document.ObjectForm.cssText.value = cssText;

//This is the cssText string for just the pagheader rules
for ( i=0;i<=100;i++ ) {
  if ( ! document.styleSheets[0].rules[i] )
    break
  cssText  = document.styleSheets[0].rules[i].selectorText + " {";
  cssText += document.styleSheets[0].rules[i].style.cssText;
  cssText += ";}";
  cssTextAll += cssText + "\n";
  }
parent.frames['botFrame'].document.ObjectForm.cssText.value = cssTextAll;
}

//---------------------------------------------------------------------------------------------------------//
// hide_object()                                                                                          -//
//---------------------------------------------------------------------------------------------------------//
function hide_object(ObjectArg) {
ObjectVar = new get_obj(ObjectArg);
if ( ObjectVar )
  if ( ObjectVar.style )
    ObjectVar.style.visibility      = "hidden";
}

//---------------------------------------------------------------------------------------------------------//
// show_object()                                                                                          -//
//---------------------------------------------------------------------------------------------------------//
function show_object(ObjectArg) {
ObjectVar = new get_obj(ObjectArg);
if ( ObjectVar )
  if ( ObjectVar.style )
ObjectVar.style.visibility      = "visible";
}

//---------------------------------------------------------------------------------------------------------//
// toggle_visible(ObjectArg)                                                                              -//
//---------------------------------------------------------------------------------------------------------//
function toggle_visible(ObjectArg) {
ObjectVar = new get_obj(ObjectArg);
if ( ObjectVar.style.visibility == "hidden" )
  ObjectVar.style.visibility = "visible";
else if ( ObjectVar.style.visibility == "visible" )
  ObjectVar.style.visibility = "hidden";
else
  alert(ObjectVar.style.visibility);
}

//---------------------------------------------------------------------------------------------------------//
// show_login()                                                                                           -//
//---------------------------------------------------------------------------------------------------------//
function show_login() {
loginObj                          = new get_obj('loginBox');
requestLoginObj                   = new get_obj('requestLoginBox');
retryLoginObj                     = new get_obj('retryLoginBox');

loginObj.style.visibility         = "visible";
requestLoginObj.style.visibility  = "hidden";
}

//---------------------------------------------------------------------------------------------------------//
// show_login_request()                                                                                   -//
//---------------------------------------------------------------------------------------------------------//
function show_login_request() {
loginObj                           = new get_obj('loginBox');
requestLoginObj                    = new get_obj('requestLoginBox');
requestLoginObj.style.visibility  = "visible";

if ( loginObj.style )
  loginObj.style.visibility       = "hidden";
}

//---------------------------------------------------------------------------------------------------------//
// check_object()                                                                                         -//
//---------------------------------------------------------------------------------------------------------//
function check_object(ObjectArg) {
//ObjectVar = new get_obj(ObjectArg);
//if ( ObjectVar )
//  return(true);
//else
  return(true);
}

//---------------------------------------------------------------------------------------------------------//
// check_visible()                                                                                        -//
//---------------------------------------------------------------------------------------------------------//
function check_visible(ObjectArg) {
ObjectVar = new get_obj(ObjectArg);
if ( ! ObjectVar )
  return(false);
if ( ! ObjectVar.style )
  return(false);
if ( ObjectVar.style.visibility == "visible" )
  return(true)
else
  return(false)
}

//---------------------------------------------------------------------------//
// nrc()                                                                    -//
//---------------------------------------------------------------------------//
function nrc(e) {
   if (bNS && e.which > 1){
      alert(am)
      return false
   } else if (bIE && (event.button >1)) {
     alert(am)
     return false;
   }
}
