function ifCheckedBoxes(listingsForm) {
var checkedBoxes = false;
for (var i = 0; i < listingsForm.elements.length; i++) {
if(listingsForm.elements[i].type == 'checkbox') {
if (listingsForm.elements[i].checked) { checkedBoxes = true;}}}
if (checkedBoxes) { return true; }
else { alert("You must select at least one category"); return false;}
}
function ifSelection(listingsForm) {
var checkedBoxes = false;
var theSelection = false;
for (var i = 0; i < listingsForm.elements.length; i++) {
if(listingsForm.elements[i].type == 'checkbox') {
if (listingsForm.elements[i].checked) { checkedBoxes = true;}}}
if (listingsForm.stType.value != '') { theSelection = true;}
if (checkedBoxes || theSelection) { return true; }
else { alert("You must select one category or one genre at least"); return false;}
}
function toggleTheAnyBox() {
var anyBox;
anyBox = document.getElementById('anyCheck');
anyBox.checked = false;
}
function toggleSexCon() {
var anyBox, theCheck, otherBoxes;
anyBox = document.getElementById('anyCheck');
if(anyBox.checked) {
otherBoxes = document.getElementsByName('sexCon[]');
for (var i = 0; i < otherBoxes.length; i++) {
otherBoxes[i].checked = false;
}
anyBox = document.getElementById('anyCheck');
anyBox.checked = true;
}
}