	// Removes leading whitespaces
	function LTrim( value ) {
		
		var re = /\s*((\S+\s*)*)/;
		return value.replace(re, "$1");
		
	}

	// Removes ending whitespaces
	function RTrim( value ) {
		
		var re = /((\s*\S+)*)\s*/;
		return value.replace(re, "$1");
		
	}

	// Removes leading and ending whitespaces
	function trim( value ) {
		
		return LTrim(RTrim(value));
		
	}

	function resetFields(szType)
	{
		var fields = new Array();
		//var fields = new Array('ref', 'email', 'shipping_addr', 'usps_track', 'inv_amt', 'est_weight', 'actual_usps', 'supplier', 'sale_amount', 'sale_tax', 'profit', 'affiliate', 'custom_key', 'status', 'giftearnings');
			
		if (szType == 'front_tracking')
		{
			var fields = new Array('search_txt');
		}
		
		for (var i=0; i<fields.length; i++)
		{
			document.getElementById(fields[i]).value = '';
		}
	}
