// -------------------------------------------
//  PS Parts Store Advisor (PSA)
//    Direct end user to home page of correct Parts store.
//
//     Using objects defined here you can:
//     -Create rules per store
//      *r = new RetailStore    (exchange,tax,URL)
//      *w = new WholesaleStore (exchange,tax,storeName,auth,locID,custNum)
//     -Store user selection data
//      *usr = new RetailStore (getRadioValue(document.navigate.retail_exchange)...
//     -Compare user data with rules to find store
//
//       - retailObj    : defines retail store 
//       - wholesaleObj : defines wholesale store
//      
//     
//  v1.0 4/7/2004 2:29PM
//       - initial build
//  
// -------------------------------------------
var DEBUG_ = 0;
var DEBUG_locID = "";
var DEBUG_custNum = "";



// -------------------------------------------
// RetailStore rule objects stored in rMap array
//  3 parameters per rule (mapped to form)
//  - exchange boolean
//  - tax exempt boolean
//  - target store URL
// -------------------------------------------
rMap = new Array();
// parts_rx_te //
rMap[0] = new RetailStore (true,true,"/shop/americas/webapp/wcs/stores/servlet/default/PromotionDisplay?promoName=parts_rx_te&catalogId=-840&storeId=822906&langId=-1");
// parts_rx   //
rMap[1] = new RetailStore (true,false,"/shop/americas/webapp/wcs/stores/servlet/default/PromotionDisplay?promoName=parts_rx&catalogId=-840&storeId=23873&langId=-1");
// parts_r_te //
rMap[2] = new RetailStore (false,true,"/shop/americas/webapp/wcs/stores/servlet/default/PromotionDisplay?promoName=parts_r_te&catalogId=-840&storeId=822905&langId=-1");
// parts_r    //
rMap[3] = new RetailStore (false,false,"/shop/americas/webapp/wcs/stores/servlet/default/PromotionDisplay?promoName=parts_r&catalogId=-840&storeId=260785&langId=-1");






// -------------------------------------------
// WholesaleStore rule objects stored in wMap array
//  4 parameters per rule (mapped to form)
//  - exchange boolean
//  - tax exempt boolean
//  - target store name
//  - target store ID ***** need to add value for 4th parameter below **********
//  - target store auth code
//    
// -------------------------------------------
wMap = new Array();     
// parts_wx_te // 
wMap[0] = new WholesaleStore (true,true,"parts_wx_te","822908","USP_WX","","");
// parts_wx //
wMap[1] = new WholesaleStore (true,false,"parts_wx","24233","USP_WX","","");
// parts_w_te //
wMap[2] = new WholesaleStore (false,true,"parts_w_te","822907","USP_W","","");
// parts_w //
wMap[3] = new WholesaleStore (false,false,"parts_w","24053","USP_W","","");









// ----------------------------------------
// retail submit button action handler
// ----------------------------------------
function retail() {
 // load user form selections into new Retail object
 user = new RetailStore (getRadioValue(document.navigate.retail_exchange),getRadioValue(document.navigate.retail_tax_exempt),"");
 // loop retail rule array
 for(i=0;i<rMap.length;i++) {
     // compare rule to user obj
     if(user.compare(rMap[i])) {
      // send to rule URL on match
      user.redirect(rMap[i])
      break;
    }
 }
}
// ----------------------------------------
// wholesale submit button action handler
// ----------------------------------------
function wholesale() {

// store user selections in wholesaleStore object (exchange,tax,storeName,storeId,auth,locID,custNum)
user = new WholesaleStore (getRadioValue(document.navigate.wholesale_exchange),getRadioValue(document.navigate.wholesale_tax_exempt),"","","",document.navigate.locID.value,document.navigate.custNum.value);

var err_ = 0;
var msg = "Please complete the following required fields to continue.\n\n";
// validate user entered location ID
if(document.navigate.locID.value == "") {
  	err_++;
  	msg += "Location ID\n";
 }
// validate user entered customer number
if(document.navigate.custNum.value == "") {
       err_++;
       msg += "Customer number";
}

// error msg 
if(err_ > 0) {
	alert(msg);
   }else {
// send to store
for(i=0;i<wMap.length;i++) {
    if(user.compare(wMap[i])) {
      
      //populate hidden authentication form      
      document.login_.shop.value=wMap[i].storeName;  
       document.login_.storeId.value=wMap[i].storeId;  
      document.login_.auth1.value=wMap[i].auth;
      document.login_.auth2.value=user.custNum;
      document.login_.auth3.value=user.locID;
      
      // debug
      t = "store:"+document.login_.shop.value+"\n";
      t = "storeId:"+document.login_.storeId.value+"\n";
      t +="Auth1:"+document.login_.auth1.value+"\n";
      t +="CustNum:"+document.login_.auth2.value+"\n";
      t +="LocID:"+document.login_.auth3.value;
      if(DEBUG_) {alert(t)};
      
      // send hidden auth form
      document.login_.submit();
      break;
    }
 }
}
}

