Sub OcultaErro
	On Error Resume Next
'	msgbox document.all("Inc_Menu1:tbLogin").value
'	msgbox document.all("btnSim").value
	document.all("btnSim").Disabled=false
	document.all("btnNao").Disabled=false
End Sub

function ValidaBusca()
	If document.all("Inc_Menu1:tbBusca").value = "" Then
		Msgbox "O campo Busca deve ser preenchido.",VBInformation,"Erro ao efetuar uma Busca"
	else
		document.all("Inc_Menu1_lkBuscar").click()
	end if
End Function

function ValidaLogin()
	if document.all("Inc_Menu1:tbLogin").value = "" Then
		Msgbox "O campo Login deve ser preenchido.",VBInformation,"Erro ao efetuar Login"

	elseif Not RegexValidaEmail(document.all("Inc_Menu1:tbLogin").value) Then
		Msgbox "O Login informado n" & chr(227) & "o apresenta um formato v" & chr(225) & "lido." & chr(13) & "Use seu e-mail como valor para o Login.",VBInformation,"Erro ao efetuar Login"

	elseif Not RegexValidaCaracteresInvalidos(document.all("Inc_Menu1:tbLogin").value) Then
		Msgbox "O Login informado, apresenta caracteres inv" & chr(225) & "lidos.",VBInformation,"Erro ao efetuar Login"

	elseif document.all("Inc_Menu1:tbSenha").value = "" Then
		Msgbox "O campo Senha deve ser preenchido.",VBInformation,"Erro ao efetuar Login"

	elseif Not RegexValidaCaracteresInvalidos(document.all("Inc_Menu1:tbSenha").value) Then
		Msgbox "A Senha informada, apresenta caracteres inv" & chr(225) & "lidos.",VBInformation,"Erro ao efetuar Login"
	else
		document.all("Inc_Menu1_lkLogar").click()
	end if
End Function

Function RegexValidaEmail(str)
  Dim regEx, retVal
  Set regEx = New RegExp
  regEx.Pattern = "^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"
  regEx.IgnoreCase = False
  retVal = regEx.Test(str)
  If retVal Then
    RegexValidaEmail = True
  Else
    RegexValidaEmail = False
  End If
End Function

Function RegexValidaCaracteresInvalidos(str)
  Dim regEx, retVal
  Set regEx = New RegExp
  regEx.Pattern = "^([1-zA-Z0-1\-@#.\s\-]{1,255})$"
  regEx.IgnoreCase = False
  retVal = regEx.Test(str)
  If retVal Then
    RegexValidaCaracteresInvalidos = True
  Else
    RegexValidaCaracteresInvalidos = False
  End If
End Function

sub ShowLinha(objeto)
	If objeto = "Inc_Menu1_LinhaSobreoGrupo" then
		document.all("Inc_Menu1_chkSobreoGrupo").Checked = NOT document.all("Inc_Menu1_chkSobreoGrupo").Checked
	End If
	If objeto = "Inc_Menu1_LinhaConteudo" then
		document.all("Inc_Menu1_chkConteudo").Checked = NOT document.all("Inc_Menu1_chkConteudo").Checked
	End If
	if document.all(objeto).style.display="" then
		document.all(objeto).style.display="none"
	else
		document.all(objeto).style.display=""
	end if
end sub

Sub MostraFuncao
	window.open "View_FuncoesDotNet.aspx?IDFuncao=" & document.all("Inc_Colunistas1:cmbFuncoes").value,"Dicas","channelmode=no,directories=no,height=150,width=300,scrollbars=yes"
End Sub

Sub MostraFoto(NomeFoto)
	window.open "view_FotoEscolhida.aspx?NomeFoto=" & NomeFoto,"Dicas","channelmode=no,directories=no,height=280,width=370,scrollbars=no"
End Sub

Sub MostraResultadoEnquete
	window.open "View_ResultadoEnquete.aspx","Enquete","channelmode=no,directories=no,height=160,width=154,scrollbars=no"
End Sub
