function mycarousel_initCallback(carousel)
{
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });
    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

function setHeaderPosition(){
  var flash=$(".flash_header");
  var f_width=flash.css('width');
  var width=$(document).width();
  var phone_block=$(".phone_block");
  var ex=0;
  f_width=f_width.replace("px","");
  ex=((width-f_width)/2);
  
  var tx=9.6;
  if(width<1400){tx=(400/100*(width-1000))*0.006;}
  
  //document.title=tx;
  
  flash.css({left:ex+'px'});
  phone_block.css({right:tx+'%'});
}
$(function(){
  // Flash Header Correct
  setHeaderPosition();
  $(window).resize(function(){
    setHeaderPosition();
  });
  
  $(".left_menu a").click(function(){
    if($(this).parent().find('ul').size()==1){
      $(this).parent().find('ul').toggle();
      $(this).parent().toggleClass('open');
      
      return false;
    };
  });
  
  $(".catalog_set").click(function(){
    var rel=$(this).attr('rel');
    if($(this).hasClass('catalog_set_act')){
      $(this).removeClass('catalog_set_act');
    }else{
      $(this).addClass('catalog_set_act');
    }
    
    $(".catalog_block[rel="+rel+"]").toggle();
    
    return false;
  });
  
  // Form Hints
  $("input[val]").each(function(){
    $(this).addClass('hinting').val($(this).attr('val'));
    $(this).focus(function(){
      if($(this).attr('val')==$(this).val()){
        $(this).removeClass('hinting').val('');
      }  
    });
    $(this).blur(function(){
      if($(this).val()==""){
        $(this).addClass('hinting').val($(this).attr('val'));
      }  
    });
  });
  
  // Product Desc
  $(".product_desc table tr:odd").addClass('odd');
  $(".product_desc table td a img").each(function(){
    $(this).css({'position':'absolute','margin-top':'3px'});
    $(this).parent().parent().css({'padding':'0px','vertical-align':'top','width':'84px'});
  });
  
  $(".cats1").hover(function(){
    var rel=$(this).attr('rel');
    $(".cats1").removeClass('active');
    $(this).addClass('active');
    $(".cats1_hint").hide();
    $(".cats1_hint[rel="+rel+"]").show();
  });
  
  
  
})