// ----------------------------------------
// Retail Store object constructor
// ----------------------------------------
function RetailStore (exchange,tax,URL) {
 this.exchange = exchange;
 this.tax      = tax;
 this.URL      = URL;
 this.compare  = compareRetail;
 this.redirect = redirect;
}

// ----------------------------------------
// Wholesale Store object constructor
// ----------------------------------------
function WholesaleStore (exchange,tax,storeName,storeId,auth,locID,custNum) {
 this.exchange = exchange;
 this.tax      = tax;
 this.storeName= storeName;
 this.storeId  = storeId;
 this.auth     = auth;
 this.locID    = locID;
 this.custNum  = custNum;
 this.compare  = compareWholesale;
}

// ----------------------------------------
// compare retail user object with retail rules
// ----------------------------------------
function compareRetail (obj) {
 if((this.exchange == obj.exchange) && (this.tax == obj.tax)) {
   return true;
 }else{
   return false;
 }
}
// ----------------------------------------
// compare wholesale user object with wholesale rules
// ----------------------------------------
function compareWholesale (obj) {
 if((this.exchange == obj.exchange) && (this.tax == obj.tax)) {
  return true;
 }else{
  return false;
 }
}
// ----------------------------------------
// redirect user to URL
// ----------------------------------------
function redirect(obj) {
  location.href = obj.URL;
}

// ----------------------------------------
// find selected radio value
// ----------------------------------------
function getRadioValue (field) {
 if(field[0].checked) {
  return true;
  }else{
  return false;
 } 
}


// ----------------------------------------
//  HTML FORMS
// ----------------------------------------
if(DEBUG_) {
DEBUG_locID = "11647";
DEBUG_custNum = "0019046";
}



// global spacer
var spacer_ ='<tr><td colspan="3"><img src="//www.ibm.com/i/c.gif" alt="" height="4" width="1" border="0" /></td></tr>';


