var objContainer;
var objDialog;

function showDiablogBox(txtContent, txtTitle) {

	if(typeof(txtTitle) == 'undefined' ) {
		txtTitle = 'Atenção';
	}
	
	objContainer = document.createElement("div");
	objContainer.id = "veil";
	objDialog = document.createElement("div");
	objDialog.id = "dialog-box";
	document.body.appendChild(objContainer);
	document.body.appendChild(objDialog);
	if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac
		objContainer.style.height = document.body.scrollHeight + "px";
	} else  { // Explorer Mac; would also work in Explorer 6 Strict, Mozilla and Safari
	    objContainer.style.height = document.body.offsetHeight + "px";
	}
	objContainer.style.filter = "alpha(opacity=75)";
	objContainer.style.opacity = "0.75";
	
	objDialog.innerHTML = '<p class="title">' + txtTitle + '</p>' + txtContent;
	
	if (self.pageYOffset) {// all except Explorer
		y_pos = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict
		y_pos = document.documentElement.scrollTop;
	} else if (document.body) { // all other Explorers
		y_pos = document.body.scrollTop;
	}
	
	objDialog.style.top = y_pos + ((getWindowHeight() / 2) - (objDialog.offsetHeight / 2)) + 'px';
}
function hideDialogBox() {
	objDialog.style.display= 'none';
	objContainer.style.display= 'none';
}

function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	//alert(windowHeight);
	return windowHeight;
}

function delayEnable(elementId, txtValue, intTimeout) {

	if(typeof(txtValue) == 'undefined' ) {
		txtValue = 'OK';
	}
	if(typeof(intTimeout) == 'undefined' ) {
		intTimeout = 5000;
	} else {
		intTimeout = intTimeout * 1000;
	}
	
	setTimeout('document.getElementById("' + elementId + '").innerHTML = "' + txtValue + '"; document.getElementById("' + elementId + '").disabled = false;', intTimeout);
}