// Função somente para tecla de números e backspace (das idades)
function desabilitateclas()
{
	var tecla = event.keyCode;
	if ((tecla >= 0 && tecla <= 7)||(tecla >= 9 && tecla <= 12)||(tecla >= 14 && tecla <= 43)||(tecla >= 58 && tecla <= 127))
	{ return false; }
	return tecla;
}
// Muda o focus do telefone
function muda_focus(a,b)
{
	if(a.length==2)
		b.focus();
}
// Função mascara de FONE
function mascaraFONE(objeto)
{
	campo = eval (objeto);
	separacao1 = '-';
	conjunto1 = 4;
	conjunto2 = 9;
	if (desabilitateclas())
	{
			if (campo.value.length < (conjunto2))
			{
			  if (campo.value.length == conjunto1)
					campo.value = campo.value + separacao1;
			}
	}
	else
		event.returnValue = false;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function favoritos() {
var name=confirm("Serma Convida você a incluir nosso site em seus Favoritos!")
if (name==true)
{
	var url      = "http://www.sermaplanosdesaude.com.br";
    var title    = "Serma - Planos de Saúde - Central de Vendas e Promoções !";
    if (window.sidebar) window.sidebar.addPanel(title, url,"");
    else if(window.opera && window.print){
        var mbm = document.createElement('a');
        mbm.setAttribute('rel','sidebar');
        mbm.setAttribute('href',url);
        mbm.setAttribute('title',title);
        mbm.click();
    }
    else if(document.all){window.external.AddFavorite(url, title);}
}
}

function piscar(x) {
   x = (x == null) ? 0 : x;
   var objLinks = document.getElementsByTagName("a");

   for (var i = 0; i < objLinks.length; i++) {
       if (objLinks[i].className == "piscar") {
           var objStyle = objLinks[i].style;
           objStyle.color = (x % 2 == 1)  ?  ""  :  "#cc0000";
           //objStyle.color = (objStyle.color == "#cc0000")  ?  ""  :  "#cc0000";
       }
   }

   setTimeout("piscar("+ (x+1) +")", 500);
}
piscar();