function show(obj) {
	document.getElementById(obj).style.visibility = 'visible';
	document.getElementById(obj).style.display = 'block';
}

function hide(obj) {
	document.getElementById(obj).style.visibility = 'hidden';
	document.getElementById(obj).style.display = 'none';
}

function showOrHide(obj) {
	vis = document.getElementById(obj).style.visibility;
	if(vis == 'hidden') show(obj);
	else if(vis == 'visible') hide(obj);
}

function clearbox(obj) {
	document.getElementById(obj).value = 'Main Article';
}

function showBox(obj, ver, verval)
{
	show(obj);
	document.getElementById(ver).value = verval;
}

function doReply(obj, repbox, rnum, real, rr, ver, verval)
{
	show(obj);
	document.getElementById(repbox).value = '#' + rnum;
	document.getElementById(real).value = rr;
	document.getElementById(ver).value = verval;
}

function setVer(ver, verval)
{
	document.getElementById(ver).value = verval;
}

function popImage(iName, iWidth, iHeight, title)
{	
	var pURL = 'imgpop.php?title=' + title + '&img=' + iName + '&w=' + iWidth + '&h=' + iHeight;
	pInfo = 'toolbar=0,';
	pInfo += 'location=0,';
	pInfo += 'directories=0,';
	pInfo += 'status=0,';
	pInfo += 'menubar=0,';
	pInfo += 'scrollbars=0,';
	pInfo += 'resizable=1,';
	pInfo += 'width=' + iWidth + ',';
	pInfo += 'height=' + iHeight;
	window.open(pURL, 'bigPop', pInfo);
}

function popGallery(galid, iWidth, iHeight, gtitle, imgnum)
{
	var pURL = 'imgshow.php?title=' + gtitle + '&gallery=' + galid + '&w=' + iWidth + '&h=' + iHeight;
	if(imgnum > 0) pURL += "&picnum=" + imgnum;
	iHeight += 50;
	pInfo = 'toolbar=0,';
	pInfo += 'location=0,';
	pInfo += 'directories=0,';
	pInfo += 'status=0,';
	pInfo += 'menubar=0,';
	pInfo += 'scrollbars=0,';
	pInfo += 'resizable=1,';
	pInfo += 'width=' + iWidth + ',';
	pInfo += 'height=' + iHeight;
	window.open(pURL, 'bigPop', pInfo);
}

function popWindow(wWidth, wHeight, wURL)
{
	pInfo = 'toolbar=0,';
	pInfo += 'location=0,';
	pInfo += 'directories=0,';
	pInfo += 'status=0,';
	pInfo += 'menubar=0,';
	pInfo += 'scrollbars=0,';
	pInfo += 'resizable=1,';
	pInfo += 'width=' + wWidth + ',';
	pInfo += 'height=' + wHeight;
	window.open(wURL, 'bigPop', pInfo);
}
