function isIn( str, ra ) {
  if( ra && str ) {
    for( var i=0; i<ra.length; i++ ) {
      if( ra[i] == str ) {
        return true;
      }
    }
  }
  return false;
}

var vars = new Array();
if( window.location.href.indexOf("?") > 0 )
  vars = window.location.href.substring(window.location.href.indexOf("?")+1).split("&");
var trackerVars = "";
var ptVarNames = new Array("ref_code");
var ptVars = new Array();
var count = 0;
for( var i=0; i<vars.length; i++ ) {
  ptVars = vars[i].split("=");
  if( isIn(ptVars[0], ptVarNames) ) {
    trackerVars += ptVars[1];
    break; // stop at first
  }
//    trackerVars += "&" + vars[i];
}
if( trackerVars ) {
  setCookie("pt", escape(trackerVars), 730); // 2 years
  // referrer does not contain CPAexcel.com
  if( document.referrer.indexOf('CPAexcel.com/') < 0 ) {
    document.write("<scr" + "ipt type=\"text/javascript\" src=\"/pttrackland.jsp\"><\/scr" + "ipt>");
  }
}
