

function getPageSize(){

	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){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}

	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}

	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else {
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
	return arrayPageSize;
}

function getpos(el_id) {
	var el = $(el_id);
	var t_left = el.offsetLeft;
	var t_top = el.offsetTop;
    var parent_el = el.offsetParent;
    while (parent_el!= null) {
    	t_left += parent_el.offsetLeft;
    	t_top += parent_el.offsetTop;
        parent_el = parent_el.offsetParent;
    }
    return [t_left,t_top];
}
function ShowTooltip(event, source, offset, wd){
	if(offset == null) offset = 15;
	if(wd == null) wd = "200px";
	
	ttSource = $(source);
		
	if($("IdeaToolTip") != null && $("IdeaToolTip").visible){
		tt = $("IdeaToolTip");
		css = tt.classNames();
		for(i=0;i<css.length;i++)
			tt.removeClassName(css[i]);
	}else{
		tt = document.createElement("div");
		Element.extend(tt);
		tt.id = "IdeaToolTip";
		tt.hide();
		document.body.appendChild(tt);
		Position.absolutize(tt);
	}
		
	tt.addClassName(ttSource.className);
	tt.update(ttSource.innerHTML);
	
	tt.setStyle({
		'width':wd,
		'height':ttSource.style.height,
		'display':'block',
		'z-index':1050
	});
	
	tt.style.left = (Event.pointerX(event) + (offset))  + "px";
	tt.style.top = (Event.pointerY(event))  + "px";
	tt.makePositioned();
	tt.show();
}

function HideTooltip(){
	$('IdeaToolTip').hide();
}

function setActiveButton(id){
	$('menu-btn-'+id).addClassName("active");
}
