
var popupWin = '';
var imgWinA = '';
var imgWinB = '';

function openImgWin(myImage,myWidth,myHeight,origLeft,origTop) {
	myHeight += 30;
	myWidth += 20;
	imgWin = window.open(myImage,'image','height='+myHeight+',width=' + myWidth + ',toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
	imgWin.moveTo(origLeft,origTop);
	imgWin.focus();
}

function openWindow(url, name, rs, w, h) {
	if (!popupWin.closed && popupWin.location) {
		 popupWin.location.href = url;
		 popupWin.focus(); 
	} else {
	  var resize = "";
	  if (rs) { resize = "resizable,"; }
  	popupWin = window.open(url, name, 'scrollbars,menubar,' + resize + 'width=' + w + ',height=' + h);
	}
}


function openImgWinA(url, name, rs, w, h, leftSide, topSide) {
	w += 30;
	h += 20;
	if (!imgWinA.closed && imgWinA.location) {
		 imgWinA.location.href = url;
		 imgWinA.focus(); 
	} else {
	  var resize = "";
	  if (rs) { 
		   resize = "resizable,"; 
	  }
	  imgWinA = window.open(url, name, +'toolbar=no,scrollbars=yes,menubar=no,' + resize + 'width=' + w + ',height=' + h);
	  imgWinA.moveTo(leftSide,topSide);
	  imgWinA.focus();				
	}
}



function openImgWinB(url, winname, rs, w, h, leftSide, topSide) {
	w += 30;
	h += 20;
	if (!imgWinB.closed && imgWinB.location) {
		imgWinB.location.href = url;
		imgWinB.focus(); 
	} else {
		var resize = "";
		if (rs) { 
			resize = "resizable,"; 
		}
		imgWinB = window.open(url, name, + 'toolbar=no,scrollbars=yes,menubar=no,' + resize + 'width=' + w + ',height=' + h);
		imgWinB.moveTo(leftSide,topSide);
		imgWinB.focus();				
	}
}

