
function validateRetypeEmail(email, retypeEmail)
{
	return validateRetypeEmail2(email, retypeEmail, 'retypeEmailGood', 'retypeEmailError' );
}

function validateRetypeEmail2(email, retypeEmail, correctId, incorectId )
{
	email2 =       trim( (document.getElementById(email).value) );
	retypeEmail = trim( (document.getElementById(retypeEmail).value) );
	
	if( retypeEmail.toLowerCase() != email2.toLowerCase() )
	{
		document.getElementById(incorectId).style.display = "block";
		if( email == 'ShipToEmailAddress' || email == 'BillToEmailAddress' )
			document.getElementById(correctId).style.display = "none";
		return false;
	}
	else
	{
		document.getElementById(incorectId).style.display = "none";
		if( email == 'ShipToEmailAddress' || email == 'BillToEmailAddress' )
			document.getElementById(correctId).style.display = "block";
		
		return true;
	}
}

function trim(str) { 

    str = str.replace(/^\s*/, '').replace(/\s*$/, ''); 

 

   return str;

}



