//2007-06-12 by camartin

//Begin main menu for faq/index.php

var menu_tech = new Array()
tech_counter=0
//these are the id values for the main menu under Technical
menu_tech[tech_counter++]='tech_pc'
menu_tech[tech_counter++]='tech_mac'


var menu_toons = new Array()
toon_counter=0
//these are the id values for the main menu under Toons
menu_toons[toon_counter++]='toon_about'
menu_toons[toon_counter++]='toon_communication'
menu_toons[toon_counter++]='toon_tasks'
menu_toons[toon_counter++]='toon_names'


function menu(menu_ids)
{
  //display or hide sublinks for category section
   i=0;
  getId = document.getElementById(menu_ids[i])

  if ( getId.style.display == 'none' )
  {
    //if ids are hidden, display them
    getId.style.display = ''
    for (i=1; i < menu_ids.length; i++)
    {
      getId = document.getElementById(menu_ids[i])  
      getId.style.display	= ''
    }
  }
  else if ( getId.style.display == '')
  {
    //if ids are not hidden, hide them
    getId.style.display = 'none'
    for (i=1; i < menu_ids.length; i++)
    {
      getId = document.getElementById(menu_ids[i])  
      getId.style.display = 'none'
    }
  }
}

//End main menu for faq/index.php


//default image width and height
var image = new Object()
image['width']   = '431';
image['height']  = '100';

//counter to loop through arrays
counter=0


function create_faq()
{
  var faq = new Object()
  faq['sharedImagePath'] = getSharedImagePath()
  faq['src'] = faq['sharedImagePath'] + 'TT_FAQ_title.gif'
  faq['width']  = image['width']
  faq['height'] = image['height']
  faq['link'] = 'no'
  faq['linkValue'] = 'faq.php'
  faq['title'] = 'Frequently Asked Questions'
  faq['alt'] = faq['title']
  return faq
}

function create_cattlelogs()
{            
  var cattlelogs = new Object()
  cattlelogs['src'] = getSharedImagePath() + 'TT_FAQ_title_catalogs.gif'
  cattlelogs['width']  = image['width']
  cattlelogs['height'] = image['height']
  cattlelogs['link'] = 'yes'
  cattlelogs['linkValue'] = getFaqUrl() + 'cattlelogs/'
  cattlelogs['title'] = 'Cattlelogs'
  cattlelogs['alt'] = 'FAQ ' + cattlelogs['title']
  return cattlelogs
}


function create_cd_rom()
{
  var cd_rom = new Object()  
  cd_rom['src'] = getSharedImagePath() + 'TT_FAQ_title_cdrom.gif'
  cd_rom['width']  = image['width']
  cd_rom['height'] = image['height']
  cd_rom['link'] = 'yes'
  cd_rom['linkValue'] = getFaqUrl() + 'cd_rom/'
  cd_rom['title'] = 'Toontown CD-ROM'
  cd_rom['alt'] = 'FAQ ' + cd_rom['title']
  return cd_rom
}


function create_cog_bucks()
{
  var cog_bucks = new Object()  
  cog_bucks['src'] = getSharedImagePath() + 'TT_FAQ_title_cogbucks.gif'
  cog_bucks['width']  = image['width']
  cog_bucks['height'] = image['height']
  cog_bucks['link'] = 'yes'
  cog_bucks['linkValue'] = getFaqUrl() + 'cog_bucks/'
  cog_bucks['title'] = 'Cog Bucks'
  cog_bucks['alt'] = 'FAQ ' + cog_bucks['title']
  return cog_bucks
}


function create_cog_hq()
{
  var cog_hq = new Object()  
  cog_hq['src'] = getSharedImagePath() + 'TT_FAQ_title_cog_hq.gif'
  cog_hq['width']  = image['width']
  cog_hq['height'] = image['height']
  cog_hq['link'] = 'yes'
  cog_hq['linkValue'] =  getFaqUrl() + 'cog_hq/'
  cog_hq['title'] = 'Cog HQ'
  cog_hq['alt'] = 'FAQ ' + cog_hq['title']
  return cog_hq
}


