  var exit=true;
  var showPopupOnExit = true;
  var tmpDomainName = "www.emoticone.biz";
  var tmpDomainLen = tmpDomainName.length;
  function doNotShowPopupOnExit() { showPopupOnExit = false; }
  
  function popupOnExit() {
   var showpopup = true;
   if (document.all) {
    var tmp, tmpSiteName, tmpSiteLen;
    tmpSiteName = "http://"+tmpDomainName;
    tmpSiteLen = tmpSiteName.length;
    if (document.activeElement) {
     if (document.activeElement.href)  {
      tmp = document.activeElement.href;
	  if (tmp.substr(0,tmpSiteLen)==tmpSiteName) showpopup = false;
     } else if (document.activeElement.type=="submit") showpopup = false;
    }
   }
      

   if (showpopup) funcOnExit();
 }
  
  function funcOnExit() {
   if (showPopupOnExit) { 
     window.open("http://www.woopami.com/","woopami");
   }
  }

function updatelinks() {
  var all_links = document.links; 
  for (i=0; i<=(document.links.length-1); i++) {
    //alert(document.links[i].hostname+ "->"+tmpDomainName);
    if ((document.links[i].hostname).substr(0,tmpDomainLen)==tmpDomainName || (document.links[i].target!="" && document.links[i].target!="_self")) (document.links[i]).addEventListener("click", doNotShowPopupOnExit, false);
  }
  var all_forms = document.forms;
  for (i=0; i<=(document.forms.length-1); i++)
    (document.forms[i]).addEventListener("submit", doNotShowPopupOnExit, false);
}

//  if (!document.all) window.onload = updatelinks;
//  window.onunload = popupOnExit;

