function popUpImage(path,w,h,title,scroll,resize) {
	if (resize == 1){
		resize = 'yes'
	}
	else {
		resize = 'no'
	}
	if (scroll == 1){
		scroll = 'yes'
	}
	else {
		scroll = 'no'
	}


	popupImg = window.open('','popupImg'+w+h,config='width='+w+',height='+h+',toolbar=no,menubar=no,scrollbars='+scroll+',resizable='+resize+',location=no,status=no');

		popupImg.document.write('<html><head><title>');
		popupImg.document.write('');
		popupImg.document.write('</title>');
		popupImg.document.write('<style>body {margin:0;}</style>');
		popupImg.document.write('</head>');
		popupImg.document.write('<body>');
		popupImg.document.write('<a href="javascript:window.close();opener.focus();">');
		popupImg.document.write('<img src="'+path+'" width="'+w+'" height="'+h+'" border="0" alt="'+title+'" title="'+title+'">');
		popupImg.document.write('</a>');
		popupImg.document.write('</body>');
		popupImg.document.write('</html>');
		popupImg.document.close();
		popupImg.focus();
}

function RePopUp(oLink,scroll,resize) {
	if (oLink.target == 'PopUp') {
		if (oLink.href.match(/(jpg)|(png)|(gif)$/i)) {

			win = makePopUp(oLink.href,400,330,scroll,resize);
			win.document.open("text/html");
			win.document.write('<html><head><title></title></head>');
			win.document.write('<script language="JavaScript" type="text/javascript">');
			win.document.write('function GetLayer(name) {');
			win.document.write('return ((eval(document.all))?(document.all[name]):(document.getElementById(name)))');
			win.document.write('} function doR () {');

			win.document.write('if (GetLayer(\'pimg\').width > screen.availWidth)');
			win.document.write('{ var wid = screen.availWidth - 100 }');
			win.document.write('else { var wid = GetLayer(\'pimg\').width + 25 }');
			win.document.write('if (GetLayer(\'pimg\').height > screen.availHeight)');
			win.document.write('{ var hei = screen.availHeight - 100 }');
			win.document.write('else { var hei = GetLayer(\'pimg\').height + 35}');

			win.document.write('window.resizeTo(wid,hei);');

			win.document.write('var halfWid = ((screen.availWidth-GetLayer(\'pimg\').width ) / 2);');
			win.document.write('var halfHei = ((screen.availHeight-GetLayer(\'pimg\').height ) / 2);');

			win.document.write('if (GetLayer(\'pimg\').width > screen.availWidth)');
			win.document.write('{ var moveWid = 50; }');
			win.document.write('else { var moveWid = halfWid }');
			win.document.write('if (GetLayer(\'pimg\').height > screen.availHeight)');
			win.document.write('{ var moveHei = 50; }');
			win.document.write('else { var moveHei = halfHei; }');

			win.document.write('window.moveTo(moveWid,moveHei);');

			win.document.write('}');
			win.document.write('</script>');
			win.document.write('<body onload="doR();" bgcolor="#feffec" style="margin:0px;text-align:center;">');
			win.document.write('<a href="#" onclick="window.close()">');
			win.document.write('<img src="'+oLink.href+'" name="pimg" id="pimg" alt="Close window" border="0"/>');
			win.document.write('</a>');
			win.document.write('</body></html>');
			win.document.close();
		} else {
			makePopUp(oLink.href,400,330,scroll,resize);
		}	
		return false;
	}
	return true;
}

function makePopUp(urlValue,widthValue,heightValue,scroll,resize) {
	if (resize == 1){
		resize = 'yes'
	} else {
		resize = 'no'
		}
	if (scroll == 1){
		scroll = 'yes'
	} else {
		scroll = 'no'
		}
	NewWidthValue=widthValue;
	NewHeightValue=heightValue;
	return window.open(urlValue, 'PopUpWindow','width='+NewWidthValue+',height='+NewHeightValue+',menubar=0,scrollbars=yes,resizable='+resize+',statusbar=no,location=no,titlebar=0,toolbar=0,status=0');
}