
// Sets or increments the "mkc=N" counter in the PERSANNON cookie.
// If N >= 8 && link==1: adds "&minireg=1" to navigation links
// If N >= 8 && link!=1: window.document.detail.minireg.value = "1"

<!--
  function periodicCookie(link,cookname,limit,urlval,periodic)
  {
    // cookname = "PERSANNON"
    // limit = 5

    // read in the cookie
    var ckHash = new Array();
    var result = readTheCookie(ckHash, cookname);

    if (result == false)
    {
      // no cookie set yet
      var cookieStr = "mkc=1";

      WM_setCookie(cookname, cookieStr, 168, "", "personals.yahoo.com", "");
      return;
    } else {
      // check the if the user has reached the ad view limit (8)
      var count = ckHash["mkc"];

      if (count < limit)
      {
        count++;
        var cookieStr = "mkc=" + count;
        WM_setCookie(cookname, cookieStr, 168, "", "personals.yahoo.com", "");
        return;
      } else {
        // the user has reached their max number of ad viewed
        // send them to mini registration

	// No, removing the cookie here would let them close the minireg
	// window and then get 5 more ad views
        if(periodic == 1) {
	  WM_killCookie(cookname, "", "personals.yahoo.com");
        }

        if (link == 1)
        {
	  if (navigator && navigator.appName && (navigator.appName == 'Netscape')) {
	    for (var i = 0; i < document.links.length; i++) {
	      if (document.links[i].href.indexOf("/display?ct_hft=preview&") != -1) {
	        document.links[i].href += "&";
	        document.links[i].href += urlval;
		document.links[i].href += "=1";
	      }
	    }
	  } else {
            var oObject = document.anchors("navanch");

            if (oObject != null)
            {
              if (oObject.length != null)
              {
                for (i = 0; i < oObject.length; i++) {
                  oObject(i).href = oObject(i).href + "&" + urlval + "=1";
	        }
              }
            }
	  }
        }
        else
          window.document.detail.minireg.value = "1";
      }
    }
  }	

  function miniReg(link)
  {
    periodicCookie(link,"PERSANNON",8,"minireg",0);
  }	

  function pleasePost()
  {
    periodicCookie('1',"PERSPOST",15,"pleasepost",1);
  }
//-->






