<!-- begin exitpop script-->
/** --------------------------------
 *  begin execution
**/

if(!varIsDefined('exitPop')) { /* create var exitPop if necessary */ 
   var exitPop=true; 
   /* exitPop must be true if not previously defined
      --otherwise why include this exitpop script?
   */
}


/* check for a cookie opsubm - meaning orderpage submitted (on this domainname) */
if(get_cookie('opsubm') == "Y") {
  exitPop=false; /* if orderpage submitted, block pops */
} else {
  /* alert('no cookie opsubm'); */
}

/* create a temp var for use in tests below */
if(!varIsDefined('temp')) {
  var temp;
}

/* get the np var, maintain as cookie */
if(!varIsDefined('np')) { var np='N'; }
temp = GetParmEP('np');
if(temp == 'Y') {
  np = 'Y';
  SetCookie("np",np);
} else {
  temp = get_cookie('np');
  if(temp == 'Y') {
    np = 'Y';
  }
}
/* np var is set */

/* settle value of var current_affiliate:
     if any possible params have non-blank value set to the best one. 
       otherwise leave previously set current_affiliate if no args. 
*/
if(!varIsDefined('current_aff')) {  var current_aff = ""; }
temp = GetParmEP('b');
if(temp != "") { /* noop */ } else { temp = GetParmEP('af'); }
if(temp != "") { /* noop */ } else { temp = GetParmEP('affiliate'); }
if(temp != "") { current_aff = temp; }
if( current_aff == "" ){ current_aff = get_cookie('affiliate'); }
/* current_aff is now set. */


/* calls to marketing engine */
document.write('<scr' + 'ipt type="text/javascript" src="http://secure.w3track.com/newtrk/SHOW_JS_CP.php"></scr' + 'ipt>');
document.write('<scr' + 'ipt type="text/javascript" src="/eScripts/epopv2/main.js"></scr' + 'ipt>');

/* end execution */

/* functions below */

/** 
 * function get_cookie
 *  return the cookie value of cookie Name or "" if not ext.
 * *used below 
 **/
function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) { // if the cookie exists
      offset += search.length
      end = document.cookie.indexOf(";", offset); // set the index of beginning value
      if (end == -1) // set the index of the end of cookie value
        end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
    }
  }
  return returnvalue;
}

/**
 * function GetParmEP 
 *  return the url param's value or "" if none
 * *used below
 **/
function GetParmEP(name) {
   SCH = document.location.search;
   SCH = "?&" + SCH.substring(1,SCH.length);
   // alert('SCH = ' + SCH);
   var start = SCH.indexOf("&" + name+"=");
   var len = start+name.length+2;
   if ((!start) && (name != SCH.substring(0,name.length))) return("");
   if (start == -1) return "";
   var end = SCH.indexOf("&",len);
   if (end == -1) end = SCH.length;
   // alert('finished getting parm ' + name);
   return unescape(SCH.substring(len,end));
}

/**
 * function SetCookie (name, value)
 * set a cookie. NOTE: this can be overloaded with args 3-5 as well 
 * *used below
 **/ 
function SetCookie (name, value) {
        var argv = SetCookie.arguments;
        var argc = SetCookie.arguments.length;
        var expires = (argc > 2) ? argv[2] : null;
        var path = (argc > 3) ? argv[3] : null;
        var delay = (argc > 4) ? argv[4] : null;
        var secure = (argc > 5) ? argv[5] : false;
        document.cookie = name + "=" + escape (value) +
        ((expires == null) ? "" : ("; expires=" + expires)) +
        ((path == null) ? "" : ("; path=" + path)) +
        ((delay == null) ? "" : ("; delay=" + delay)) +
        ((secure == true) ? "; secure" : "");
}

/**
 * function varIsDefined 
 *  return true/false for whether a var has been defined
 *    in the global (window) context
 * *used below
**/
function varIsDefined(variable) {
  return (typeof(window[variable]) == "undefined") ?  false: true;
}


/* end functions */

<!-- end exitpop script -->

