/* FUNCTIONS FOR ACTION SCREEN - PlayerGroupEdit */

var extArray;
var extList;
var grouptypeid_private_closed = '';

function fn_ShowIDInfo (dividinfo, aidinfo) {
	if (document.getElementById(dividinfo).className == "hiddenSection") {
		tmp = fn_ShowSection(dividinfo,true);
		document.getElementById(aidinfo).innerHTML = "[ - ]";
	} else {
		tmp = fn_ShowSection(dividinfo,false);
		document.getElementById(aidinfo).innerHTML = "[ + ]";
	}
}

function RemovePictureFile() {
	if (confirm('This will remove the picture from this group.  Continue?')) {
		document.form.command.value="removepicture";
		document.form.submit();
	}
}

function CheckForm(){
	document.form.newpicturefilename.value = document.form.newpicturefile.value;
	//fn_CheckFileType ( fileName, fileControl, fileTitle, required, showAlert, fileExtArray, fileExtList )
	return fn_CheckFileType(document.form.newpicturefilename.value,document.form.newpicturefile,'Picture',false,true,extArray,extList);
}

function fn_GroupTypeID() {
	if (document.form.grouptypeid.value != grouptypeid_private_closed) {
		tmp = fn_ShowSection('divcontributors',true);
	} else {
		tmp = fn_ShowSection('divcontributors',false);
	}
	if (fn_AllowParentConfig_Get(document.form.grouptypeid.value) == "Y") {
		tmp = fn_ShowSection('divmaxgroupplayers',true);
	} else {
		tmp = fn_ShowSection('divmaxgroupplayers',false);
	}
	if (fn_AllowApply_Get(document.form.grouptypeid.value)) {
		tmp = fn_ShowSection('divapply',true);
	} else {
		tmp = fn_ShowSection('divapply',false);
	}
}

function SaveForm(btnSubmit) {
	var bCheckForm = CheckForm(); 
	if (bCheckForm) {
		btnSubmit.disabled = true;
		document.form.command.value='save';
	}
	return bCheckForm;
}

