var win = null;

function popup (href) {
	var w = 740;
	var h = 550;

	var x = (screen.width) ? (screen.width - w)/2 : 0;
	var y = (screen.height) ? (screen.height - h)/2 + 50 : 0;

	var chrome = "width=" + w + ", height=" + h + ", left=" + x + ", top=" + y + ", scrollbars=yes, resizable=no, status=no";
//	alert('Popup: '+href); //return;
//	win = window.open (href, 'pop','');
//	win = window.open (href, '', chrome);
 	win = window.open (baseHref+href, '', chrome);
	win.focus();
	
}


function popupPlain (href) {
	var w = 740;
	var h = 550;

	var x = (screen.width) ? (screen.width - w)/2 : 0;
	var y = (screen.height) ? (screen.height - h)/2 : 0;

	var chrome = "width=" + w + ", height=" + h + ", left=" + x + ", top=" + y + ", scrollbars=no, resizable=no, status=no";
 	win = window.open (baseHref+href, '', chrome);
	win.focus();
	
}

function popupSized (href, w, h) {
	var w = (!xDef(w) ? 740 : w);
	var h = (!xDef(h) ? 550 : h);

	var x = (screen.width) ? (screen.width - w)/2 : 0;
	var y = (screen.height) ? (screen.height - h)/2 : 0;

	var chrome = "width=" + w + ", height=" + h + ", left=" + x + ", top=" + y + ", scrollbars=yes, resizable=no, status=no";
 	win = window.open (baseHref+href, '', chrome);
	win.focus();
}

function popupSizedNoBase (href, w, h) {
	var w = (!xDef(w) ? 740 : w);
	var h = (!xDef(h) ? 550 : h);

	var x = (screen.width) ? (screen.width - w)/2 : 0;
	var y = (screen.height) ? (screen.height - h)/2 : 0;

	var chrome = "width=" + w + ", height=" + h + ", left=" + x + ", top=" + y + ", scrollbars=yes, resizable=no, status=no";
 	win = window.open (href, '', chrome);
	win.focus();
}

function popupNew(href){
	win = window.open(href,'','');
}

function resizeWin (w, h) {
	var x = (screen.width) ? (screen.width - w)/2 : 0;
	var y = (screen.height) ? (screen.height - h)/2 : 0;
	this.resizeTo(w, h);
	this.moveTo(x, y);
}


function refreshParent(){
	
	window.opener.location.reload();
	
}


