<insert><name>scramble_code</name></insert><insert><name>SOURCE_Script</name></insert><insert><id>2404</id></insert><!--POST 
//Version of this scramble code with all the comments can be found in all NG versions prior to April 2003
var ASCII_for_A = 'A'.charCodeAt(0);
var ASCII_for_a = 'a'.charCodeAt(0);
var ASCII_for_0 = '0'.charCodeAt(0);
 
var encode64 = buildEncode64Table ();
var decode64 = buildDecode64Table ();

var preValidString = "aV1";
var postValidString = "V1z";
 
var preSignature = "rb";
var postSignature = "sg";
 
var AlgorithmValidationRE = new RegExp(preValidString + "([A-Za-z0-9\\-\\_]+)" + postValidString);
 
var EncodingAlgorithmVersionRE = new RegExp(preSignature + "([A-Za-z0-9\\-\\_]+)" + postSignature);
 
var scrambleKeyString = "a8Fm*f";
var scrambleKey = scrambleKeyString.split("");
var scrambleKeyLen = scrambleKeyString.length;

function retAsciiVal (decodeChar)
{
    return(decodeChar.charCodeAt(0));
}

var codeChar   = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" +  "0123456";
var decodeChar = "!#$'*+-/^`{|}~%&=? ()<>,;:" + '\\"[].@_';

function escapeChar (specialChar)
{
    var nIndex = decodeChar.indexOf(specialChar);
    if (-1 == nIndex) // Not found
      {
        return(specialChar);
      }
 
    return(codeChar.charAt(nIndex));
 }
 
function specialChar (escapeChar)
{
    var nIndex = codeChar.indexOf(escapeChar);
    if (-1 == nIndex) // Not found
      {
        return(escapeChar);
      }
 
    return(decodeChar.charAt(nIndex));
 }
 
 
function buildEncode64Table ()
{
    var encode64 = new Array(64);
 
    for (i=0; i < 26; i++)
      {
        encode64[i] = String.fromCharCode(ASCII_for_A+i);
        encode64[i+26] = String.fromCharCode(ASCII_for_a+i);
      }
 
    for (i=0; i < 10; i++)
      {
        encode64[i+52] = String.fromCharCode(ASCII_for_0+i);
      }
 
    encode64[62] = "-";
    encode64[63] = "_";
 
    return encode64;
}
 
function buildDecode64Table ()
{
    var decode64 = new Array( 127 );
 
    for (i=0; i <= 26; i++)
      {
        decode64[i+ASCII_for_A] = i;
        decode64[i+ASCII_for_a] = i+26;
      }
 
    for (i=0; i <= 10; i++)
      {
        decode64[i+ASCII_for_0] = i+52;
      }
 
    decode64['-'.charCodeAt(0)] = 62;
    decode64['_'.charCodeAt(0)] = 63;
 
    return decode64;
}
 
function scramble64 (plainText64) {
    var plainTextLength = plainText64.length;
    var escapedTextLength = 0;
    var escapePrefix = "_";
    var escapedChar = "";
    var escapedText = "";
    var scrambled = "";
    var i = 0;
        
    for (i = 0; i < plainTextLength; i++) {
        plainChar = plainText64.charAt(i);
        escapedChar = escapeChar(plainChar);
        if (escapedChar != plainChar){
            escapedText += escapePrefix;
            }
        escapedText += escapedChar;
    }
 
    // Add the validation strings pre-encryption.
    escapedText = preValidString + escapedText + postValidString;
 
    escapedTextLength = escapedText.length;
 
    var i0 = decode64[ retAsciiVal(escapedText.charAt (escapedTextLength - 1)) & 0x7F ];
    var i1 = decode64[ retAsciiVal(escapedText.charAt (0)) & 0x7F ];
    var value = ((i0 << 5) | (i1 >>> 1)) & 0x3F;
    value = (value ^ retAsciiVal(scrambleKey[ 0 ])) & 0x3F;
 
    if (scrambled == null){
        scrambled = encode64[ value ];}
    else {
        scrambled = scrambled.concat (encode64[ value ]);}
 
    i0 = i1;
    for (i = 1; i < escapedTextLength; i++) {
        i1 = decode64[ retAsciiVal(escapedText.charAt (i)) & 0x7F ];
        value = ((i0 << 5) | (i1 >>> 1)) & 0x3F;
        value = (value ^ retAsciiVal (scrambleKey[ i % scrambleKeyLen ])) & 0x3F;
        scrambled = scrambled.concat (encode64[ value ]);
       i0 = i1;}
 
    // Add the signature strings post-encryption.
    scrambled = preSignature + scrambled + postSignature;
 
    return scrambled;}
 
var emailString = user.attr("eMail");
var cIdString = user.attr("cId");
var argString = emailString + ":" + cIdString;
var URLArg = scramble64(argString);
/*******************************************************
End subscription services url scramble code
*******************************************************/


