function showDiv(divName){
	document.getElementById(divName).style.display = 'block';
}
function hideDiv(divName){
	document.getElementById(divName).style.display = 'none';
}

function cms_showCommentForm(){
	hideDiv('cms_commentText');
	showDiv('cms_commentForm');
}
function cms_hideCommentForm(){
	hideDiv('cms_commentForm');
	showDiv('cms_commentText');
}

function getDocumentHeights(){
	if (parseInt(navigator.appVersion)>3) {
		if (navigator.appName=="Netscape") {
			winWidth  = window.innerWidth;
			winHeight = window.innerHeight;
		}
		if (navigator.appName.indexOf("Microsoft")!=-1) {
			winWidth  = document.body.offsetWidth;
			winHeight = document.body.offsetHeight;
		}
	}
	
	if (document.getElementById('cms_main')){
		bodyWidth  = document.getElementById('cms_main').offsetWidth +20;  //10px margin each side
		bodyHeight = document.getElementById('cms_main').offsetHeight+20; //10px margin each side
	} else {
		bodyWidth = winWidth;
		bodyHeight = winHeight;
	}
}
function setPageClickHeights(){
	getDocumentHeights();
	document.getElementById('cms_cover').style.width  = Math.max(bodyWidth,  winWidth) - 20;
	document.getElementById('cms_cover').style.height = Math.max(bodyHeight, winHeight - 4);
}

function doPageClick(clickAction){
	getDocumentHeights();
	setPageClickHeights();
	
	window.scrollTo(0,0);
	document.getElementById('cms_cover').style.visibility='visible';
	document.getElementById('cms_loading').style.visibility='visible';
	setTimeout(clickAction, 1500);
}
function hidePageClick(){
	document.getElementById('cms_cover').style.visibility='hidden';
	document.getElementById('cms_loading').style.visibility='hidden';
}
