// JavaScript OrderLineLicenseInfo

function EditionUpgrade() {
	
	// attributes
	this._singleCover = new Array();
	this._singleUncover = new Array();
	this._floatingCover = new Array();
	this._floatingUncover = new Array();
	this._targetEditionCount = 0;

	// methods
	this.addTargetEdition = addTargetEdition;
	this.getCover = getCover;
	this.getUncover = getUncover;
}

function addTargetEdition(sc, su, fc, fu) {
	this._singleCover[this._targetEditionCount] = sc;
	this._singleUncover[this._targetEditionCount] = su;
	this._floatingCover[this._targetEditionCount] = fc;
	this._floatingUncover[this._targetEditionCount] = fu;
	
	this._targetEditionCount++;
}

function getCover(licType, index) {
	return eval("this._"+licType+"Cover")[index];
}

function getUncover(licType, index) {
	return eval("this._"+licType+"Uncover")[index];
}
// static methods
function getRadioValue(radioName) {
	radioGroup = document.getElementsByName(radioName);
	var len = radioGroup!=null ? radioGroup.length : 0;
	if (len==1) {
		return radioGroup[0].value;
	}
	for (var i=0; i<len; i++) {
		if (radioGroup[i].checked) {
			return radioGroup[i].value;
		}
	}
	return null;
}
