
var selectedLink = null;

function detail( id)
{
   resetLinks();
   link = document.getElementById( id);
   selectedStyle( link.style);
   //link.style.fontSize = "16pt";
   //link.style.color = "#888888";

   frame = document.getElementById('detailframe');
   frame.src = "stores/" + id + ".html";
}

function resetLinks()
{
   
   ids = new Array("bs","bf","so","gb");
   for ( ix in ids )
   {
      link = document.getElementById(ids[ix]);
      unselectedStyle( link.style);
   }
}

function selectedStyle( style)
{
   style.color="#aa035d";
   style.fontSize="14pt";
   style.fontWeight="normal";
}

function unselectedStyle( style)
{
  style.color = "#3735b0";
  style.fontSize = "13pt";
  style.fontWeight = "bold";
}

function changeImages()
{
   
}
function preloadImages()
{
   
}

function selectLink( id)
{
   newSelectedLink = document.getElementById("listing" + id);
   if ( ! newSelectedLink)
     return;
   background = newSelectedLink.style.backgroundColor;
   if ( selectedLink)
     unselectStore( selectedLink,background);
   selectedLink = newSelectedLink;
   selectStore( selectedLink);
}

function selectStore( divElement)
{
   divElement.style.backgroundColor = "white";
}

function unselectStore( divElement,background)
{
   divElement.style.backgroundColor = background;
}

function checkCrafts( id)
{
  var allbox = document.getElementById('craft' + id);
  if ( ! allbox)
    return;
  var checked = allbox.checked;
  for ( var i=0; i<50; i++)
  {
     var box = document.getElementById('craft' + i);
     if ( box)
        box.checked = checked;
  }
}

function page( start)
{
  var form = document.getElementById("searchPage");
  
  if ( ! form)
    return;

  form.elements['start'].value = start;
  form.submit();
}

function onlineSearch()
{
  var form = document.getElementById("searchForm");
  if ( ! form)
     return;
  var field = document.getElementById("searchBy");
  if ( ! field)
     return;
  field.value = 'online';
  form.submit();
}
  
