<insert><name>main_functions</name></insert><!--POST

  //---------------------------------------------------//
 //--------- Define Initial Variables ----------//
//--------------------------------------------------//

var msgVersion = user.attr("msgVersion");
var firstName       = initCap(user.attr ("firstName"), "Valued Customer");
var eMail = user.attr("eMail");
var userid          = user.attr("id");
var userID          = user.attr("id");
var uid             = user.attr("id").toString();
var segment         = uid.substr(uid.length - 2);
var mmid = masterinfo.getID();
var mailingProgram;
var listsource;
var omniture;
var mailingProgram  = user.attr("mailingProgram");

var jobnum = "hhos_default";     //JOB NUMBER : VERIFY AS THIS VALUE IS INSERTED INTO LINKS.
var showOffers = "false";     //Set to true if this is a sale message
var isPhone = false;         //Replaces the "Clearance" button with a "Phone" button, this is for PALM messages
var phone = "1-866-433-2028 English/Espal"; 
var audience = "";       //Displays the audience that recieves
var facePage = "Hphome";     //The FacePage is the facebook page to link to.  "Hphome" is the standard.
var twitterPage = "hpdeals";     //The twitterPage is the twitter page to link to.  "hpdirect" is the standard.

//The leverage is a Shopping (HHOS) Message that goes to an HPN Newsgram Audience
//There are some difference from the regular shopping message, so set this variable to true for leverage
var leverage = false;
var commercial = false;

  //---------------------------------------------------//
 //------ END Define Initial Variables ------//
//--------------------------------------------------//


  //--------------------------------------------------//
 //--------- Define Message Type ----------//
//--------------------------------------------------//

// Define what type of message this is, Can be
//hhos
//microbiz
//hpn

var messageType = "hhos";


  //------------------------------------------------------//
 //-------- END Define Message Type --------//
//------------------------------------------------------//

POST--><insert><name>message_vars</name></insert><!--POST



/************************************************************************
HPN BACKGROUNDS
************************************************************************/

// BACKGROUND COLOR FOR BODY OF MESSAGE
var bodyBG = "#eaeaea";
// BACKGROUND COLOR FOR LINKS BLOCK IN FOOTER
var linksBG = "#000000";
// LINK TEXT COLOR FOR LINKS BLOCK IN FOOTER
var linksFont = "#FFFFFF";


/************************************************************************
AOIDs
************************************************************************/

var aoid;
var store_name;
//define Job Number
var jobnum = "hpn_1395";
var imageVal = "";  //This is appended on each image to load _app or _hpepp, etc
var folder = "gs";  //This is the folder that images are stored in, changes between versions.
var printerVal = "";

if(messageType == "microbiz")
{
	facePage = "hpsmallbusiness";
}

//Settups AOIDs for different versions
if (mailingProgram == "EPP_HP"){
	aoid = "79552";
	imageVal = "_hpepp";
	printerVal = "EPP_00_";
} else if (mailingProgram == "EPP"){
	aoid = "83489";
	imageVal = "_epp";
	printerVal = "EPP_00_";
} else if (mailingProgram == "APP"){
	aoid = "79552";
	imageVal = "_app";
	printerVal = "EPP_00_";
} else if (mailingProgram == "General Store"){
	aoid = "83488";
	printerVal = "";
}

if (mmid == "1222065"){  //Commercial
	aoid = "83487";
	var commercial = true;
	imageVal = "";
	mailingProgram = "General Store";
    audience = "Small Business Direct";
}

if (mmid == "719025"){  //Leverage
	aoid = "83490";
	leverage = true;
	jobnum = "hpn_1395";
	imageVal = "";
	printerVal = "";
}
   

//Changes phone number if APP(AKA HPA)
var phone = "1-866-433-2028 English/Espal";
if (mailingProgram == "APP")
    phone = "1-866-433-2029 English/Espal";
if (messageType == "microbiz"){
    phone = "1-800-608-6947 English/Espal";
}
if(messageType == "hpn"){
    phone = "1-888-917-8097";
    aoid = "79555";
    }
     
//Define the JumpID
//This adds the Job Number to HHOS and Microbiz URLS, and also the userMail=epp to tiered versions
var jumpID = "";
if(mailingProgram == "EPP_HP" || mailingProgram == "EPP" || mailingProgram == "APP")
    jumpID = jobnum + "&userMail=epp";
 else 
    jumpID = jobnum;
   
