// JavaScript Document

var popWindow;
// declare a new function, newWindow
function newWindow(url) {

// declare variable winURL, setting it to the name of the PHP file
// and accompanying data.
	var winURL = url;
// If the popup window does not exist, or it is currently closed,
// open it.

	
	if (!popWindow || popWindow.closed) {
		
		if(screen.width > 800){
			popWindow = window.open(winURL,'popWindow','dependent,toolbar=no,location=no,scrollbars=yes,resizable=yes,width=875,height=755');
		}else{
			popWindow = window.open(winURL,'popWindow','dependent,toolbar=no,location=no,scrollbars=yes,resizable=yes,width=800,height=600');
		}
	}
// If the popup window is already open, make it active and update
// its location to winURL.
	else {
		popWindow.focus();
		popWindow.location = winURL;
	}
}