function switcheroo()
{
  var obj = document.forms[0].elements;
  var s = obj.length;
  var i=0;
  for( i=0; i<s; i++ )
  {
    if( obj[i].name=='spq' )
    {
       obj[i].name = 'sp-q';
    }
    if( obj[i].value=='sp-k' )
    {
      obj[i].value = obj[i].name;
      obj[i].name = 'sp-k';
      if( obj[i].value=='CBC' )
      {
         obj[i].value='';
      }
    }
  }
}
 
function deselect( what )
{
  var obj = eval( "document.forms[0]." + what );
  obj.checked = false;
}

function check( what )
{
  var obj1 = eval( "document.forms[0]." + what );
  var all = eval( what + ".split(',')" );
  var s = all.length;
  var i=0;
  for( i=0; i<s; i++ )
  {
    obj2 = eval( "document.forms[0]." + all[i] );
    obj2.checked = obj1.checked;
  } 
}

function checkAll()
{
  var main = document.forms[0].CBC;
  var ar = CBCCat.split(',');
  var i=0;
  for( i=0;i<ar.length;i++ )
  {
    var obj, obj2;
    obj2 = eval( "document.forms[0]." + ar[i] );
    obj2.checked = false;
    var all = eval( ar[i] + ".split(',')" );
    var s = all.length;
    for( j=0; j<s; j++ )
    {
      obj = eval( "document.forms[0]." + all[j] );
      obj.checked = false;
    }
  }
}

function setFocus()
{
  document.forms[0].spq.focus();
}

function searchTips() 
{
  window.open("http://infoculture.cbc.ca/flash/searchtips.html","Search_Tips", "resizable,scrollbars,width=400, height=200");
}
