var newWindow;
var newHeight = 400;;
var newWidth = 400;
var windowHeight = window.screen.availHeight;
var windowWidth = window.screen.availWidth;


function popNewWindow(width, height, url)
{      
	//half of the window width
	var left_point = parseInt(windowWidth/2) - parseInt(width/2);
	var top_point = parseInt(windowHeight/2) - parseInt(height/2);

	//only resize if the window is not already open
	var resize = ((newWindow == null) || (newWindow.closed == true));
	if (resize)
	{
		if (width != null) newWidth = width;
		if (height != null) newHeight = height;
	}

	//open the window and redirect to new url with query string
    //url = url + "?searchStoreNumber=" + storeNumber + "&searchSkn=" + skn;
	newWindow = window.open(url, 'newWindow',
 			'directories=no,location=no,menubar=no,resizable=yes,status=no,' +
			'toolbar=no,width=400,scrollbars=yes,dependant=no, ');
	//resize of needed
	if (resize == true) newWindow.resizeTo(newWidth, newHeight);
	//bring it to the front
	newWindow.focus();
	newWindow.moveTo(left_point, top_point);
}
