
function abrir_popup(strURL, intWidth, intHeight){
	var remote = null;
	var intPosx = (screen.width - intWidth) / 2;
	var intPosy = (screen.height - intHeight) / 2;
	remote = window.open(strURL, '', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+ intWidth +',height='+ intHeight +',left='+ intPosx+',top='+ intPosy);
	//remote.resizeTo(intWidth,intHeight);
	remote.focus();
}

function abrir_popup_relatorio(strURL, intWidth, intHeight){
	var remote = null;
	var intPosx = (screen.width - intWidth) / 2;
	var intPosy = (screen.height - intHeight) / 2;
	remote = window.open(strURL, '', 'toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width='+ intWidth +',height='+ intHeight +',left='+ intPosx+',top='+ intPosy);
	//remote.resizeTo(intWidth,intHeight);
	remote.focus();
}

function abrir_popup_excluir_ati(id_ati){
	url ='atividade_excluir.asp?id_ati='+id_ati;
	if (confirm("Deseja realmente EXCLUIR essa atividade?")){
		window.location.href = url;
	}
}

function mover_estrutura_prj(id_est,mov_est){
	url = 'mover_estrutura.asp?tip_est=PRJ&id_est='+ id_est +'&mov_est='+ mov_est +'&url_est=principal.asp&str_sta=mov_prj';
	window.location.href = url;
}

function mover_estrutura_ati(id_est,mov_est){
	url = 'mover_estrutura.asp?tip_est=ATI&id_est='+ id_est +'&mov_est='+ mov_est +'&url_est=principal.asp&str_sta=mov_ati';
	window.location.href = url;
}
//	PersistentLayer("LayerStatus",100,100,1500,'<a href=\"javascript:window.top.history.go(0);\"><img src=\"../imagens/gpa_refresh.gif\" alt=\"Clique para atualizar a tela. Caso prefira pode fazer outras altera&ccedil;&otilde;es antes de atualiz&aacute;-la.\" width=\"27\" height=\"26\" border=\"0\" id=\"img_refresh\"></a><br><b><span class=\"text_10\">teste</span></b>','#0000CC','#FFFFFF',1,'#D8D8D8','../../../Comum/styles.css');

function mostra_refresh(strMsg){
	intX = ((document.body.clientWidth - 700) / 2)-120;
	if(intX<0){ intX = 0; }
	intY = ((document.body.clientHeight) / 2) - 40 ;
	PersistentLayer("LayerStatus",intY,intX,1500,'<a href=\"javascript:window.top.history.go(0);\"><img src=\"../imagens/gpa_refresh.gif\" alt=\"Clique para atualizar a tela. Caso prefira pode fazer outras altera&ccedil;&otilde;es antes de atualiz&aacute;-la.\" width=\"27\" height=\"26\" border=\"0\" id=\"img_refresh\"></a><br><b><span class=\"text_10\">'+ strMsg +'</span></b>','#0000CC','#FFFFFF',1,'#D8D8D8','../../../Comum/styles.css');
	//str_sta.value = strMsg;
	//document.all["prg_status"].style.display = "block";
	//document.all["img_refresh"].src = "../imagens/gpa_refresh.gif";
}

function mostra_carregando(strMsg){
	intX = ((document.body.clientWidth - 200) / 2);
	if(intX<0){ intX = 0; }
	intY = ((document.body.clientHeight - 40) / 2);
	
	//SE DESCOMENTAR ESSA LINHA, O LAYER DE ATUALIZAÇÃO PARA DE FUNCIONAR
	//PersistentLayer("Layer1",intY,intX,90,strMsg,'#0000CC','#FFFFFF',1,'#0000CC','../../Comum/styles.css');
	
	//PersistentLayer("LayerStatus",intY,intX,100,strMsg,'#0000CC','#FFFFFF',1,'#0000CC','../../Comum/styles.css');
	//PersistentLayer("Layer1",intY,intX,1500,strMsg,'#0000CC','#FFFFFF',1,'#D8D8D8','../../Comum/styles.css');
	//alert("Alcides!");
	//str_sta.value = strMsg;
	//document.all["prg_status"].style.display = "block";
	//document.all["img_refresh"].src = "../imagens/gpa_refresh.gif";
}
function DetailsPlus(id_prg,id_prj){

	//recuperando cookie
	strCookie = unescape(document.cookie); //converte caracteres estranhos do cookie
	if (strCookie.indexOf(id_prg + "_" + id_prj)!= (-1)){ //existe cookie
		intInicio = strCookie.indexOf(id_prg + "_" + id_prj) + (id_prg + "_" + id_prj).length + 1;
		intFim = strCookie.indexOf(";", strCookie.indexOf(id_prg + "_" + id_prj));
	}else{ //não existe cookie
		intInicio = (-1);
		intFim = (-1);
	}
	strCookie = unescape(strCookie.substring(intInicio, intFim));
	
	//alert(intInicio + "," + intFim +"," + strCookie + "|");

	//gera data futura
	var myDate = new Date(); //cria um objeto de data em formato GMT
	myDate.setFullYear(myDate.getFullYear() + 1); //Pega o ano atual e adiciona 1

	if (strCookie=="H" || strCookie==""){ //não tem cookie
		document.cookie = id_prg + "_" + id_prj +"=S; expires=" + myDate.toGMTString(); //grava o cookie com projeto aberto
	}else{ //tem cookie
		document.cookie = id_prg + "_" + id_prj +"=H; expires=" + myDate.toGMTString(); //grava o cookie com projeto fechado
	}
	Details(id_prj); //executa função de HidenShow para projeto clicado
	
}

function DetailsOnLoad(id_prg,id_prj){
	//recuperando cookie
	strCookie = unescape(document.cookie); //converte caracteres estranhos do cookie
	if (strCookie.indexOf(id_prg + "_" + id_prj)!= (-1)){ //existe cookie
		intInicio = strCookie.indexOf(id_prg + "_" + id_prj) + (id_prg + "_" + id_prj).length + 1;
		intFim = strCookie.indexOf(";", strCookie.indexOf(id_prg + "_" + id_prj));	
	}else{ //não existe cookie
		intInicio = (-1);
		intFim = (-1);
	}
	strCookie = unescape(strCookie.substring(intInicio, intFim));
	
	if (!(strCookie=="H" || strCookie=="")){//tem cookie
		Details(id_prj); //executa função de HidenShow para projeto do cookie
	}	
}

//function auto_refresh(){
	//window.top.history.go(0);
//}

//objCtrlRefresh = setTimeout("auto_refresh()", 1080000);

