	function launchBGContact(){
		
	 var win = window.open('bgContact.asp','BuyingGuidePopup','height=400,width=450,status=no,toolbar=no,menubar=no,location=no,scrollbars');
		
	}//end function


	function bgShowMoreRecProducts(){
		var element = "tr";
		var showClass = "bgrow_extra_show";
		var hideClass = "bgrow_extra_hide";
		
		for (i=0;i<document.getElementsByTagName(element).length; i++) {
			if (document.getElementsByTagName(element).item(i).className == hideClass){
				document.getElementsByTagName(element).item(i).className = showClass;
			}
		}
	}//end function

	function changePage( passedPageNum ){
		newAction = ""
		
		if (passedPageNum == 6){
			newAction = "results"
		} else {
			newAction = "p" + passedPageNum
		}
		
		//submit the form
		document.bgform.action.value = newAction
		document.bgform.submit()
	}//end function
	
	//this is used for the 'Next' button
	function nextPage( currentPage ) {
		
		//set the page we'll show next
		newAction = ""	
		nextPageNum = currentPage + 1
		if (nextPageNum == 6){
			newAction = "results"
		} else {
			newAction = "p" + nextPageNum
		}
	
		//set the 'callingPage' var...shows its
		cp = ""
		if (currentPage){
			cp = "p" + currentPage
		}
		
		//submit the form
		document.bgform.callingPage.value = cp
		document.bgform.action.value = newAction
		document.bgform.submit()
	}//end function
	
	
	function doDeleteSelectedProduct( pid ) {
		var confirmText = "Are you sure you want to remove this product?";
		if ( confirm(confirmText) ){
			document.bgform.pid.value = pid;
			document.bgform.action.value = "deleteproduct";
			document.bgform.submit();
		}
	}//end function
	
	function doStartover(){
		document.bgform.action.value = "startover";
		document.bgform.submit();	
	}
	
	
	
	function doCheckout(){
		var err_header = "Please complete the following required fields: \n";
		var err = "";
		var name = document.bgform.user_name.value;
		var email = document.bgform.user_email.value;
		
		if (name == ""){
			err += " - Name \n";
		}
		if (email == ""){
			err += " - Email \n";
		}
		
		if (err == ""){
			document.bgform.action.value = "checkout";
			document.bgform.submit();		
		} else {
			alert(err_header + err);
		}
	}//end function
	
	
	
	function nextFromCardsPerYear(){
	var found_flag = 0;
	var err = "Please select an answer: \n";
	
	var name = document.bgform.FIRST_YEAR_CARDS;
	
	for (i=0; i < document.bgform.FIRST_YEAR_CARDS.length; i++) {
			if (document.bgform.FIRST_YEAR_CARDS[i].checked) {
				found_flag = 1;
			}
	}
	
	if (found_flag){		
		//do the next page
		nextPage(1);
	} else {
		alert(err);
	}
}


