function categ_letters (curl,cdelim) {
  var alp_str="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  var location=document.location.href;
  if (cdelim==undefined) { cdelim='&nbsp;&nbsp;' }; 
  if (curl!=undefined) location=curl;
  if (location.indexOf('?')>0) { location=location.substr(0,location.indexOf('?')) }
  for (i=0; i<26; i++) {
    document.write('<a href="'+location+'?let='+alp_str.charAt(i)+'">'+alp_str.charAt(i)+'</a>'+cdelim);
  }
}

function categ_letlist (cpath,gpath,cdelim,cheader,cfooter) {
  if (cdelim==undefined) { cdelim='<br>' } //window.alert(cdelim);
  var location=document.location.href;
  if (location.indexOf('let=')>0) {
    var lett=location.charAt(location.indexOf('let=')+4);
    if (cheader!=undefined) document.write(cheader.replace(/{title}/g,lett));
    for (i=0; i<cgroups; i++) {
      if (cgroup_name[i].charAt(0)==lett) {
        var cat1=cgroup_name[i];
        //cat1=cat1.replace(/['| |&]/g,'_');
        var gpath1=gpath.replace(/{grp}/g,i);
        document.write('[<a href="'+gpath1+'"><b>'+cgroup_name[i]+'</b></a>]'+cdelim);
      }
    }
    for (i=0; i<catnum; i++) {
      if (cats[i].charAt(0)==lett) {
        var cat1=cats[i];
        cat1=cat1.replace(/['| |&]/g,'_');
        var cpath1=cpath.replace(/{categ}/g,cat1);
        document.write('<a href="'+cpath1+'">'+cats[i]+'</a>'+cdelim);
      }
    }
    if (cfooter!=undefined) document.write(cfooter);
  }
}

function categ_grplist (cpath,cdelim,cheader,cfooter) {
  if (cdelim==undefined) { cdelim='<br>' } //window.alert(cdelim);
  var location=document.location.href;
  if (location.indexOf('grpid=')>0) {
    var grpid=location.substr(location.indexOf('grpid=')+6,location.length);
    var grp=eval('cgroupid'+grpid);
  }
  if (location.indexOf('grp=')>0) {
    var grp=location.substr(location.indexOf('grp=')+4,location.length);
  }
  if (typeof(grp)!=undefined) {
    //window.alert (grp);
    if (cheader!=undefined) document.write(cheader.replace(/{title}/g,cgroup_name[grp]));
    for (i=0; i<cgroup_cnt[grp]; i++) {
        var cat1=cgroup_cat[grp][i];
        cat1=cat1.replace(/['| |&]/g,'_');
        var cpath1=cpath.replace(/{categ}/g,cat1);
        document.write('<a href="'+cpath1+'">'+cgroup_cat[grp][i]+'</a>'+cdelim);
    }
    if (cfooter!=undefined) document.write(cfooter);
  }
}

function categ_select (cpath,tdadd) { // WITHIN TD
  document.write('<FORM name=cjump1 method=get ><TD '+tdadd+'>');
  document.write('<SELECT size=1 name=c1 style="font-size: 8pt; color: #0000FF">');
  document.write('<OPTION value=# selected>All Categories</OPTION>'); 
  for (i=0; i<catnum; i++) {
        var cat1=cats[i];
        cat1=cat1.replace(/['| |&]/g,'_');
        var cpath1=cpath.replace(/{categ}/g,cat1);
        document.write('<option value="'+cpath1+'">'+cats[i]+'</option>');
  }
  document.write('</SELECT><INPUT onclick=c_jump(1) type=button value=Go style="color: #FF0000; font-size: 8pt; font-weight: bold"></TD></FORM>');
}

function cgroup_select (cpath,tdadd,action) { // WITHIN TD
  //window.alert(cpath);
  document.write('<FORM name=cjump2 method=get action="'+action+'"><TD '+tdadd+'>');
  document.write('<SELECT size=1 name=c2 style="font-size: 8pt; color: #0000FF">');
  document.write('<OPTION value=# selected>All Groups</OPTION>'); 
  for (i=0; i<cgroups; i++) {
        //var cg1=cgroup_name[i];
        var cpath1=cpath.replace(/{group}/g,i);
        document.write('<option value="'+cpath1+'">'+cgroup_name[i]+'</option>');
    //window.alert(cpath1);
  }
  document.write('</SELECT><INPUT onclick=c_jump(2) type=button value=Go style="color: #FF0000; font-size: 8pt; font-weight: bold"></TD></FORM>');
}

function cgroup_list (cpath) { 
  for (i=0; i<cgroups; i++) {
        //var cg1=cgroup_name[i];
        var cpath1=cpath.replace(/{group}/g,i);
        document.write('<a href="'+cpath1+'">'+cgroup_name[i]+'</a> ');
  }
}

function cgroup_logo() { 
  var location=document.location.href;
  if (location.indexOf('grp=')>0) {
    var grp=location.substr(location.indexOf('grp=')+4,location.length);
    document.write('<img src="'+cgroup_img[grp]+'">');
  }
  if (location.indexOf('grpid=')>0) {
    var grpid=location.substr(location.indexOf('grpid=')+6,location.length);
    var grp=eval('cgroupid'+grpid);
    document.write('<img src="'+cgroup_img[grp]+'">');
  }
}

///

function c_jump(sn) {
  if (sn==1) {
    var jumpurl=document.cjump1.c1.value;
    if (jumpurl!='#') {
	//window.alert(jumpurl);
      document.cjump1.action=jumpurl;
      document.cjump1.submit();
    }
  }
  if (sn==2) {
    var jumpurl=document.cjump2.c2.value;
    if (jumpurl!='#') {
      //document.cjump2.action=jumpurl;
      //document.cjump2.submit();
      document.location.href=jumpurl;
    }
  }
  //document.location.href=jumpurl;
}


