function amplia(w,h,mypage,descri) {
	var i;
	if (navigator.appName == 'Netscape') i=40;
	if (w == '') w=640;
	if (h == '') h=520;
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h + 53-i) / 2;
	winprops = 'width='+w+',height='+h+',top='+wint+',left='+winl+',scrollbars=no,resizable=yes';
	page = 'http://www.futtura.net/sis/imagem.php?url='+mypage+'&descri='+descri;
	win = window.open(page, 'Amplia', winprops)
	if (parseInt(navigator.appVersion) >= 4) {
		win.window.focus();
	}
}
function download(w,h,formato,nome,mypage,descri,path) {
	var i;
	if (navigator.appName == 'Netscape') i=40;
	if (w == '') w=423;
	if (h == '') h=75;
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h + 53-i) / 2;
	winprops = 'width='+w+',height='+h+',top='+wint+',left='+winl+',scrollbars=auto,resizable=yes';
	page = 'http://www.futtura.net/sis/arquivo.php?path='+path+'&f='+formato+'&nome='+nome+'&url='+mypage+'&descri='+descri;
	win = window.open(page, 'Amplia', winprops)
	if (parseInt(navigator.appVersion) >= 4) {
		win.window.focus();
	}
}
function inicial() {
  var ns = (navigator.appName == "Netscape");
  var ie = (navigator.appName == "Microsoft Internet Explorer");
  if(ie)
  {
    vId.style.behavior='url(#default#homepage)';
    vId.setHomePage('http://www.itagiba.ba.gov.br/');
  } 
  else if(ns)
  {
    netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite");
    navigator.preference("browser.startup.homepage", 'http://www.itagiba.ba.gov.br/');
  };
}
function favoritos() {
	window.external.AddFavorite('http://www.itagiba.ba.gov.br','Prefeitura Municipal de Itagibá - Site Oficial');
}
function MM_findObj(n, d) { 
  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_validateForm() { 
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' deve conter um endereço de e-mail.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' deve ser preenchido.\n'; }
  } if (errors) alert('Ocorreu o(s) seguinte(s) erro(s):\n'+errors);
  document.MM_returnValue = (errors == '');
}
function MM_showHideLayers() {
  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 janela(mypage, w, h, scroll, add) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'width='+w+',height='+h+',top='+wint+',left='+winl+',scrollbars='+scroll+','+add+'';
	win = window.open(mypage, 'janela', winprops)
	if (parseInt(navigator.appVersion) >= 4) {
		win.window.focus();
	}
}