// ----------------------------------------
//  Wholesale advisor form
// ----------------------------------------
function wholesaleFrm() {
str = '<form name="navigate" action="" method="post">';
str += '<table width="600" cellpadding="0" cellspacing="0" border="0"><tr><td width="443" valign="top">';
str += '<table cellpadding="0" cellspacing="0" border="0" width="441"><tr><td colspan="3" class="v14-header-1">Part order</td></tr>';
str += spacer_;
str += '<tr><td colspan="3">Please choose the proper store to begin.  If you are a retail customer, complete the short retail store questions on the left.  If this is a wholesale purchase, begin ';
str += 'at the store on the right, enter your Location ID and Customer number, and order your parts.<br /><br /><b>Please note:</b> Wholesale customers include authorized IBM Business Partners ';
str += 'and Third Party Maintenance Providers entitled to purchase low end PC parts at a discounted price for post warranty support.<br /><img src="//www.ibm.com/i/c.gif" alt="" height="4" width="1" border="0" /><br /></td></tr></table>';
str += spacer_;
str += '<table cellpadding="0" cellspacing="0" border="0" width="441"><tr><td width="217" class="v14-header-2" height="18">Order from the wholesale store</td><td width="6"></td><td width="217" class="v14-header-3" height="18">Need help with your order?</td></tr>';
str += spacer_;
str += '<tr><td width="217">Would you like to check to see if  you can exchange a part for a discount towards a new purchase?<br /><br />';
str += '<input type="radio" name="wholesale_exchange" id="r1a" value="Yes" /><label for="r1a">Yes, I have a part to exchange.</label><br />';
str += '<input type="radio" name="wholesale_exchange" id="r1b" value="No" checked="checked" /><label for="r1b">No, I do not have a part to exchange.</label><br /></td>';
str += '<td width="6"></td><td width="217" valign="top"><table summary="" border="0" cellpadding="0" cellspacing="0">';
str +='<tr><td width="4"><img src="/shop/americas/content/promotion_images/en_US/bluebl.gif" width="2" height="2" alt="" border="0" align="absmiddle" /><img src="/shop/americas/content/misc_images/en_US/c.gif" width="2" height="1" alt="" /></td>';
str +='<td width="215"><a href="//www.ibm.com/pc/support/site.wss/MIGR-4UCLGT.html?lang=en_US&page=brand&brand=root&doctype=&subtype=Cat" class="fbox">Locate your part number.</a></td></tr>';
str +='<tr><td colspan="2"><img src="//www.ibm.com/i/c.gif" alt="" height="4" width="1" border="0" /></td></tr>';
str +='<tr><td width="4" valign="top"><img src="/shop/americas/content/misc_images/en_US/c.gif" width="1" height="7" alt="" /><br /><img src="/shop/americas/content/promotion_images/en_US/bluebl.gif" width="2" height="2" alt="" border="0" />';
str +='<img src="/shop/americas/content/misc_images/en_US/c.gif" width="2" height="1" alt="" /></td>';
str +='<td width="215"><a href="//www.ibm.com/support/us/" class="fbox">Browse our support and downloads area.</a></td></tr>';
str +='<tr><td colspan="2"><img src="//www.ibm.com/i/c.gif" alt="" height="4" width="1" border="0" /></td></tr>';
str +='<tr><td width="4"><img src="//www.ibm.com/i/v13/blkbl.gif" border="0" width="2" height="2" alt=""/><img src="/shop/americas/content/misc_images/en_US/c.gif" width="2" height="1" alt="" /></td>';
str +='<td width="215">Call IBM parts help at 1-877-719-0841</td></tr></table></td></tr>';
str += spacer_;
str += '<tr><td width="217" valign="top">Is this a tax exempt purchase?	</td><td width="6"></td><td width="217"></td></tr>';
str += spacer_;
str += '<tr><td width="217"><input type="radio" name="wholesale_tax_exempt" id="r1c" value="Yes"><label for="r1c" />Yes</label> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
str += '<input type="radio" name="wholesale_tax_exempt" id="r1d" value="No" checked="checked" /><label for="r1d">No</label></td><td width="6"></td><td width="217"></td></tr>';
str += spacer_;
str += '<tr><td width="217"><label for="custNum">Customer number</label>: [7 digits]<br /><input type="Text" size="15" name="custNum" id="custNum" class="iform" value="'
str += DEBUG_custNum;
str += '" /></td>';
str += '<td width="6"></td><td width="217"></td></tr>';
str += spacer_;
str += '<tr><td width="217"><label for="locID">Location ID</label>: [5 characters]<br /><input type="password" size="15" name="locID" id="locID" class="iform" value="'
str += DEBUG_locID;
str += '" /></td>';
str += '<td width="6"></td><td width="217"></td></tr>';
str += spacer_;
str += '<tr><td width="217"><a href="javascript:wholesale()"><img src="//www.ibm.com/i/v14/buttons/us/en/submit.gif" border="0" width="120" height="21" alt="Submit" /></a></td><td width="6"></td><td width="217"></td>';
str += '</tr></table></form>';
document.write(str);
}


