/**
 * Communities javascript functions...
 *
 * Requires the use of trim(s) function in main.js
 *
 */
 
 

function communitiesValDel() {
	v_AreYouSure = window.confirm("Are you sure you want to delete this community?"
		+ "\n"
		+ "\n" + "Click 'OK' to delete."
		+ "\n" + "Click 'Cancel' to return without deleting.");
	if (v_AreYouSure == true) {
		return true;
	} else {
		return false;
	}
}

function communitiesValAdd(frm) {
	if (trim(frm.communityName.value) == "") {
		alert("Please type a community name before uploading.");
		return false;
	}
	
	return true;
}

function communitiesValUpdate(frm,communityId) {
	var nme = eval("frm.communityName_" + communityId + ".value");
	if (trim(nme) == "") {
		alert("Please type a community name before uploading.");
		return false;
	}
	
	return true;
}


function communitiesValUploadImage(frm) {
	if (trim(frm.pic_for_upload.value) == "") {
		alert("Please click \"Browse...\" to select a photo before uploading.");
		return false;
	}
	
	return true;
}


function communitiesValDelImage() {
	v_AreYouSure = window.confirm("Are you sure you want to delete this image?"
		+ "\n"
		+ "\n" + "Click 'OK' to delete."
		+ "\n" + "Click 'Cancel' to return without deleting.");
	if (v_AreYouSure == true) {
		return true;
	} else {
		return false;
	}
}


