<!-- hiding code from bad browsers
// this is for any index pages

// Atlas landing page code
// added 7/5/2005
// atlas code moved to actual pages
// atlas code moved to actual pages


// added to cookie customer info
// passed as ?b=1001&cinfo=fn:eric|ln:tester|adr:123+fake|cty:NY|st:NY|zp:11111|ctry:CA|em:ere@test.com|ph:212-222-2222
var cinfo = "";
cinfo = Get_Parm('cinfo');
if( (cinfo != "") && (cinfo != null) ) {
  SimpleCookie('cinfo',cinfo,60*24*30,"/");
//  alert('set cinfo to '+ cinfo);
}

// modified per Matt req by ericw 4/8/2004

var AFFILIATE_IF_BLANK = "NA";
var NEW_AFFILIATE_OVERWRITES = true;

// a pipe separated list of affiliatecodes to disable
var disabledCodes = "||";

// please also check that this page exists on this website
var disabledpage = "/disabled.html";

var idnum = Get_Parm("b");

if(disabledCodes && (idnum != "") ) {
  var index1 = disabledCodes.indexOf(idnum);
  if(index1 >= 0) {
    document.location = disabledpage;
    // alert('kill');
  } else {

  // alert(document.location);
  }
}


var banner = GetCookie('affiliate');
var idnum = "";
var pid="";

// don't overwrite affiliates
if(!(NEW_AFFILIATE_OVERWRITES) && (banner != null) && (banner != "")  ) {
  // alert('keeping banner : ' + banner);
  idnum = banner;
} else {
  idnum = Get_Parm("b");
  // alert('setting idnum:' + idnum);

  if( (idnum == null) || (idnum == "") ) {
    // idnum = AFFILIATE_IF_BLANK;
  } else {
    pid=Get_Parm('pid');
  }
}

// old schema
/*
var banner = GetCookie('affiliate');
var idnum = Get_Parm("b");
var pid=Get_Parm('pid');
*/
var days2expire=60; // cookie expires in 60 days

var testing = "n";

function Get_Parm(name) {
    return(new_get_parm(name));
}

function new_get_parm(name) {
    SCH = document.location.search;
    var args = SCH.substring(1);
    // alert('SCH = ' + SCH);
    var start = SCH.indexOf(name+"=");
    var len = start+name.length+1;
    var temp = new Array();
    var j;
    var val = '';
    temp = args.split('&');
    for(i=0;i<temp.length;i++) {
       j=temp[i].indexOf('=');
       if(temp[i].substring(0,j) == name) {
	 val = temp[i].substring(j+1);
       }
       // alert(temp[i].substring(0,j) + ' => ' + temp[i].substring(j+1));
    }
    // alert('Get_Parm('+name+')...SCH: ' + SCH );
    return(val);
}
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 SimpleCookie (cookieName, cookieValue, expires_in_minutes,path) {
  var expDate = new Date();
  expDate.setTime( expDate.getTime() + (expires_in_minutes * 60 * 1000) );
  SetCookie(cookieName,cookieValue,expDate.toGMTString(),path);
}

