// JavaScript Document

function openPopup(theURL,winName,winWidth,winHeight)
{
	popup = window.open(theURL,winName,'width='+winWidth+',height='+winHeight+',left='+(screen.width-winWidth)/2+',top='+(screen.height-winHeight)/2+',scrollbars=no,status=0,menubar=0,toolbar=0,resizable=0');
	popup.window.focus();
}

/*
http://simon.incutio.com/archive/2004/05/26/addLoadEvent
*/
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

// Number Functions
function isInt (str)
{
	var i = parseInt (str);

	if (isNaN (i))
		return false;

	i = i . toString ();
	if (i != str)
		return false;

	return true;
}


// String Functions
function Left(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}
function Right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}