
function $(strId){
	return document.getElementById(strId);
}


function getWindowSize(){
  windowWidth =  window.innerWidth;
  windowWidth = (windowWidth)? windowWidth : document.documentElement.clientWidth;
  windowWidth = (windowWidth)? windowWidth : document.body.clientWidth;
  windowHeight =  window.innerHeight;
  windowHeight = (windowHeight)? windowHeight: document.documentElement.clientHeight;
  windowHeight = (windowHeight)? windowHeight: document.body.clientHeight;  
  return {'width': windowWidth, 'height': windowHeight};
}

function getPageSize(){
  var windowSize = getWindowSize() 
  var xScroll, yScroll;  
	xScroll = document.body.scrollWidth;
	yScroll = (window.innerHeight && window.scrollMaxY)? window.innerHeight + window.scrollMaxY : document.body.scrollHeight;
	var pageWidth = (xScroll < windowSize.width)? windowSize.width : xScroll;  
  var pageHeight = (yScroll < windowSize.height)? windowSize.height : yScroll;
  return {'width': pageWidth, 'height': pageHeight};
}


function getCursor(e) {
  e = e || window.event;
  return {'x': e.clientX, 'y': e.clientY};
}

function getScrollCursor(e){
  e = e || window.event;
	var curScrollX = (e.pageX)? e.pageX : e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
	var curScrollY = (e.pageY)? e.pageY : e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
  return {'x': curScrollX, 'y': curScrollY};
}


function openItem(context,item){
  var clean = item.id.replace("+", "");
  var show = $(clean);
  changeClass(context,show);
  changeClass(context,item);
}

