// CORE.JS   Copyright (c) 2004-2005 Rene Durik
var wndX, wndY;
/*
_uacct = "UA-1698178-1";
_udn="none";
_ulink=1;
urchinTracker(); */

function btnFire(id)
{
  var e = getEvent();
  var key = getKeyCode(e);
  if (key == 13)
    __doPostBack(id,'');
}

function getKeyCode(e)
{
  if (e.keyCode)
    return e.keyCode;
  if (e.which)
    return e.which;
  return 0;
}

function getById(id)
{
  if (document.all)
    return document.all[id];
  if (document.getElementById)
    return document.getElementById(id);
  if (document.layers)
    return document.layers[id];
  return document[id];
}

function getHtml(obj)
{
  if (obj.innerHTML)
    return obj.innerHTML;
  
  return null;
}

function setHtml(obj, html)
{
  if (document.all)
    obj.innerHTML = html;
  else if (typeof(obj.innerHTML) != 'undefined')
  {
    obj.innerHTML = '';
    obj.innerHTML = html;
  }  
  else if (document.layers)
  {
    obj.document.open();
    obj.document.write(html);
    obj.document.close();
  }
}

function addHtml(obj, html)
{
  if (obj.insertAdjacentHTML)
    obj.insertAdjacentHTML('beforeEnd',html);
  else if (obj.appendChild)
  {
    var r = obj.ownerDocument.createRange();
	r.selectNodeContents(obj);
    r.collapse(false);
    var df = r.createContextualFragment(html);
    obj.appendChild(df);
  }
  else if (typeof(obj.innerHTML) != 'undefined')
    obj.innerHTML += html;
  else if (document.layers)
  {
    obj.document.open();
    obj.document.write(html);
    obj.document.close();
  }
}

function hideObj(e) 
{
  if (e.style)
    e.style.visibility = "hidden";
  else
    e.visibility = "hide";
}

function showObj(e) 
{
  if (e.style)
    e.style.visibility = "visible";
  else
    e.visibility = "show";
}

function hideDiv(e) 
{
  if (e.style)
    e.style.display = "none";
  else
    e.visibility = "hide";
}

function showDiv(e) 
{
  if (e.style)
    e.style.display = "inline";
  else
    e.visibility = "show";
}

function isVisibleObj(e)
{
  if (e.style)
    return e.style.visibility == "visible";
  return e.visibility == "show";
}

function isVisibleDiv(e)
{
  if (e.style)
    return e.style.display != "none";
  return e.visibility == "show";
}

function getObjX(e)
{
  if (e.x)
    return e.x;
  if (e.offsetParent)
  {
    var l = 0;
    while (e.offsetParent)
    {
      l += e.offsetLeft;
      e = e.offsetParent;
    }
    return l;
  }
  return 0;
}

function getObjY(e)
{
  if (e.y)
    return e.y;
  if (e.offsetParent)
  {
    var t = 0;
    while (e.offsetParent)
    {
      t += e.offsetTop;
      e = e.offsetParent;
    }
    return t;
  }
  return 0;
}

function getObjWidth(e)
{
  if (e.offsetWidth)
    return e.offsetWidth;
  if (e.innerWidth)
    return e.innerWidth;
}

function getObjHeight(e)
{
  if (e.offsetHeight)
    return e.offsetHeight;
  if (e.innerHeight)
    return e.innerHeight;
}

function setObjX(e, x)
{
  if (e.style)
    e.style.left = x + "px";
}

function setObjY(e, y)
{
  if (e.style)
    e.style.top = y + "px";
}

function hideWnd()
{
  if (document.all)
  {
    wndX = window.screenLeft;
    wndY = window.screenTop;
  }
  else if (document.layers)
  {
    wndX = window.screenX;
    wndY = window.screenY;
  }
  else
  {
    wndX = 30;
    wndY = 30;
  }
  window.moveTo(2000,2000);
}

function showWnd()
{
  window.moveTo(wndX,wndY);
}

function offsetX(e)
{
  if (e.offsetX)
    return e.offsetX;
    
  return e.layerX;
}

function offsetY(e)
{
  if (e.offsetY)
    return e.offsetY;
    
  return e.layerY;
}

function containObj(e, p)
{
  while (e = e.parentNode)
  {
    if (e == p)
      return true;
  }
  return false;
}

function getViewWidth()
{
  if (window.innerWidth)
    return window.innerWidth - 18;
  if (document.documentElement && document.documentElement.clientWidth) 
  	return document.documentElement.clientWidth;
  if (document.body && document.body.clientWidth) 
  	return document.body.clientWidth;
  return 0;
}

function getViewHeight()
{
  if (window.innerHeight)
    return window.innerHeight - 18;
  if (document.documentElement && document.documentElement.clientHeight) 
    return document.documentElement.clientHeight;
  if (document.body && document.body.clientHeight) 
    return document.body.clientHeight;
  return 0;
}
  
function getScrollX()
{
  if (typeof window.pageXOffset == "number")
    return window.pageXOffset;
  if (document.documentElement && document.documentElement.scrollLeft)
  	return document.documentElement.scrollLeft;
  if (document.body && document.body.scrollLeft) 
  	return document.body.scrollLeft; 
  if (window.scrollX)
    return window.scrollX;
  return 0;
}
  
function getScrollY()
{
  if (typeof window.pageYOffset == "number")
    return window.pageYOffset;
  if (document.documentElement && document.documentElement.scrollTop)
    return document.documentElement.scrollTop;
  if (document.body && document.body.scrollTop) 
    return document.body.scrollTop; 
  if (window.scrollY)
    return window.scrollY;
  return 0;
}

function getEvent()
{    
  if (window.event)
    return window.event;
  if (event)
    return event;
  return null;
}

function targetEvent(e)
{
  if (e.srcElement)
    return e.srcElement;
 
  var t = e.target;
  if (t.nodeType == 3)
    return t.parentNode;
}

function mouseX(e)
{
  if (e.pageX)
    return e.pageX;
  else if (e.clientX)
    return e.clientX + document.body.scrollLeft;
  return 0;
}

function mouseY(e)
{
  if (e.pageY)
    return e.pageY;
  else if (e.clientY)
    return e.clientY + document.body.scrollTop;
  return 0;
}

function isRight(e)
{
  if (e.button)
    return e.button == 2;
  if (e.which)
    return e.which == 3;
  return false;
}

function URLencode(s)
{
  return escape(s).replace(/\+/g, '%2C').replace(/\"/g,'%22').replace(/\'/g, '%27');
}
