    $(document).ready(function () 
    {
      box();
      $("a").live('mouseover', function() 
      {
        var link = $(this).attr("href");
        if(link != undefined)
        {
          var i = (link).indexOf('/');
          var j = (link).indexOf('.');
          if(i == -1 && j == -1)
            $(this).attr('href','#/' + link);
        }
      });

      $("a").live('click', function() 
      {
        var link = $(this).attr("href");
        if(typeof(link)=="undefined")
          link = $(this).attr("name");
        if(link.charAt(0) == '#')
          link = link.substring(1);
        if(link.charAt(0) != '/')
          link = '/'+link;
        $.ga.load('UA-628880-2', function(pageTracker)
        {
          pageTracker._trackPageview(link);
        });
      });

      $("#top_menu a").live('click', function() 
      {
        if($(this).attr("title") != 'Tłumaczenia.pl-Promocje')
          $('#promotions').hide();
      });

      $("#kontakt_box").live('mouseenter', function()
      {
        $(this).animate({right: 0},200);
      });

      $("#kontakt_box").live('mouseleave', function()
      {
        $(this).animate({right: '-176px'},200);
      });

      $("div.cont_right").live('mouseenter', function()
      {
        $(this).css('background','#d4893d');
      });

      $("div.cont_right").live('mouseleave', function()
      {
        $(this).css('background','none');
      });

      $("#skype_link").live('click', function()
      {
        $.ga.load('UA-628880-2', function(pageTracker) 
        {
          pageTracker._trackPageview('skype');
        });
      });

      $.fn.qtip.styles.login = 
      {
      }

      $("#login").qtip(
      {
        content: {url: '/site/login'},
        position: 
        {
          corner: 
          {
            target: 'bottomLeft',
            tooltip: 'topRight'
          }
        },
        style:
        {
          name: 'login',
          width:  290,
          height: 200,
          padding: 0,
          background: 'transparent url(../images/bg.png) repeat scroll 0 0'
        },
        show: 
        {
          delay:  0,
          when:   'click',
          effect: 'slide'
        },
        hide: 
        {
          when:   {event: 'unfocus'},
          effect: 'slide'
        }
      });
      $("#new_form_tr").qtip(
      {
        content: {url: '/order/newform'},
        position: 
        {
          type: 'absolute',
          target: $(document.body), // Position it via the document body...
          corner: 'center' // ...at the center of the viewport
        },
        style:
        {
          border: 
          { 
            width: 1,
            color: '#939393'
          },
          background: '#efefef',
          width:  950,
          height: 525,
          padding: 0
        },
        show: 
        {
          delay:  0,
          when:   'click'
        },
        hide: { when:false },
        api:
        {
          onShow: 
            function()
            {
              $.ga.load('UA-628880-2', function(pageTracker) 
              {
                pageTracker._trackPageview('otworzono_formularz_wyceny');
              });
            }
        }
      });
      var name = window.location.pathname.substr(1,6);
      if(name == 'wycena')
        $('#new_form_tr').trigger('click');
    });

    function box()
    {
      $("#kontakt_box").animate({right: 0},200).delay(3000).animate({right: '-176px'},200);
    }

    $("#pendrives").qtip(
    {
      content: '<img src = "../images/pendrive_all.jpg" />',
      position: 
      {
        corner: 
        {
          target: 'bottomRight',
          tooltip: 'topLeft'
        }
      },
      style:
      {
        width:  400,
        height: 196,
        padding: 0,
      },
    });

    $("#pen_info").qtip(
    {
      content: '<table class = "pendrive_tip"><tr><th>Wartość zamówienia:</th><th>Pojemność:</th></tr>'+
               '<tr><td>300 - 500 zł</td><td>2 GB</td></tr>'+
               '<tr><td>500 - 800 zł</td><td>4 GB</td></tr>'+
               '<tr><td>800 - 1200 zł</td><td>8 GB</td></tr>'+
               '<tr><td>powyżej 1200 zł</td><td>16 GB</td></tr></table>',
      position: 
      {
        corner: 
        {
          target: 'bottomRight',
          tooltip: 'topLeft'
        }
      },
      style:
      {
        border: 
        { 
          width: 1,
          color: '#939393'
        },
        background: '#efefef',
        width:  250,
        height: 100,
        padding: 0
      },
    });
