var newwin
var UniqueWin

function cleanupwin(){
	if (newwin!=null && !newwin.closed){
		newwin.close();
		newwin=null;
	}
}

function popwin(url,winname,width,height) {
  var leftPo = (screen.availWidth-width)/2
  var topPo = (screen.availHeight-height)/2
  if (newwin != null && !newwin.closed) {newwin.close(); newwin=null;} 
  newwin = window.open(url, winname, "scrollbars=yes,toolbar=no,status=no,location=no,menubar=no,resizable=yes,height="+height+",width="+width+",left="+leftPo+",top="+topPo)
//  newwin.focus();
  return false;
}

function popUniqueWin(url,winname,width,height) { 
  var leftPo = (screen.availWidth-width)/2
  var topPo = (screen.availHeight-height)/2
  if (UniqueWin != null && !UniqueWin.closed) {UniqueWin.close(); UniqueWin=null;} 
  UniqueWin = window.open(url, winname, "scrollbars=yes,toolbar=no,status=no,location=no,menubar=no,resizable=yes,height="+height+",width="+width+",left="+leftPo+",top="+topPo)
  UniqueWin.focus();
  return false;
}

/*
	format:
	return popUniqueWin (win, '', width, height)
*/

function adminwin(win) { // admin panel
	return popUniqueWin(win,'',760,550);
}

function profwin(win) { // show voter stats
	return popUniqueWin(win,'',680,440);
}

function addresswin(win) { // quick Address; PM read status
	if (!document.all){
		return popwin(win,'address',230,465);
	} else {
		return popwin(win,'',230,465);
	}
}

function uplwin(win) { // upload
	if (!document.all){
		return popwin(win,'uplwin',300,170);
	} else {
		return popwin(win,'',300,170);
	}
}

function previewwin(win) { // preview
	if (!document.all){
		return popwin(win,'previewwin',660,510);
	} else {
		return popwin(win,'',660,510);
	}
}

function pgdwin(win) { // pgd code helper window
	if (!document.all){
		return popwin(win,'pgdwin',660,510);
	} else {
		return popwin(win,'',660,510);
	}
}

function overpopwin(win) { // post
	return popwin(win,'','toolbar=1,scrollbars=1,status=1,location=1,menubar=1,resizable=1,height=410,width=690,left=15,top=15');
}

function abspopwin(win) { // post
	return popwin(win,'','toolbar=0,scrollbars=1,status=0,location=0,menubar=0,resizable=0,height=350,width=600,left=15,top=15');
}

function prodpopwin(win) { // post
	return popwin(win,'','toolbar=0,scrollbars=1,status=0,location=0,menubar=0,resizable=0,height=400,width=350,left=15,top=15');
}

function respopwin(win) { // forward
	return popwin(win,'','toolbar=0,scrollbars=1,status=0,location=0,menubar=0,resizable=1,height=425,width=620,left=15,top=15');
}

function logwin(win) { // login; move post to another forum window
	return popwin(win,'','toolbar=0,scrollbars=0,status=0,location=0,menubar=0,resizable=0,height=400,width=600,left=15,top=15');
}

function specpopwin(win) { // login; move post to another forum window
	return popwin(win,'','toolbar=0,scrollbars=0,status=0,location=0,menubar=0,resizable=0,height=468,width=660,left=15,top=15');
}

function helppopwin(win) { // login; move post to another forum window
	return popwin(win,'','toolbar=0,scrollbars=1,status=0,location=0,menubar=0,resizable=0,height=650,width=500,left=15,top=15');
}


<!-- Copyright 2005, Sandeep Gangadharan -->
<!-- For more free scripts go to http://sivamdesign.com/scripts/ -->
<!--
function openPopup() {
  SW=window.open('http://www.trudellmed.com/Consumers/Survey/intro.asp','Survey','scrollbars=yes,toolbar=no,resizable=1,status=no,width=625,height=450')  // change the name/path of the pop-up at left
  SW.moveTo(190,240);  // change the #s at the left to adjust the place the popup should open
}
// -->