function changecolormenu(strBackColor, objTag){
	objTag.style.backgroundColor=strBackColor;	
}

function deletenews(strNewsID, strNewsTitulo){
	var bConfirm = window.confirm('Confirma a deleção da notícia (' + strNewsTitulo + ') ?');
	
	if (bConfirm){
		window.location.href('newsdelete.asp?NewsID=' + strNewsID);
	}		
}

function deletelink(strLinkID, strLinkDesc){
	var bConfirm = window.confirm('Confirma a deleção do link (' + strLinkDesc + ') ?');
	
	if (bConfirm){
		window.location.href('linkdelete.asp?LinkID=' + strLinkID);
	}		
}

function deletesessao(strSessao){
	var bConfirm = window.confirm('Confirma a deleção da sessão (' + strSessao + ') ?');
	
	if (bConfirm){
		window.location.href('sessaodelete.asp?Sessao=' + strSessao);
	}		
}

function deletecliente(strClienteID, strRazSocial){
	var bConfirm = window.confirm('Confirma a deleção do cliente (' + strRazSocial + ') ?');
	
	if (bConfirm){
		window.location.href('clientedelete.asp?ClienteID=' + strClienteID);
	}		
}

function deleteprojetocliente(strClienteID, strProjetoID, strProjetoNome){
	var bConfirm = window.confirm('Confirma a deleção do projeto (' + strProjetoNome + ') ?');
	
	if (bConfirm){
		window.location.href('clienteprojetodelete.asp?ClienteID=' + strClienteID + '&ProjetoID=' + strProjetoID);
	}		
}

function focusPage(nField){	
	window.document.forms[0].elements[nField].focus()
}

function PrintNews(strNewsID){
	var newPage = 'newsprint.asp?NewsID=' + strNewsID	

	newWindow = window.open(newPage,'newWin','toolbar=yes,location=no,scrollbars=yes,width=700,height=500,left=0,top=0')			
}

function SendNews(strNewsID){
	var newPage = 'newssend.asp?NewsID=' + strNewsID
	
	newWindow = window.open(newPage,'newWin','toolbar=no,location=no,scrollbars=no,width=350,height=120,left=100,top=100')
}

function SomenteNumero(campo, event){
        var BACKSPACE=  8;
        var key;
        var tecla;
        
        if(navigator.appName.indexOf("Netscape")!= -1)  
                tecla= event.which;     
        else
                tecla= event.keyCode;

        key = String.fromCharCode( tecla);        

        if (tecla == 13 )
                return false;
        if (tecla == BACKSPACE )
                return true;
        return (isNum(key));   
} 

function isNum(caractere){
	var strValidos = "0123456789"
    if(strValidos.indexOf( caractere ) == -1 )
    	return false;
    return true;
}

function deleteuser(strUsername, strCurUser){
	var confirm
	
	if (strUsername != strCurUser)
		{		
		confirm = window.confirm('Deseja realmente apagar o usuário "' + strUsername + '" ?');

		if (confirm)
			{
			window.location.href('userdelete.asp?Username=' + strUsername);
			}
		}
	else
		{
		window.alert('Não será possível apagar o usuário "' + strUsername + '".\n\nEste é o usuário desta sessão.');
		}
}

function startWindow(){
	setTimeout("closeWindow()",1000);
}

function closeWindow(){
	window.close();
}

function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function showHideLayers() { //v3.0
  var i,p,v,obj,args=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 sendcursenha(){
	var strCPF = window.document.forms[0].txtCPF.value;	
	
	window.location.href('sendcursenha.asp?CPF=' + strCPF);
}

function deleteformacao(strCurso, strFormacaoID){
	var bConfirm = window.confirm('Deseja apagar a formação (' + strCurso + ') ?');
	
	if(bConfirm){
		window.location.href('formacaodelete.asp?FormacaoID=' + strFormacaoID);
	}
}

function deleteexperiencia(strEmpresa, strExperienciaID){
	var bConfirm = window.confirm('Deseja apagar e emperiência em (' + strEmpresa + ') ?');
	
	if(bConfirm){
		window.location.href('experienciadelete.asp?ExperienciaID=' + strExperienciaID);
	}
}