function showDetails(thediv, target_div, products_id)
{
	var url = 'ajax_server.php';
	var target = target_div;
	var tar = document.getElementById(target_div);
	
	var pars = 'products_id='  + products_id + '&jj_Action=getDetails';

	//set below to 'inline' to show AJAX tooltips
	//tar.style.display = 'inline';
	tar.style.display = 'none';
	
	var myAjax = new Ajax.Updater(target, url, {	method: 'get',	parameters: pars});
}

function hideDetails(thediv, target_div)
{
	var tar = document.getElementById(target_div);
	tar.style.display = 'none';
}

function validateChoices(myform)
{
	var returnValue = true;

	if ((myform.products_id.options[myform.products_id.selectedIndex].value == 'none') || (myform.products_id.options[myform.products_id.selectedIndex].value == '0'))
	{
		alert("Please choose a metal type.");
		returnValue = false;
	}

	return returnValue;
}

function validateChoicesForAjax(myform)
{
	var returnValue = true;

	if ((myform.product_id.options[myform.product_id.selectedIndex].value == 'none') || (myform.product_id.options[myform.product_id.selectedIndex].value == '0'))
	{
		alert("Please choose a metal type.");
		returnValue = false;
	}

	return returnValue;
}

function validateChoicesCollege(myform)
{
	var returnValue = true;

	if (myform.metal_type.options[myform.metal_type.selectedIndex].value == 'none')
	{
		alert("Please choose a metal type.");
		returnValue = false;
	}

	return returnValue;
}

function validateChoicesMil(the_form)
{
	var returnValue = true;
	if(the_form.branch.options[the_form.branch.selectedIndex].value == 'none')
	{
		alert("Please choose a branch of service.");
		returnValue = false;
	}
	else if(the_form.products_id.options[the_form.products_id.selectedIndex].value == 'none')
	{
		alert("Please choose a metal type.");
		returnValue = false;
	}

	return returnValue;
}

function validateChoices3(the_form)
{
	var returnValue = true;
	if(the_form.branch_of_service.options[the_form.branch_of_service.selectedIndex].value == 'none')
	{
		alert("Please choose a branch of service.");
		returnValue = false;
	}
	else if(the_form.products_id.options[the_form.products_id.selectedIndex].value == 'none')
	{
		alert("Please choose a metal type.");
		returnValue = false;
	}

	return returnValue;
}

function validateChoices2(the_form)
{
	var returnValue = true;
	if(the_form.products_id.options[the_form.products_id.selectedIndex].value == 'none')
	{
		alert("Please choose a branch of service.");
		returnValue = false;
	}

	return returnValue;
}


function changeProductThumbnail(metal_type_pulldown, product_count, first_thumbnail, second_thumbnail)
{
	if((metal_type_pulldown.options[metal_type_pulldown.selectedIndex].text.search(/white/) > -1) || (metal_type_pulldown.options[metal_type_pulldown.selectedIndex].text.search(/White/) > -1) || (metal_type_pulldown.options[metal_type_pulldown.selectedIndex].text.search(/^Siladium/) > -1) || (metal_type_pulldown.options[metal_type_pulldown.selectedIndex].text.search(/Silver/) > -1))  
	{
		var my_thumbnail = document.getElementById("thumbnail" + product_count);
		my_thumbnail.src = second_thumbnail;
	}
	else
	{
		var my_thumbnail = document.getElementById("thumbnail" + product_count);
		my_thumbnail.src = first_thumbnail;
	}
}

function submitForm(my_form)
{
	var returnValue = true;
	if(my_form.number_of_stones.selectedIndex == 0)
	{
		alert("Please choose the number of stones.");
		return false;
	}
	return returnValue;
}