//Verifica se o CEP está no formato correto 99999-999 ou 99999999
function IsCEP(strCEP){
      var r = new RegExp("([0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9])|([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9])");

      if (strCEP==""){
         return false;
      }
      
      //Verifica se o CEP é válido
      var arrResultado = strCEP.match(r); 
      if (arrResultado != null && arrResultado.length > 0 && arrResultado[0] == strCEP)
         return true;
      else
         return false;
}
