var popwin;
function popWin(url) {
  popwin = window.open(url,'popwin');
  return popwin;
}

// exitpop_remote scripting:
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 isDefined(ckVar)


    {
    	var DEFINED_V=true;
    	


        	function handleError() {
        	DEFINED_V=false;
        	return true;
        	}
        	var oldOnError=window.onerror;
        	window.onerror=handleError;
        	try { 
        		eval(ckVar);
        	}catch (e) 
        	{ DEFINED_V=false;
        	}
        	window.onerror=oldOnError;
        	return DEFINED_V;
    }


if(!isDefined('current_aff')) {
  var current_aff = ""; // null;
}
if( (current_aff == null) || (current_aff == "") ){
  current_aff = get_cookie('affiliate');
}
// alert(document.location.pathname);
var dir = document.location.pathname;
dir = dir.substring(1,dir.length);
var i=1;
var lastIndex = -1;
var loopcount = 0;
var i = dir.lastIndexOf("/");
dir = dir.substring(0,i);
/*
// var i = 
if(document.location.pathname != '/') {
  var dir = document.location.pathname;
} else {
  var dir = "";
}
*/
var host = document.location.hostname;
// var MY_URL = 'https://secure.excellnow.com/order/popup/exitpop_remote.php?site=' + host + '&af=' + current_aff + '&dir=' + dir;
var MY_URL = 'https://www.urbannutritioninc.com/urbaninc/popup/exitpop_remote.php?site=' + host + '&af=' + current_aff + '&dir=' + dir;

// document.write(current_aff + '<br>' + MY_URL+'<br>\n');
document.write('<SCR'+'IPT LANGUAGE=javascript src="' + MY_URL + '"></scr'+'ipt>');