function create_fishing()
{
  var fishing = new Object()  
  fishing['src'] = getSharedImagePath() + 'TT_FAQ_title_tn_tasks_fish.gif'
  fishing['width']  = image['width']
  fishing['height'] = image['height']
  fishing['link'] = 'yes'
  fishing['linkValue'] = getFaqUrl() + 'fishing/'
  fishing['title'] = 'Fishing'
  fishing['alt'] = 'FAQ ' + fishing['title']
  return fishing
}

function create_gags_and_cogs()
{
  var gags_and_cogs = new Object()
  gags_and_cogs['src'] = getSharedImagePath() + 'TT_FAQ_title_gagsandcogs.gif'
  gags_and_cogs['width']  = image['width']
  gags_and_cogs['height'] = image['height']
  gags_and_cogs['link'] = 'yes'
  gags_and_cogs['linkValue'] =  getFaqUrl() + 'gags_and_cogs/'
  gags_and_cogs['title'] = 'Gags and Cogs'
  gags_and_cogs['alt'] = 'FAQ ' + gags_and_cogs['title']
  return gags_and_cogs
}


function create_game_cards()
{
  var game_cards = new Object()  
  game_cards['src'] = getSharedImagePath() + 'TT_FAQ_game_cards.gif'
  game_cards['width']  = image['width']
  game_cards['height'] = image['height']
  game_cards['link'] = 'yes'
  game_cards['linkValue'] = getFaqUrl() + 'game_cards/'
  game_cards['title'] = 'Toontown Game Cards'
  game_cards['alt'] = 'FAQ ' + game_cards['title']
  return game_cards
}
  
  
function create_getting_started()
{
  var getting_started = new Object()  
  getting_started['src'] = getSharedImagePath() + 'TT_FAQ_title_getting_start.gif'
  getting_started['width']  = image['width']
  getting_started['height'] = image['height']
  getting_started['link'] = 'yes'
  getting_started['linkValue'] = getFaqUrl() + 'getting_started/'
  getting_started['title'] = 'Getting Started'
  getting_started['alt'] = 'FAQ ' + getting_started['title']
  return getting_started
}


function create_guest_pass()
{
  var guest_pass = new Object()  
  guest_pass['src'] = getSharedImagePath() + 'TT_FAQ_title_guest_pass.gif'
  guest_pass['width']  = image['width']
  guest_pass['height'] = image['height']
  guest_pass['link'] = 'yes'
  guest_pass['linkValue'] = getFaqUrl() + 'guest_pass/'
  guest_pass['title'] = 'Guest Pass'
  guest_pass['alt'] = 'FAQ ' + guest_pass['title']
  return guest_pass
}


function create_member_services()
{
  var member_services = new Object()  
  member_services['src'] = getSharedImagePath() + 'TT_FAQ_title_memberservices.gif'
  member_services['width']  = image['width']
  member_services['height'] = image['height']
  member_services['link'] = 'yes'
  member_services['linkValue'] = getFaqUrl() + 'member_services/'
  member_services['title'] = 'Member Services'
  member_services['alt'] = 'FAQ ' + member_services['title']
  return member_services
}


function create_overview()
{
  var overview = new Object()  
  overview['src'] = getSharedImagePath() + 'TT_FAQ_title_overview.gif'
  overview['width']  = image['width']
  overview['height'] = image['height']
  overview['link'] = 'yes'
  overview['linkValue'] = getFaqUrl() + 'overview/'
  overview['title'] = 'Toontown Overview'
  overview['alt'] = 'FAQ ' + overview['title']
  return overview
}


