// 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; function goListGroup(apikey, L7, L6, L5, L4, L3, L2, L1){ var GlobalOptions = ""; $('.global').each(function(){ var checked = $(this).prop('checked'); if(checked) { var globalID = $(this).attr('id'); // handle jsonp/callback global option differently if(globalID == "jsonp") { GlobalOptions = GlobalOptions + "&" + globalID + "=foo"; } else { GlobalOptions = GlobalOptions + "&" + globalID + "=1"; } } }); // handle the show.getposter / show.getbanner differently as they return an image and not json if (L1 == "?cmd=show.getposter" || L1 == "?cmd=show.getbanner") { var imgcache = sbRoot + "/api/" + apikey + "/" + L1 + L2 + GlobalOptions; var html = imgcache + '

'; $('#apiResponse').html(html); $.ajax({ url: sbRoot + "/api/" + apikey + "/" + L1 + L2 + GlobalOptions, async: false, cache: false, dataType: "html", success: function (img) { $('#imgcache').attr('src', imgcache); } }) } else { var html = sbRoot + "/api/" + apikey + "/" + L1 + L2 + L3 + L4 + L5 + L6 + L7 + GlobalOptions + "
";
        html += $.ajax({
          url: sbRoot + "/api/" + apikey + "/" + L1 + L2 + L3 + L4 + L5 + L6 + L7 + GlobalOptions,
          async: false,
          dataType: "html"
        }).responseText;

        html += '
'; $('#apiResponse').html(html); } } // ------ 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