// Title: PDR calculator
// Author Matt Stinson

// if two digit year input dates after this year considered 20 century.
var NUM_CENTYEAR = 30;
// is time input control required by default
var BUL_TIMECOMPONENT = false;
// are year scrolling buttons required by default
var BUL_YEARSCROLL = true;

var calculators = [];
var RE_NUM = /^\-?\d+$/;

function ec_calc1(obj_target) {

	// assigning methods
	this.popup = ec_popup1;

	// validate input parameters
	if (!obj_target)
		return cal_error("Error calling the calculator: no target control specified");
	if (obj_target.value == null)
		return cal_error("Error calling the calculator: parameter specified is not valid target control");
	
	this.target = obj_target;
	// register in global collections
	this.id = calculators.length;
	calculators[this.id] = this;	
}

function ec_popup1 () {
	
	var obj_calwindow = window.open('resources/ec_calc.html?id=' + this.id, 'ECWizard', "width=800, height=800, status=1,resizable=yes,top=200,left=200,dependent=yes,alwaysRaised=yes, scrollbars=yes");

	obj_calwindow.opener = window;
	obj_calwindow.focus();

}


function cal_error (str_message) {
	alert (str_message);
	return null;
}
