ajaxBox.ttrGetBottom = function()
{
	if (self.innerHeight)
	{	// FF
		var windowWidth  = self.innerWidth;
		var windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) 
	{ // IE
		var windowWidth  = document.documentElement.clientWidth;
		var windowHeight = document.documentElement.clientHeight;
	} else if (document.body) 
	{ // Outros
		var windowWidth  = document.body.clientWidth;
		var windowHeight = document.body.clientHeight;
	}

	return Array( parseInt(windowWidth), parseInt(windowHeight));
}
ajaxBox.ttrGetTop = function()
{
	if (self.pageYOffset)
	{	// FF
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop)
	{	 // IE
		yScroll = document.documentElement.scrollTop;
	} else if
	(document.body) 
	{	// Outros
		yScroll = document.body.scrollTop;
	}
	return yScroll;
}
ajaxBox.showElement = function( W, H,Element)
{	
	GetElement = ajaxBox.ttrGetBottom();
	
	$(Element).style.position = 'absolute';
	$(Element).style.left 	  = (parseInt(W))-(0)+'px';
	$(Element).style.top 	  = (parseInt(H))-(0)+'px';
}
ajaxBox.DialogOpen = function( jSon)
{
	// .Start
	jSon = eval( jSon );
	
	var H 		= jSon.Tamanho[1];
	var W 		= jSon.Tamanho[0];
	var Element = jSon.Dialod;
	
	// Abre
	ajaxBox.me(Element);
	// Define
	var ScrollY 		= ajaxBox.ttrGetTop();
	var PageY 			= ajaxBox.ttrGetBottom();
	var AreaVisivel__Y 	= PageY[1];
	var Distancia__Top 	= ScrollY;
	
	// Centraliza Y
	var PegaMeioY = ((PageY[1])/2) + ( Distancia__Top ) -(H/2);
	// Centraliza X
	var PegaMeioX = ((PageY[0])/2)-(W/2);
	// Arruma
	ajaxBox.showElement(PegaMeioX,PegaMeioY,Element)
	// Sai daqui a pouco :)
	setTimeout( function(){ ajaxBox.DialogClose(Element) },2000);	
}
ajaxBox.DialogClose = function(Element)
{	
	ajaxBox.me(Element);
}
