function validateProduct()
{
	//
	// Check to see if the user specified the necessary parameters for the 
	// product on the client side.  If they didn't, then give them an 
	// opportunity to change that before submitting.  If they don't have
	// javascript enabled, then they'll have to wait until it gets sent
	// to the server for validation.  This is only a quick validation to
	// see if the information was defined -- it doesn't check to see if it
	// is accurate.
	//

	var flag_valid = true;

	for( g = 0; g < ( document.forms['productattributes'].length - 1 ); g++ ) {

		if ( document.forms['productattributes'].elements[g].value.length == 0 ) {

			flag_valid = false;

		}

	}

	if ( flag_valid == false ) {

		alert('Please specify all attributes before adding this item to your cart.');

	}

	return flag_valid;

}

function swapImage( element, id )
{

	var tmp = document.getElementById( element + "-" + id ).src.split( "/" );

	var image = new Array();

	if ( tmp.length > 1 ) {

		image[0] = tmp[( tmp.length - 1 )];

	}

	document.getElementById(element + "-main").src = "/images/product/large/" + image[0];

}

function swapPointer( element, id, flagvisible )
{

	if ( flagvisible == 1 ) {

        	document.getElementById( element ).style.visibility = "visible";

	} else {

        	document.getElementById( element ).style.visibility = "hidden";

	}

       	document.getElementById( element ).style.left = 50 + ( ( id - 1 ) * 135 ) + "px"; 

}

