function clearoptions(pulldown) {
	for (x=0;x<pulldown.options.length;x++) {
		pulldown.options[x]=null
	}
	pulldown.options.length=0
}

function setoptions(pulldown,gender,type) {

	if (gender=="R") {
		part1="reset"
	}
	if (gender=="M") {
		part1="male"
	}
	if (gender=="F") {
		part1="female"
	}
	if (gender=="K") {
		part1="kid"
	}
	if (gender=="I") {
		part1="infant"
	}
	clearoptions(pulldown)
	
	theSource=eval(part1+type)
	pulldown.options[0]=new Option("Any " + type,"*")
	
	matched="no"
	
	pulldown.selectedIndex=0	
 	for (x=1;x<theSource.length;x++) {
		pulldown.options[x]=eval(part1+type+"[x]")

	}
	pulldown.selectedIndex=0

}


function switchpulls(thisPull) {	
        gender=thisPull.value
        if (document.searchform.sssize.length==1) {
	   setoptions(document.searchform.sssize,gender,'size')
	   setoptions(document.searchform.ssbrand,gender,'brand')
	   setoptions(document.searchform.sswidth,gender,'width')
	   setoptions(document.searchform.sscat,gender,'category')
	   setoptions(document.searchform.sscolor,gender,'color')		
	}
}
function findShoes() {
   if (document.searchform.ssgender.value!="R") {
     with (document.searchform) {
         qs=ssgender.value + "~"
         qs=qs+"*" + "~"
         qs=qs+sscat.value.replace("All","*") +"~"
         qs=qs+ssbrand.value.replace("All","*") +"~"
         qs=qs+sssize.value.replace("All","*") +"~"
         qs=qs+sswidth.value.replace("All","*") +"~"
         qs=qs+sscolor.value.replace("All","*")
         window.location="/shoelistpage.asp?qs=" + qs
     }
   } else {
      alert("You must Select at least a Gender")
   }
   
}   

