<!--
//#############################################################
msg			= "Todos os campos devem ser preenchidos.";
msgEmail	= "Esse não é um e-mail válido.";
msgCpf		= "Esse não é um CPF válido.";
//#############################################################
function vld_campanha(){
	with(document.form1){
		if(nome.value.length == 0){
			alert(msg);
			nome.focus();
			return false;
		}
		if(cpf.value.length == 0){
			alert(msg);
			cpf.focus();
			return false;
		}else{
			if(!validaCPF(cpf.value)){
				alert(msgCpf);
				cpf.focus();
				return false;
			}
		}
		if(email.value.length == 0){
			alert(msg);
			email.focus();
			return false;
		}else{
			if(!vld_email(email.value)){
				alert(msgEmail);
				email.focus();
				return false;
			}
		}
	}
	return true;
}
//#############################################################
function exibeDiv(div){
	if(document.getElementById(div).style.display == 'none'){
		document.getElementById(div).style.display = 'block';
	} else {
		document.getElementById(div).style.display = 'none';
	}
}
//#############################################################
function load_swf(ban_widht,ban_height,ban_xml,ban_swf){
	document.writeln('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + ban_widht + '" height="' + ban_height + '">');
	document.writeln('  <param name="movie" value="' + ban_swf + '" />');
	document.writeln('  <param name="quality" value="high" />');
	document.writeln('  <param name="wmode" value="opaque" />');
	document.writeln('  <param name="swfversion" value="6.0.65.0" />');
	document.writeln('  <param name="expressinstall" value="Scripts/expressInstall.swf" />');
	document.writeln('  <param name="flashvars" value="_xml=' + ban_xml + '">');
	document.writeln('  <!--[if !IE]>-->');
	document.writeln('  <object type="application/x-shockwave-flash" data="' + ban_swf + '" width="' + ban_widht + '" height="' + ban_height + '">');
	document.writeln('    <!--<![endif]-->');
	document.writeln('    <param name="quality" value="high" />');
	document.writeln('    <param name="wmode" value="opaque" />');
	document.writeln('    <param name="swfversion" value="6.0.65.0" />');
	document.writeln('    <param name="expressinstall" value="Scripts/expressInstall.swf" />');
	document.writeln('    <param name="flashvars" value="_xml=' + ban_xml + '">');
	document.writeln('    <div>');
	document.writeln('      <h4>O conte&uacute;do desta p&aacute;gina requer uma vers&atilde;o mais recente do Adobe Flash Player.</h4>');
	document.writeln('      <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Obter Adobe Flash player" width="112" height="33" /></a></p>');
	document.writeln('    </div>');
	document.writeln('    <!--[if !IE]>-->');
	document.writeln('  </object>');
	document.writeln('  <!--<![endif]-->');
	document.writeln('</object>');
}
//#############################################################
function exibeBox(div){
	if(div == 'box_academico'){
		document.getElementById('box_servicos').style.display = 'none';
		document.getElementById('box_webmail').style.display = 'none';
		document.getElementById('box_academico').style.display = 'block';
	}else if(div == 'box_servicos'){
		document.getElementById('box_academico').style.display = 'none';
		document.getElementById('box_webmail').style.display = 'none';
		document.getElementById('box_servicos').style.display = 'block';
	}else if(div == 'box_webmail'){
		document.getElementById('box_academico').style.display = 'none';
		document.getElementById('box_servicos').style.display = 'none';
		document.getElementById('box_webmail').style.display = 'block';
	}
}
//#############################################################
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//#############################################################
function vld_email(email){
	var er = new RegExp(/^[A-Za-z0-9_\-\.]+@[A-Za-z0-9_\-\.]{2,}\.[A-Za-z0-9]{2,}(\.[A-Za-z0-9])?/);
	if(er.test(email)){
		return true;
	}else{
		return false;
	}
}
//#############################################################
function validaCPF(cpf)   
{   
  erro = new String;   
  
    if (cpf.length == 11)   
    {     
            cpf = cpf.replace('.', '');   
            cpf = cpf.replace('.', '');   
            cpf = cpf.replace('-', '');   
  
            var nonNumbers = /\D/;   
       
            if (nonNumbers.test(cpf))   
            {   
                    erro = "A verificacao de CPF suporta apenas números!";   
            }   
            else   
            {   
                    if (cpf == "00000000000" ||   
                            cpf == "11111111111" ||   
                            cpf == "22222222222" ||   
                            cpf == "33333333333" ||   
                            cpf == "44444444444" ||   
                            cpf == "55555555555" ||   
                            cpf == "66666666666" ||   
                            cpf == "77777777777" ||   
                            cpf == "88888888888" ||   
                            cpf == "99999999999") {   
                               
                            erro = "Número de CPF inválido!"   
                    }   
       
                    var a = [];   
                    var b = new Number;   
                    var c = 11;   
  
                    for (i=0; i<11; i++){   
                            a[i] = cpf.charAt(i);   
                            if (i < 9) b += (a[i] * --c);   
                    }   
       
                    if ((x = b % 11) < 2) { a[9] = 0 } else { a[9] = 11-x }   
                    b = 0;   
                    c = 11;   
       
                    for (y=0; y<10; y++) b += (a[y] * c--);   
       
                    if ((x = b % 11) < 2) { a[10] = 0; } else { a[10] = 11-x; }   
       
                    if ((cpf.charAt(9) != a[9]) || (cpf.charAt(10) != a[10])) {   
                        erro = "Número de CPF inválido.";   
                    }   
            }   
    }   
    else   
    {   
        if(cpf.length == 0)   
            return false   
        else   
            erro = "Número de CPF inválido.";   
    }   
    if (erro.length > 0) {   
//            alert(erro);   
//            cpf.focus();   
            return false;   
    }     
    return true;       
}   
  
//envento onkeyup   
function maskCPF(CPF) {   
    var evt = window.event;   
    kcode=evt.keyCode;   
    if (kcode == 8) return;   
    if (CPF.value.length == 3) { CPF.value = CPF.value + '.'; }   
    if (CPF.value.length == 7) { CPF.value = CPF.value + '.'; }   
    if (CPF.value.length == 11) { CPF.value = CPF.value + '-'; }   
}   
  
// evento onBlur   
function formataCPF(CPF)   
{   
    with (CPF)   
    {   
        value = value.substr(0, 3) + '.' +   
                value.substr(3, 3) + '.' +   
                value.substr(6, 3) + '-' +   
                value.substr(9, 2);   
    }   
}   
function retiraFormatacao(CPF)   
{   
    with (CPF)   
    {   
        value = value.replace (".","");   
        value = value.replace (".","");   
        value = value.replace ("-","");   
        value = value.replace ("/","");   
    }   
} 
//#############################################################

function flashembed(g,h,j){if(typeof g=='string')g=document.getElementById(g);var k={src:'#',width:'100%',height:'100%',version:null,loadEvent:null,onFail:null,expressInstall:null,allowfullscreen:true,allowscriptaccess:'always',quality:'high',bgcolor:'#ffffff',type:'application/x-shockwave-flash',pluginspage:'http://www.adobe.com/go/getflashplayer'};extend(k,h);var l=k.loadEvent;k.loadEvent=null;if(l){g['on'+l]=function(){return load()}}else{return load()}function extend(a,b){if(b){for(key in b){a[key]=b[key]}}}function load(){var a=getVersion();var b=k.version;var c=k.expressInstall;if(!g)return;if(!b||isSupported(b)){k.onFail=k.version=k.expressInstall=null;g.innerHTML=getHTML();return g.firstChild}else if(k.onFail){var d=k.onFail.call(k,getVersion(),j);if(d)g.innerHTML=d}else if(b&&c&&isSupported([6,0,65])){extend(k,{src:c});j={MMredirectURL:location.href,MMplayerType:'PlugIn',MMdoctitle:document.title};g.innerHTML=getHTML()}else{if(g.innerHTML!=''){}else{g.innerHTML="<h2>Flash version "+b+" or greater is required</h2>"+"<h3>"+(a[0]>0?"Your version is "+a:"You have no flash plugin installed")+"</h3>"+"<p>Download latest version from <a href='"+k.pluginspage+"'>here</a></p>"}}g['on'+l]=null}function isSupported(a){var b=getVersion();return b[0]>=a[0]&&b[1]>=a[1]&&(b[2]==null||b[2]>=a[2])}function getHTML(){var a="";if(typeof j=='function')j=j();if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){a='<embed type="application/x-shockwave-flash" ';extend(k,{name:k.id});for(var b in k){if(k[b]!=null)a+=[b]+'="'+k[b]+'"\n\t'}if(j){a+='flashvars=\'';for(var b in j){a+=[b]+'='+asString(j[b])+'&'}a+='\''}a+='/>'}else{a='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';a+='width="'+k.width+'" height="'+k.height+'"';if(document.all&&parseInt(navigator.appVersion)<=6){k.id="_"+(""+Math.random()).substring(5)}if(k.id)a+=' id="'+k.id+'"';a+='>';a+='\n\t<param name="movie" value="'+k.src+'" />';k.id=k.src=k.width=k.height=null;for(var b in k){if(k[b]!=null)a+='\n\t<param name="'+b+'" value="'+k[b]+'" />'}if(j){a+='\n\t<param name="flashvars" value=\'';for(var b in j){a+=[b]+'='+asString(j[b])+'&'}a+='\' />'}a+="</object>"}return a}function getVersion(){var a=[0,0];if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){var b=navigator.plugins["Shockwave Flash"].description;if(typeof b!="undefined"){b=b.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var c=parseInt(b.replace(/^(.*)\..*$/,"$1"),10);var d=/r/.test(b)?parseInt(b.replace(/^.*r(.*)$/,"$1"),10):0;a=[c,d]}}else if(window.ActiveXObject){try{var f=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(e){try{var f=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");a=[6,0];f.AllowScriptAccess="always"}catch(e){if(a[0]==6)return}try{var f=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(e){}}if(typeof f=="object"){var b=f.GetVariable("$version");if(typeof b!="undefined"){b=b.replace(/^\S+\s+(.*)$/,"$1").split(",");a=[parseInt(b[0],10),parseInt(b[2],10)]}}}return a}function asString(b){switch(typeOf(b)){case'string':return'"'+b.replace(new RegExp('(["\\\\])','g'),'\\$1')+'"';case'array':return'['+map(b,function(a){return asString(a)}).join(',')+']';case'object':var c=[];for(var d in b){c.push('"'+d+'":'+asString(b[d]))}return'{'+c.join(',')+'}'}return String(b).replace(/\s/g," ").replace(/\'/g,"\"")}function typeOf(a){if(a===null||a===undefined)return false;var b=typeof a;return(b=='object'&&a.push)?'array':b}if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}})}function map(a,b){var c=[];for(var i in a){c[i]=b(a[i])}return c}flashembed.getVersion=getVersion;flashembed.isSupported=isSupported;return g}if(typeof jQuery=='function'){(function($){$.fn.extend({flashembed:function(a,b){return this.each(function(){new flashembed(this,a,b)})}})})(jQuery)}

-->

