var my_debug = true;
var my_debug = false;


function get_window_width()
{
  if (is_ie6up)
   return document.documentElement.clientWidth;
  else if (is_ie5up)
   return document.body.clientWidth; 
 else
   return window.innerWidth;
}

function get_window_height()
{
 if (is_ie6up)
   return document.documentElement.clientHeight;
 else if (is_ie5up)
   return document.body.clientHeight; 
 else
   return window.innerHeight;
}

function get_screen_height()
{
  return window.screen.availHeight;
}

function get_screen_width()
{
  return window.screen.availWidth;
}

function setHeight()
{
  if (arguments[0])
  {
    arguments[0].setAttribute("height", arguments[1]);
  }
}

function getTotalOffset ()
{
  totalOffset = 0;
  currentNode = arguments[0];
  
  while(currentNode && currentNode != document)
  {
    totalOffset += currentNode.offsetTop;
    currentNode = currentNode.parentNode;
  }
  
  return totalOffset;
}

function my_noop(e)
{
  my_alert("my_noop");
  return true;
}

function my_alert(message)
{
  if(my_debug)
  {
    window.dump(message);
    alert(message);
  }
}

function addEvent(obj, evt, fn, capture)
{
  if(is_ie)
    obj.attachEvent("on" + evt, fn);
  else 
    obj.addEventListener(evt, fn, capture);
}

function propagate_event(e)
{
  if(!e)
  {
    my_alert("event handler: end1");
    return true;
  }
  else
  {
    var ret = routeEvent(e);
    my_alert("event handler: end2: ret=" + ret);
    return !(ret == false);
  }
}

function go_to(url)
{
  window.location = url;
}

function get_random()
{
  return Math.random();
}


function set_bgcolor(obj, color)
{
  obj.style.backgroundColor = color;
}


function null_resize_handler(e)
{
  my_alert("null_resize_handler");
  propagate_event(e);
}

var is_ns4 = (is_nav && is_major<=4);

function set_cursor(obj, cursor)
{
  if(is_ie && cursor == "pointer")
  {
    obj.style.cursor = "hand";
  }
  else
  {
    obj.style.cursor = cursor;
  }
}

function set_scroll_bar(value)
{
  if(is_ie6up)
    document.documentElement.scroll = value;
  else if(is_ie5up)
    document.body.scroll = value;
}