if (messageType == "microbiz"){
	if(mailingProgram == "EPP_HP" || mailingProgram == "EPP" || mailingProgram == "APP")
	jumpID = jobnum + "MB" + "&userMail=epp";
	else 
	jumpID = jobnum + "MB";
}
    
if (leverage){
    audience = "HP Newsgram";
    mailingProgram = "General Store";
    if(messageType != "microbiz"){
        phone = "1-888-917-8097 English/Espal";
        jumpID = jobnum+"NG";
    }
}
/************************************************************************
SUBJECT LINES
************************************************************************/
var textHeadline = "Reward Yourself!";
var subjectLine;

//document.subject(subjectLine);

var alt = "SEE THE GREAT DEALS WAITING FOR YOU AT HP HOME and HOME OFFICE STORE!";



/************************************************************************
LEGACY CODE
************************************************************************/

/************** VARIABLES DECLARATION *************************/

//ID segmentation
var uid             = user.attr("id").toString();
var userid          = user.attr("id");
var segment         = uid.substr(uid.length - 2);
var firstName       = user.attr ("firstName");
var eMail           = user.attr("eMail");
var user_score       = user.attr("userScore");
var purchase = false;
var coreg = false;
var optin = false; 
var msgVersion = user.attr("msgVersion"); 

/**************************************************************************************
    PRODUCT GROUPS
**************************************************************************************/  
var ccmUpsellQryGroup = user.attr("ccmUpsellQryGroup");
/************************************
  AOID Segmentation and subject lines
************************************/

var aoid        = "";
var subjectLine = "";

if (ccmUpsellQryGroup == "Group-1 (Highest Priority)") {
   aoid = "41859";
   subjectLine = "Accessorize your HP notebook";
} else if (ccmUpsellQryGroup == "Group-2") {
   aoid = "41860";
   subjectLine = "Get the most from your HP desktop";
} else if (ccmUpsellQryGroup == "Group-3") {
   aoid = "42154";
   subjectLine = "Stock Up on Toner for Your New HP Printer";
} else if (ccmUpsellQryGroup == "Group-4") {
   aoid = "42153";
   subjectLine = "Stock Up on Ink for Your New HP Printer";
} else if (ccmUpsellQryGroup == "Group-5") {
   aoid = "41863";
   subjectLine = "Get the most from your Digital Camera";
} else if (ccmUpsellQryGroup == "Group-6") {
   aoid = "41864";
   subjectLine = "Get the most from your HP HDTV";
} else if (ccmUpsellQryGroup == "Group-7 (Lowest Priority)") {
   aoid = "41864";
   subjectLine = "Bring out the best in your new iPAQ";
} else {
   ccmUpsellQryGroup = "Group-1 (Highest Priority)"; 
   aoid = "41859";
   subjectLine = "Accessorize your HP notebook";
}

document.subject(subjectLine);

textHeadline = subjectLine;

var footNote;

if (ccmUpsellQryGroup == "Group-3" || ccmUpsellQryGroup == "Group-4"){
footNote = "";
} else {
footNote = "* Offer is good while supplies last. Offer is also subject to\nchange or cancellation at any time. See product page for\ndetails. Prices shown may include applicable rebates.\nRestrictions apply to sale items and are subject to change\nwithout notice.";
}

/************************************************************************
END LEGACY CODE
************************************************************************/

POST--><!--POST if(messageType == "hpn"){ POST-->`audience`
http://www.hp.com?aoid=`aoid`&hhosnl=`jobnum`|`mmid`|`urlArg`
---------------------------------------------------------------

`textHeadline`
@HTML_PREVIEW_LINK&msgVersion=web

---------------------------------------------------------------<!--POST }else{ POST-->To ensure you receive your HP Home & Home Office Store offers, 
please add news@mail.hpshopping.com to your address book. 
Need help? Visit:
http://h30189.www3.hp.com/add_address.dyn?v=s
---------------------------------------------------------------
If you prefer to view this message in HTML format, please visit: 
@HTML_PREVIEW_LINK&msgVersion=web
---------------------------------------------------------------

`audience`

---------------------------------------------------------------

`textHeadline`
@HTML_PREVIEW_LINK&msgVersion=web

---------------------------------------------------------------
<!--POST } POST--><insert><name>sub_footer</name></insert>
<insert><name>footer</name></insert>