<!--
function getDateforEndofMonth(theyear, themonth) {
// remember that months are counted 0-11.
// set date to 1st of next month and then subtract 1 day.
// above takes away need to calculate leap years.
	if (themonth == 12) {
		themonth = 0
		theyear = theyear + 1
	}
	endofmonth = new Date(theyear, themonth, 1)
	endofmonthval = endofmonth - 1000*3600*24
	endofmonth.setTime(endofmonthval)
	return endofmonth
}

function IsEmailValid(email) {

	if (document.layers||document.getElementById||document.all) {
		var str=email
		var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
		testresults = filter.test(str)
		return (testresults)

	} else {
		return true
	}
}

function moneyFormat(input, addsign) { 
   var dollars = Math.floor(input); 
   var tmp = new String(input); 
 
   for ( var decimalAt = 0; decimalAt < tmp.length; decimalAt++ ) { 
      if ( tmp.charAt(decimalAt)=="." ) 
         break; 
   } 
 
   var cents  = "" + Math.round(input * 100); 
   cents = cents.substring(cents.length-2, cents.length) 
           dollars += ((tmp.charAt(decimalAt+2)=="9")&&(cents=="00"))? 1 : 0; 
 
   if ( cents == "0" ) 
      cents = "00"; 

   if (addsign) {
   	return("$" + dollars + "." + cents); 
   } else {
   	return(dollars + "." + cents); 
   }	
}

//-->