// ----------------------------------------
//  Wholesale exchange advisor form
// ----------------------------------------
function wholesalexFrm() {
str = '<form name="navigate" action="" method="post">';
str += '<table width="600" cellpadding="0" cellspacing="0" border="0"><tr><td width="443" valign="top">';
str += '<table cellpadding="0" cellspacing="0" border="0" width="441"><tr><td colspan="3" class="v14-header-1">Part order</td></tr>';
str += spacer_;
str += '<tr><td colspan="3">Please choose the proper store to begin.  If you are a retail customer, complete the short retail store questions on the left.  If this is a wholesale purchase, begin ';
str += 'at the store on the right, enter your Location ID and Customer number, and order your parts.<br /><br /><b>Please note:</b> Wholesale customers include authorized IBM Business Partners ';
str += 'and Third Party Maintenance Providers entitled to purchase low end PC parts at a discounted price for post warranty support.<br /><img src="//www.ibm.com/i/c.gif" alt="" height="4" width="1" border="0" /><br /></td></tr></table>';
str += spacer_;
str += '<table cellpadding="0" cellspacing="0" border="0" width="441"><tr><td width="217" class="v14-header-2">Order from the wholesale store</td><td width="6"></td><td width="217" class="v14-header-3">Need help with your order?</td></tr>';
str += spacer_;
str += '<tr><td width="217">Would you like to check to see if  you can exchange a part for a discount towards a new purchase?<br /><br />';
str += '<input type="radio" name="wholesale_exchange" id="r1a" value="Yes" checked="checked" /><label for="r1a">Yes, I have a part to exchange.</label><br />';
str += '<input type="radio" name="wholesale_exchange" id="r1b" value="No" /><label for="r1b">No, I do not have a part to exchange.</label><br /></td>';
str += '<td width="6"><img src="//www.ibm.com/i/c.gif" alt="" height="1" width="6" border="0" /></td><td valign="top" width="217"><table border="0" cellpadding="0" cellspacing="0">';
str +='<tr><td width="4"><img src="/shop/americas/content/promotion_images/en_US/bluebl.gif" width="2" height="2" alt="" border="0" align="absmiddle" /><img src="/shop/americas/content/misc_images/en_US/c.gif" width="2" height="1" alt="" /></td>';
str +='<td width="215"><a href="//www.ibm.com/pc/support/site.wss/MIGR-4UCLGT.html?lang=en_US&page=brand&brand=root&doctype=&subtype=Cat" class="fbox">Locate your part number.</a></td></tr>';
str +='<tr><td colspan="2"><img src="//www.ibm.com/i/c.gif" alt="" height="4" width="1" border="0" /></td></tr>';
str +='<tr><td width="4" valign="top"><img src="/shop/americas/content/misc_images/en_US/c.gif" width="1" height="7" alt="" /><br /><img src="/shop/americas/content/promotion_images/en_US/bluebl.gif" width="2" height="2" alt="" border="0" />';
str +='<img src="/shop/americas/content/misc_images/en_US/c.gif" width="2" height="1" alt="" /></td>';
str +='<td width="215"><a href="//www.ibm.com/support/us/" class="fbox">Browse our support and downloads area.</a></td></tr>';
str +='<tr><td colspan="2"><img src="//www.ibm.com/i/c.gif" alt="" height="4" width="1" border="0" /></td></tr>';
str +='<tr><td width="4"><img src="//www.ibm.com/i/v13/blkbl.gif" border="0" width="2" height="2" alt=""/><img src="/shop/americas/content/misc_images/en_US/c.gif" width="2" height="1" alt="" /></td>';
str +='<td width="215">Call IBM parts help at 1-877-719-0841</td></tr></table></td></tr>';
str += spacer_;
str += '<tr><td width="217" valign="top">Is this a tax exempt purchase?	</td><td width="6"></td><td width="217"></td></tr>';
str += spacer_;
str += '<tr><td width="217"><input type="radio" name="wholesale_tax_exempt" id="r1c" value="Yes" /><label for="r1c" />Yes</label> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
str += '<input type="radio" name="wholesale_tax_exempt" id="r1d" value="No" checked="checked"  /><label for="r1d">No</label></td><td width="6"></td><td width="217"></td></tr>';
str += spacer_;
str += '<tr><td width="217"><label for="custNum">Customer number</label>: [7 digits]<br /><input type="Text" size="15" name="custNum" id="custNum" class="iform" value="'
str += DEBUG_custNum;
str += '" /></td>';
str += '<td width="6"></td><td width="217"></td></tr>';
str += spacer_;
str += '<tr><td width="217"><label for="locID">Location ID</label>: [5 characters]<br /><input type="password" size="15" name="locID" id="locID" class="iform" value="'
str += DEBUG_locID;
str += '" /></td>';
str += '<td width="6"></td><td width="217"></td></tr>';
str += spacer_;
str += '<tr><td width="217"><a href="javascript:wholesale()"><img src="//www.ibm.com/i/v14/buttons/us/en/submit.gif" border="0" width="120" height="21" alt="Submit" /></a></td><td width="6"></td><td width="217"></td>';
str += '</tr></table></form>';
document.write(str);
}

