// JavaScript Document
function Start(page) {
OpenWin = this.open(page, "CtrlWindow", "height=480, width=620, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no");
}
var myWindow;
function openCenteredWindow(url, width, height) {
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + 
        ",status,resizable,left=" + left + ",top=" + top + 
        ",screenX=" + left + ",screenY=" + top;
    myWindow = window.open(url, "subWind", windowFeatures);
}

// ADD EVENT TO OBJECT
function addEvent( obj, type, fn ){  // the add event function
	if (obj.addEventListener) obj.addEventListener( type, fn, false );
	else if (obj.attachEvent) {
	  obj["e"+type+fn] = fn;
	  obj[type+fn] = function() {
		obj["e"+type+fn]( window.event );
	  };
	  obj.attachEvent( "on"+type, obj[type+fn] );
	}
}



function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}
var myWindow;
function openCenteredWindow(url, width, height) {
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + 
        ",status,resizable,left=" + left + ",top=" + top + 
        ",screenX=" + left + ",screenY=" + top;
    myWindow = window.open(url, "subWind", windowFeatures);
}

// For charts
function openWin(loc, w, h) {
	var windowFeatures = "width=" + w + ",height=" + h + 
        ",status,resizable,scrollbars=yes";
	var newWin = window.open(loc, "subWind", windowFeatures);
	newWin.window.focus();
}

