function openPopup(page,winname,param)
{
	window.open(page,winname,param);
}

function openPopupCenter(page,winname,param)
{
	var newWin = window.open(page,winname,param);
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function lTrim(value){
	var found = false;
	var i = 0;

	while((i<value.length) && (!found)){
		if (value.charAt(i)!=' ') found = true;
		i++;
	} // while
	if (found) i--;
	return value.substr(i,value.length-i);
}

function rTrim(value){
	var found = false;
	var i = value.length-1;

	while((i>=0) && (!found)){
		if (value.charAt(i)!=' ') found = true;
		i--;
	} // while
	if (found) i++;
	return value.substr(0,i+1);
}
/**
 *
 * @access public
 * @return void
 **/
function trim(value) {
	return lTrim(rTrim(value));
}

function frmfocus(obj, txt) 
{
	(obj.value==txt)?obj.value='':obj.select();
}
function frmblur(obj, txt) 
{
	(obj.value=='')?obj.value=txt:obj.value=obj.value;
}

function addCommas(nStr) 
{ 
  nStr += ''; 
  x = nStr.split('.'); 
  x1 = x[0]; 
  x2 = x.length > 1 ? '.' + x[1] : ''; 
  var rgx = /(\d+)(\d{3})/; 
  while (rgx.test(x1)) { 
	x1 = x1.replace(rgx, '$1' + ',' + '$2'); 
  } 
	  return x1 + x2; 
}
		
function stripNonNumeric( str ) 
{ 
	str += ''; 
	var rgx = /^\d|\.|-$/; 
	var out = ''; 
	for( var i = 0; i < str.length; i++ ) 
	{ 
		if( rgx.test( str.charAt(i) ) ){ 
		if( !( ( str.charAt(i) == '.' && out.indexOf( '.' ) != -1 ) || 
			 ( str.charAt(i) == '-' && out.length != 0 ) ) ){ 
			out += str.charAt(i); 
		  } 
		} 
	} 
	return out; 
}

function randomPassword(length)
{
  chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
  pass = "";
  for(x=0;x<length;x++)
  {
    i = Math.floor(Math.random() * 62);
    pass += chars.charAt(i);
  }
  return pass;
}