// ----------------------------------------
//  Retail advisor form
// ----------------------------------------
function retailFrm() {
str = '<form name="navigate" action="" method="post">';
str +='<table width="600" cellpadding="0" cellspacing="0" border="0"><tr><td width="443" valign="top">';
str +='<table cellpadding="0" cellspacing="0" border="0" width="441"><tr><td colspan="3" class="v14-header-1">Part order</td></tr>';
str += spacer_;
str +='<tr><td colspan="3">Please fill out form below to begin shopping.<br /><img src="//www.ibm.com/i/c.gif" alt="" height="4" width="1" border="0" /><br /></td></tr>';
str += spacer_;
str +='<tr><td width="217" class="v14-header-2">Order from the retail store</td><td width="6"></td><td width="217" class="v14-header-3">Need help with your order?</td></tr>';
str += spacer_;
str +='<tr><td width="217">Would you like to check to see if  you can exchange a part for a discount towards a new purchase?<br /><br />';
str +='<input type="Radio" name="retail_exchange" id="r1a" value="Yes" /><label for="r1a">Yes, I have a part to exchange.</label><br />';
str +='<input type="Radio" name="retail_exchange" id="r1b" value="No" checked="checked"/><label for="r1b">No, I do not have a part to exchange.</label><br />';
str +='</td><td width="6"><img src="/shop/americas/content/misc_images/en_US/c.gif" width="6" height="1" alt="" /></td>';
str +='<td width="217" valign="top"><table summary="" border="0" cellpadding="0" cellspacing="0">';
str +='<tr><td width="4"><img src="/shop/americas/content/promotion_images/en_US/bluebl.gif" width="2" height="2" alt="" border="0" align="absmiddle" /><img src="/shop/americas/content/misc_images/en_US/c.gif" width="2" height="1" alt="" /></td>';
str +='<td width="215"><a href="//www.ibm.com/pc/support/site.wss/MIGR-4UCLGT.html?lang=en_US&page=brand&brand=root&doctype=&subtype=Cat" class="fbox">Locate your part number.</a></td></tr>';
str +='<tr><td colspan="2"><img src="//www.ibm.com/i/c.gif" alt="" height="4" width="1" border="0" /></td></tr>';
str +='<tr><td width="4" valign="top"><img src="/shop/americas/content/misc_images/en_US/c.gif" width="1" height="7" alt="" /><br /><img src="/shop/americas/content/promotion_images/en_US/bluebl.gif" width="2" height="2" alt="" border="0" />';
str +='<img src="/shop/americas/content/misc_images/en_US/c.gif" width="2" height="1" alt="" /></td>';
str +='<td width="215"><a href="//www.ibm.com/support/us/" class="fbox">Browse our support and downloads area.</a></td></tr>';
str +='<tr><td colspan="2"><img src="//www.ibm.com/i/c.gif" alt="" height="4" width="1" border="0" /></td></tr>';
str +='<tr><td width="4"><img src="//www.ibm.com/i/v13/blkbl.gif" border="0" width="2" height="2" alt=""/><img src="/shop/americas/content/misc_images/en_US/c.gif" width="2" height="1" alt="" /></td>';
str +='<td width="215">Call IBM parts help at 1-877-719-0841</td></tr></table></td></tr>';
str += spacer_;
str +='<tr><td width="217">Is this a tax exempt purchase?</td><td width="6"></td><td width="217"></td></tr>';
str += spacer_;
str +='<tr><td width="217"><input type="radio" name="retail_tax_exempt" id="r1c" value="Yes"><label for="r1c" />Yes</label>';
str +='&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="radio" name="retail_tax_exempt" id="r1d" value="No" checked="checked"/><label for="r1d">No</label>';
str +='</td><td width="6"></td><td width="217"></td></tr>' + spacer_;
str +='<tr><td width="217" valign="top"><a href="javascript:retail()"><img src="//www.ibm.com/i/v14/buttons/us/en/submit.gif" border="0" width="120" height="21" alt="Submit" /></a></td>';
str +='<td width="6"></td><td width="217"></td></tr></table><br /></td><td width="7"><img src="/misc_images/en_US/c.gif" alt="" height="7" width="1" border="0" /><br /></td>';
str +='<td width="150" valign="top"></td></tr></table></form>';
document.write(str);
}

