//-----------------------------------------------------------------------//
function formatSSN(sSSN)                                                 //
//-----------------------------------------------------------------------//
//          function name: formatSSN()                                   //
//             created by: Dustin Brown                                  //
//             created on: 2/20/2001                                     //
//                purpose: format a given SSN to 999-99-9999             //
//             parameters: sSSN - the SSN to be formatted.               //
//                returns: the newly formatted SSN if 'sSSN' is valid; a //
//                         zero length string if it is not.              //
// include files required: validSSN.js, stripChars.js                    //
//-----------------------------------------------------------------------//
{
	//verify 'sSSN' is a valid SSN
	if(!validSSN(sSSN))return "";
	
	sSSN=stripChars(sSSN);
	
	//insert dashes in appropriate spots
	var temp=sSSN;
	sSSN=temp.substring(0,3)+"-";
	sSSN+=temp.substring(3,5)+"-";
	sSSN+=temp.substring(5,9);
	
	//return the formatted SSN
	return sSSN;
}
//End function formatSSN(sSSN)-------------------------------------------//