

function OpenComments (c) {
    window.open(c,
                    'comments',
                    'width=480,height=480,scrollbars=yes,status=yes');
}

function OpenTrackback (c) {
    window.open(c,
                    'trackback',
                    'width=480,height=480,scrollbars=yes,status=yes');
}

var newWindow = null;

function closeWin(){
	if (newWindow != null){
		if(!newWindow.closed)
			newWindow.close();
	}
}

function popUpWin(url, type, strWidth, strHeight){
	
	closeWin();
	
	if (type == "fullScreen"){
		strWidth = screen.availWidth - 400;
		strHeight = screen.availHeight - 200;
	}
	
	var tools="";
	if (type == "standard" || type == "fullScreen") tools = "resizable,toolbar=yes,location=yes,scrollbars=yes,menubar=yes,width="+strWidth+",height="+strHeight+",top=0,left=0";
	if (type == "console") tools = "resizable,toolbar=no,location=no,scrollbars=no,width="+strWidth+",height="+strHeight+",left=0,top=0";
	newWindow = window.open(url, 'newWin', tools);
	newWindow.focus();
}

function popUp(what)
{
	if (document.getElementById)
	{
		var writePop = window.open('','_blank','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=50,height=50');
		
		var popTop = '';
		popTop += '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\n';
		popTop += '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n';
		popTop += '\n';
		popTop += '<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">\n';
		popTop += '<head>\<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />\n<meta http-equiv="imagetoolbar" content="false" />\n<\script>\n';
		popTop += 'function resizeZoomer(){\n';
		popTop += 'document.getElementById(\'loading\').style.display=\'none\';\n';
		popTop += 'document.getElementById(\'image\').style.visibility=\'visible\';\n';
		popTop += 'var sizeX = document.getElementById(\'image\').offsetWidth+80;\n';
		popTop += 'var sizeY = document.getElementById(\'image\').offsetHeight+105;\n';
		popTop += 'self.resizeTo(sizeX,sizeY);\n';
		popTop += '}\n';
		popTop += '\<\/script>\n';
		popTop += '<title>Image Zoom</title>\n';
		popTop += '</head>\n';
		popTop += '<body onload="resizeZoomer();" style="margin: 15px 2px 20px 2px; text-align: center; font: normal 10px verdana; color: #666; background: #fff;">\n';
		popTop += '<img id="loading" style="display: block;" src="../../i/loading.gif" width="60" height="10" alt="loading" />\n';
		popTop += '<a href="javascript:self.close();" onmousedown="self.close();" title="click to close"><img id="image" style="visibility: hidden; padding: 2px; border: 2px solid #eee;" src="' + what + '" alt="click to close" border="0" /></a>\n';
		popTop += '<\script>\n';
		popTop += 'document.getElementById(\'image\').onload = resizeZoomer;\n';
		popTop += '<\/script>\n';
		popTop += '</body>\n';
		popTop += '</html>\n';
		
		popRocks = writePop.document;
		popRocks.open();
		popRocks.write(popTop);
		popRocks.close();
	}
	else return true;
}