var emailStr = user.attr("eMail");

    /*******************************************************
    This code allows varying content for the message.
    *******************************************************/
var mdb = false;
var subServices = false;
var prospect = false;
var quick_sub = false;

// assigning values to ssdb, prospect and mdb vars
if (user.contains ("source","HP ScanJet Microsoft")) { 
   subServices = true;}
if (user.contains ("source","Mac Software Updates")) {
    subServices = true;}
if (user.contains ("source","HP ScanJet Gazette")) {
    subServices = true;}
if (user.contains ("source","ScanJet")) {
    subServices = true;}
if (user.contains ("source","Marketing Database")) {
    mdb = true;}
if (user.contains ("source","ProspectNet")) {
    prospect = true;}
if (user.contains ("source","Quick_Sub")) {
    quick_sub = true;}


var edition = false;
var interest;

if (user.contains("ngQsPageSource", "Quilting")) {
  edition = true;
  interest = "quilting";}
else if (user.contains("ngQsPageSource", "Scrapbooking")) {
  edition = true;
  interest = "scrapbooking";}
else if (user.contains("ngQsPageSource", "PC")) {
  edition = true;
  interest = "computing";}
else if (user.contains("ngQsPageSource", "Digital Imaging")) {
  edition = true;
  interest = "digital photography";}

//Subject line
if (firstName == null || firstName == "" || firstName == " ") {
       document.subject("Welcome to the HP Newsgram"); 
    } else {
       document.subject(firstName + ", Welcome to the HP Newsgram");
}

var greeting;
var firstName = user.attr ("firstName");
if (firstName == null || firstName == "" || firstName == " ") {
  greeting ="Hello,"; 
    } else {
     /***** convert first letter of name to uppercase *******/
    var phraseLength = firstName.length;
    var userFirstInitial = firstName.substring(0,1).toUpperCase();
    var userRestOfName = firstName.substring(1, phraseLength);
    greeting = "Hello " + userFirstInitial + userRestOfName + ",";
}



/********************************************
      CHECKING FOR E-MAIL SYSTEMS USERS
********************************************/

var userid = user.attr("id");
var emailStr = user.attr("eMail");

/********************************************
         CHECKING FOR AOL USERS
********************************************/
var isAOL = false;
if (user.attr ("eMail") != null) {
    isAOL = user.attr ("eMail").substring (
user.attr ("eMail").length - 8, 999) == "@aol.com";}

/********************************************
         CHECKING FOR HOTMAIL USERS
********************************************/
var hasHotmail = false;
if (emailStr.substring (emailStr.length - 12) == "@hotmail.com") {
   hasHotmail = true;}
   
/********************************************
         CHECKING FOR Excite USERS
********************************************/
var hasExcite = false;
if (emailStr.substring (emailStr.length - 11) == "@excite.com") {
   hasExcite = true;}

/********************************************
         CHECKING FOR Juno USERS
********************************************/
var hasJuno = false;
if (emailStr.substring (emailStr.length - 9) == "@juno.com") {
   hasJuno = true;}

/********************************************
         CHECKING FOR Mindspring USERS
********************************************/
var hasMindspring = false;
if (emailStr.substring (emailStr.length - 15) == "@mindspring.com") {
   hasMindspring = true;}

/********************************************
         CHECKING FOR Netscape USERS
********************************************/
var hasNetscape = false;
if (emailStr.substring (emailStr.length - 13) == "@netscape.net") {
   hasMindspring = true;}

/********************************************
         CHECKING FOR Prodigy USERS
********************************************/
var hasProdigy = false;
if (emailStr.substring (emailStr.length - 12) == "@prodigy.net") {
   hasProdigy = true;}

/********************************************
         CHECKING FOR Webtv USERS
********************************************/
var hasWebtv = false;
if (emailStr.substring (emailStr.length - 10) == "@webtv.net") {
   hasWebtv = true;}

/********************************************
         CHECKING FOR MSN USERS
********************************************/
var hasMSN = false;
if (emailStr.substring (emailStr.length - 8) == "@msn.com") {
   hasMSN = true;}

/********************************************
         CHECKING FOR EARTHLINK USERS
********************************************/
var hasEarthlink = false;
if (emailStr.substring (emailStr.length - 14) == "@earthlink.net") {
   hasEarthlink = true;}

var isAOL = false;
if (user.attr ("eMail") != null) {
    isAOL = user.attr ("eMail").substring (
user.attr ("eMail").length - 8, 999) == "@aol.com";}

function anchor (url, label) {
    if (isAOL) {
        document.write ("<A HREF=\"" + url + "\">" + label + "</A>");}
    else {
        document.write (url);}}