function create_recruit_a_toon()
{
  var recruit_a_toon = new Object()  
  recruit_a_toon['src'] = getSharedImagePath() + 'TT_FAQ_rat.gif'
  recruit_a_toon['width']  = image['width']
  recruit_a_toon['height'] = image['height']
  recruit_a_toon['link'] = 'yes'
  recruit_a_toon['linkValue'] = getFaqUrl() + 'recruit_a_toon/'
  recruit_a_toon['title'] = 'Recruit-a-Toon'
  recruit_a_toon['alt'] = 'FAQ ' + recruit_a_toon['title']
  return recruit_a_toon
}


function create_trading_cards_and_mailers()
{
  var trading_cards_and_mailers = new Object()  
  trading_cards_and_mailers['src'] = getSharedImagePath() + 'TT_FAQ_tcm.gif'
  trading_cards_and_mailers['width']  = image['width']
  trading_cards_and_mailers['height'] = image['height']
  trading_cards_and_mailers['link'] = 'yes'
  trading_cards_and_mailers['linkValue'] = getFaqUrl() + 'tradingcards_mailers/'
  trading_cards_and_mailers['title'] = 'Trading Cards and Mailers'
  trading_cards_and_mailers['alt'] = 'FAQ ' + trading_cards_and_mailers['title']
  return trading_cards_and_mailers
}

function create_tech_mac()
{
  var tech_mac = new Object()  
  tech_mac['src'] = getSharedImagePath() + 'TT_FAQ_title_technical_mac.gif'
  tech_mac['width']  = image['width']
  tech_mac['height'] = image['height']
  tech_mac['link'] = 'yes'
  tech_mac['linkValue'] = getFaqUrl() + 'tech/mac/'
  tech_mac['title'] = 'Mac Technical'
  tech_mac['alt'] = 'FAQ ' + tech_mac['title']
  return tech_mac
}


function create_tech_pc()
{
  var tech_pc = new Object()  
  tech_pc['src'] = getSharedImagePath() + 'TT_FAQ_title_technical.gif'
  tech_pc['width']  = image['width']
  tech_pc['height'] = image['height']
  tech_pc['link'] = 'yes'
  tech_pc['linkValue'] = getFaqUrl() + 'tech/pc/'
  tech_pc['title'] = 'PC Technical'
  tech_pc['alt'] = 'FAQ ' + tech_pc['title']
  return tech_pc
}


function create_toon_about()
{
  var toon_about = new Object()  
  toon_about['src'] = getSharedImagePath() + 'TT_FAQ_title_tn_aboutmytoon.gif'
  toon_about['width']  = image['width']
  toon_about['height'] = image['height']
  toon_about['link'] = 'yes'
  toon_about['linkValue'] = getFaqUrl() + 'toons/about/'
  toon_about['title'] = 'About My Toon'
  toon_about['alt'] = 'FAQ ' + toon_about['title']
  return toon_about
}


function create_toon_communication()
{
  var toon_communication = new Object()  
  toon_communication['src'] = getSharedImagePath() + 'TT_FAQ_title_tn_com.gif'
  toon_communication['width']  = image['width']
  toon_communication['height'] = image['height']
  toon_communication['link'] = 'yes'
  toon_communication['linkValue'] = getFaqUrl() + 'toons/communication/'
  toon_communication['title'] = 'Toon Communication'
  toon_communication['alt'] = 'FAQ ' + toon_communication['title']
  return toon_communication  
}


function create_toon_names()
{
  var toon_names = new Object()
  toon_names['src'] = getSharedImagePath() + 'TT_FAQ_title_tn_names.gif'
  toon_names['width']  = image['width']
  toon_names['height'] = image['height']
  toon_names['link'] = 'yes'
  toon_names['linkValue'] =  getFaqUrl() + 'toons/names/'
  toon_names['title'] = 'Toon Names'
  toon_names['alt'] = 'FAQ ' + toon_names['title']
  return toon_names
}


