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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function admin(frame){
  	window.open("system/administrator/frameset.php?" + frame + ".php", frame, "top=0,left=0,scrollbars=yes,dependent=true,resizable=yes,width=776,height=400");
}
function logout() {
	window.location = "action.php?send=send_logout";
}
function enlarge(picture) {
	window.open("enlarge.php?picture=" + picture, "enlarge", "resizable=yes,scrollbars=yes,width=200,height=130,top=0,left=0"); 
}
function download(file) {
  	document.location = "download.php?file=" + file + "&send=download";
}
function calendar(formu, field) {
  window.open("calendar_call.php?formu=" + formu + "&field=" + field , "calendar", "width=180,height=168,top=200,left=320"); 
}
function printer(article_idpk)
{
  window.open("article_printer.php?article_idpk=" + article_idpk, "printer", "scrollbars=yes,resizable=no,toolbar=yes,width=546,height=400");
}
function sendmail(article_idpk)
{
  window.open("article_sendmail.php?article_idpk=" + article_idpk, "sendmail", "scrollbars=yes,resizable=no,toolbar=no,width=546,height=310");
}
function Article()
{
  window.open("", "Article", "left=100,top=100,scrollbars=yes,resizable=no,width=600,height=330");
}
function selectmenu() {
document.location = document.form_selectmenu.month.options[document.form_selectmenu.month.selectedIndex].value
}
function select_last_article() {
document.location = document.form_last_article.last_article.options[document.form_last_article.last_article.selectedIndex].value
}
function verify_form_ssearch(form_search) {
	if(form_search.search_txt.value.length < 3) {
		alert("Preencha o campo 'Pesquise aqui' com mais de 3 caracteres."); this.document.form_search.search_txt.focus(); return false; }
	if(form_search.search_txt.value == '') {
		alert("O campo de pesquisa está vazio."); this.document.form_search.search_txt.focus(); return false; }
	if(form_search.search_txt.value == 'Pesquise aqui') {
		alert("Preencha o campo 'Pesquise aqui' corretamente."); this.document.form_search.search_txt.focus(); return false; }
}
function verify_form_sendmail(form_sendmail) {
	if(form_sendmail.yourname_sendmail.value.length < 3) {
		alert("Preencha o campo 'Seu nome' corretamente."); this.document.form_sendmail.yourname_sendmail.focus(); return false; }
	if((form_sendmail.youremail_sendmail.value.length < 2) || (form_sendmail.youremail_sendmail.value.indexOf("@") == -1)) {
		alert("Seu e-mail inválido."); this.document.form_sendmail.youremail_sendmail.focus(); return false; }
	if((form_sendmail.addressee_sendmail.value.length < 2) || (form_sendmail.addressee_sendmail.value.indexOf("@") == -1)) {
		alert("E-mail destinatário inválido."); this.document.form_sendmail.addressee_sendmail.focus(); return false; }
	
	if (form_sendmail.copy_sendmail.value != '') {
		if((form_sendmail.copy_sendmail.value.length < 2) || (form_sendmail.copy_sendmail.value.indexOf("@") == -1)) {
			alert("E-mail cópia inválido."); this.document.form_sendmail.copy_sendmail.focus(); return false; }
	}
}

function checa(frm) {
	if(frm.nome.value.length < 3) {
		alert("Preencha o campo 'Nome' corretamente."); this.document.frm.nome.focus(); return false; }
	if((frm.email.value.length < 2) || (frm.email.value.indexOf("@") == -1)) {
		alert("Seu e-mail inválido."); this.document.frm.email.focus(); return false; }
	if(frm.mensagem.value.length < 5) {
		alert("Preencha o campo 'Mensagem' corretamente."); this.document.frm.mensagem.focus(); return false; }
}

function checa2(frm) {
	if(frm.nome.value.length < 3) {
		alert("Please to fill field 'Name'."); this.document.frm.nome.focus(); return false; }
	if((frm.email.value.length < 2) || (frm.email.value.indexOf("@") == -1)) {
		alert("E-mail invalid."); this.document.frm.email.focus(); return false; }
	if(frm.mensagem.value.length < 5) {
		alert("Please to fill field 'Mesasge'."); this.document.frm.mensagem.focus(); return false; }
}