// ----------------------------------------
//  Retail exchange advisor form
// ----------------------------------------
function retailxFrm() {
str = '<form name="navigate" action="" method="post">';
str +='<table width="600" cellpadding="0" cellspacing="0" border="0"><tr><td width="443" valign="top">';
str +='<table cellpadding="0" cellspacing="0" border="0" width="441"><tr><td colspan="3" class="v14-header-1">Part order</td></tr>';
str += spacer_;
str +='<tr><td colspan="3">Please fill out form below to begin shopping.<br /><img src="//www.ibm.com/i/c.gif" alt="" height="4" width="1" border="0" /><br /></td></tr>';
str += spacer_;
str +='<tr><td width="217" class="v14-header-2">Order from the retail store</td><td width="6"></td><td width="217" class="v14-header-3">Need help with your order?</td></tr>';
str += spacer_;
str +='<tr><td width="217">Would you like to check to see if  you can exchange a part for a discount towards a new purchase?<br /><br />';
str +='<input type="Radio" name="retail_exchange" id="r1a" value="Yes" checked="checked"/><label for="r1a">Yes, I have a part to exchange.</label><br />';
str +='<input type="Radio" name="retail_exchange" id="r1b" value="No" /><label for="r1b">No, I do not have a part to exchange.</label><br />';
str +='</td><td width="6"></td><td width="217" valign="top"><table summary="" border="0" cellpadding="0" cellspacing="0">';
str +='<tr><td width="4"><img src="/shop/americas/content/promotion_images/en_US/bluebl.gif" width="2" height="2" alt="" border="0" align="absmiddle" /><img src="/shop/americas/content/misc_images/en_US/c.gif" width="2" height="1" alt="" /></td>';
str +='<td width="215"><a href="//www.ibm.com/pc/support/site.wss/MIGR-4UCLGT.html?lang=en_US&page=brand&brand=root&doctype=&subtype=Cat" class="fbox">Locate your part number.</a></td></tr>';
str +='<tr><td colspan="2"><img src="//www.ibm.com/i/c.gif" alt="" height="4" width="1" border="0" /></td></tr>';
str +='<tr><td width="4" valign="top"><img src="/shop/americas/content/misc_images/en_US/c.gif" width="1" height="7" alt="" /><br /><img src="/shop/americas/content/promotion_images/en_US/bluebl.gif" width="2" height="2" alt="" border="0" />';
str +='<img src="/shop/americas/content/misc_images/en_US/c.gif" width="2" height="1" alt="" /></td>';
str +='<td width="215"><a href="//www.ibm.com/support/us/" class="fbox">Browse our support and downloads area.</a></td></tr>';
str +='<tr><td colspan="2"><img src="//www.ibm.com/i/c.gif" alt="" height="4" width="1" border="0" /></td></tr>';
str +='<tr><td width="4"><img src="//www.ibm.com/i/v13/blkbl.gif" border="0" width="2" height="2" alt=""/><img src="/shop/americas/content/misc_images/en_US/c.gif" width="2" height="1" alt="" /></td>';
str +='<td width="215">Call IBM parts help at 1-877-719-0841</td></tr></table></td></tr>';
str += spacer_;
str +='<tr><td width="217">Is this a tax exempt purchase?</td><td width="6"></td><td width="217"></td></tr>';
str += spacer_;
str +='<tr><td width="217"><input type="radio" name="retail_tax_exempt" id="r1c" value="Yes"><label for="r1c" />Yes</label>';
str +='&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="radio" name="retail_tax_exempt" id="r1d" value="No" checked="checked"/><label for="r1d">No</label>';
str +='</td><td width="6"></td><td width="217"></td></tr>' + spacer_;
str +='<tr><td width="217" valign="top"><a href="javascript:retail()"><img src="//www.ibm.com/i/v14/buttons/us/en/submit.gif" border="0" width="120" height="21" alt="Submit" /></a></td>';
str +='<td width="6"></td><td width="217"></td></tr></table><br /></td><td width="7"><img src="/misc_images/en_US/c.gif" alt="" height="7" width="1" border="0" /><br /></td>';
str +='<td width="150" valign="top"></td></tr></table></form>';
document.write(str);
}


