function viewImage(id,width,height) {
	LeftPosition = (screen.width) ? (screen.width-width)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-height)/2 : 0;
	OpenWin = this.open('/view.php?id='+id,"PicWindow","toolbar=no,width="+width+",height="+height+",left="+LeftPosition+",top="+TopPosition+",directories=no,status=no,scrollbars=no,resize=no,menubar=no")
}

function viewPopup(id,width,height) {
	LeftPosition = (screen.width) ? (screen.width-width)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-height)/2 : 0;
	OpenWin = this.open('/viewpopup.php?id='+id,"PopupWindow","toolbar=no,width="+width+",height="+height+",left="+LeftPosition+",top="+TopPosition+",directories=no,status=no,scrollbars=no,resize=no,menubar=no")
}

function popupImage(image, width, height, title, alt)
{
	lPos = (screen.width) ? (screen.width-width)/2 : 0;
	tPos = (screen.height) ? (screen.height-height)/2 : 0;
	title = title ? title:'Image Popup';
	alt = alt ? alt:'';

	newWin = this.open('', title, "toolbar=no,width="+width+",height="+height+",left="+lPos+",top="+tPos+",directories=no,status=no,scrollbars=no,resize=no,menubar=no");
	var tmp = newWin.document;

	tmp.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1-transitional.dtd">');
	tmp.write('<html xmlns="http://www.w3.org/1999/xhtml"><head><title>'+title+'</title>');
	tmp.write('<style type="text/css">* {padding:0px; margin:0px;}</style></head>');
	tmp.write('<body><img src="'+image+'" width="'+width+'" height="'+height+'" alt="'+alt+'" /></body></html>');

	tmp.close();
	newWin.focus();
}

function EmailPage() {
    LeftPosition = (screen.width) ? (screen.width-450)/2 : 0;
    TopPosition = (screen.height) ? (screen.height-250)/2 : 0;
    OpenWin = 
    this.open("/emailpage.php?page="+location.href,"EmailWindow","toolbar=no,width=450,height=250,left="+LeftPosition+",top="+TopPosition+",directories=no,status=no,scrollbars=no,resize=no,menubar=no")
}
