//JavaScript Document

function validateForm() {

var 
	frm =document.form_princ;
	topic = frm.productCatId;
	title = frm.productName;
	format = frm.mediaTypeId;
	ISBN = frm.ISBN10;
	author1 = frm.authorName1;
	keyword = frm.keyword;
	ageRange = frm.ageRangeId;
	text = 'website_search.php?type=adv';
	i = 0;
	/*onsubmit="return validateForm(this)"*/
	if (topic.selectedIndex != 0) {
		text = text + '&topic='+topic.value;
		i++;
	}
	if (title.value.length > 2) {
		text = text + '&title='+title.value;
	}
	if (format.selectedIndex != 0) {
		text = text + '&format='+format.value;
	}
	if (ISBN.value.length > 0) {
		text = text + '&ISBN='+ISBN.value;
	}
	if (author1.value.length > 0) {
		text = text + '&author='+author1.value;
	}
	if (keyword.value.length > 0) {
		text = text + '&keyword='+keyword.value;
	}
	if (ageRange.selectedIndex != 0) {
		text = text + '&ageRange='+ageRange.value;
	}
	if (text == 'website_search.php?type=adv') {
		alert ('You must select at least one field!');
	} else {
		document.location = text;
	}
	return false;
}
