//	These menu options are for collars that only available in sizes Medium and Large.

//	This code pertains to: medium&largefabric.html,



// **************************************************************************************************************

var itemList=document.classic.itemsCh				//saves select itemsCh to a variable
var buckleChoice=document.classic.buckledata			//saves select buckles to a variable

//	Create a new array to change the elements stored in the selected variable for buckles

var buckles=new Array()

// 	First option is null.
buckles[0]="";

//	THIS OPTION HANDLES ALL OF THE BUCKLE COLORS AVAILABLE.

buckles[1]=["Select Your Buckle|", "Black $14.95|Black Plastic Buckle s1=0 s2=0 @14.95","Army Green $15.95|Army Green Plastic Buckle s1=0 s2=0 @15.95",
	"Brown $15.95|Brown Plastic Buckle s1=0 s2=0 @15.95","Grass Green $15.95|Grass Green Plastic Buckle s1=0 s2=0 @15.95",
	"Hot Pink $15.95|Hot Pink Plastic Buckle s1=0 s2=0 @15.95","Khaki $15.95|Khaki Plastic Buckle s1=0 s2=0 @15.95",
	"Light Pink $15.95|Light Pink Plastic Buckle s1=0 s2=0 @15.95","Lime $15.95|Lime Plastic Buckle s1=0 s2=0 @15.95",
	"Navy Blue $15.95|Navy Blue Plastic Buckle s1=0 s2=0 @15.95","Orange $15.95|Orange Plastic Buckle s1=0 s2=0 @15.95",
	"Purple $15.95|Purple Plastic Buckle s1=0 s2=0 @15.95","Red $15.95|Red Plastic Buckle s1=0 s2=0 @15.95",
	"Turquoise $15.95|Turquoise Plastic Buckle s1=0 s2=0 @15.95","Yellow $15.95|Yellow Plastic Buckle s1=0 s2=0 @15.95",
	"White $15.95|White Plastic Buckle s1=0 s2=0 @15.95"];
	
//	THIS OPTION HANDLES THE METAL BUCKLES.

buckles[2]=["Select Your Buckle|","Black Metal $19.95|Black Metal Buckle s1=0 s2=0 @19.95","Silver Metal $19.95|Silver Metal Buckle s1=0 s2=0 @19.95"];

	
	
// Function loops through the array in order to change the buckledata select elements
// name function "updatebuckles, declare variable-paramater "selectbucklegroup"

function updatebuckles(selectbucklegroup)	
	{
	buckleChoice.options.length=0					// set select elements stored in buckleChoice to 0
	if (selectbucklegroup>0)
		{
		// set the array variable "buckles[i]" into the function variable-parameter.
		for (i=0; i<buckles[selectbucklegroup].length; i++)
		
		buckleChoice.options[buckleChoice.options.length]=new Option(buckles[selectbucklegroup][i].split("|")[0],
		buckles[selectbucklegroup][i].split("|")[1])
		}
	}
	
	
	// three final steps.
	// 1. retrive the "buckledat" which was saved to the buckleChoice varialbe and set it to an .options() construcor.
	// split it using the (|) the buckles[variable] array. fist the text set to [0]
	// then the values set to [1].
	
	
	// Make sure a selection is choosen.


function validateform()
	{
		valid = true;
	if (document.classic.buckledata.selectedIndex == 0)
	    {
	        alert ("Please select your buckle color!");
	        valid = false;
	    }
	else if (document.classic.itemsCh.selectedIndex == 0)
	    {
	        alert ("Please select an item!");
	        valid = false;
	    }
	    
	    	return valid;
	}
	
	
function checkpullon()
	{
	if (document.classic.itemsCh !=='0')
		{
		document.classic.buckledata.disabled=false;
		document.classic.nylonselect.disabled=false;
		}
	}
	

	
