function popupImage(URL,WIDTH,HEIGHT) {
	day = new Date();
	id = day.getTime();

	if(!WIDTH) { WIDTH = 400;}
	if(!HEIGHT) { HEIGHT = 300;}

	//printablePage = window.open(URL, '" + id + "', 'toolbar=1,directories=0,scrolling=auto,location=0,statusbar=0,menubar=0,resizable=0,width=665,height=600');

    // calculate the center of the page
    //x = (screen.availWidth - width) / 2;
    //y = (screen.avaiHeight - height) / 2

    // move to the center of the page
    //printablePage.moveTo(x, y);
	//eval("page" + id + printablePage);
	//
	eval("page" + id + " = window.open('" + URL + "', '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=" + WIDTH + ",height=" + HEIGHT + "');");
}

function openWindow (windowTarget, windowTitle, windowType, width, height, windowOptions) {
	if(!width) { width = 400;}
	if(!height) { height = 300;}
	
	if (!windowOptions) {windowOptions = 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width='+width+',height='+height;}
	
	switch (windowType) {
		case "HREF": 
			newWindow = window.open(windowTarget, '', windowOptions);
			newWindow.focus();

		break
		case "IMG": 
			newWindow = window.open('', '', windowOptions);
			windowTarget='<html><head><title>'+windowTitle+'</title></head><body><center><img src='+windowTarget+' border=0></center></body></html>';
			newWindow.document.write(windowTarget);
			//newWindow.document.bgColor="lightblue"
			//newWindow.document.close();
			newWindow.focus();
		break
		default:
			newWindow = window.open('', '', windowOptions);
			windowTarget='<html><head><title>'+windowTitle+'</title><link rel=stylesheet type=text/css href=config/css/style_main.css></head><body><center>'+windowTarget+'</center></body></html>';
			newWindow.document.write(windowTarget);
			//newWindow.document.bgColor="lightblue"
			//newWindow.document.close() 
			newWindow.focus();
		break
	}
}

