/*
$(document).ready(function() {
    var clip, a;
    ZeroClipboard.setMoviePath( '/media/promoscode.com/ZeroClipboard.swf' );
    $('.coupon').each(function() {
        $(this).mouseover(function() {
            var code = $(this).find('.code');
            var a = code.find('a');
            var btn = $(this).find('.btnuse');
            if (clip) {
                clip.destroy();
            }
            clip = new ZeroClipboard.Client();
            clip.setText( a.text() );
            clip.setHandCursor(true);
            clip.glue( btn.get(0) );
            clip.addEventListener('onComplete', function() {
                var link = a.attr('href');
                var open = window.open(link, '_blank');
                if(!open) {
                    window.location = link;
                } 
            });
            code.addEventListener( 'onMouseOver', function() {
                a.qtip({
                   content: 'Copy the code and go to the site',
                   show: {'ready':true},
                   hide: false,
                   style: {
                      border: {
                         width: 5,
                         radius: 10
                      },
                      padding: 10, 
                      textAlign: 'center',
                      tip: true,
                      name: 'green',
                   }
                });
            });
            code.addEventListener( 'onMouseOut', function() {
                a.qtip('destroy');
            });
        });
    });
});
*/

$(document).ready(function() {
    $('.btnuse').qtip({
       content: 'Copy the above code into clipboard then click here',
       show: 'mouseover',
       hide: 'mouseout',
       style: {
          border: {
             width: 5,
             radius: 10
          },
          padding: 10, 
          textAlign: 'center',
          tip: true,
          name: 'green',
       }
    })
    $('.btnredeem').qtip({
       content: 'Click this button to redeem coupon',
       show: 'mouseover',
       hide: 'mouseout',
       style: {
          border: {
             width: 5,
             radius: 10
          },
          padding: 10, 
          textAlign: 'center',
          tip: true,
          name: 'green',
       }
    })
});
