/**************************************/
/***Abre uma janela de browser comum***/
/**************************************/
function openWindow(width, height, url, name){
	/*
	Obs.:
	O valor mínimo para width é 100 pixels
	O valor mínimo para height é 100 pixels
	*/
	vLeft = centerSeg(width,800)
	vTop = centerSeg(height,600)
	sFeatures = "width=" + width + ",height=" + height 
	sFeatures = sFeatures + ",left=" + vLeft + ",top=" + vTop + ",fullscreen=no,resizeble=no"
	sFeatures = sFeatures + ",location=no,menubar=no,scrollbars=no,status=yes,toolbar=no"
	window.open(url,name,sFeatures)
}
/**************************************************/
/***Abre uma janela de browser comum com rolagem***/
/**************************************************/
function openWindowScr(width, height, url, name){
	/*
	Obs.:
	O valor mínimo para width é 100 pixels
	O valor mínimo para height é 100 pixels
	*/
	vLeft = centerSeg(width,800)
	vTop = centerSeg(height,600)
	sFeatures = "width=" + width + ",height=" + height 
	sFeatures = sFeatures + ",left=" + vLeft + ",top=" + vTop + ",fullscreen=no,resizeble=no"
	sFeatures = sFeatures + ",location=no,menubar=no,scrollbars=yes,status=no,toolbar=no"
	window.open(url,name,sFeatures)
}
/*****************************************************/
/***Abre uma janela de browser que não perde o foco***/
/*****************************************************/
function openModal(width, height, url){
	/*
	Obs.:
	Para retirar a scrollbar da página, atribuir o valor "false" para a propriedade "scroll" no elemento "<body>" da página
	*/	
	sFeatures = "dialogWidth=" + width + "px,dialogHeight=" + height + "px"
	sFeatures = sFeatures + ",center=yes,help=yes,resizable=no"
	sFeatures = sFeatures + "status=no"
	windowValue = window.showModalDialog(url,null,sFeatures)			
	return windowValue	
}
/***********************************************************************/
/***Abre uma janela de browser que perde o foco mas não fica por trás***/
/***********************************************************************/
function openModeless(width, height, url){
	/*
	Obs.:
	Para retirar a scrollbar da página, atribuir o valor "false" para a propriedade "scroll" no elemento "<body>" da página
	*/
	sFeatures = "dialogWidth=" + width + "px,dialogHeight=" + height + "px"
	sFeatures = sFeatures + ",center=yes,help=yes,resizable=no,scroolbars=no"
	sFeatures = sFeatures + "status=no"
	window.showModelessDialog(url,null,sFeatures)
}
/************************************************************************/
/********Calcula a margem anterior para centralizar um seguimento********/
/************************************************************************/
function centerSeg(segSize, spaceSize){
	if(segSize >= spaceSize){
		margin = 0
	} else {
		margin = parseInt(( (spaceSize - segSize) / 2) - 1)
	}
	return margin
}
/**************************************/
/***Cria Botão Padrão do Sistema	***/
/**************************************/
function newButton(type,name,value,click){
	document.write("<table cellpadding=0 cellspacing=0 border=0 height=18 class=button>")
	document.write("<tr><td height=18>")
	document.write("<img src='/adm/img/btgbL.gif'>")
	document.write("</td>")
	document.write("<td background='/adm/img/btgb.gif'>")
	document.write("<input type='" + type + "' name='" + name + "' value='" + value + "' onclick=" + click + ">")
	document.write("</td>")
	document.write("<td>")
	document.write("<img src='/adm/img/btgbR.gif'>")
	document.write("</td>")
	document.write("</tr>")
	document.write("</table>")
}
/**************************************/
/***Prompt de Confirmação 			***/
/**************************************/
function conf(cnfText,cnfUrl){
	resp = window.confirm(cnfText)
	if(resp){
		window.navigate(cnfUrl)
	}
}