/******************************************************************************
          __| |    |  | _ )   \   _ \ __|  \ |   \      __|  _ \   \  |        
         (    |    |  | _ \  _ \    / _|  .  |  _ \    (    (   | |\/ |        
        \___|____|\__/ ___/_/  _\_|_\___|_|\_|_/  _\_)\___|\___/ _|  _|        
             Coded by Jan-Erik Moon - +372 5183782 / jan@110kv.com             
******************************************************************************/

/* Content block height altering */

function getHeight() {
	var myHeight = 0;
	if (typeof(window.innerWidth) == 'number') {
		myHeight = window.innerHeight;
	} else {
		if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
			myHeight = document.documentElement.clientHeight;
		} else {
			if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
				myHeight = document.body.clientHeight;
			}
		}
	}
	return myHeight;
}

function resizeContent() {
	var pseudoImage = new Image();
	var newHeight = getHeight() - headerHeight - footerHeight;

	if (newHeight > 0) {
		pseudoImage.src = 'resize?height=' + newHeight;
		document.getElementById('rightContentCell').style.height = newHeight + 'px';
	}
}

/* Menus */

var hideTimer = false;
var lastObjId = '';
var menuObject = false;

function showMenu(menuId) {
	if (lastObjId != menuId) {
		lastObjId = menuId;
		if (menuObject) {
			menuObject.style.display = 'none';
		}
		menuObject = document.getElementById(menuId);
	}
	clearTimeout(hideTimer);
	menuObject.style.display = '';
}

function hideMenu() {
	hideTimer = setTimeout('menuObject.style.display = \'none\';', 500);
}

/* Pictures in comments */

function checkCommentPicture(pictureObj) {
	if (pictureObj.width > commentWidth) {
		pictureObj.width = commentWidth;
		pictureObj.setAttribute('alt', "Click to zoom in");
		pictureObj.runtimeStyle.cursor = "hand";
		pictureObj.attachEvent('onclick', openCommentPicture);
	}
}

function openCommentPicture() {
	window.open(event.srcElement.src, '', '');
}