// ----------------------------------------
//  Retail and wholsale advisor form
// ----------------------------------------
function retailWholsaleFrm() {
str = '<form name="navigate" method="get">';
str +='<table width="600" cellpadding="0" cellspacing="0" border="0">';
str +='<tr><td width="443" valign="top">Please choose the proper store to begin.  If you are a retail customer, complete the short retail store questions on the left.  If this is a wholesale purchase, ';
str +='begin at the store on the right, enter your Location ID and Customer number, and order your parts.<br /><br />';
str +='<b>Please note:</b> Wholesale customers include authorized IBM Business Partners and Third Party Maintenance Providers entitled to purchase low end PC parts at a discounted price for post warranty support.';
str +='<br /><br /><table cellpadding="0" cellspacing="0" border="0" width="441">';
str +='<tr><td width="217" class="v14-header-1" >Order from the retail store</td><td width="6"></td><td width="217" class="v14-header-2" >Order from the wholesale store</td></tr>';
str += spacer_;
str +='<tr><td width="217">Would you like to check to see if  you can exchange a part for a discount towards a new purchase?</td><td width="6"></td><td width="217">Would you like to check to see if  you can exchange a part for a discount towards a new purchase?</td></tr>';
str +='<tr><td colspan="3"><img src="//www.ibm.com/i/c.gif" alt="" height="4" width="1" border="0" /></td></tr>';
str +='<tr><td width="217">';
str +='<input type="Radio" name="retail_exchange" id="r1a" value="Yes" /><label for="r1a">Yes, I have a part to exchange.</label><br />';
str +='<input type="Radio" name="retail_exchange" id="r1b" value="No" checked="checked"/><label for="r1b">No, I do not have a part to exchange.</label><br /></td>';
str +='<td width="6"></td><td width="217"><input type="Radio" name="wholesale_exchange" id="r2a" value="Yes" /><label for="r2a">Yes, I have a part to exchange.</label><br />';
str +='<input type="Radio" name="wholesale_exchange" id="r2b" value="No" checked="checked"/><label for="r2b">No, I do not have a part to exchange.</label><br /></td></tr>';
str += spacer_;
str +='<tr><td width="217">Is this a tax exempt purchase?</td><td width="6"></td><td width="217">Is this a tax exempt purchase?</td></tr>';
str +='<tr><td colspan="3"><img src="//www.ibm.com/i/c.gif" alt="" height="4" width="1" border="0" /></td></tr>';
str +='<tr><td width="217"><input type="radio" name="retail_tax_exempt" id="r1c" value="Yes"><label for="r1c" />Yes</label> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'
str +='<input type="radio" name="retail_tax_exempt" id="r1d" value="No" checked="checked"/><label for="r1d">No</label></td>';
str +='<td width="6"></td><td width="217"><input type="radio" name="wholesale_tax_exempt" id="r2c" value="Yes"><label for="r2c" />Yes</label> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
str +='<input type="radio" name="wholesale_tax_exempt" id="r2d" value="No" checked="checked"/><label for="r2d">No</label></td></tr>';
str += spacer_;
str +='<tr><td width="217"></td><td width="6"></td><td width="217"><label for="custNum">Customer number</label>: [7 digits]<br />';
str +='<input type="Text" size="15" name="custNum" id="custNum" class="iform" value="';
str += DEBUG_custNum;
str += '" /></td></tr>';
str += spacer_;
str +='<tr><td width="217" valign="top"><a href="javascript:retail()"><img src="//www.ibm.com/i/v14/buttons/us/en/submit.gif" border="0" width="120" height="21" alt="Submit"  /></a></td>';
str +='<td width="6"></td><td width="217"><label for="locID">Location ID</label>: [5 characters]<br /><input type="password" size="15" name="locID" id="locID" class="iform" value="';
str += DEBUG_locID;
str += '"/></td></tr>';
str += spacer_;
str +='<tr><td width="217"></td><td width="6"></td><td width="217"><a href="javascript:wholesale()"><img src="//www.ibm.com/i/v14/buttons/us/en/submit.gif" border="0" width="120" height="21" alt="Submit" /></a></td>';
str +='</tr></table><br /></td><td width="7"><img src="/misc_images/en_US/c.gif" alt="" height="7" width="1" border="0" /><br /></td>';
str +='<td width="150" valign="top"></td></tr></table></form>';
document.write(str);
}








// ----------------------------------------
//  Login authorization form
// ----------------------------------------
function authFrm() {
str = '<form name="login_" action="/shop/americas/webapp/wcs/stores/servlet/default/ProtectLogon" method="post">';
str +='<input type="hidden" name="shop" value="" />';
str +='<input type="hidden" name="storeId" value="" />';
str +='<input type="hidden" name="catalogId" value="-840" />';
str +='<input type="hidden" name="langId" value="-1" />';
str +='<input type="hidden" name="auth1" value="" />';
str +='<input type="hidden" name="auth2" value="" />'; // custNum
str +='<input type="hidden" name="auth3" value="" />'; // locID
str +='</form>';
document.write(str);
}
	
