// POPUP functions --------------------------------------------------------------
var Popup = {
	createImgPopup: function (url, wname, popW, popH) {
			var	w = window.screen.width;
   			var	h = window.screen.height;
   			var scrollbar_display = ((popW > w) || (popH > h)) ? 1 : 0;
   		
   			// If scrollbars are to be displayed, increase width of window by standard V-Scrollbar width
   			if (scrollbar_display) { popW = popW + 16; }
   			
   			// If popup Height or Width is greater than screen resolution, then constrain it to the screen
   			if (popW > w) { popW = w; }
   			if (popH > h) { popH = (h - (28 + 24)); } // Adjust for taskbar/titlebar also (estimated heights)
   								
			var leftPos = ((w - popW)/2);
			var topPos = ((h - popH)/2);
					
		window.open('', wname, 'width=' + popW + ', height=' + popH + ' ,top=' + topPos + ', left=' + leftPos + 'resizable=0, scrollbars=' + scrollbar_display);
	},
	
	createPopup: function (url, wname, popW, popH) {
			var	w = window.screen.width;
   			var	h = window.screen.height;
   			var scrollbar_display = 1;
   		
   			// If scrollbars are to be displayed, increase width of window by standard V-Scrollbar width
   			if (scrollbar_display) { popW = popW + 16; }
   			
   			// If popup Height or Width is greater than screen resolution, then constrain it to the screen
   			if (popW > w) { popW = w; }
   			if (popH > h) { popH = (h - (28 + 24)); } // Adjust for taskbar/titlebar also (estimated heights)
   								
			var leftPos = ((w - popW)/2);
			var topPos = ((h - popH)/2);
					
		window.open(url, wname, 'width=' + popW + ', height=' + popH + ' ,top=' + topPos + ', left=' + leftPos + 'resizable=0, scrollbars=' + scrollbar_display);
	}
};