(function($) {
   /* use jQuery as container for more convenience */
   $.popunder = function(sUrl,sWidth,sHeight) {
       var _parent = self;
       var bPopunder = !($.browser.mozilla && $.browser.version >= '2.0');
       
       if (top != self) {
           try {
               if (top.document.location.toString()) {
                   _parent = top;
               }
           }
           catch(err) { }
       }
       
       /* create popunder dummy*/
       /* var popunder = _parent.window.open('about:blank', 'pu_' + Math.floor(89999999*Math.random()+10000000), 'toolbar=0,scrollbars=1,location=1,statusbar=1,menubar=0,resizable=1,width=' + sWidth + ',height=' + sHeight); */
	   var popunder = _parent.window.open('about:blank', 'jobinaclick_co_uk', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=' + sWidth + ',height=' + sHeight);
       if (popunder) {
           popunder.blur();
           if (bPopunder) {
               /* classic popunder, should work on webkit*/
               popunder.location = sUrl;
               _parent.window.blur();
               _parent.window.focus();
               try { opener.window.focus(); }
               catch (err) { }
           }
           else {
               /* popunder for e.g. ff4 */
               popunder.init = function(e) {
                   with (e) {
                       (function() {
                           if (typeof window.mozPaintCount != 'undefined') {
                               var x = window.open('about:blank');
                               x.close();
                           }

                           try { opener.window.focus(); }
                           catch (err) { }
                           window.location = e.params.url;
                       })();
                   }
               };
               popunder.params = {
                   url: sUrl
               };
               popunder.init(popunder);
           }
       }
            
       return this;
   }
})(jQuery);

