var range_guide_1 = " (1 - 10)";

if(info.NO_OF_STNS) {
   var range_guide_2 = " (1 - "+info.NO_OF_STNS+")";
	if(info.NO_OF_STNS < 100) {
		var maxInputRange = info.NO_OF_STNS;
	} else {
		var maxInputRange = "100";
	}
} else {
   var range_guide_2 = "";
}

if(info.PHASE >= 2.2) {
	var pgm237_ipcr_halicense  = {key: "pgm237_ipcr_halicense", contents: [{name: "IPCR_HATYPE", value: "", select:[{value: "1", option: langs.getText("p237","ipcr_halicense")}, {value: "2", option: langs.getText("p237","ipcr_halicense")}], message: "", show: 0}, {text: " : "}, {name: "IPCR_HALICENSE_CUR", value: "", text: 1}, {text: " / "+langs.getText("common","total")+"("}, {name: "IPCR_HALICENSE_TOT", value: "", text: 1}, {text: ") "},
																	 {name: "IPCR_HALICENSE", value: "", textfield: [{size: 10}], message: ""}]};
} else {
	var pgm237_ipcr_halicense = {};
}

define(
    {elements:[
        {name:"tab1", tab: [
            {key: "pgm237_button", button: [{btn: langs.getText("common","btn_save"), btn_type: "btn_save auth_write"}]},
            {key: "pgm222_preload", preload: [{name: "RANGE_TYPE_1", range_type: 2}, {text: langs.getText("p237","enter_ipcrnum")+range_guide_1+" : "}, {name: "RANGE_1_0", value: "", textfield: [{max: 8, size: 10}], message: "", default_range: "1"}, {br: 1}, {name: "RANGE_TYPE_2", range_type: 2}, {text: langs.getText("p237","enter_agentorder")+range_guide_2+" : "}, {name: "RANGE_2_1", value: "", textfield: [{max: 40, size: 50}], message: "", default_range: getDefaultRange(range_guide_2, maxInputRange), help: langs.re_toolTip()+"<br><br>"+langs.getText("toolTip","maxinputrange")+" - "+maxInputRange}, {btn: langs.getText("common","load"), btn_type: "btn_load"},
															 langs.Range_Error_Table(),
															 {endload: 1}, {br: 2}, {text: langs.getText("p237","ipcr_num")+" "}, {name: "RANGE_VIEW_1", value: "", text: 1}, {br: 1}, {text: langs.getText("p237","agent_order")+" "}, {name: "RANGE_VIEW_2", value: "", text: 1}, {br: 2}]},
				{key: "pgm237_ipcr_license", contents: [{name: "IPCR_TYPE", value: "", select:[{value: "1", option: langs.getText("p237","ipcr_license")}, {value: "2", option: langs.getText("p237","third_license")}], message: "", show: 0}, {text: " : "}, {name: "IPCR_LICENSE_CUR", value: "", text: 1}, {text: " / "+langs.getText("common","total")+"("}, {name: "IPCR_LICENSE_TOT", value: "", text: 1}, {text: ") "},
																	 {name: "IPCR_LICENSE", value: "", textfield: [{size: 10}], message: ""}]},
				pgm237_ipcr_halicense,													 
            {key: "pgm237_mktbl", table: [{label: langs.getText("common","index"), sort: "num"}, {label: langs.getText("p237","callrec_aid"), sort: "str"}, {label: langs.getText("p237","callrec_agttype")}, {label: langs.getText("p237","callrec_destval")}, {label: langs.getText("p237","callrec_anncval")}],
                              data_form: [{key: "", tr: [{name: "CALLREC_INDEX", value: "", label: 1},
                                                         {name: "CALLREC_AID", value: "", textfield: [{max: 12, size: 10}], message: "", cont: 0},
                                                         {name: "CALLREC_AGTTYPE", value: "", select: [{value: "0", option: langs.getText("common","info_stn")}, {value: "1", option: langs.getText("common","co_line")}, {value: "2", option: langs.getText("common","not_assigned")}], message: "", cont: 0},
                                                         {name: "CALLREC_DESTVAL", value: "", textfield: [{max: 8, size: 10}], message: "", cont: 0},
			                                             {name: "CALLREC_ANNCVAL", value: "", textfield: [{max: 1, size: 1}], message: "", cont: 0}]}],
            
                          variable_data: [{}]}
        ]}
    ]}
);
