function Trim(TRIM_VALUE)
	{
		if(TRIM_VALUE.length < 1)
		{
			return "";
		}
		TRIM_VALUE = RTrim(TRIM_VALUE);
		TRIM_VALUE = LTrim(TRIM_VALUE);
		if(TRIM_VALUE=="")
		{
			return "";
		}
		else
		{
			return TRIM_VALUE;
		}
	} 
	
function RTrim(VALUE)
	{
		var w_space = String.fromCharCode(32);
		var v_length = VALUE.length;
		var strTemp = "";
		if(v_length < 0)
		{
			return "";
		}
		var iTemp = v_length -1;

		while(iTemp > -1)
		{
			if(VALUE.charAt(iTemp) == w_space)
			{
			}
			else
			{
				strTemp = VALUE.substring(0,iTemp +1);
				break;
			}
			iTemp = iTemp-1;
		} 
  
		return strTemp;
	} 

function LTrim(VALUE)
	{
		var w_space = String.fromCharCode(32);
		if(v_length < 1)
		{
			return "";
		}
		var v_length = VALUE.length;
		var strTemp = "";
		var iTemp = 0;

		while(iTemp < v_length)
		{
			if(VALUE.charAt(iTemp) == w_space)
			{
			}
			else
			{
				strTemp = VALUE.substring(iTemp,v_length);
				break;
			}
			iTemp = iTemp + 1;
		} 

		return strTemp;
	} 

function open_window(HTMLPage)
	{
	var windowHeight = screen.height * .65 ;
    var windowWidth = screen.width * .65 ;
    var PageURL = HTMLPage ; 		
    var windowProperties = 'height=' + windowHeight + ',width=' + windowWidth + ',top=60,left=60,resizable,scrollbars=yes,toolbar=no,status=no' ;

    win = window.open( PageURL, '', windowProperties) ;
        
    return false ;
	}
	
function open_new_window(HTMLPage)
	{
	var windowHeight = screen.height * .35 ;
    var windowWidth = screen.width * .45 ;
    var PageURL = HTMLPage ; 		
    var windowProperties = 'height=' + windowHeight + ',width=' + windowWidth + ',top=100,left=100,resizable,scrollbars=no,toolbar=no,status=no' ;

    win = window.open( PageURL, '', windowProperties) ;
        
    return false ;
	}
	
function format_number(num)
	{
    var dol = Math.floor(num).toString() ;
    
    var cents = Math.floor((num*100+.5)%100).toString() ;

    while (cents.length < 2)
        cents += "0";

    return dol + "." + cents ;
    }

function format_string(numstring)
	{
	var amount = "" ;
	var regExpr1 = /,/g ;
	var regExpr2 = /\$/g ;
			
	amount = numstring.replace(regExpr1,"")  ;
	amount = amount.replace(regExpr2,"")  ;
			
	return amount ;
    }
