function resizeCommentsFrame() {
	var currHeight = document.getElementById('pjphoto').height;
	if (currHeight > 150)
		document.getElementById('MWOcommentsFrame').style.height = currHeight + 'px';
}

var originalWidth;
var theframe;
var thebox;
//var thetext;
var ua = navigator.userAgent.toLowerCase();
var expandOK = 0;
var expandIE = 0;
if ((ua.indexOf("gecko")+1) || (ua.indexOf("opera")+1) || (ua.indexOf("msie 7")+1))
	expandOK = 1;
if (ua.indexOf("msie 6")+1)
	expandIE = 1;
	
function setComments() {
	if (document.getElementById) {
		originalWidth = document.getElementById('MWOcommentsFrame').offsetWidth;
		theframe = document.getElementById('MWOcommentsFrame');
		thebox = document.getElementById('MWOcomments');
		//thetext = document.getElementById('MWOcommentsToggleText');
		////if ((ua.indexOf("firefox")+1) || (ua.indexOf("opera")+1))
		//if (expandOK || expandIE)
			//thetext.innerHTML = 'expand';
	} else {
		originalWidth = '280';
	}
}

function toggleComments() {
	if (document.getElementById) {
		var currWidth = document.getElementById('MWOcommentsFrame').offsetWidth;
		if (currWidth <= 280) {
			if (expandOK) {
				thebox.style.position = 'relative';
				thebox.style.left = '-464px';
				thebox.style.width = '744px';
				theframe.style.width = '744px';
			} else if (expandIE) {
				thebox.style.position = 'absolute';
				thebox.style.left = '-462px';
				thebox.style.width = '742px';
				theframe.style.width = '740px';
			}
			//thetext.innerHTML = 'collapse';
		} else {
			thebox.style.position = 'relative';
			thebox.style.left = '0';
			thebox.style.width = '280px';
			theframe.style.width = originalWidth + 'px';
			//thetext.innerHTML = 'expand';
		}
	}
}
