$(function(){
  $('table.navigation_bar td.content a img').mouseover(function(){
	  if($(this).attr("src").match(/_over/)) return;
    $(this).attr("src", $(this).attr("src").replace(/\.gif/, "_active.gif"));
  });
    
  $('table.navigation_bar td.content a img').mouseout(function(){
    $(this).attr("src", $(this).attr("src").replace(/_active/, ""));   
  });
  
  $('img.accept').click(function(){
    $.post(Registry.URL_ACCEPT_TERMS, { accept: true }, function(response){
       toUrl(Registry.URL_SHOPPING_CART);       
    });  
  });
  
  $('img').each(function(){
    if($(this).attr("src").match(/nav_/))
    {
      $(this).mouseover(function(){
    	  if($(this).attr("src").match(/_over/)) return;
        $(this).attr("src", $(this).attr("src").replace(/\.gif/, "_active.gif"));
      });
        
      $(this).mouseout(function(){
        $(this).attr("src", $(this).attr("src").replace(/_active/, ""));   
      });
    }
  });
  
  /* MAGIG BUTTONS */
  //---------------------------------------------------------------------
  $('.magic').mouseover(function(){
    //alert(1);
  	var newSrc = $(this).attr("src").replace(/\.gif/, "_hover.gif");    	
  	$(this).attr("src", newSrc);
  });
  
  $('.magic').mouseout(function(){
  	$(this).attr("src", $(this).attr("src").replace(/_hover/, ""));
  });
  //---------------------------------------------------------------------
  
  
  
});

function getElem(id)
{
  return document.getElementById(id);
}

function highlight(unitId)
{
  for (var i = 1; i < 10; i++)
  {
  	unhighlight(i);
  }
  if(unitId < 5) unitId = 1;
  setTimeout(function(){
    getElem('unit'+unitId).style.backgroundColor = '#900';  	
  },100);
  
}
function unhighlight(unitId)
{
  if(unitId < 5) unitId = 1;
  getElem('unit'+unitId).style.backgroundColor = '';
}