function dia_trim(x)
{
   x = x.replace(/^s*/g,'');
   x = x.replace(/s*$/g,'');
   return x;
}

function dia_verify(email_id, zip_id)
{	

   var email = document.getElementById(email_id);
   var zip = document.getElementById(zip_id);
   if(email && zip)
   {
                var emailv = dia_trim(email.value);
                var zipv = dia_trim(zip.value);
		if((emailv!='email')&&(emailv.length>0)&&(zipv!='zip')&&(zipv.length>0)&&(emailv.indexOf('@')>0)&&(zipv.match(/\d{5}/)))
                {
                        return true;
                }
                else
                {
                        alert('Please complete all form fields before pressing \'Submit\'.');
                        return false;
                }
        }
}

function clearInputBox (id)
{
    if (document.getElementById && document.createElement) {
        document.getElementById(id).value = "";
    }
}