function awayta(idDiv,divW,divH) {
	var awaytaBody = new Element('div',{
		'id': 'awayta',
		'styles': {
			'left': (getPageWidth() / 2) - (divW / 2),
			'top': getPageScroll()[1] + (divH / 4),
			'width': divW,
			'height': divH + 20,
			'padding': 10
		}
	});
	
	var awaytaContent = new Element('div',{
		'id': idDiv,
		'styles': {
			'width': divW,
			'height': divH,
			'background-color': '#fff',
			'text-align': 'center'
		}
	});
	
	var awaytaEvent = new Element('div',{
		'id': 'awayta_event',
		'styles': {
			'width': divW,
			'height': 20,
			'background-color': '#1C1C1C',
			'text-align': 'right'
		}
	});
	
	var awaytaCerrar = new Element('a', {
		'href': 'javascript:cerrarAwayta(),Mostrar()',		
		'html': 'Cerrar'
	});
		
	$('overlay').setStyle('width',getPageScroll()[0] + getPageWidth());
	$('overlay').setStyle('height',getPageScroll()[1] + getPageHeight());	
		
	awaytaBody.inject($('body'),'top');		
	awaytaContent.inject($('awayta'),'top');
	awaytaEvent.inject($('awayta'),'top');
	awaytaCerrar.inject($('awayta_event'),'top');
		
	$('overlay').setStyle('z-index','99');
	$('overlay').setStyle('display','block');
		

}

function Mostrar()
{
}

function cerrarAwayta(){
	  
  
  $('overlay').setStyle('z-index','-99');
	$('overlay').setStyle('display','none');
	$('awayta').dispose();
  /*$('awayta').destroy();*/
}

// getPageScroll() by quirksmode.com
function getPageScroll() {
  var xScroll, yScroll;
  if (self.pageYOffset) {
    yScroll = self.pageYOffset;
    xScroll = self.pageXOffset;
  } else if (document.documentElement && document.documentElement.scrollTop) {	 // Explorer 6 Strict
    yScroll = document.documentElement.scrollTop;
    xScroll = document.documentElement.scrollLeft;
  } else if (document.body) {// all other Explorers
    yScroll = document.body.scrollTop;
    xScroll = document.body.scrollLeft;	
  }
  return new Array(xScroll,yScroll) 
}

// Adapted from getPageSize() by quirksmode.com
function getPageHeight() {
  var windowHeight
  if (self.innerHeight) {	// all except Explorer
    windowHeight = self.innerHeight;
  } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
    windowHeight = document.documentElement.clientHeight;
  } else if (document.body) { // other Explorers
    windowHeight = document.body.clientHeight;
  }	
  return windowHeight
}

function getPageWidth() {
  var windowWidth
  if (self.innerWidth) {	// all except Explorer
    windowWidth = self.innerWidth;
  } else if (document.documentElement && document.documentElement.clientWidth) { // Explorer 6 Strict Mode
    windowWidth = document.documentElement.clientWidth;
  } else if (document.body) { // other Explorers
    windowWidth = document.body.clientWidth;
  }	
  return windowWidth
}
