// JavaScript Document

function imgPopup(imgSrc) {
	leftPos = 0;
	topPos = 0;
	if (screen) {
		leftPos = (screen.width / 2) - 400;
		topPos = (screen.height / 2) - 300;
	}
	var newWindow = window.open('','','location=0,status=0,scrollbars=0,width=800,height=600,left=' + leftPos + ',top=' + topPos);
	newWindow.document.write('<html><head>');
	newWindow.document.write('<style>body,html{margin:0px;padding:0px}</style>');
	newWindow.document.write('</head><body>');
	newWindow.document.write('<img src="../_images/' + imgSrc + '" onload="javascript:window.resizeBy(document.images[0].width - window.innerWidth, document.images[0].height - window.innerHeight);window.resizeBy(document.images[0].width - window.document.body.clientWidth, document.images[0].height - window.document.body.clientHeight);" />');
	newWindow.document.write('</body></html>');
	newWindow.document.close();
}

function imgThumbnail(imgSrc) {
	document.write('<img src="../_php/phpThumb/phpThumb.php?src=../../_images/' + imgSrc + '&w=160&h=120" />');
}

function replaceWith(type, newCode) {
	if (type == 'image') {
		newCode = '<img src="../_images/' + newCode + '" />';
	} else if (type == 'page') {
		newCode = '<iframe width="100%" height="100%" frameborder="0" marginheight="0" marginwidth="0" src="' + newCode + '"></iframe>';
	}
	var contentDiv = document.getElementById('right_content');
	contentDiv.innerHTML = newCode;
}