// Function to build a popup window

//Function to open a popup
function openPopup(popupURL,cancelURL,completeURL,popupTop,popupLeft,popupWidth,popupHeight,popupAttrs) {

	var baseURL = 'http://'+location.hostname+'/';

	if (!popupTop)         { popupTop         = 20};
	if (!popupLeft)        { popupLeft        = 20};
	if (!popupWidth)       { popupWidth       = 640};
	if (!popupHeight)      { popupHeight      = 480};

	cancelURL = baseURL+cancelURL;
	completeURL = baseURL+completeURL;

	if (popupURL.indexOf('?') > 0) {
		popupURL = popupURL+"&_cancel="+escape(cancelURL)+"&_complete="+escape(completeURL)
	} else {
		popupURL = popupURL+"?_cancel="+escape(cancelURL)+"&_complete="+escape(completeURL)
	}
	
	if (isNetscape) {
		popupWin = window.open(popupURL, "emailmadeeasy", popupAttrs);
		popupWin.blur();
		popupWin.moveTo(popupTop,popupLeft);
		popupWin.resizeTo(popupWidth,popupHeight);
		popupWin.focus();
	} else {
		var attrs = new Array;
		attrs[0] = popupAttrs;
		attrs[1] = "left="+popupLeft+",top="+popupTop+",width="+popupWidth+",height="+popupHeight;
		var attrStr = attrs.join(', ');
		popupWin = window.open(popupURL, "emailmadeeasy", attrStr);
		popupWin.focus();
	}

}

function popUp(objAnchor, iWidth, iHeight, iLeft, iTop, sOptions) {
  if (typeof(objAnchor) == 'string'){
    var sHref = objAnchor;
  } 
  else var sHref = objAnchor.href;
	var sTarget = objAnchor.target;
	iWidth = (iWidth > 0) ? iWidth : 640;
	iHeight = (iHeight > 0) ? iHeight : 640;
	iLeft= (iLeft > 0) ? iLeft : 25;
	iTop = (iTop > 0) ? iTop : 25;
	sOptions = (sOptions && sOptions != '') ? sOptions : 'scrollbars=no,status=no';
	
	sOptions = 'top='+iTop+','+sOptions;
	sOptions = 'left='+iLeft+','+sOptions;
	sOptions = 'height='+iHeight+','+sOptions;
	sOptions = 'width='+iWidth+','+sOptions;
	
	var objWin = window.open(sHref,sTarget,sOptions);
}