// BugMePathTracker.js// Author: Todd M. Reith <todd@bluehonu.com>// (c)2001, Blue Honu Corporation// Version 1.0.0// Date: Saturday, May 05, 2001 12:17:43 PM// delCookie('BUGMEURL');// Uncomment the above to delete cookie for testing ;-)var mReturnPath   = null;var mExtendedPath = null;var mVendor       = null;var mDefaultPath  = "http://www.bugme.net/";// PALMGEAR.COM ------------------------- [START]var mPGidBugme     = 839;var mPGidMessenger = 10120;var mPGidViewer    = 6941;var mPGbuyPage     = "palmgearbuy.html";var mPGtest        = false;// not currently usedvar mPGidBusiness  = null;var mPGidPocketPc  = null;// PALMGEAR.COM --------------------------- [END]// Redirect browser depending on originating request// uses BugMePathTracker.pl to set cookiefunction redirectBrowser (request, download, popup) {  mDownload = download;  mRequest  = request;    mPopUp    = popup;      // set mPopUp flag to false if no value is set  if (mPopUp == null){    mPopUp = false;  }    // get cookie if one exists  mReturnPath = getCookie('BUGMEURL');      // if cookie exists determine if visitor came from palmgear  if (mReturnPath != null){    var iPGtest = mReturnPath.indexOf('www.palmgear.com');        // debug alert    //alert (iPGtest);        if (iPGtest == 7) {      mPGtest = true;    }  }       // check palmgear and create remaining   // query string based on supplied key  if (mPGtest)  {      if (mRequest == 'bugme'){      mExtendedPath = "?prodID=" + mPGidBugme + "&type=zip";    } else if (mRequest == 'messenger'){      mExtendedPath = "?prodID=" + mPGidMessenger + "&type=zip";    } else if (mRequest == 'viewer'){      mExtendedPath = "?prodID=" + mPGidViewer + "&type=zip";    } else if (mRequest == 'buy'){      mDownload = mPGbuyPage;      mReturnPath = null;          }  }      // check if cookie value exists -   // send local path if false and remote path if true  if (mReturnPath == null)
{
 if (mRequest == 'buy')
 {
      mReturnPath = "http://electricpocketshop.com/xcart/customer/home.php";
  }
 else
	mReturnPath = mDefaultPath + mDownload;
}
else{
  if (mRequest == 'buy')
  {
      mReturnPath = "http://electricpocketshop.com/xcart/customer/home.php";
  }
  else	
  mReturnPath = mReturnPath + mDownload + mExtendedPath;    }    // debug alert  //alert (mReturnPath);      // check if called from a popup window    // debug alert  //alert (mPopUp);    if (mPopUp){        opener.location = mReturnPath;  }else{    location = mReturnPath;  }}// An adaptation of Heinle's function for retrieving a cookie.function getCookie(name){  var cname = name + "=";                 var dc = document.cookie;               if (dc.length > 0) {                  begin = dc.indexOf(cname);           if (begin != -1) {                 begin += cname.length;             end = dc.indexOf(";", begin);      if (end == -1) end = dc.length;        return unescape(dc.substring(begin, end));    }   }  return null;}// An adaptation of Dorcht's function for setting a cookie.function setCookie(name, value, expires, path, domain, secure) {  document.cookie = name + "=" + escape(value) +   ((expires == null) ? "" : "; expires=" + expires.toGMTString()) +  ((path == null) ? "" : "; path=" + path) +  ((domain == null) ? "" : "; domain=" + domain) +  ((secure == null) ? "" : "; secure");}// An adaptation of Dorcht's function for deleting a cookie.function delCookie (name,path,domain) {  if (getCookie(name)) {    document.cookie = name + "=" +    ((path == null) ? "" : "; path=" + path) +    ((domain == null) ? "" : "; domain=" + domain) +    "; expires=Thu, 01-Jan-70 00:00:01 GMT";  }}

