jQuery.fn.ForceNumericOnly =
function()
{
    return this.each(function()
    {
        jQuery(this).keydown(function(e)
        {
            var key = e.charCode || e.keyCode || 0;
            // allow backspace, tab, delete, arrows, numbers and keypad numbers ONLY
            return (
                key == 8 || key == 9 ||
                (key >= 48 && key <= 57) ||
                (key >= 96 && key <= 105));
        })
    })
};

jQuery.noConflict();
if (jQuery.browser.msie && jQuery.browser.version.substr(0,1)<7)
{
  jQuery(
  function()
    {
      DD_belatedPNG.fix('.spritepng');
    }
  );
}
else
{
  jQuery(function(){
    jQuery('div.search .jNice').jNice();
  });
}
jQuery(function(){
  jQuery('td.checkbox.jNice').jNice();
  Cufon.replace('div.sidebar ul li a, .order h2, .order h3', { fontFamily: 'Univers'});
  Cufon.replace('h3.containerheading', { fontFamily: 'Univers', lineHeight: '7px'});
  jQuery('div.carousel ul').jcarousel({
        scroll: 1,
        visible: 1,
        wrap: 'last',
        auto: 12,
        buttonNextHTML: null,
        buttonPrevHTML: null,
        itemVisibleInCallback: {
          onAfterAnimation: function(instance, object, index, action){
            jQuery('div.container div.carousel div.commands a').attr('class', 'spritepng');
            jQuery('div.container div.carousel div.commands a').each(function(){
              if(jQuery(this).text() == index)
              {
                jQuery(this).attr('class','spritepng active');
              }
            });
          } 
        },
        initCallback: function(carousel){
          jQuery('div.carousel div.commands a').click(function(){
           carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
         }); 
        }
    });
  jQuery(".tagcloud").tagcloud({type:'list', height: 200, sizemin:12, sizemax: 20}).find('li').tsort({order: 'rand'});
  jQuery('div.produsbig a[rel="facebox"]').facebox();
  jQuery('.specs dl dt:even, .specs dl dd:even').attr('class', 'odd');
  jQuery('.specs dl dt:odd, .specs dl dd:odd').attr('class', 'even');
  jQuery('span.jNiceCheckbox').click(function(){
    window.location = jQuery(this).parent().find('input').val();
  });
  jQuery('a.comenteaza').click(function(){
    if(jQuery('#reviewForm').is(':visible'))
    {
      jQuery('#reviewForm').slideUp();
    }
    else
    {
      jQuery('#reviewForm').slideDown();
    }
  });
  
});

