// JavaScript Document
<!--
//////////////////////////////////////////////////////////////////////////////
//
// JavaScript PopUp Window Script - 
//
// Opens a new child window, takes the following parameters:
//  loc = URL
//  name = window name
//  w = width
//  h = height
//  pos = position ('left', 'right', 'center'
//  scroll = include scrollbars ('yes' or 'no')
//  toolbar = include scrollbars ('yes' or 'no')
//  menubar = include scrollbars ('yes' or 'no')
//  addressbar = include scrollbars ('yes' or 'no')
//  directories = include scrollbars ('yes' or 'no')
//  resize = include scrollbars ('yes' or 'no')
//  status = include scrollbars ('yes' or 'no')
//
//////////////////////////////////////////////////////////////////////////////
function popUpWindow(loc,name,w,h,pos,scroll,toolbar,menubar,addressbar,directories,resize,status)
{
  goWhere = loc;
  windowName = name;
  wWidth = w;
  wHeight = h;
  
  sBars = scroll;
  tBar = toolbar;
  mBar = menubar;
  aBar = addressbar;
  dBar = directories;
  statusBar = status;
  canResize = resize;
  
  if(pos=="center"){
    leftLoc = window.screen.width/2 - wWidth/2;
    topLoc = window.screen.height/2 - wWidth/2;
    }
  else if(pos=="left"){
    leftLoc = 0;
    topLoc = 0;
    }
  else if(pos=="right"){
    leftLoc = window.screen.width - wWidth - 10;
    topLoc = 0;
    }

  return window.open(goWhere,windowName,config='height='+wHeight+',width='+wWidth+',left='+leftLoc+',top='+topLoc+',toolbar='+tBar+',menubar='+mBar+',scrollbars='+sBars+',resizable='+canResize+',location='+aBar+',directories='+dBar+',status='+statusBar+'');
  
}


//////////////////////////////////////////////////////////////////////////////
//
// Wrapper for popupWindow() function
// Accepts the same parameters, adds two:
//		bReOpen: if true closes and opens an existing window, if false, re-uses existing open window
//		theWin: a page var of the new/existing window
//
//////////////////////////////////////////////////////////////////////////////

function popUp(loc,name,w,h,pos,scroll,toolbar,menubar,addressbar,directories,resize,status,bReOpen,theWin) {
	
	if ( theWin != null ) {
		if (theWin.closed) {
			theWin = popUpWindow(loc,name,w,h,pos,scroll,toolbar,menubar,addressbar,directories,resize,status); }
		else { 
		   if (bReOpen) {
		      theWin.close();
		      theWin = popUpWindow(loc,name,w,h,pos,scroll,toolbar,menubar,addressbar,directories,resize,status); }
		   else { 
		      theWin.location = loc;
		      theWin.focus(); }
		}
	}
	else { 
		theWin = popUpWindow(loc,name,w,h,pos,scroll,toolbar,menubar,addressbar,directories,resize,status);
	}
	
  return theWin;
}	
var rememberWin;

function showCoupon(myID) 
{
	rememberWin = popUp('/trainerinsite/pages/Survey.aspx?SID=' + myID,'rememberWin',600,600,'center','yes','no','no','no','no','yes','no',false,rememberWin);
}

//-->