function openPopup(pag, wid, hei) {
    
    pagina = window.open(pag, 'formUpload', 
        'scrollbars=yes, width='+ wid +', height='+ hei +', top=100, left=200');
    pagina.focus();
    
}

function mudaFlash(siteX) {
    var flashCarregado = carregarFlash("bannerCM");
    if (flashCarregado != null) {
        var flashReturn = flashCarregado.mudarFilme(siteX);
    }
}

function carregarFlash(movie) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movie]
    }
    else {
        return document[movie]
    }
}

function mascaraDataPt(idInput, evento) {
    var input = document.getElementById(idInput);
    var tamanho = input.value.length;
    var aux = input.value;
    var aceita = false;
    
    try {
        teclaCode = event.keyCode;
    } catch (e) {
    try {
        teclaCode = evento.which;
    } catch (ex) {
    alert('Não foi possível capturar seu digito, por favor, ultilize o IE 6+ ou Firefox 1.5+');
    return false;
}
}

if((teclaCode >= 48) && (teclaCode < 58) || (teclaCode >= 96) && (teclaCode <= 105)){
    aceita = true;
}

if (teclaCode == 0)
    aceita = true;

if (teclaCode == 8) {
    input.value = input.value.substr(0, input.value.length - 1);
    //alert('Entrou aqui!');
    return false;
}

if (tamanho < 10) {
    while (aux.indexOf("/") != -1) {
        aux = aux.replace("/", "");
    }
} else {
return false;
}

if ((tamanho >= 2) && (tamanho < 5))
    aux = aux.substr(0, 2) + '/' + aux.substr(2, tamanho);
else if ((tamanho >= 5) && (tamanho <=10))
    aux = aux.substr(0, 2) + '/' + aux.substr(2, 2) + '/' + aux.substr(4, 4);

if (aceita)
    input.value = aux;

return aceita;
}
