// function to check the check boxes for the "email suppliers"... if
//	no check boxes checked, keep exhibit id list the same, if check boxes checked,
//	then change exhibit id list to the ones that are checked
//	
//	used in featured products section of the site


function checkForm(alink, exhibitList)   
{  
	var newLink;
	var newList = "";
	//loop over all check boxes.  Build a list of the exhibits that are checked.
	
	var i = 0;
	for (i = 0; i < document.SearchResults.elements.length; i++)    //Loop thru all form elements
	{
		// if its a checkbox and its checked, add to the list
		if (document.SearchResults.elements[i].type == 'checkbox' 
			&& document.SearchResults.elements[i].checked){
		 	newList = newList + document.SearchResults.elements[i].name + ";";
		}
	}
	
	//if the list contains items, then make it the new exhibitList
	if (newList.length > 0){
		exhibitList = newList;
	}
	
	//go to the featured products email page with the correct exhibit list
	newLink = alink + exhibitList;
	setLocationHref(location, newLink, 0);
	
	return false;
}


function checkForCheckedBoxes(alink)
{  
	var isChecked = 0;
	var goOn = true;
	//loop over all check boxes. see if any are checked.
	var i = 0;
	for (i = 0; i < document.SearchResults.elements.length; i++)    //Loop thru all form elements
	{
		// if its a checkbox and its checked, add to the list
		if (document.SearchResults.elements[i].type == 'checkbox' 
			&& document.SearchResults.elements[i].checked){
		 	isChecked=1;
		}
	}
	
	//if isChecked, then show a warning popup alert
	if (isChecked){
		goOn = confirm("By proceeding to the next page, the email boxes you've selected on this page will be deselected.  Press OK to continue to the next page without first completing the email process for this page.");
	}

	if(goOn){
		//they hit ok, so go to the next page
		setLocationHref(location,alink, 0);
		return true;
	}
	else{
		// they hit cancel, so stop
		return false;
	}
}





