//CENTERED POPUP CODE
function centeredPopup(url, name, width, height, scrollbars, toolbar, menubar, location, resizable, status) {
    var winLeft = (screen.width - width) / 2;
    var winTop = (screen.height - height - 100) / 2;
    winprops = 'width='+width+',height='+height+',top='+winTop+',left='+winLeft+',scrollbars='+scrollbars+',toolbar='+toolbar+',menubar='+menubar+',location='+location+',resizable='+resizable+',status='+status+''
    win = window.open(url, name, winprops)
    
    if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function Xpopup(url,windowname,width,height,scrollbars, toolbar, menubar, location, resizable, status) {
	width=(width)?width:screen.width/3;
	height=(height)?height:screen.height/3;
	var screenX = (screen.width/2 - width/2);
	var screenY = (screen.height/2 - height/2)-100;
	var features= "width=" + width + ",height=" + height;
	features += ",screenX=" + screenX + ",left=" + screenX;
	features += ",screenY=" + screenY  +",top=" + screenY;
	features += ",scrollbars="+scrollbars+",toolbar="+toolbar+",menubar="+menubar+",location="+location+",resizable="+resizable+",status="+status ;
	//alert("Features"+features);
	var mywin=window.open(url, windowname, features);
	if (mywin) 
		mywin.focus();
	return mywin;
}