// Chained Selects // Copyright Xin Yang 2004 // Web Site: www.yxScripts.com // EMail: m_yangxin@hotmail.com // Last Updated: Jan. 31, 2009 // This script is free as long as the copyright notice remains intact. var _disable_empty_list=false; var _hide_empty_list=false; // ------ if (typeof(disable_empty_list)=="undefined") { disable_empty_list=_disable_empty_list; } if (typeof(hide_empty_list)=="undefined") { hide_empty_list=_hide_empty_list; } var cs_goodContent=true, cs_M="M", cs_L="L", cs_G="G", cs_EG="EG"; var cs_names=new Array(); var cs_supportDOM=document.createElement; var cs_nav=navigator.userAgent.toLowerCase(); var cs_isIE7=(cs_nav.indexOf("msie 7")!=-1 || cs_nav.indexOf("msie 8")!=-1); var cs_isOpera=(cs_nav.indexOf("opera")!=-1); var cs_isMac=(cs_nav.indexOf("mac")!=-1); function cs_findOBJ(obj,n) { for (var i=0; i=0; i--) { list.options[i]=null; } } } function cs_refreshList(list,opt,df,key) { var l=list.options.length; var optGroup=null, newOpt=null, optCount=0, optPool=list; if (cs_isMac) { var l=list.options.length; var iCount=0; for (var i=0; i options[i].idx && menu.items[options[i].idx].type==cs_M) { if (!has_sublist) { has_sublist=true; cs_emptyList(content.lists[idx+1]); } var subkey=cs_getKey(key,options[i].idx), df=cs_getSelected(mode,content.cookie,idx+1,subkey,menu.items[options[i].idx].df); cs_refreshList(content.lists[idx+1],cs_getOptions(menu.items[options[i].idx],list),df,subkey); } } } } if (key!="") { cookies+=(cookies==""?"":"-")+key+option; } if (content.cookie) { cs_setCookie(content.cookie+"_"+idx,cookies); } if (has_sublist && idx+10) { cs_initListGroup(content,content.cookie); } } } function initListGroups(n) { var listCount=0; for (var i=1; iarguments[i].length || listCount==0) { listCount=arguments[i].length; } } } var _content=cs_findContent(n), count=0, content=null; if (_content!=null) { for (var l=0; l0) { cs_initListGroup(content,content.cookie); } } } } function resetListGroup(n,count) { var content=cs_findContent("cs_"+(count||1)+"_"+n); if (content!=null && content.lists.length>0) { cs_initListGroup(content,""); } } function selectOptions(n,opts,mode) { var content=cs_findContent(n); if (content!=null) { var optss=opts.split(":"), menu=content.menu, path=true; for (var i=0; i