
function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.drop_list.Category, "Fruits", "Fruits", "");
addOption(document.drop_list.Category, "Games", "Games", "");
addOption(document.drop_list.Category, "Scripts", "Scripts", "");
}
//speciality
function fillsize()
{
	sizes=""
	color_size2=""
	azx="";
	// ON selection of category this function will work
	removeAllOptions(document.getElementById("size2"));
	all_value2=document.form1.all_value.value.split("+")
	for (i = 0; i <= all_value2.length; i++)
	{
		color_size2=all_value2[i].split("-")
		
			if(document.form1.color2.value == color_size2[0])
			{
				sizes=color_size2[1].split(",")
				
				//addOption(document.getElementById("size2"),color_size2[1], sizes[0]);
				for (i1 = 0; i1 < sizes.length; i1++)
				{
					addOption(document.getElementById("size2"),sizes[i1], sizes[i1]);	
				}
				
			}	
		
	}
	
}
////////////////// 

function removeAllOptions(selectbox)
{
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		//selectbox.options.remove(i);
		selectbox.remove(i);
	}
}


function addOption(selectbox, value, text )
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;

	selectbox.options.add(optn);
}
///////////////////////////////////////
function fillcolor22()
{
	//BOYS-Blue+BOYS-Pink+JUNIORS-blue+JUNIORS-pink+JUNIORS-Grey+MEN-blue+MEN-pink+MEN-grey
	removeAllOptions(document.getElementById("color2"));
	removeAllOptions(document.getElementById("size2"));	
	document.getElementById("p_text1").innerHTML=""
	document.getElementById("p_text2").innerHTML=""
	document.getElementById("p_amt").innerHTML=""
	document.getElementById('hide_price').value=""
	if(document.form1.all_gender_color_text.value!="")
	{
		all_value2=document.form1.all_gender_color_text.value.split("+");
		addOption(document.getElementById("color2"),'', 'Select Color');
		addOption(document.getElementById("size2"),'', 'Select Sizes');
		for (i = 0; i < all_value2.length; i++)
		{
			gender_color2=all_value2[i].split("-")
			if(document.form1.gender2.value == gender_color2[0])
			{
				addOption(document.getElementById("color2"),gender_color2[1], gender_color2[1]);
			}	
		}
		
		all_value22=document.form1.gender_price_text.value.split("!")
		for (i = 0; i < all_value22.length; i++)
		{
			zz=all_value22[i].split("|")
			if(document.form1.gender2.value == zz[0])
			{
				document.getElementById("p_text1").innerHTML="Price"
				document.getElementById("p_text2").innerHTML=":"
				document.getElementById("p_amt").innerHTML="$"+zz[1]
				document.getElementById('hide_price').value=zz[1]
			}	
		}
	}
}
///////////////////////////////////////
function fillsizes22()
{
	///BOYSBlue-S,M,L,XL+BOYSPink-S,M,L,XL+JUNIORSblue-S,M,L,XL+JUNIORSpink-S,M,L,XL+JUNIORSGrey-S,M,L,XL+MENblue-S,M,L,XL+MENpink-S,M,L,XL+MENgrey-S,M,L,XL
	removeAllOptions(document.getElementById("size2"));	
	if(document.form1.all_value.value!="")
	{
		addOption(document.getElementById("size2"),'', 'Select Sizes');
		all_value222=document.form1.all_value.value.split("+")
		for (i = 0; i < all_value222.length; i++)
		{
			color_size2=all_value222[i].split("-")
			
				if(document.form1.gender2.value+""+document.form1.color2.value == color_size2[0])
				{
					sizes=color_size2[1].split(",")
					for (i1 = 0; i1 < sizes.length; i1++)
					{
						addOption(document.getElementById("size2"),sizes[i1], sizes[i1]);	
					}
				}	
		}
	}
}