function create_toon_tasks()
{
  var toon_tasks = new Object()  
  toon_tasks['src'] = getSharedImagePath() + 'TT_FAQ_title_tn_tasks.gif'
  toon_tasks['width']  = image['width']
  toon_tasks['height'] = image['height']
  toon_tasks['link'] = 'yes'
  toon_tasks['linkValue'] =  getFaqUrl() + 'toons/tasks/'
  toon_tasks['title'] = 'Toon Tasks'
  toon_tasks['alt'] = 'FAQ ' + toon_tasks['title']
  return toon_tasks
}


function create_trolley_games()
{
  var trolley_games = new Object()  
  trolley_games['src'] = getSharedImagePath() + 'TT_FAQ_title_trolleygames.gif'
  trolley_games['width']  = image['width']
  trolley_games['height'] = image['height']
  trolley_games['link'] = 'yes'
  trolley_games['linkValue'] =  getFaqUrl() + 'trolley_games/'
  trolley_games['title'] = 'Trolley Games'
  trolley_games['alt'] = 'FAQ ' + trolley_games['title']
  return trolley_games
}


function getHost()
{
  url = 'http://' + location.host + '/'
  return url
}


function getFaqUrl()
{
  url = 'http://' + location.host + '/faq/'
  return url
}


function getSharedImagePath()
{
  url = 'http://' + location.host + '/shared/images/'
  return url
}


/*
function displayFaqCategory(catQuestion, catQuestionLink)
{
  document.write('<tr><td><span class="faqTopic">Select a Topic:</span><br>')
    document.write('<ul>')    
      for (i=0; i < catQuestion.length; i++)
      {
        document.write('<li><a href="'+ catQuestionLink[i]+'">'+catQuestion[i]+'</a></li>')
      }
    document.write('</ul>')      
  document.write('</td></tr>')
}
*/


/*
function displayFaqQandA(faqQuestion, faqAnswer)
{
//if the answer is not simple text but complex html that does not fit this format, do NOT use this function
//instead, just use good old html
//for example, see toons/about/control.php
  document.write('<tr><td>')
  for (i=0; i < faqQuestion.length; i++)
  {
    document.write('<p><span class="faqQA">Q:</span><span class="faqQ">'+faqQuestion[i]+'</span></p>')    
    document.write('<p><span class="faqQA">A:</span>'+faqAnswer[i]+'</p>')      
  }
  document.write('</td></tr>')
}
*/


function displayFaqForm()
{
  document.write('<br>')
  document.write('<form name="formSear" action="'+getFaqUrl()+'search.php">')
  document.write('<span class="bold">Can&#39;t find what you&#39;re looking for?</span> ')
  document.write('<input name="zoom_query" size="15">')
  document.write('<input name="submit" type="submit" value="Search">')
  document.write('</form>')
  document.write('<p>If you think you have found a problem with the game, please check a list of <a href="'+getHost()+'knownIssues.php">Known Issues</a> before reporting a bug, or sending an e-mail.<br><br>')
  document.write('Do you have a question? Your answer may be here. If you cannot find your answer <a href="'+getHost()+'problem.php">contact us</a>.</p>')
}


function displayFaqHeader(faqHeader)
{
  document.write('<tr><td align="center">')
  document.write('<img src="'+faqHeader['src']+'" width="'+faqHeader['width']+'" height="'+faqHeader['height']+'" alt="'+faqHeader['alt']+'">')  
  document.write('<br><br></td></tr>')
}


function displayFaqContent(faqContent)
{
  document.write('<tr><td>')
  displayFaqForm() 
  document.write('<table width="100%" border="0">')
  document.write('<tr><td height="13"><span class="txtSmallB"><a href="'+getFaqUrl()+'">Select New Category</a></span></td>')
  document.write('<td><div align="right">')
  if (faqContent['link']=='yes') {   
    document.write('<span class="txtSmallB"><a href="'+faqContent['linkValue']+'">Back to '+faqContent['title']+'</a></span>')
  }
  document.write('</div></td>')
  document.write('</tr></table></td></tr>')
}