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_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

function MM_controlShockwave(objStr,x,cmdName,frameNum) { //v3.0
  var obj=MM_findObj(objStr);
  if (obj) eval('obj.'+cmdName+'('+((cmdName=='GotoFrame')?frameNum:'')+')');
}
//-->
function convertField(field) {
	field.value = field.value.toUpperCase();
}
function convertFieldUp(field) {
	field.value = field.value.replace( "&", "" );
	field.value = field.value.replace( "=", "" );
}
function Refresh(){
window.opener.location.href = "admin.php";
}
function enviardados(){
	if(document.contato.nome.value=="")
	{
		alert( "Preencha campo NOME!" );
		document.contato.nome.focus();
		return false;
	}
	if( document.contato.email.value=="" || document.contato.email.value.indexOf('@')==-1 || document.contato.email.value.indexOf('.')==-1 )
	{
		alert( "Preencha campo E-MAIL corretamente!" );
		document.contato.email.focus();
		return false;
	}
	if (document.contato.mensagem.value.length =="")
	{
		alert( "É necessario preencher o campo MENSAGEM!" );
		document.contato.mensagem.focus();
		return false;
	}
	if(document.contato.codigo.value =="")
	{
		alert( "Preencha campo de Validação!" );
		document.contato.codigo.focus();
		return false;
	}	
	return true;
}
function foto(){
	if(document.fotos.nome.value=="")
	{
		alert( "O campo Nome do albúm é obrigatório!" );
		document.fotos.nome.focus();
		return false;
	}
}
function enviarnot(){
	if(document.tb_noticias.titulo.value=="")
	{
		alert( "O campo TÍTULO é necessário!" );
		document.tb_noticias.titulo.focus();
		return false;
	}
	if( document.tb_noticias.texto.value=="" )
	{
		alert( "O campo TEXTO é necessário!" );
		document.tb_noticias.texto.focus();
		return false;
	}
	if( document.tb_noticias.tipo.value=="0" )
	{
		alert( "É necessário escolher um tipo para o texto: Noticia ou Recado!" );
		document.tb_noticias.tipo.focus();
		return false;
	}
}
function enviarlogin(){
	if(document.login.user.value=="")
	{
		alert( "O campo USUARIO é necessário!" );
		document.login.user.focus();
		return false;
	}
	if( document.login.pass.value=="" )
	{
		alert( "O campo SENHA é necessário!" );
		document.login.pass.focus();
		return false;
	}
	if( document.login.codigo.value=="" )
	{
		alert( "Digite a seqüência de caracteres exibida!" );
		document.login.codigo.focus();
		return false;
	}		
	return true;
}
function enviar_admin_grava(){
	if(document.admin_grava.smtp.value=="")
	{
		alert( "O campo Servidor SMTP é necessário!" );
		document.admin_grava.smtp.focus();
		return false;
	}
	if( document.admin_grava.username.value=="" || document.admin_grava.username.value.indexOf('@')==-1 || document.admin_grava.username.value.indexOf('.')==-1 )
	{
		alert( "Preencha campo EMAIL do Servidor SMTP corretamente!" );
		document.admin_grava.username.focus();
		return false;
	}
	if( document.admin_grava.mail.value=="" || document.admin_grava.mail.value.indexOf('@')==-1 || document.admin_grava.mail.value.indexOf('.')==-1 )
	{
		alert( "Preencha campo EMAIL de Retorno dos Contatos corretamente!" );
		document.admin_grava.mail.focus();
		return false;
	}	
	if( document.admin_grava.pass.value!="" )
	{
		if( document.admin_grava.pass.value!=document.admin_grava.re_pass.value )
		{
			alert( "Repita a senha do servidor SMTP!" );
			document.admin_grava.re_pass.focus();
			return false;
		}
	}
	if( document.admin_grava.url.value=="" )
	{
		alert( "O campo DOMÍNIO do Site é necessário!" );
		document.admin_grava.url.focus();
		return false;
	}
	if( document.admin_grava.pass_admin.value!="" )
	{
		if( document.admin_grava.pass_admin.value!=document.admin_grava.re_pass_admin.value )
		{
			alert( "Repita a senha do usuário administrativo!" );
			document.admin_grava.re_pass_admin.focus();
			return false;
		}
	}
	if( document.admin_grava.user_admin.value=="" )
	{
		alert( "O campo Nome de usuário administrador é necessário!" );
		document.admin_grava.user_admin.focus();
		return false;
	}else
		if( document.admin_grava.user_admin.value!=document.admin_grava.user_admin_back.value && document.admin_grava.pass_admin.value=="" )
		{
			alert( "Para efetuar a alteração do nome do usuário administrativo se faz necessário a inserção da senha nos campos ao lado!" );
			document.admin_grava.pass_admin.focus();
			return false;
		}	
	return true;
}
function ieupdate(){
theObjects = document.getElementsByTagName("object");
	for (var i = 0; i < theObjects.length; i++) {
	theObjects[i].outerHTML = theObjects[i].outerHTML;
	}
}
//->
window.onload = function(){
	if (document.getElementsByTagName) {
	var objs = document.getElementsByTagName("object");
		for (i=0; i<objs.length; i++) {
		objs[i].outerHTML = objs[i].outerHTML;
		}
	}
}
//When the page unloads:
window.onunload = function() {
	if (document.getElementsByTagName) {
	var objs = document.getElementsByTagName("object");
		for (i=0; i<objs.length; i++) {
		objs[i].outerHTML = "";
		}
	}
}
//Abre janela
function NovaJanela(pagina){
	nome='Conteúdo';
	w=550;
	h=500;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',titlebar=no,directories=no,location=no,status=no,resizable=no,scrollbars=no,menubar=no';
	win = window.open(pagina,nome,settings);
}
//Submit imgagens
function doPostImg(formName, actionName)
{	
	var hiddenControl = document.getElementById('acao');
    var theForm = document.getElementById(formName);
	hiddenControl.value = actionName;
    theForm.submit();
}
//Submit imgagens
function doPostBaner(formName, actionName)
{	
	var hiddenControl = document.getElementById('acaobaner');
    var theForm = document.getElementById(formName);
	hiddenControl.value = actionName;
    theForm.submit();
} 

<!--
function coordenadas(event) {
var x=event.pageX;
var y=event.pageY;
alert(x);
alert(y);
}

//document.onmousemove = function(event){coordenadas(event);}
//Acoes
function doPost(formName, actionName, idparam)
{
    var hiddenControl = document.getElementById('action');
	var id = document.getElementById('id');
    var theForm = document.getElementById(formName);
    
    hiddenControl.value = actionName;
	id.value = idparam;
    theForm.submit();
}
function doPostB(formName, actionName, idparam)
{
		var hiddenControl = document.getElementById('action');
		var id = document.getElementById('id');
		var theForm = document.getElementById(formName);
		hiddenControl.value = actionName;
		if(!confirm("Confima a exclusão do registro?")){
			hiddenControl.value = 'nada';
		}		
		id.value = idparam;
		theForm.submit();
}