
function popupWin(w,h,target,page)
{
   //get the width and height of the window
	var wide = w;
	var high = h;
	
	//this gets the total available width and height of the users screen
	screen_height = window.screen.availHeight;
	screen_width = window.screen.availWidth; 

	//this gets the left and top point by saying total width of the screen divided by 2 (center), minus the width of your window divided by 2, which make its center point the middle of the screen. Same for the top
	left_point = parseInt(screen_width/2)-(wide/2); 
	top_point = parseInt(screen_height/2)-(high/2)-20; 

	//just doing a simple popup window here, but plugging your info into it, and setting the top and left corners to be our calculated points that will center your window.
	win = window.open(page, target, 'width='+wide+',height='+high+',left='+left_point+',top='+top_point+',toolbar=no,location=no,scrollbars=1,status=no,resizable=yes,fullscreen=no'); 
	//make sure your window is in the front 
	win.focus(); 
}	

