function checkForm(f) {
	for (i = 0; i < f.elements.length; i++) {
		var e = f.elements[i];
		if (e.getAttribute('required') && e.value == '') {
			alert('The "' + e.title + '" field must be completed.');
			e.focus();
			return false;
		}
	}
}

function deleteNews(id) {
	var a = confirm('Are you sure you want to delete this news?');
	if (a) {
		window.location.href = 'index.php?d=n&i=' + id;
	}
}

function deleteStaff(id) {
	var a = confirm('Are you sure you want to delete this staff member?');
	if (a) {
		window.location.href = 'index.php?d=s&i=' + id;
	}
}

function deleteStory(id) {
	var a = confirm('Are you sure you want to delete this success story?');
	if (a) {
		window.location.href = 'index.php?d=ss&i=' + id;
	}
}

function deleteEvent(id) {
	var a = confirm('Are you sure you want to delete this event?');
	if (a) {
		window.location.href = 'index.php?d=e&i=' + id;
	}
}

function deleteModel(id) {
	var a = confirm('Are you sure you want to delete this model?');
	if (a) {
		window.location.href = 'index.php?d=m&i=' + id;
	}
}

function deleteMailingList(id) {
	var a = confirm('Are you sure you want to delete this mailing list person?');
	if (a) {
		window.location.href = 'index.php?d=ml&i=' + id;
	}
}

var images = new Array('commercial-children.png', 'commercial-men.png', 'commercial-women.png', 'fashion-men.png', 'fashion-women.png', 'infant.png', 'men.png', 'preteen.png', 'women.png');
for (var i = 0; i < images.length; i++) {
	var img = document.createElement('image');
	img.src = 'images/' + images[i];
}