/*
//*******
//  filename: shop.ts
//  author:   Zack Brown
//  date:     2nd March 2008
//  comments:
//
//  provides wrapper functions for saucy shop visuals
*/

function search_switcher(id)
{
  //get search elements by id
  var category_search = document.getElementById('category_search');
  var keyword_search = document.getElementById('keyword_search');
  
  //get menu elements by id
  var category_search_menu = document.getElementById('category_search_menu');
  var keyword_search_menu = document.getElementById('keyword_search_menu');
  
  //get elements to reveal by id
  var focus_search = document.getElementById(id);
  var focus_search_menu = document.getElementById(id + '_menu');

  //hide search elements
  category_search.style.display = 'none';
  keyword_search.style.display = 'none';
  
  //reveal search element
  focus_search.style.display = 'block';
  
  //hide selected menus
  category_search_menu.className = '';
  keyword_search_menu.className = '';
  
  //set selected menu
  focus_search_menu.className = 'selected_search_menu';
}

function popup_image(image, title, width, height)
{
  //window params
  params = 'width=' + (parseInt(width) + 40) + ', ';
  params += 'height=' + (parseInt(height) + 85) + ', '; 
  params += 'directories=no, ';
  params += 'fullscreen=no, ';
  params += 'location=no, ';
  params += 'menubar=no, ';
  params += 'resizeable=no, ';
  params += 'scrollbars=no, ';
  params += 'status=no, ';
  params += 'titlebar=no, ';
  params += 'toolbar=no, ';
  params += 'top=10, ';
  params += 'left=10';
  
  //create a new window
  new_window = window.open('', '', params);
  
  //add content to the window
  new_window.document.write('<img style="margin:10px;" src="' + image + '" alt="' + title + '" width="' + width + '" height="' + height + '" />');
  new_window.document.write('<p style="text-align: center;"><a style="color: #6197AE;" href="javascript:window.close();" title="Close this window.">Close Window</a></p>');
  
  //hand over focus to the new window
  new_window.focus();
}
