function creatsel(selname,stroption,stroptionnum,opt,onchange)
    {if(selname.indexOf("radio_")!=0){
		if(onchange!=""){onchange=" onchange=\""+onchange+"\" "}
		document.write("<select name='"+selname+"' id='"+selname+"' "+onchange+"></select>");	
		temparr=stroption.split("|")
		temparr2=stroptionnum.split("|")
		selname0=document.getElementById(selname)
		 for (i=0;i<temparr.length; i++)
			{
				 selname0.options[i] = new Option(temparr[i],temparr2[i]);  
				 if(opt==temparr2[i])selname0.selectedIndex=i; 
			}
		}else{	func_name=selname.replace("radio_","")				
		temparr=stroption.split("|")
		temparr2=stroptionnum.split("|")
		if(onchange!=""){onchange=" onclick=\""+onchange+"\" "}				
		for (i=0;i<temparr.length; i++){
			if( i==0 || opt==temparr2[i]){func_checked=" checked "}else{func_checked=""}
			document.write("<label "+onchange+"><input type=radio name='"+func_name+"' id='"+func_name+"' value='"+temparr2[i]+"'"+func_checked+" >"+temparr[i]+"</label> ");
		}	
		}
}
function changelocation(locationid,sortname,subcat,opt)
{var sortname0=document.getElementById(sortname);
 sortname0.length = 0; 
	for (i=0;i < subcat.length; i++)
        {
		 if (subcat[i][1] == locationid)
            {if(sortname0.length ==0 && typeof(showall)=="boolean" && showall==true)sortname0.options[0]=new Option("All Categories","");			
             sortname0.options[sortname0.length] = new Option(subcat[i][0],subcat[i][2]);
			 
			 if(opt==subcat[i][2])
			 {sortname0.selectedIndex=sortname0.length-1;			 
			 }
            }        
        }
	if(sortname0.length ==0){sortname0.options[0]=new Option("No subclass","");}
	else{sortname0.style.color="";}		
}
