//VALIDA EMAIL
function checaEmail(Form) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(Form.email.value)){
return (true)
}
alert("Email é inválido!")
return (false)
}
function save() {
	document.execCommand("SaveAs");
}

function confirmLink(theLink, theSqlQuery)
{
    // Confirmation is not required in the configuration file
    // or browser is Opera (crappy js implementation)
    if (confirmMsg == '' || typeof(window.opera) != 'undefined') {
        return true;
    }

    var is_confirmed = confirm(confirmMsg + ' :\n' + theSqlQuery);
    return is_confirmed;
} // end of the 'confirmLink()' function

function ChecaPreenchimento(form){
	for (var i=0; i < form.length; i++)
		if (form[i].value == "")
			if (form[i] != form["dt_publi_fim"]){  
				alert ("Campo em branco");
				return false;
			}
	return true;
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function popup(Url, Titulo, Width, Height, Scrollbar) 
{
    window.open(Url, Titulo, 'width='+Width+', height='+Height+', scrollbars='+Scrollbar+', status=no, resizable, top='+((screen.availHeight/2)-(Height/2))+', left='+((screen.availWidth/2)-(Width/2)))
}

function ExibeBloco(id){
	if(window.document.getElementById('solucoes_'+id).style.display == "none"){
		window.document.getElementById('solucoes_'+id).style.display = "";
		window.document.getElementById('solucoes_li_'+id).className = "aberto"
	}else{
		window.document.getElementById('solucoes_'+id).style.display = "none";
		window.document.getElementById('solucoes_li_'+id).className = "fechado"
	}
}