﻿// JScript for Default.aspx
function toggleMoreApplicants(){$("#sLessPeope").toggle();$("#sMorePeope").toggle();$("#moreApplicants").slideToggle('slow')}
Number.parse=function(value){if(!value||(value.length==0)){return 0}return parseFloat(value)}

function toSafeNumber(stringValue){
	if (stringValue != null){
		var temp = stringValue;
		if (temp !=null){
			temp=temp.replace("$","");
			temp=temp.replace(",","");
			temp = parseFloat(temp);
			if (isNaN(temp)==false){
				return temp;
			} else {return 0;}
		} else {return 0;}
		return temp;
	} else { return 0;}
}

function formatCurrency(num) {
num = num.toString().replace(/\$|\,/g,'');
if(isNaN(num))
num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num*100+0.50000000001);
cents = num%100;
num = Math.floor(num/100).toString();
if(cents<10)
cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+','+
num.substring(num.length-(4*i+3));
return (((sign)?'':'-') + '$' + num + '.' + cents);
}