// JavaScript Document

	function isEmpty(str)
	{
		var str_trim = str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
		
		if(str_trim==null || str_trim=="" || str_trim.length<1)
			return true;
		else return false;
	}
	
function isNumeric(field)
  {
  var errCount = 0;
 
  for(j=0;j<field.value.length;j++)
    {
    c = field.value.charAt(j);        // short hand notation for character at position j
    if(c >= 0 && c <= 9)
      {
      }
   else
	{
	 errCount++;               // if it's none of those, increment error counter
	}
    }
  // error if count is non-zero
  if(errCount > 0)
    {
    return false;
    }
  return true;
  }	
	
	function hideallids()
	{
		//loop through the array and hide each element by id
		for (var i=0;i<ids.length;i++){
			hidediv(ids[i]);
		}		  
	}
	
	function hidediv(id) 
	{
		//safe function to hide an element with a specified id
		if (document.getElementById) { // DOM3 = IE5, NS6
			document.getElementById(id).style.display = 'none';
		}
		else {
			if (document.layers) { // Netscape 4
				document.id.display = 'none';
			}
			else { // IE 4
				document.all.id.style.display = 'none';
			}
		}
	}
	
	function showdiv(id) 
	{
		//safe function to show an element with a specified id
			  
		if (document.getElementById) { // DOM3 = IE5, NS6
			document.getElementById(id).style.display = 'block';
		}
		else {
			if (document.layers) { // Netscape 4
				document.id.display = 'block';
			}
			else { // IE 4
				document.all.id.style.display = 'block';
			}
		}
	}	
	
	
	function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
	}

		//Strip Non-Numeric characters
	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;}