function GetCookie(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 DeleteCookie (name) {
	var exp = new Date();
	exp.setTime (exp.getTime() - 1);
	var cval = GetCookie (name);
	document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}


function SimplePopUnder(pageURL,h,w){
    h = parseInt(h);
    w = parseInt(w);
    if( (h == null) || (h == "") || (h == 0) || isNaN(h)) {
	  h=465;
	}
	if( (w == null) || (w == "") || (w == 0) || isNaN(w)) {
	  w=350;
	}

	var top='',left='';
	var smnNavUA = navigator.userAgent.toLowerCase();
	var	smnIE = (smnNavUA.indexOf('msie')>-1) && (smnNavUA.indexOf('opera')==-1) && (smnNavUA.indexOf('aol')==-1) && (smnNavUA.indexOf('webtv')==-1);
	var sOpt = 'width=' + w + ',height=' + h;
	if((parseInt(navigator.appVersion)>=5)&&!smnIE) sOpt += ',location=1';
	if(navigator.appVersion.indexOf("AOL") > 0) {
	  return;

        	}
	// alert('name:' + navigator.appName + '\n' + 'version:' + navigator.appVersion + '\ncode:' + navigator.appCodeName);
	var top=((screen.height-h)/2);
	top -= Math.round(top * smnTOffset);
	var left=((screen.width-w)/2);

	if (smnIE) sOpt += ',top=4000,left=4000';
	else sOpt += ',top=' + top + ',left=' + left;

	var nw = window.open('about:blank','nw',sOpt);

	// self.focus();
	// setTimeout("this.window.focus()",2000);

	if (nw.window.moveTo) nw.window.moveTo(left,top);
	nw.window.location = pageURL;
	nw.blur();
	// self.focus();
}

function affiliate2form() {
// in a form, use this:
  var banner = GetCookie('affiliate');
  if( (banner != null) && (banner != "") ) {
	document.write('<input type="Hidden" name="affiliate" value="'+ banner+'">');
  } else {
	document.write('<input type="Hidden" name="affiliate" value="0">');
  }
}

function Get_Parm_Normal(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));
}
var banner = GetCookie('affiliate');
function MAP_pixel(siteAcct) { // changed to use myaf_tracked cookie, and not require b on the url string
  var idnum = Get_Parm("b"); // only set the map pixel when passed in this way
  var subid = Get_Parm("sub");
  var myaf_tracked = GetCookie('myaf_tracked');
  if( (idnum != null) && (idnum != "") ) {
    SimpleCookie('myaf_tracked',idnum,60*24*days2expire,"/"); // simple cookie uses minutes
    document.write('<img src="https://www.myaffiliateprogram.com/u/'+siteAcct+ '/t.asp?id=' +idnum+ '&sub=' + subid +'" height=1 width=1 border=0>');
    //alert('<img src="https://www.myaffiliateprogram.com/u/'+siteAcct+ '/b.asp?id=' +idnum+ '" height=1 width=1 border=0>"');
  } else if( (banner != null) && (banner != "") && (banner != myaf_tracked) ) {
    SimpleCookie('myaf_tracked',banner,60*24*days2expire,"/"); // simple cookie uses minutes
    document.write('<img src="https://www.myaffiliateprogram.com/u/'+siteAcct+ '/t.asp?id=' +banner+ '&sub=' + subid +'" height=1 width=1 border=0>');
    // alert(idnum);
  }

  <!--MNME Code-->
  var scriptUrl='https://secure.w3track.com/newtrk/click_js_urbsite.php?ENGINE=URB&cp=' + escape(Get_Parm_Normal('cp')) + '&ucp=' + escape(Get_Parm_Normal('ucp')) + '&mcp=' + escape(Get_Parm_Normal('mcp')) + '&rf='+escape(document.referrer) + '&wu=' + escape(document.location)
	+ '&b=' + escape(Get_Parm_Normal('b')) + '&af=' + escape(Get_Parm_Normal('af'));
  // document.write(scriptUrl);
  document.write('<scr' + 'ipt language="JavaScript" src="' + scriptUrl + '"></scr' + 'ipt>');
  <!--END MNME Code-->
}


function MAP_pixel_manual(siteAcct,idnum) { // pass in an idnum instead of reading off the url
 // var idnum = Get_Parm("b"); // only set the map pixel when passed in this way

 if( (idnum != null) && (idnum != "") ) {
   document.write('<img src="https://www.myaffiliateprogram.com/u/'+siteAcct+ '/b.asp?id=' +idnum+ '" height=1 width=1 border=0>');
   //alert('<img src="https://www.myaffiliateprogram.com/u/'+siteAcct+ '/b.asp?id=' +idnum+ '" height=1 width=1 border=0>');
 } else {
   // alert(idnum);
 }
  <!--MNME Code-->
  var scriptUrl='https://secure.w3track.com/newtrk/click_js_urbsite.php?ENGINE=URB&cp=' + escape(Get_Parm_Normal('cp')) + '&ucp=' + escape(Get_Parm_Normal('ucp')) + '&mcp=' + escape(Get_Parm_Normal('mcp')) + '&rf='+escape(document.referrer) + '&wu=' + escape(document.location)
	+ '&b=' + escape(idnum) + '&af=' + escape(Get_Parm_Normal('af'));
  // document.write(scriptUrl);
  document.write('<scr' + 'ipt language="JavaScript" src="' + scriptUrl + '"></scr' + 'ipt>');
  <!--END MNME Code-->

}



// end functions always check for affiliate here


// pixel_track_locally(idnum);

/* do this into page. in the head it would result in interference with the swf js */

function pixel_track_locally(idnum) {
  var pid = Get_Parm('pid');
  var subaff = Get_Parm("sub");
  if(pid == null) {
    pid='';
  }
  if(subaff == null) {
    subaff='';
  }
  if (idnum && (idnum != "") && (idnum != null) ) {
    SimpleCookie('affiliate',idnum,60*24*days2expire,"/"); // simple cookie uses minutes
    document.write('<img src="/eScripts/setcookie_domain.php?b=' + idnum + '&pid=' + escape(pid) + '&sub=' + escape(subaff) + '" height=1 width=1 border=0>');
    // alert('did a pixel');
  }

}



// end hiding -->

