var newWindow = null;
var newWindowIndex = 0;

function popUpWindow(url, width, height) {

	if (!newWindow || newWindow.closed) {
	newWindow = window.open(url, 'search_window_' + newWindowIndex++, 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=1,width='+(width+1)+',height='+(height+1)+',left = 25,top = 25');
	} else {
	newWindow.focus();
	}
}

//following is for mailto replacement popups
function popupContact(url, email, language) {
	var width = 600;
	var height = 500;
	if (!newWindow || newWindow.closed) {
		newWindow = window.open(url + '?lang=' + language + '&contact_to=' + email + "&givenContact=1", 'compose_window_' + newWindowIndex++, 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=1,width='+(width+1)+',height='+(height+1)+',left = 25,top = 25');
	} else {
		newWindow.focus();
	}
}

//following is for email to a friend popup
function popupEmailPage(url) {
	var width = 600;
	var height = 500;
	if (!newWindow || newWindow.closed) {
		newWindow = window.open(url, 'compose_window_' + newWindowIndex++, 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=1,width='+(width+1)+',height='+(height+1)+',left = 25,top = 25');
	} else {
		newWindow.focus();
	}
}

//following is for print this page popup
function popupPrintPage(url) {
	var width = 750;
	var height = 580;
	if (!newWindow || newWindow.closed) {
		newWindow = window.open(url, 'print_window_' + newWindowIndex++, 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=1,width='+(width+1)+',height='+(height+1)+',left = 25,top = 25');
	} else {
		newWindow.focus();
	}
}

