//$Id: index.js,v 1.1.1.1.2.2 2008/02/19 22:58:21 lilstargazer Exp $
var search_type = 'people';
function search(type)
{
  var searchLinks = document.getElementById('search_links');
  var types = ['people', 'blogs', 'pics', 'vids', 'questions'];
  for (var i = 0; i < types.length; i++)
  {
    if (type == types[i])
      document.getElementById('search_' + types[i]).className = 'indexSearchLinks_selected';
    else
      document.getElementById('search_' + types[i]).className = 'indexSearchLinks';
  }

  search_type = type;
}

function gotosearch()
{
  var search_string = document.getElementById('search_string').value;
  if (search_type == 'people')
    location = 'people/search.php?searchType=displayname&gender=B&age1=14&age2=100&country=AC&state=AC&resortBy=99&searchString=' + search_string;
  else if (search_type == 'blogs')
    location = 'blogs/search.php?action=names&value=' + search_string;
  else if (search_type == 'pics')
    location = 'pics/view_tag.php?searchOption=tags&search=' + search_string;
  else if (search_type == 'vids')
    location = 'video/index.php?query=' + search_string;
  else if (search_type == 'questions')
    location = 'qbank/index.php?searchQuery=' + search_string;
}

function select(type)
{
  var types = ['what', 'why', 'how'];
  for (var i = 0; i < types.length; i++)
  {
    if (type == types[i])
    {
      document.getElementById(types[i] + '_tab').className = 'indexQuestion_selected';
      document.getElementById(types[i]).style.display = '';
    }
    else
    {
      document.getElementById(types[i] + '_tab').className = 'indexQuestion';
      document.getElementById(types[i]).style.display = 'none';
    }
  }
}
