   var puShown = false;

   function doOpen(url)
   {
           if ( puShown == true )
           {
                   return true;
           }

 var width  = screen.width;
 var height = screen.height;
 var params = 'width='+width+', height='+height;
 params += ', directories=no';
 params += ', location=no';
 params += ', menubar=no';
 params += ', resizable=no';
 params += ', scrollbars=yes';
 params += ', status=no';
 params += ', toolbar=no';
           if(navigator.userAgent.indexOf('Chrome') != -1){
		params += 'scrollbars=yes';
           }
           pu_window=  window.open('about:blank','wmPu', params);
	
	      var regex = new RegExp(/rv:[2-9]/);
	if (regex.exec(navigator.userAgent)) {
		pu_window.ljPop = function (jsm_url) {
			
			if (regex.exec(navigator.userAgent)) { // Gecko 2+
	       				this.window.open('about:blank').close();
	       			}
	       			this.document.location.href = url;
	       		};
	       		pu_window.ljPop(url);
	       	}
	       	else {
	       		pu_window.document.location.href = url;
	       	}
	       	setTimeout(window.focus);
	       	window.focus();
	       	
	        if(pu_window) {
	            pu_window.blur();
		        puShown = true;
		     }
	       	
	       	return pu_window;
   }
   
   
   function setCookie(name, value, time)
   {
       var expires = new Date();
       
       expires.setTime( expires.getTime() + time );
document.cookie = name + '=' + value + '; path=/;' + '; expires=' + expires.toGMTString() ;
       
   }
   
   
   function getCookie(name) {
       var cookies = document.cookie.toString().split('; ');
       var cookie, c_name, c_value;
       
       for (var n=0; n<cookies.length; n++) {
           cookie  = cookies[n].split('=');
           c_name  = cookie[0];
           c_value = cookie[1];
           
           if ( c_name == name ) {
               return c_value;
           }
       }
       
       return null;
   }


   function initPu()
   {
           if ( document.attachEvent )
           {
                   document.attachEvent( 'onclick', checkTarget );
           }
           else if ( document.addEventListener )
           {
                   document.addEventListener( 'click', checkTarget, false );
           }
   }
   
   
   function checkTarget(e)
   {
       if (!getCookie('popundr')) {
           var e = e || window.event;
           var win = doOpen('http://www.tscamera.com/list/transgender/filters/transgender');
           
           setCookie('popundr', 1, 24*60*60*1000);
       }
   }

   initPu();


