// Screen size

var tgtX = 400;
var tgtY = 320;

var win1 = new Array (tgtX, tgtY);

function ContextOpenW(whichPage) {
  var winHandle;
  winHandle = window.open(whichPage ,'popUp','scrollbars=yes,resizable=no,menubar=no,location=no,personalbar=no,titlebar=no,toolbar=no,status=yes');
  winHandle.resizeTo(win1[0],win1[1]);
  self.focus();
  winHandle.focus();
  return;
}

function openWin(url, width, height) {
	var w = 680, h = 540;
	var popupDate = new Date();
	var popupName = 'popup' + popupDate.getTime();
	
	if (screen != null && screen.availWidth != null) {
		w = screen.availWidth;
		h = screen.availHeight;
	}
	
	var popW = width, popH = height;
	var leftPos = (w - popW) / 2, topPos = (h - popH) / 2;
	
	window.open(url, popupName, 'width='+width+',height='+height+',toolbar=no,menubar=no,status=no,scrollbars=auto,resize=no,top='+topPos+',left='+leftPos);
}

function openWin2(url, width, height) {
	var w = 480, h = 340;
	var popupDate = new Date();
	var popupName = 'popup' + popupDate.getTime();
	
	if (screen != null && screen.availWidth != null) {
		w = screen.availWidth;
		h = screen.availHeight;
	}
	
	var popW = width, popH = height;
	var leftPos = (w - popW) / 2, topPos = (h - popH + 400) / 2;
	
	window.open(url, popupName,'width='+width+',height='+height+',toolbar=no,menubar=no,status=no,scrollbars=no,resize=no,top='+topPos+',left='+leftPos);
}

function openWinS(url, width, height) {
	var w = 480, h = 340;
	var popupDate = new Date();
	var popupName = 'popup' + popupDate.getTime();
	
	if (screen != null && screen.availWidth != null) {
		w = screen.availWidth;
		h = screen.availHeight;
	}
	
	var popW = width, popH = height;
	var leftPos = (w - popW) / 2, topPos = (h - popH) / 2;
	
	window.open(url, popupName,'width='+width+',height='+height+',toolbar=no,menubar=no,status=no,scrollbars=yes,resize=yes,top='+topPos+',left='+leftPos);
}

var doSurvey = 1;

function showSurvey(){
	if(doSurvey == 1) {
    var popURL = "/survey.cfm";
    var popTitle = "popupSurvey";
    var popWidth = 330;
    var popHeight = 335;
    var popParms = "scrollbars=no,menu=no,left=2000,top="+popHeight+",screenX=2000,screenY="+popHeight+",resizeable=no,status=no,width="+popWidth+",height="+popHeight;

    var surveyWindow = window.open(popURL, popTitle, popParms);
    self.focus();
	}
}
