var Objects = {
  getHeight: function(object) {
    return $(object).offsetHeight;
  },
  getWidth: function(object) {
    return $(object).offsetWidth;
  },
  getRect: function(object) {
	var pos = getPosition(object);
	return {L:pos.x,T:pos.y,R:pos.x+object.offsetWidth,B:pos.y+object.offsetHeight};
  },
  getPageviewSize: function() {
	var width, height;
	if (self.innerHeight) {
		width = self.innerWidth;
		height = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		width = document.documentElement.clientWidth;
		height = document.documentElement.clientHeight;
	} else if (document.body) {
		width = document.body.clientWidth;
		height = document.body.clientHeight;
	}
	arrayPageSize = {pageWidth:width,pageHeight:height}
	return arrayPageSize;  
  },
  getPageSize: function() {
	var xScroll, yScroll;
	if (window.innerHeight && window.scrollMaxY){
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else {
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	var windowWidth, windowHeight;
	if (self.innerHeight) {
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) {
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}
	if(yScroll < windowHeight) pageHeight = windowHeight;
	else pageHeight = yScroll;
	if(xScroll < windowWidth) pageWidth = windowWidth;
	else pageWidth = xScroll;
	arrayPageSize = {pageWidth:pageWidth,pageHeight:pageHeight,windowWidth:windowWidth,windowHeight:windowHeight}
	return arrayPageSize;
  },
  getPageScroll: function(){
	var yScroll;
	if (self.pageYOffset) yScroll = self.pageYOffset;
	else if (document.documentElement && document.documentElement.scrollTop) yScroll = document.documentElement.scrollTop;
	else if (document.body) yScroll = document.body.scrollTop;
	arrayPageScroll = {yScroll:yScroll};
	return arrayPageScroll;
  },
  getPosition:function(element){
	element=$(element);
	var left=0,top=0;
	if(!element) return {x:left, y:top};
	while (element.offsetParent){ left += element.offsetLeft; top  += element.offsetTop; element = element.offsetParent; }
	left += element.offsetLeft;
	top  += element.offsetTop;
	return {x:left, y:top};
  },
  ShowHide: function(object) {
	object=$(object);
	if(object && object.style) {
	  object.style.display=object.style.display!='block'?'block':'none';
    }
  },
  extend: function(destination,source) {
    for (var property in source) destination[property] = source[property];
	return destination;
  }
}
var getElementsByClass = function(className) {
  var ls = document.getElementsByTagName('*');
  var elements = [];
  for(var i=0;i<ls.length;i++)
  if(Style(ls[i]).haveClass(className)) elements.push(ls[i]);
  return elements;
}
