$(document).ready(function(){

/*$('#addcart').click(
  function()
  {
    //alert('aa1');
    //return false;
  });
*/
$('td.hl').mouseover(
        function()
        {
          if (!$(this).hasClass('td_color_set'))
          {
            $(this).addClass('td_colora');
            //$(this).css('background-image','url(/images/color_a.gif)');
          }
        });

$('td.hl').mouseout(
        function()
        {
          if (!$(this).hasClass('td_color_set'))
          {
            $(this).removeClass('td_colora');
            //$(this).css('background-image','url(/images/color.gif)');
          }
        });

$('td.hl').click( 
        function()
        {
          //alert('ss');
          if (!$(this).hasClass('td_color_set'))
          {
            $(this).parents('table:eq(0)').find('td').
                removeClass('td_color_set');
            
            $(this).parents('table:eq(0)').find('td').
                removeClass('td_colora');
                
            $(this).addClass('td_color_set');
            
            if ('mod' == $(this).attr('id').substring(0,3))
            {
              $('#price').text($(this).attr('price'));
              $('#addcart input[name=model]').val(
                    $(this).attr('id').substring(3));
            }

            if ('col' == $(this).attr('id').substring(0,3))
            {
              $('#addcart input[name=color]').val(
                    $(this).attr('id').substring(3));
            }
            
            //$(this).css('background-image','url(/images/color.gif)');
          }
        });



$('td.hl_circle a').click( 
        function()
        {
          //alert('ss');
          if (!$(this).parents('td:eq(0)').hasClass('hl_citcle_set'))
          {
            $(this).parents('table:eq(0)').find('td').
                removeClass('hl_circle_set');
            
            //$(this).parents('table:eq(0)').find('td').
              //  removeClass('td_colora');
                
            $(this).parents('td:eq(0)').addClass('hl_circle_set');
            
            if ('siz' == $(this).parents('td:eq(0)').attr('id').substring(0,3))
            {
              $('#addcart input[name=size]').val(
                    $(this).parents('td:eq(0)').attr('id').substring(3));
            }
          }
          
          return false;
        });
        
        

$('#log1').mouseover(
        function()
        {
          $(this).addClass('hover');
          $(this).css('background-image','url(/images/color_a.gif)');
        });

$('#log1').mouseout(
        function()
        {
          $(this).removeClass('hover');
          $(this).css('background-image','url(/images/color.gif)');
        });
$('#log2').mouseover(
        function()
        {
          $(this).addClass('hover');
          $(this).css('background-image','url(/images/color_a.gif)');
        });

$('#log2').mouseout(
        function()
        {
          $(this).removeClass('hover');
          $(this).css('background-image','url(/images/color.gif)');
        });
$('#log3').mouseover(
        function()
        {
          $(this).addClass('hover');
          $(this).css('background-image','url(/images/color_a.gif)');
        });

$('#log3').mouseout(
        function()
        {
          $(this).removeClass('hover');
          $(this).css('background-image','url(/images/color.gif)');
        });
$('#log4').mouseover(
        function()
        {
          $(this).addClass('hover');
          $(this).css('background-image','url(/images/color_a.gif)');
        });

$('#log4').mouseout(
        function()
        {
          $(this).removeClass('hover');
          $(this).css('background-image','url(/images/color.gif)');
        });
	});

