<!--

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}


function colorRows() {
  var grid = document.getElementsByTagName("table");
  for (var i=0; i<grid.length; i++) {
    if (grid[i].className.match("grid")) {
      var rows = grid[i].getElementsByTagName("tr");
      for (var j=0; j<rows.length; j=j+2) {
        rows[j].className = "even";
      }
    }
  }
}

function doPopups() {
  if (!document.getElementsByTagName) return false;
  var links = document.getElementsByTagName("a");
  for (var i=0; i < links.length; i++) {
    if (links[i].className.match("popup")) {
      links[i].onclick = function() {
        window.open(this.href, 'popup','width=400,height=200');
        return false;
      }
    }
  }
}

function jump() {
select = form.getElementsByTagName( 'select')[0];
if( select.options[ select.selectedIndex].value) {
form.action = select.options[ select.selectedIndex].value;
  }
}

function limits(limit,opt)
{
	var dlen;
	var rem;
	frm = document.forms.theform;
	dlen = frm.content.value.length;
	rem = limit - dlen;

	if( rem > 0)
	{
		frm.remlen.value= rem;
		return true;
	}
	else if( rem == 0)
	{
		frm.remlen.value = rem;
		if(opt == 0) {
			alert( 'Out of limit: '+limit+' chars!' );
        }
		return false;
	}
	else
	{
		if(opt == 0) {
			alert( 'Out of limit: '+limit+' chars!' );
		}
		frm.remlen.value=0;
		frm.content.value = frm.content.value.substr(0,limit);
		return false;
	}
}

function jumpMenu(targ,selObj,restore)
{ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


addLoadEvent(colorRows);
addLoadEvent(doPopups);
//addLoadEvent(jump);
//addLoadEvent(limits);
//addLoadEvent(jumpMenu);
//-->