POST--><insert><name>scramble_code</name></insert><insert><name>SOURCE_Script</name></insert><insert><id>2404</id></insert><!--POST if (isReferred) { POST-->Hello `lastReferredfirstName`

`firstName` thought you would like to see this special 
edition of the HP newsgram.
<!--POST if (referredNoteExists) { 
var lastReferredNote = lastReferredNote;
document.write(lastReferredNote);
POST-->`signature`<!--POST } POST-->
This doesn't mean you will be getting messages from HP. But if you'd
like to sign up for useful and fun information like this, you can
subscribe here today. 
http://h30189.www3.hp.com/signUp.jsp
<!--POST } POST-->
HP Newsgram
--------------------------------------------------------
Welcome to the handy and helpful HP Newsgram

`greeting` welcome to the HP Newsgram - a free e-newsletter 
filled with handy tips, creative ideas for projects, relevant 
articles based on your products and info on new products.

Customized for you
We want you to get the most useful, relevant information in your 
monthly Newsgram. 

 Tell us about your interests & other HP products
so we may personalize your email
<!--POST if (mdb || prospect || quick_sub) { POST-->`anchor("http://h30189.www3.hp.com/modify_profile.dyn", "- update -")`<!--POST } else { POST--><!--POST if (isAOL) { POST--><a href="http://subscription.support.hp.com/di/nc?c=`URLArg`">- update -</a><!--POST } else { POST-->http://subscription.support.hp.com/di/nc?c=`URLArg`<!--POST } POST--><!--POST } POST-->


You'll get an HP Newsgram made just for you featuring:
- Product support articles for the HP products you own.
- Feature topics catered to your interests.
- Creative projects you can start now. 

-----------------------------------------------------------------
AWARD-WINNING HP SERVICE AND SUPPORT 
-----------------------------------------------------------------

Software & Driver Downloads
>> http://www.hp.com/info/hho-ng-1142-supportDriverDownload

Support & Troubleshooting
>> http://www.hp.com/info/hho-ng-1142-supportTroubleshoot

Real Time Chat
>> http://www.hp.com/info/hho-ng-1142-chat

Email Support in as fast as 1 hour
>> http://www.hp.com/info/hho-ng-1142-oneHourSupport

Enhanced Service Plans
>> http://www.shopping.hp.com/esp?jumpid=in_R329_prodexp/hhoslp/split/serviceplans&aoid=35972

-----------------------------------------------------------------
SHOP WHERE AND WHEN YOU WANT
-----------------------------------------------------------------

Call: 1-888-917-8097

Click: www.hpshopping.com
>> http://www.shopping.hp.com/webapp/shopping/home.do?aoid=35972

Visit: over 15,000 retail locations
>> http://h71036.www7.hp.com/hho/cache/581708-0-0-225-121.html?

Quick Shopping Links
--------------------
Printer supplies
>> http://www.shopping.hp.com/webapp/shopping/store_access.do?template_type=printer_supp_acc&aoid=35972

Outlet
>> http://www.shopping.hp.com/webapp/shopping/store_access.do?template_type=landing&landing=outlet_store&aoid=35972

Online shopping
>> http://www.shopping.hp.com/webapp/shopping/home.do?aoid=35972

Snapfish - Online Photo Service
>> http://www.snapfish.com/hp_ongoing_newsgramtop

-----------------------------------------------------------------
HP RESOURCES ON THE WEB
-----------------------------------------------------------------

Projects
>> http://www.hp.com/info/hho-ng-1142-projects

Online classes
>> http://www.hp.com/info/hho-ng-1142-online-classes

-----------------------------------------------------------------
HP NEWSGRAM OPTIONS
-----------------------------------------------------------------
<!--POST if(!isReferred) { POST-->
Update your preferences
>> http://h30189.www3.hp.com/modify_profile.jsp

Change your e-mail
>> http://h30189.www3.hp.com/change-email.jsp

Privacy policy
>> http://www.hp.com/country/us/en/privacy.html

Unsubscribe
>> http://h30189.www3.hp.com/one-click.jsp
<!--POST } else { POST-->
Privacy policy
>> http://welcome.hp.com/country/us/en/privacy.html
<!--POST } POST--> 
-----------------------------------------------------------------
Please note that the content of this email is intended for
U.S. residents only.

Please add Hewlett-Packard@us.newsgram.hp.com to your
address book. Need help? Click here.
http://h30189.www3.hp.com/add_address.jsp

This mailing was sent to `emailString` because you signed up to
receive the HP Newsgram.

If you no longer want to receive the HP Newsgram, please
click unsubscribe.
http://h30189.www3.hp.com/one-click.jsp
To unsubscribe from the HP Newsgram and other
marketing-related communication from HP, reply with
"UNSUBSCRIBE" as the subject line.

HP Privacy Mailbox, 11445 Compaq Center Drive W., Mailstop 040307, Houston, TX 77070.