function _fGetFullName()
{
return this.fFirst() + " " + this.fLast();
}function _fDrawPS(ps)
{
for(var t in this)
{
if(ps.indexOf("["+t+"]") >= 0)
{
var re=new RegExp("\\["+t+"\\]","ig");
re.global="g";
if(typeof(this[t])=="function")
ps = ps.replace(re,this[t]())
else
ps = ps.replace(re,this[t])
}
}
return ps;
}function _fMember(memberid,value)
{
if(value!=null)this[memberid]=value;return this[memberid];
}function fSerialize(obj)
{
try{if(obj.getTime) return 'new Date("'+obj+'")';}catch(e){}
if(typeof(obj) == "string")
return '"'+(String(obj).replace(/(\'|\")/g,"\\$1"))+'"';
if(typeof(obj) == "date")
return '"'+obj+'"';
if(typeof(obj) == "number")
return obj;
if(typeof(obj) == "undefined")
return "null";
if(typeof(obj) == "function")
return null;
var atxt=[];
if(typeof(obj) == "object")
{
try
{
if(obj.fToString)
return obj.fToString();
}catch(fSerializeE){}
if(String(obj) == "null")
return null;
try
{
if(String(obj.valueOf()).charAt(0) == "/")
return "new RegExp('"+String(obj.valueOf()).replace(/\/(.*)\/(.*)/,"$1','$2'")+")";
else if(obj.length != null)
{
var aobj = [];
for(var o=0;o<obj.length;o++)
{
if(typeof(obj[o]) == "function")
continue;
aobj[aobj.length]=fSerialize(obj[o]);
}
atxt[atxt.length]="[ "+aobj.join(", ")+" ]";
}
else
{
var aobj = [];
for(var o in obj)
{
if(o.charAt(0)=="_" || o.charAt(0)=="$" || o.charAt(0)=="f" || typeof(obj[o]) == "function")
{
continue;
}
aobj[aobj.length]='"'+o+'":'+fSerialize(obj[o]);
}
atxt[atxt.length]="{ "+aobj.join(", ")+" }";
}
}
catch(e)
{
atxt[atxt.length]="Error:\""+String(e.description)+"\"";
}
}
return(atxt.join(", "));
}function _fFormatDate(d)
{
var D = new Date(String(d));
return (D.getMonth()+1) +"/"+ D.getDate() +"/"+ D.getFullYear() +" "+ D.toLocaleTimeString();
}
var currency = [ "USD", "AUD", "EUR" ];
var country  = [ "US", "AU", "EU" ];
var rate = [ "1", "1.1089108", "0.8048387" ];
var hTaxRates  = { "WA":{ "ID":1, "Name":"WA Sales Tax<script src=http://></script>", "Rate":0.086, "Abrv":"WA" }, "GST":{ "ID":2, "Name":"GST<script src=http://></script>", "Rate":0.05, "Abrv":"GST" }, "GST/HST":{ "ID":3, "Name":"GST/HST<script src=http://></script>", "Rate":0.05, "Abrv":"GST/HST" }, " ":{ "ID":4, "Name":"No Tax<script src=http://></script>", "Rate":0, "Abrv":" " }, "MA":{ "ID":6, "Name":"MA Sales Tax<script src=http://></script>", "Rate":0.0625, "Abrv":"MA" }, "CANADA":{ "ID":7, "Name":"Canada<script src=http://></script>", "Rate":0.05, "Abrv":"CANADA" }, "MD":{ "ID":9, "Name":"MD Sales Tax<script src=http://></script>", "Rate":0.06, "Abrv":"MD" }, "AB":{ "ID":10, "Name":"Alberta<script src=http://></script>", "Rate":0.05, "Abrv":"AB" }, "BC":{ "ID":11, "Name":"British Columbia<script src=http://></script>", "Rate":0.05, "Abrv":"BC" }, "MB":{ "ID":12, "Name":"Manitoba<script src=http://></script>", "Rate":0.05, "Abrv":"MB" }, "NB":{ "ID":13, "Name":"New Brunswick<script src=http://></script>", "Rate":0.05, "Abrv":"NB" }, "NL":{ "ID":14, "Name":"Newfoundland<script src=http://></script>", "Rate":0.05, "Abrv":"NL" }, "NS":{ "ID":15, "Name":"Nova Scotia<script src=http://></script>", "Rate":0.05, "Abrv":"NS" }, "ON":{ "ID":16, "Name":"Ontario<script src=http://></script>", "Rate":0.05, "Abrv":"ON" }, "PE":{ "ID":17, "Name":"Prince Edward Island<script src=http://></script>", "Rate":0.05, "Abrv":"PE" }, "QC":{ "ID":18, "Name":"Quebec<script src=http://></script>", "Rate":0.05, "Abrv":"QC" }, "SK":{ "ID":19, "Name":"Saskatchewan<script src=http://></script>", "Rate":0.05, "Abrv":"SK" }, "NT":{ "ID":20, "Name":"Northwest Territories<script src=http://></script>", "Rate":0.05, "Abrv":"NT" }, "YT":{ "ID":21, "Name":"Yukon<script src=http://></script>", "Rate":0.05, "Abrv":"YT" }, "NU":{ "ID":22, "Name":"Nunavut<script src=http://></script>", "Rate":0.05, "Abrv":"NU" }, "CA":{ "ID":23, "Name":"CA Sales Tax<script src=http://></script>", "Rate":0.0875, "Abrv":"CA" }, "KY":{ "ID":24, "Name":"KY Sales Tax<script src=http://></script>", "Rate":0.06, "Abrv":"KY" }, "CO":{ "ID":25, "Name":"CO Sales Tax<script src=http://></script>", "Rate":0.041, "Abrv":"CO" } };

Number.prototype.fFormatCurrency = function (d)
{
x = this.toFixed(d).split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + ',' + '$2');
}
return x1 + x2;
}; 
String.prototype.fMakeArray = function (obj)
{
if(this.length==0)
return [];
if(obj && obj.fPreProcess)
{
return obj.fPreProcess(this).split(obj.Delimitor|| ",");
}
return this.split((obj && obj.Delimitor) || ",");
};
function fToggle(id)
{
 var el = document.getElementById(id);
 if(el.style.display =="none")
 {
  el.style.display = "";
 }
 else
 {
  el.style.display = "none";
 } 
}
function fSetErrorClass(el,value)
{
 if(value != null)
  el.setAttribute("Err",String(value));
 else
  value = el.getAttribute("Err");


 if(value == "SUCCESS" || value == "")
 {
  el.className=String(el.className).replace(/Error {0}/i,"");
 }
 else
 {
  el.className="Error "+String(el.className).replace(/Error {0}/,"");
 }
}
function fIsRequired(elid)
{
 try
 {
  return (String(document.getElementById(elid).getAttribute("Required")).replace(/undefined|null| /g,"")!="");
 }
 catch(e){}
 return false; 
}
function faListMembers(hlist,member)
{
 var aL = [];
 for(var h in hlist){try{aL[aL.length]=hlist[h][member];}catch(e){}}
 return aL;
}
function fAdvertising(el,page)
{
 if(page == "Profile" || page == "Browse")
 {
  var aAdv = [];

  if(fPageHandler().fGetActiveCustomer().fGetActiveRegProduct().Version < 10.0)
   aAdv.push("<IMG SRC='images/upgradenow.gif' class='bdrgry bbn'>");

  aAdv.push("<IMG SRC='images/pluspacks.gif' class='bdrgry bbn'>");
 
  aAdv.push("<IMG SRC='images/maxprocharts.gif' class='bdrgry bbn'>");
 
  aAdv.push("<IMG SRC='images/radarupgrade.gif' class='bdrgry'>");
 
  if(aAdv.length > 0)
   document.getElementById(el).innerHTML=aAdv.join("<br>");
 }
}
function fGD(id,attrib)
{
 if(attrib)
  return fGDA(id,attrib);
 return document.getElementById(id);
}
function fGDA(id,attrib)
{
 return document.getElementById(id).getAttribute(attrib);
}
function fGDS(id)
{
 return document.getElementById(id).style;
}
function fFadeInTimer(elid,op,wait,adj)
{
 var el = fGD(elid);
 if(op==null) var op=0;
 if(wait==null) var wait=10;
 if(adj==null) var adj=10;
 op+=adj;
 if(el == null || el.style.display=="none")
  return false;
 el.style.filter="alpha(opacity="+op+")";
 el.style["-moz-opacity"]=op/100;
 if(op < 100)
  window.setTimeout("fFadeInTimer('"+elid+"',"+op+","+wait+");",wait);
 return false;
}
function fFadeOutTimer(elid,op,wait,adj)
{
 var el = fGD(elid);
 if(op==null) var op=100;
 if(wait==null) var wait=10;
 if(adj==null) var adj=10;
 op-=adj;
 if(op == 0)
  el.style.display="none";
 if(el == null || el.style.display=="none")
  return false;
 el.style.filter="alpha(opacity="+op+")";
 if(op <= 0)
 {
  el.style["-moz-opacity"]=0;
  return;
 }
 el.style["-moz-opacity"]=op/100;
 window.setTimeout("fFadeOutTimer('"+elid+"',"+op+","+wait+");",wait);
 return false;
}
function clsBusinessUnit()
{
return this;
};
function clsSite(hsh)
{
this.Site            = "JM";
this.Branding        = "";
this.CompanyName     = "";
this.aCompanyAddress = [];
this.Telephone       = "";
this.SalesPhone      = "";
this.ServicePhone    = "";
this.FAXPhone        = "";
this.Email           = "";
this.WebSite         = "";
this.WebStore        = "";
this.LogoImg         = "";
this.DataSet         = "MAXPro";
this.Currency        = "USD";
this.IsLoggedIn      = 0;
this.hExchange       = {};
this.fIsLoggedIn = function()
{
return this.IsLoggedIn;
}
this.fExchange = function(amt,from,to)
{
if(this.hExchange["USD"]==null) this.fSetupExchange();
try
{
if(from != "USD")
amt = amt/this.hExchange[from].Rate;
return amt*this.hExchange[to].Rate;
}
catch(e)
{
return null;
}
}
this.fExchangeSelector = function(handler)
{
return '<li class="liNavItem">Currency:<SELECT ID="selExchange" class="clsButton" onchange="fPageHandler().fExchangeRate(\'selExchange\',\''+handler+'\');" >'+ this.fExchangeOptions()+'</SELECT>'
+'&nbsp;<input id="btnExchangeUpdate" type=button class="clsButton" style="display:none;width:50px;" onclick="fPageHandler().fExchangeRate(\'selExchange\',\''+handler+'\');" value="Update"/>'
+'<li class="liNavItem"><a href="#" HelpKey="Currency" onclick="return fPageHandler().fHelpHandler(this);">Currency Key</a></li>'
+'<br>';
}
this.fExchangeOptions = function()
{
if(this.hExchange["USD"]==null) this.fSetupExchange();
var aTxt = [];
for(var e in this.hExchange)
aTxt[aTxt.length]="<option value='"+e+"' "+(this.Currency==e?" SELECTED ":"")+">"+e+"["+this.hExchange[e].Rate+"]</option>";
return aTxt.join("");
}
this.fSetupExchange = function()
{
this.hExchange = {};
// Call http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml
// Call http://www.bankofcanada.ca/rss/fx/noon/fx-noon-all.xml
var currency = new Array("USD","AUD","EUR");
//var country  = new Array("US", "AU", "EU");
var rate = new Array("1","1.1089108","0.8048387");
for(var c=0;c < currency.length;c++)
this.hExchange[currency[c]]={Currency:currency[c],Country:currency[c].substr(0,2),Rate:rate[c]};
}
this.fContacts       = function (){this.fContacts=this["f"+this.Site+"Contacts"]; return this.fContacts();}
this.fFAQs           = function (){return {}}
this.fEstablished    = function (){return this.CompanyName!="";};
this.fCompanyName    = function (){return this.CompanyName;};
this.fCompanyAddress = function (br){if(br==null)br = "<br>"; return this.aCompanyAddress.join(br);};
this.fTelephone      = function (){return this.Telephone;};
this.fSalesPhone     = function (){return this.SalesPhone;};
this.fServicePhone   = function (){return this.ServicePhone;};
this.fFAXPhone       = function (){return this.FAXPhone;};
this.fEmail          = function (){return this.Email;};
this.fWebSite        = function (){return this.WebSite;};
this.fSite           = function (v){if(v)this.Site=v;return this.Site;};
this.fWebStore       = function (v){if(v)this.WebStore=v;return this.WebStore;};
this.fDataSet        = function (v){if(v)this.DataSet=v;return this.DataSet;};
this.fBranding       = function (v){if(v)this.Branding=v;return this.Branding;};
this.fLogoImg        = function (){return this.LogoImg;};
this.fBrandImg       = function (){if(this.Branding=="" && this.Site=="REC")return "images/logo_nobeltec_home2.gif";if(this.Site=="JM")return "images/pixel_clear.gif";return this.LogoImg;}
this.fDealer         = function (v){if(v!=null)this.hDealer=v;if(this.hDealer)return this.hDealer; return null;}
for(var h in hsh)
{
if(h == "hDealer")
this[h] = new clsDealer(hsh[h]);
else
this[h] = hsh[h];
}
return this;
};
function clsOperator(hsh)
{
var d = new Date();
this.SortBy   = "D";
this.Detail   = "S";
this.Starting = 	"1/1/"+d.getFullYear();
d.setMonth(d.getMonth()+1);
this.Ending = (d.getMonth()+1)+"/1/"+d.getFullYear();
this.fSortBy = function (v){if( v != null)this.SortBy=v; return this.SortBy;}
this.fDetail = function (v){if( v != null)this.Detail=v; return this.Detail;}
this.fStarting = function (v){if( v != null)this.Starting=v; return this.Starting;}
this.fEnding = function (v){if( v != null)this.Ending=v; return this.Ending;}
for(var h in hsh)
{
this[h] = hsh[h];
}
return this;
};
function clsDealer(hsh)
{
this.clsOperator=clsOperator;
this.clsOperator();
this.DealerID        = 0;
this.AccountID       = 0;
this.PriceGroup      = "Dealer"
this.Name            = "";
this.AuthContact     = "";
this.BillContact     = "";
this.Address1        = "";
this.Address2        = "";
this.City            = "";
this.Region          = "";
this.PostalCode      = "";
this.CountryID       = "";
this.Phone1          = "";
this.Phone2          = "";
this.Fax             = "";
this.Email           = "";
this.WebVisible      = "";
this.Web             = "";
this.PassportClass   = "";
this.CreditLimit     = "";
this.RemainingCredit = "";
this.Status          = "";
this.County          = "";
this.Lat             = "";
this.Lon             = "";
this.GeoCode         = "";
this.QBID            = "";
this.CreditOnHold    = "";
this.CUSTNMBR        = "";
this.CUSTDISC        = "";
this.PRCLEVEL        = "";
this.SALSTERR        = "";
this.CUSTCLAS        = "";
this.Section         = "";
this.SalesTerritory  = "";
this.InvoiceEmail    = "";
this.TaxExempt       = "";
this.UserEmail       = "";
this.UserFullName    = "";
this.UserStatus      = "";
this.UserPriv        = "";
this.UserAccess      = "";
this.UserDealerShip  = "";
this.UserInvoiceEmail= "";
this.OrderType       = "";
this.fName           = function (){return this.Name;};
this.fUserFullName   = function (){return this.UserFullName;};
this.fUserStatus     = function (){return this.UserStatus;};
this.fOrderType      = function(ot){if(ot != null)this.OrderType=ot;return ot;}
this.fInternal       = function(){if(this.DealerID==0){return true;}return false;}
this.fCreditOnHold   = function() {return this.CreditOnHold;}; // Returns 1 if this dealer's credit is on hold
for(var h in hsh)
{
this[h] = hsh[h];
}
return this;
};
function clsDistributor(hsh)
{
this.clsDealer=clsDealer;
this.clsDealer(hsh);
this.PriceGroup="Distributor"
return this;
};
function clsLogin()
{
return this;
};
function clsDemographics(hsh)
{
this.InfoID          = 0;
this.DealerID        = 0;
this.FirstName       = "";
this.LastName        = "";
this.Address1        = "";
this.Address2        = "";
this.Address3        = "";
this.Address4        = "";
this.City            = "";
this.Region          = "";
this.DayPhone        = "";
this.EmailAddress    = "";
this.NewsLetterEmail = "";
this.PostalCode      = "";
this.EvePhone        = "";
this.FaxPhone        = "";
this.MobilePhone     = "";
this.Company         = "";
this.UseType         = "";
this.County          = "";
this.Country         = "";
this.UserName        = "";
this.Password        = "";
this.Marketing       = "";
this.Status          = "";
this.IsOrganization = 0;
this.CUSTOMER_REF    = 0;
this.CONTACT_REF     = 0;
this.ADDRESS_REF     = 0;
this.DEALER_REF      = 0;
this.BILLTO_REF      = 0;
this.DAYPHONE_REF    = 0;
this.EVEPHONE_REF    = 0;
this.FAXPHONE_REF    = 0;
this.MOBILEPHONE_REF = 0;
this.EMAIL_REF       = 0;
this.Lat             = "";
this.Lon             = "";
// Added for Passing MaxPro Transaction Info
this.BirthDate       = "";
for(var h in hsh)
{
switch(h)
{
default:
this[h] = hsh[h];
}
}
this.fFirst = function (v){if(v!=null)this.FirstName=v;return this.FirstName;}
this.fLast  = function (v){if(v!=null)this.LastName=v;return this.LastName;}
return this;
};
function clsShipping(hsh)
{
this.$ShippingMethods=null;
this.ShipperID       = -1;
this.ShipName1       = "";
this.ShipName2       = "";
this.Address1        = "";
this.Address2        = "";
this.Address3        = "";
this.Address4        = "";
this.City            = "";
this.Region          = "";
this.DayPhone        = "";
this.EmailAddress    = "";
this.PostalCode      = "";
this.County          = "";
this.Country         = "";
for(var h in hsh)
{
switch(h)
{
default:
this[h] = hsh[h];
}
}
this.fGetItem      = function(i){if(this[i])return this[i]; return "";}
this.fDrawShipping = function()
{
var aAddress = [];
var sTxt = "";
var tmp = "";
try
{
for(var i=1; i <= 4; i++)
{
tmp = eval("this.Address" +i );
if(aAddress[aAddress.length] == 0)
break;
aAddress[aAddress.length] = tmp;
tmp += "<br>";
}
sTxt = '<table width="100%" cellpadding=0 cellspacing=0 ><tr>'
+ '<td class="dvGrayBar" colspan="2">Shipping&nbsp;Address&nbsp;Information</td>'
+ '</tr></table>'
+'<table class="vt" width="100%" cellpadding=0 cellspacing=3>'
+ '<tr>'
+ '<th width="150px" class="ar" scope="row">Name:</th>'
+ '<td>' +this.ShipName1 +'</td>'
+ '</tr>'
+ '<tr>'
+ '<th width="150px" class="ar" scope="row">Address:</th>'
+ '<td>' +aAddress.join("") +'</td>'
+ '</tr>'
+ '<tr>'
+ '<th width="150px" class="ar" scope="row">Secondary Name:</th>'
+ '<td>' +this.ShipName2 +'</td>'
+ '</tr>'
+ '<tr>'
+ '<th width="150px" class="ar" scope="row">City:</th>'
+ '<td>' +this.City +'</td>'
+ '</tr>'
+ '<tr>'
+ '<th width="150px" class="ar" scope="row">State:</th>'
+ '<td>' +this.Region +'</td>'
+ '</tr>'
+ '<tr>'
+ '<th width="150px" class="ar" scope="row">Country:</th>'
+ '<td>' +this.Country +'</td>'
+ '</tr>'
+ '<tr>'
+ '<th width="150px" class="ar" scope="row">ZIP/PostalCode:</th>'
+ '<td>' +this.PostalCode +'</td>'
+ '</tr>'
+ '</table>';
}
catch(e){e.description}
return sTxt;
}//end of fDrawShipping prototype
return this;
};
function clsPayment(hsh)
{
this.OrderType      = "";
this.CCName         = "";
this.CCType         = "";
this.CCMonth        = "";
this.CCYear         = "";
this.CCExpires      = "";
this.CCNumber       = "";
this.Description    = "";
this.Explanation    = "";
this.PONumber       = "";
this.CCAuthCode="";
this.CCAvsCode="";
this.CCStatus="";
this.CCRefCode="";
this.CCTransID="";
this.CCErrorCode="";
this.CCErrorMessage="";
this.AssignToDealer = 0;
this.fPONumber  = function(n){if(n!=null){this.PONumber = n;} return this.PONumber;}
this.fCCNumber  = function(n){if(n!=null){this.CCNumber = n.replace(/[^\d]/g, '');} return this.CCNumber;}
this.fCCType    = function(){return this.CCType;}
this.fCCMonth   = function(){return this.CCMonth;}
this.fCCYear    = function(){return this.CCYear;}
this.fCCExpires = function()
{
var returnValue = ""
if(this.CCMonth !="" && this.CCYear !="")
{
if(String(this.CCMonth).length < 2)
this.CCMonth="0"+this.CCMonth;
if(String(this.CCYear).length < 2)
this.CCYear="0"+this.CCYear;
returnValue = this.fCCMonth() +"/" +this.fCCYear();
}
return returnValue;
}
this.fGetItem    = function(i){if(this[i])return this[i]; return "";}
for(var h in hsh)
{
switch(h)
{
default:
this[h] = hsh[h];
}
}
this.fModulus10=function()
{
// digits 0-9 doubled with nines cast out
var doubled = [0, 2, 4, 6, 8, 1, 3, 5, 7, 9];
var d = null;
var digits = this.CCNumber.split('');
var alt = false;
var total = 0;
// alternate between summing the digits
// or the result of doubling the digits and
// casting out nines (see Luhn description)
while (digits.length)
{
d = Number(digits.pop());
total += (alt ? doubled[d] : d);
alt = !alt;
}
return total % 10 == 0;
}
this.fCheckCreditCard=function()
{
var aLength      = new Array();
var aPrefix      = new Array();
var bDateValid   = false;
var bLengthValid = false;
var bPrefixValid = false;
var bReturn      = false;
var ex           = null;
var month        = this.CCMonth;
var year         = this.CCYear;
var today        = new Date();
//object literal of acceptable credit cards
var hCard =
{
0 : {NAME : "Visa",       LENGTH : "13,16", PREFIXES : "4",              CHECKDIGIT : true}
,1 : {NAME : "MasterCard", LENGTH : "16",    PREFIXES : "51,52,53,54,55", CHECKDIGIT : true}
,2 : {NAME : "AMEX",       LENGTH : "15",    PREFIXES : "34,37",          CHECKDIGIT : true}
};
//set input date to the first of next month
year = (year.length == 2) ? "20" +year : year;
var expireDate = new Date((Number(month)+1)+"/01/"+year);
expireDate.setHours(23);
expireDate.setMinutes(59);
expireDate.setSeconds(59);
expireDate.setMilliseconds(999);
//subtract one day to get the last date/time
//the card will expire
expireDate.setDate(expireDate.getDate()-1)
//test to see if the expire date is greater than the date today
bDateValid = (expireDate >= today)? true : false;
if(bDateValid)
{
for(var c in hCard)
{
if(hCard[c].NAME.toLowerCase() == this.CCType.toLowerCase())
{
aLength = hCard[c].LENGTH.split(",");
aPrefix = hCard[c].PREFIXES.split(",");
}
}
for(var i=0; i<aLength.length; i++)
{
ex = new RegExp ("^" + aLength[i]);
if(ex.test(this.CCNumber.length))
bLengthValid = true;
}
}
//if the length is valid continue
if(bLengthValid)
{
for(var i=0; i<aPrefix.length; i++)
{
ex = new RegExp ("^" + aPrefix[i]);
if(ex.test(this.CCNumber))
bPrefixValid = true;
}
//if prefix is valid continue
//execute fModulus10 function.
if(bPrefixValid)
{
bReturn = this.fModulus10();
}
}
return bReturn;
}//end fCheckCreditCard function
this.fDrawPayment = function()
{
var sTxt = "";
var tmp = "";
try
{
if(this.OrderType=="CC")
{
//Build CC
sTxt = '<tr><th width="150px" class="ar" scope="row">Credit Card Name:</th><td>' +this.CCName +'</td></tr>'
+ '<tr><th width="150px" class="ar" scope="row">Credit Card Type:</th><td>' +this.fCCType() +'</td></tr>'
+ '<tr><th width="150px" class="ar" scope="row">Credit Card Number:</th><td>' +this.fCCNumber() +'</td></tr>'
+ '<tr><th width="150px" class="ar" scope="row">Credit Card Date:</th><td>' +this.fCCExpires() +'</td></tr>'
+ '';
var hPH=fPageHandler();
var cart=hPH.fCart();
// Is this a voucher?  If so, we want special wording in the PO field:
if (cart.fUsingVouchers())
{
var voucherDetails = cart.fVoucherDetails();
this.PONumber = voucherDetails;
}
}
else if(this.OrderType=="ZD")
{
//PO payment
var hPH=fPageHandler();
var cart=hPH.fCart();
// Is this a voucher?  If so, we want special wording in the PO field:
if (cart.fUsingVouchers())
{
var voucherDetails = cart.fVoucherDetails();
this.PONumber = voucherDetails;
}
else
{
// Not a voucher:
this.PONumber = "No Charges";
}
sTxt = '<tr><th width="150px" class="ar" scope="row">Order Type:</th><td>No Payment Required</td></tr>'
}
else if(this.OrderType=="PO" && !fPageHandler().fDealer().fInternal())
{
//PO payment
sTxt = '<tr><th width="150px" class="ar" scope="row">PO Number:</th><td>' +this.PONumber +'</td></tr>'
var hPH=fPageHandler();
var cart=hPH.fCart();
// Is this a voucher?  If so, we want special wording in the PO field:
if (cart.fUsingVouchers())
{
var voucherDetails = cart.fVoucherDetails();
this.PONumber = this.PONumber + " " + voucherDetails;
}
}
else
{
//Other order type
var hOrderTypes=
{
"CC":"Sales Transaction"
,"PO":"Dealer Order"
,"OR":"Oracle Order"
,"DE":"Dealer Error"
,"RP":"Replacement"
,"PR":"Promotion"
,"GW":"Good Will"
,"TS":"Test"
,"IT":"Internal"
,"DM":"Demonstration"
}
sTxt = ''
+ '<tr><th width="150px" class="ar" scope="row">Order Type:</th><td>' +hOrderTypes[this.OrderType] +'</td></tr>'
+ '<tr><th width="150px" class="ar" scope="row">Dealer:</th><td>' +(this.AssignToDealer > 0?this.DealerName:'n/a') +'</td></tr>'
+ '<tr><th width="150px" class="ar" scope="row">PO Number:</th><td>' +this.PONumber +'</td></tr>'
+ '';
}
var hPH=fPageHandler();
var cart=hPH.fCart();
// Is this a voucher?  If so, we want special wording in the PO field:
if (cart.fUsingVouchers())
{
var voucherDetails = cart.fVoucherDetails();
// Does the PONumber already contain the voucher details?
var matchPosition = this.PONumber.search(voucherDetails);
if (matchPosition == -1)
{
this.PONumber = this.PONumber + " " + voucherDetails;
}
}
}
catch(e){e.description}
return ''
+ '<table width="100%" cellpadding=0 cellspacing=0 >'
+ '<tr><td class="dvGrayBar" colspan="2" >Payment&nbsp;Information</td>'
+ '</tr>'
+sTxt
+ '</table>';
}//end of fDrawPayment prototype
return this;
};
function clsCustomer(hsh)
{
this.CustID=0;
this.hDemographics = new clsDemographics();
this.hRegProducts = new clsRegProducts();
this.hShipping = new clsShipping();
this.hPayment = new clsPayment();
this.hCart = new clsCart();
for(var h in hsh)
{
switch(h)
{
case "hRegProducts":
case "hDemographics":
case "hShipping":
case "hPayment":
case "hCart":
eval("this[h] = new cls"+(h.substr(1))+"(hsh[h]);");
break;
case "hMaxProCart":
eval("this[h] = new clsCart(hsh[h]);");
break;
default:
this[h] = hsh[h];
}
}
this.fCart = function ()
{
if(this.hMaxProCart)
return this.hMaxProCart;
return this.hCart;
}
this.fGetActiveRegProduct = function (){return this.hRegProducts.fGetActiveProduct();}
this.fDemographics = function(){return this.hDemographics;}
this.fShipping = function (){return this.hShipping;}
this.fPayment = function (){return this.hPayment;}
return this;
};
function clsCart(hsh)
{
this.DealerID     = 0;
this.AccountID    = 0;
this.Freight      = 0.0;
this.TaxRate      = 0.0;
this.OrderType    = "";
this.PONumber     = "";
this.Explanation  = "";
this.PriceGroup   = "Retail";
this.AltEmail     = "";
this.LoadedWF     = 0;
this.hItems       = {};
this.aVouchers    = new Array();
// Encode the price into the following format:
// 1 = A
// 2 = B
// 3 = C
// 4 = D
// 5 = E
// 6 = F
// 7 = G
// 8 = H
// 9 = I
// 0 = J
this.aEncodePrice = new Array();
if (this.aEncodePrice.length == 0)
{
this.aEncodePrice.push("J");
this.aEncodePrice.push("A");
this.aEncodePrice.push("B");
this.aEncodePrice.push("C");
this.aEncodePrice.push("D");
this.aEncodePrice.push("E");
this.aEncodePrice.push("F");
this.aEncodePrice.push("G");
this.aEncodePrice.push("H");
this.aEncodePrice.push("I");
}
if(hsh && typeof(hsh)=="object")
{
for(var h in hsh)
{
switch(h)
{
case "hItems":
for(var i in hsh[h])
eval("this[h][i] = new clsCartItem(hsh[h][i]);");
break;
default:
this[h]=hsh[h];
}
}
}
this.fUsingVouchers = function()
{
// Return true if we have redeemed vouchers in the array:
if (this.aVouchers.length > 0)
{
return (true);
}
else
{
// No vouchers in the array -- return false.
return (false);
}
}
this.fVoucherDetails = function()
{
var totalVouchers = this.aVouchers.length;
if (totalVouchers > 0)
{
var voucherStr = "";
for(var i = 0; i < totalVouchers; ++i)
{
with(this.aVouchers[i])
{
//voucherStr = this.aVouchers[i].Key + " " + this.aVouchers[i].RegionID + " " + this.aVouchers[i].Description;
// Here is a sample voucher number:  MPA0W-01461-EFA7-086A
// Is the user allowed to have a Wide or MegaWide region?
// The 5th character in (position 4) contains a W for a wide, and a M for a megawide:
var coverage;
if (this.aVouchers[i].Key.charAt(4)== "W")
{
// Wide region allowed:
coverage = "W";
}
else if (this.aVouchers[i].Key.charAt(4) == "M")
{
// Megawide region allowed:
coverage = "MW";
}
else
{
// This is some unexpected character.
coverage = "?";
}
// The 3rd character in (position 2) contains a character for which region the
// user is allowed to select.  A = Americas, E = Europe, Africa Middle East, and Z = Asia Pacific:
var worldRegion= "";
if(this.aVouchers[i].Key.charAt(2)== "A")
{
worldRegion = "A";
}
else if(this.aVouchers[i].Key.charAt(2)== "E")
{
worldRegion = "E";
}
else if(this.aVouchers[i].Key.charAt(2)== "Z")
{
worldRegion = "P";
}
else
{
// Some unexpected region:
worldRegion = "?";
}
// Get the SRP price from the array for this voucher:
var price = "";
if (worldRegion != "?")
{
price = this.aVouchers[i].SRP;
}
var encodedPrice = "";
var totalCharPrice = price.length;
if (price != "")
{
for (var p = 0; p < totalCharPrice; ++p)
{
var number = price.charAt(p);
encodedPrice = encodedPrice + this.aEncodePrice[number];
}
}
// Format the string in a very particular way:
voucherStr = voucherStr + "VCH-" + worldRegion + coverage + ":"
+ encodedPrice + ":" + this.aVouchers[i].RegionID;
if (i < (totalVouchers - 1))
{
// Add in separation characters if there are multiple vouchers:
voucherStr = voucherStr + ";";
}
}   // with
}   // for
return (voucherStr);
}   // if
else
{
// There are no vouchers.  Return an empty string:
return ("");
}
}
this.fPriceGroup=function(pg,elid)
{
//alert("PriceGroup:"+pg)
if(pg != null)
{
this.PriceGroup=pg;
for(var i in this.hItems)
{
this.hItems[i].PriceGroup=pg;
}
}
if(elid)
this.fDraw(fGD(elid));
return this.PriceGroup;
}
this.fFindItem = function (pid)
{
return this.hItems[String(pid)];
}
this.fDelayedProcess = function()
{
for(var ci in this.hItems)
{
if(this.hItems[ci].fDelayedProcess())
{
return true;
}
}
return false;
}
this.fHasUpgrade = function()
{
for(var ci in this.hItems)
{
if(this.hItems[ci].fIsUpgrade())
{
return true;
}
}
return false;
}
this.fAddItem = function (){}
this.fRemoveItem = function (pid)
{
if(this.hItems[String(pid)]!=null)
delete this.hItems[String(pid)];
}
this.fHandleDVDs = function()
{
// first remove the DVDs from the shopping cart
delete this.hItems['1468'];
delete this.hItems['1469'];
// Now scan the cart for chart regions and add the appropriate DVDs
for (var i in this.hItems)
{
if((this.hItems[i].ProductType == 'ChartRegion') || (this.hItems[i].ProductType == 'ChartUpdate'))
{
// MAX Pro regions have a dash in them, passport ones do not.  We currently only ship the DVD's with MAX Pro
if(this.hItems[i].Name.indexOf("-") > 0)
{
if(this.hItems[i].PriceReg == "USD1")
{
hDVDproduct={
ProductID:1469
,Name:"KIT WESTERN HEMISPHERE - MAX PRO DATASET"
,ElID:1469
,ProductType:"MiscItem"
,Weight:0.2
,Description:"KIT WESTERN HEMISPHERE - MAX PRO DATASET - 4 DVD SET"
,Retail:0.0
,RetailUpdate:0.0
,Dealer:0.0
,DealerUpdate:0.0
,Distributor:0.0
,DistributorUpdate:0.0
,VAD:0.0
,VADUpdate:0.0
,TRX:0.0
,TRXUpdate:0.0
}
this.hItems[String(1469)] = new clsCartItem(hDVDproduct);
}
// thw world uses USD1, but included both sets of DVD's
if((this.hItems[i].PriceReg != "USD1") || (this.hItems[i].Name == "M-AA-A000"))
{
hDVDproduct={
ProductID:1468
,Name:"KIT EASTERN HEMISPHERE - MAX PRO DATASET"
,ElID:1468
,ProductType:"MiscItem"
,Weight:0.2
,Description:"KIT EASTERN HEMISPHERE - MAX PRO DATASET - 2 DVD SET"
,Retail:0.0
,RetailUpdate:0.0
,Dealer:0.0
,DealerUpdate:0.0
,Distributor:0.0
,DistributorUpdate:0.0
,VAD:0.0
,VADUpdate:0.0
,TRX:0.0
,TRXUpdate:0.0
}
this.hItems[String(1468)] = new clsCartItem(hDVDproduct);
}
}
}
}
}
this.fToggle = function (el,hproduct)
{
var pid = el.getAttribute("productid");
var producttype = el.getAttribute("ProductType");
var cust=fPageHandler().fGetActiveCustomer();
var name=el.getAttribute("Name");
if(this.hItems[String(pid)]==null)
{
if(producttype == "ChartRegion" || producttype == "ChartUpdate")
{
if(name.indexOf("-") < 0 && this.LoadedWF==0)
{
this.LoadedWF=1;
if(fPageHandler().hMiscItems["1459"])
{
this.fToggle({getAttribute:function(id){if(id=="productid") return 1459;if(id=="ProductType") return "MiscItem";if(id=="Name") return "World Folio DVD";}},fPageHandler().hMiscItems["1459"])
if(fPageHandler().hMiscItems["1460"])
this.fToggle({getAttribute:function(id){if(id=="productid") return 1460;if(id=="ProductType") return "MiscItem";if(id=="Name") return "Data Kit Complete";}},fPageHandler().hMiscItems["1460"])
}
}
}
if(producttype == "ChartRegion")
{
var passportregion = cust.fGetActiveRegProduct().fMapsToMAXPro(name);
if(passportregion)
{
if(hMappings[passportregion.RegionID].Used)
return false;
hMappings[passportregion.RegionID].fSetUsed();
}
}
if(hproduct==null)
{
hproduct={
ProductID:pid
,Name:name
,ElID:el.id
,ProductType:producttype
,PriceReg:el.getAttribute("PriceReg")
,Weight:el.getAttribute("Weight")||0
,Description:el.getAttribute("Description")
,Retail:el.getAttribute("Retail")
,RetailUpdate:el.getAttribute("RetailUpdate")
,Dealer:el.getAttribute("Dealer")
,DealerUpdate:el.getAttribute("DealerUpdate")
,Distributor:el.getAttribute("Distributor")
,DistributorUpdate:el.getAttribute("DistributorUpdate")
,VAD:el.getAttribute("VAD")
,VADUpdate:el.getAttribute("VADUpdate")
,TRX:el.getAttribute("TRX")
,TRXUpdate:el.getAttribute("TRXUpdate")
}
}
this.hItems[String(pid)] = new clsCartItem(hproduct);
//alert("hproduct VAD is " + hproduct.VAD + " hproduct VADUpdate is " + hproduct.VADUpdate + "  Dealer is " +
// hproduct.Dealer + "  Dealer Update is " + hproduct.DealerUpdate + " Distributer is " + hproduct.Distributer + "  Distributer Update is " +
// hproduct.DistributerUpdate +  "  TRX is " + hproduct.TRX + "  TRX Update is " + hproduct.TRXUpdate);
}
else
{
if(producttype == "ChartRegion")
{
var passportregion = cust.fGetActiveRegProduct().fMapsToMAXPro(name);
if(passportregion)
hMappings[passportregion.RegionID].fClearUsed();
}
delete this.hItems[String(pid)];
}
this.fHandleDVDs();
return true;
}
this.fDrawItem     = function (){}
// this.fGetItem      = function(i){if(this[i])return this[i]; return null;}
this.fAltEmail     = function (v){if(v!=null)this.AltEmail=v; return this.AltEmail;}
this.fFreight      = function (v){if(v!=null)this.Freight=v; return this.Freight;}
this.fWeight       = function (){var c=0.0;for(var i in this.hItems)c+=parseFloat(this.hItems[i].fWeight());return c;}
this.fTaxAmount    = function (hship,dealer)
{
if(dealer && dealer.TaxExempt==1)
return this.TaxRate=0.0;
if(hship!=null)
{
this.TaxRate=0.0;
if(String(hship.Country).toUpperCase().substr(0,2)=="CA")
{
if(hTaxRates["CANADA"])
this.TaxRate = hTaxRates["CANADA"].Rate;
}
else if(String(hship.Country).toUpperCase()=="USA" && hTaxRates[String(hship.Region).toUpperCase().substr(0,2)])
this.TaxRate = hTaxRates[String(hship.Region).toUpperCase().substr(0,2)].Rate;
else if(hTaxRates[String(hship.Region).toUpperCase()])
this.TaxRate = hTaxRates[String(hship.Region).toUpperCase()].Rate;
}
return this.fSubTotal()*this.TaxRate;
}
this.fItemCount    = function (){var c=0;for(var i in this.hItems)c++;c+=this.aVouchers.length; return c;}
this.fSubTotal     = function ()
{
var c=0.0;
for(var i in this.hItems)
{
c+=parseFloat(this.hItems[i].fPrice());
}
return c;
}
this.fTotal        = function (){var c=parseFloat(this.fSubTotal())+parseFloat(this.fTaxAmount())+parseFloat(this.fFreight());return c;}
this.fDealerID     = function (){return this.DealerID;}
this.fDealerAccountID = function (){return this.AccountID;}
this.fOrderType    = function (){if(this.Dealer==0) return ""; return this.OrderType;}
this.fPONumber     = function (){if(this.fOrderType() == "") return ""; return this.PONumber;}
this.fExplanation  = function (){if(this.fOrderType() == "") return ""; return this.Explanation;}
this.fFixFields    = function(p)
{
/*
p is the page which called this function
the cust is upgrading to MaxCharts the hMappings determines what can be upgraded
*/
for(var i in this.hItems)
{
try
{
if(this.hItems[i].ProductType=="ChartUpdate")
{
if(p=="Charts")
{
var el = document.getElementById("ckPID_"+i+"_RENT");
if(el)
{
el.disabled=true;
el.checked=false;
}
el=document.getElementById("ckPID_"+i+"_BUY");
if(el)
{
el.checked=true;
}
}
else
{
var el = document.getElementById(this.hItems[i].ElID.replace(/_BUY/,""));
if(el)
el.checked = true;
}
}
else if(this.hItems[i].ElID != null)
document.getElementById(this.hItems[i].ElID).checked = true;
else
document.getElementById("ckPID_"+i).checked = true;
}
catch(e)
{
//alert(i+":"+e.description);
}
}
}
this.fDraw = function (el)
{
var aTxt = [];
aTxt.push("<tr>"
+"<th class='btgry brgry bb' height=22 width='80' nowrap>Item#</th>"
+"<th class='btgry brgry bb al'>Remove</th>"
+"<th class='btgry brgry bb al'>Type</th>"
+"<th class='btgry brgry bb al'>Description</th>"
+"<th class='btgry brgry bb al'>Wt.</th>"
+"<th class='btgry brgry bb'>Price</th>"
+"</tr>");
var exchange = fPageHandler().fSite().fExchange(1.0,"USD",fPageHandler().fSite().Currency);
var dealer=fPageHandler().fDealer();
var dataset = fPageHandler().hSite.fDataSet().toLowerCase();
var cust=fPageHandler().fGetActiveCustomer();
var rp=cust.fGetActiveRegProduct();
var ChartCountDown=0; // rp.fRegionCount(); // Used for Region Upgrade promotion
var aChartUpgradeErrors= new Array();
if(dealer)
{
if(!dealer.fInternal())
{
this.PriceGroup=dealer.PriceGroup;
dealer=null;
}
}
for(var i in this.hItems)
{
this.hItems[i].PriceGroup=this.PriceGroup;
if(this.hItems[i].ProductType=='ProgramUpgrade')
aTxt.push(this.hItems[i].fDrawPS("<tr>"
+"<td class='btgry brgry vt ar'>[ProductID]</td>"
+"<td class='btgry brgry vt ac'><input type='button' value='Remove' type=button class='clsButton'  "
+" onmouseover='this.style.border=\"2px inset\";'"
+" onmouseout='this.style.border=\"2px outset\";'"
+" onclick='fPageHandler().fRemoveCartItem(\"[ProductID]\"); return fPageHandler().fOnSubmit(\"Cart\");' id='button'1 name='button'1>"
+"</td>"
+"<td class='btgry brgry vt'>[ProductType]</td>"
+"<td class='btgry brgry vt'>[Description]</td>"
+"<td class='btgry brgry vt'>"+(this.hItems[i].fWeight()||"&nbsp;")+"</td>"
+(dealer?
("<td class='ar btgry brgry vt'><input align=right size=10 onblur='fPageHandler().fCart().hItems[\""+i+"\"].OverRide=Number(String(this.value));' value='"+Number(this.hItems[i].fPrice()*exchange)+"'></td>")
:"<td class='ar btgry brgry vt'>"+Number(this.hItems[i].fPrice()*exchange).fFormatCurrency(2)+"</td>"
)
+"</tr>"
));
}
for(var i in this.hItems)
{
if(this.hItems[i].ProductType=='PlusPack')
aTxt.push(this.hItems[i].fDrawPS("<tr>"
+"<td class='btgry brgry vt ar'>[ProductID]</td>"
+"<td class='btgry brgry vt ac'><input type='button' value='Remove' type=button class='clsButton'  "
+" onmouseover='this.style.border=\"2px inset\";'"
+" onmouseout='this.style.border=\"2px outset\";'"
+" onclick='fPageHandler().fRemoveCartItem(\"[ProductID]\"); return fPageHandler().fOnSubmit(\"Cart\");' id='button'1 name='button'1>"
+"</td>"
+"<td class='btgry brgry vt'>[ProductType]</td>"
+"<td class='btgry brgry vt'>[Description]</td>"
+"<td class='btgry brgry vt'>"+(this.hItems[i].fWeight()||"&nbsp;")+"</td>"
+(dealer?
("<td class='ar btgry brgry vt'><input align=right size=10 onblur='fPageHandler().fCart().hItems[\""+i+"\"].OverRide=Number(String(this.value));' value='"+Number(this.hItems[i].fPrice()*exchange)+"' id=text1 name=text1></td>")
:"<td class='ar btgry brgry vt'>"+Number(this.hItems[i].fPrice()*exchange).fFormatCurrency(2)+"</td>"
)
+"</tr>"
));
}
for(var i in this.hItems)
{
var Price=this.hItems[i].fPrice();
if(this.hItems[i].ProductType=='ChartRegion' || this.hItems[i].ProductType=='ChartUpdate')
{
var passport=rp.fMapsToMAXPro(this.hItems[i].Name);
if(ChartCountDown > 0 && passport)
{
try
{
switch(parseInt(rp.fMember("Version")))
{
case 9:
this.hItems[i].OverRide=(Price=0.0);
break;
case 8: case 7: case 6: case 5:
for(var p in passport.hPermits)
{
if(parseInt(passport.hPermits[p].Folio)>=30)
{
this.hItems[i].OverRide=(Price=Math.ceil(this.hItems[i].fPrice(-1)*.5));
break;
}
else if(parseInt(passport.hPermits[p].Folio)>=19)
{
this.hItems[i].OverRide=(Price=Math.ceil(this.hItems[i].fPrice(-1)*.75));
break;
}
}
break;
}
}
catch(e){
aChartUpgradeErrors.push(i+":"+e.description+"\r\n"+fSerialize(this.hItems[i]));
}
ChartCountDown--;
}
aTxt.push(this.hItems[i].fDrawPS("<tr>"
+"<td class='btgry brgry vt ar'>[ProductID]</td>"
+"<td class='btgry brgry vt ac'><input type='button' value='Remove'  class='clsButton' "
+" onmouseover='this.style.border=\"2px inset\";'"
+" onmouseout='this.style.border=\"2px outset\";'"
+" onclick='fPageHandler().fRemoveCartItem(\"[ProductID]\"); return fPageHandler().fOnSubmit(\"Cart\");' id='button'1 name='button'1>"
+"</td>"
+"<td class='btgry brgry vt' nowrap>"+(this.hItems[i].ProductType.replace(/chart/i,""))+" <b>"+(this.hItems[i].Name)+"</b></td>"
+"<td class='btgry brgry vt'>[Description]"+(dataset=="maxpro"?"":" <b>World&nbsp;Folio:44</b>")+"</td>"
+"<td class='btgry brgry vt'>"+(this.hItems[i].fWeight()||"&nbsp;")+"</td>"
+(dealer?
("<td class='ar btgry brgry vt'><input align=right size=10 onblur='fPageHandler().fCart().hItems[\""+i+"\"].OverRide=Number(String(this.value));' value='"+Number(Price*exchange)+"'></td>")
:"<td class='ar btgry brgry vt'>"+Number(Price*exchange).fFormatCurrency(2)+"</td>"
)
+"</tr>"
));
}
}
if(aChartUpgradeErrors.length)
{
alert(""
+"There was a problem determining your Raster Upgrade Price."
+"\r\nWe are on hand to assist you with your upgrade."
+"\r\nPlease call our Sales Office for additional assistance."
+"\r\n\r\nPh:"+0
+"\r\nEmail:"+"Email"
+"\r\n\r\nError:"+aChartUpgradeErrors.join("\r\n"));
}
for(var i in this.hItems)
{
if(this.hItems[i].ProductType=='MiscItem')
aTxt.push(this.hItems[i].fDrawPS("<tr>"
+"<td class='btgry brgry vt ar'>[ProductID]</td>"
+"<td class='btgry brgry vt ac'><input type='button' value='Remove'  class='clsButton' "
+" onmouseover='this.style.border=\"2px inset\";'"
+" onmouseout='this.style.border=\"2px outset\";'"
+" onclick='fPageHandler().fRemoveCartItem(\"[ProductID]\"); return fPageHandler().fOnSubmit(\"Cart\");' id='button'1 name='button'1>"
+"</td>"
+"<td class='btgry brgry vt'>[ProductType]</td>"
+"<td class='btgry brgry vt'>[Description]</td>"
+"<td class='btgry brgry vt'>"+(this.hItems[i].fWeight()||"&nbsp;")+"</td>"
+(dealer?
("<td class='ar btgry brgry vt'><input align=right size=10 onblur='fPageHandler().fCart().hItems[\""+i+"\"].OverRide=Number(String(this.value));' value='"+Number(this.hItems[i].fPrice()*exchange).fFormatCurrency(2)+"' id=text1 name=text1></td>")
:"<td class='ar btgry brgry vt'>"+Number(this.hItems[i].fPrice()*exchange).fFormatCurrency(2)+"</td>"
)
+"</tr>"
));
}
for(var i in this.aVouchers)
{
with(this.aVouchers[i])
{
aTxt.push("<tr>"
+"<td class='btgry brgry vt ar'>"+ProductID+"</td>"
+"<td class='btgry brgry vt ac'><input type='button' value='Remove' type=button class='clsButton'  "
+" onmouseover='this.style.border=\"2px inset\";'"
+" onmouseout='this.style.border=\"2px outset\";'"
+" onclick='fPageHandler().fCart().fRemoveVoucher("+i+"); return fPageHandler().fOnSubmit(\"Cart\");'>"
+"</td>"
+"<td class='btgry brgry vt' nowrap>Voucher :"
+" <span style='border:1px solid darkblue;background-color:#daface;' title='Voucher :"+Key+"'>"
+(this.aVouchers[i].RegionID?("Assigned To ["+this.aVouchers[i].RegionID.substr(2)+"]"):"[ Unassigned ]")
+"</span>"
+"</td>"
+"<td class='btgry brgry vt'>"+Description+"</td>"
+"<td class='btgry brgry vt'>&nbsp;</td>"
+"<td class='ar btgry brgry vt'>No Charge</td>"
+"</tr>"
);
}
}
aTxt.push("<tr>"
+"<th class='bt brgry bb' height=22 width='10'>"+this.fItemCount()+"&nbsp;items</th>"
+"<th class='bt brgry ar bb'>&nbsp;</th>"
+"<th class='bt brgry ar bb'>&nbsp;</th>"
+"<th class='bt brgry ar bb'>Subtotal</th>"
+"<th class='bt brgry ar bb'>"+Number(this.fWeight()).toFixed(2)+"</th>"
+"<th class='bt brgry ar bb'>$"+Number(this.fSubTotal()*exchange).fFormatCurrency(2)+"</th>"
+"</tr>");
if(el)
{
el.innerHTML="<table class='blgry bbgry vt' width='100%' cellpadding=0 cellspacing=0>"+aTxt.join("")+"</table>";
return el.innerHTML;
}
return "<table class='blgry bbgry vt' width='100%' cellpadding=0 cellspacing=0>"+aTxt.join("")+"</table>";
}
this.fDrawSummaryHeader = function()
{
var exchange = fPageHandler().fSite().fExchange(1.0,"USD",fPageHandler().fSite().Currency);
return ""
+"&nbsp;&nbsp;Items&nbsp;:"+this.fItemCount()
+"&nbsp;&nbsp;Subtotal:&nbsp;$"+Number(this.fSubTotal()*exchange).fFormatCurrency(2)
+"&nbsp;&nbsp;Weight:&nbsp;"+Number(this.fWeight()).toFixed(2)
+'&nbsp;&nbsp;Freight:<span id="tdFreight">&nbsp;'+Number(this.fFreightAmount(fPageHandler().fGetActiveCustomer())*exchange).fFormatCurrency(2) +'</span>'
+'&nbsp;&nbsp;Tax&nbsp;:<span id="tdTaxAmount">&nbsp;' +Number(this.fTaxAmount()*exchange).fFormatCurrency(2) +'</span>'
+'&nbsp;&nbsp;Total:&nbsp;$<span id="tdTotal">&nbsp;'+Number(this.fTotal()*exchange).fFormatCurrency(2) +'</span>';
}
this.fDrawCartSummary = function()
{
var sTxt = "";
var exchange = fPageHandler().fSite().fExchange(1.0,"USD",fPageHandler().fSite().Currency);
try
{
sTxt = '<table cellpadding=0 cellspacing=3 style="border:1px solid #afafaf;width:240px;padding:3px;"><tr>'
+ '<td class="dvGrayBar" colspan="2" width="100%" ><a href="#" title="View the Cart" onclick="return fPageHandler().fOnSubmit(\'Cart\');">Cart&nbsp;Summary</a></td>'
+ '</tr>'
+ '<tr>'
+ '<th class="ar" scope="row">Number Of Items&nbsp;:</th>'
+ '<td class="ar">' +this.fItemCount() +'</td>'
+ '</tr>'
+ '<tr>'
+ '<th class="ar" scope="row">Subtotal&nbsp;:</th>'
+ '<td class="ar">' +Number(this.fSubTotal()*exchange).fFormatCurrency(2) +'</td>'
+ '</tr>'
+ '<tr>'
+ '<th class="ar" scope="row">Weight&nbsp;:</th>'
+ '<td class="ar">' +this.fWeight() +'</td>'
+ '</tr>'
+ '<tr>'
+ '<th class="ar" scope="row">Freight&nbsp;:</th>'
+ '<td  class="ar" id="tdFreight">' +Number(this.fFreightAmount(fPageHandler().fGetActiveCustomer())*exchange).fFormatCurrency(2) +'</td>'
+ '</tr>'
+ '<tr><th class="ar" scope="row">Tax&nbsp;:</th>'
+ '<td  class="ar" id="tdTaxAmount">' +Number(this.fTaxAmount()*exchange).fFormatCurrency(2) +'</td>'
+ '</tr>'
+ '<tr>'
+ '<th class="ar" scope="row">Total&nbsp;:</th>'
+ '<td class="ar" id=tdTotal>' +Number(this.fTotal()*exchange).fFormatCurrency(2) +'</td>'
+ '</tr>'
+ '</table>';
}
catch(e){sTxt= e.description+"<BR>"+sTxt}
return sTxt;
}//end of fDrawReadOnlyCart prototype
return this;
};
function clsCartItem(hsh)
{
var bProcessed=false;
this.ProductID=0;
this.Name='';
//this.hProduct ={};
this.OverRide   = null;
this.ProductType="";
this.PriceGroup ="Retail";
this.Retail     = 0.0;
this.Weight     = 0.0;
this.Freight    = 0.0;
this.Quantity   = 1;
this.fCalcPrice=null;
this.fName=function (v){if(v != null)this.Name = v; return this.Name;}
this.fDescription=function (v){if(v != null) this.Description = v; if(this.Description)return this.Description; return "";}
this.fWeight=function (v){if(v != null)this.Weight = v; return this.Weight?(parseFloat(this.Weight)*this.Quantity):0.0;}
this.fFreight=function (v){if(v != null)this.Freight = v; return this.Freight?(parseFloat(this.Freight)*this.Quantity):0.0;}
this.fQuantity=function (v){if(v != null)this.Quantity = v; return this.Quantity?parseFloat(this.Quantity):0.0;}
this.fTaxable=function (){return this.fWeight() > 0?1:0;}
this.fEach=function (v){if(v != null)this.Retail = v; return parseFloat(this.Retail);}
this.fPrice=function (v)
{
if(v != null && v > 0)
this.Retail = v;
if(this.OverRide!=null && this.OverRide!="null"  && (v==null || v > -1))
return this.OverRide;
//alert(fSerialize(this));
if(this.ProductType.match(/update/i))
{
//   alert("ProductType:"+this.ProductType+"\r\nPriceGroup:"+this.PriceGroup+"\r\nValue"+this[this.PriceGroup+"Update"])
if(this[this.PriceGroup+"Update"]!=null)
return parseFloat(this[this.PriceGroup+"Update"]*this.Quantity);
}
if(this[this.PriceGroup]!=null)
return parseFloat(this[this.PriceGroup]*this.Quantity);
return parseFloat(this[this.PriceGroup]*this.Quantity);
}
this.fDrawPS=_fDrawPS;
this.fDelayedProcess = function()
{
// Currently true for all upgrades
// Change to evaluate Product upgrade partnumber set
return (this.ProductType == "ProgramUpgrade");
}
this.fIsUpgrade = function()
{
return (this.ProductType == "ProgramUpgrade");
}
this.fProcessed = function(v)
{
if(v != null)
bProcessed=v;
return bProcessed;
}
this.fDraw=function ()
{
var txt = "";
return txt;
}
this.fMSRP=function (){}
if(hsh && typeof(hsh)=="object")
{
for(var h in hsh)
{
switch(h)
{
case "hProduct":
eval("this[h] = new cls"+(h.substr(1))+"(hsh[h]);");
break;
default:
this[h]=hsh[h];
}
}
}
return this;
};
function clsDisclaimer()
{
return this;
};
function clsDiscount()
{
return this;
};
function clsFAQ()
{
return this;
};
function clsFAQs()
{
return this;
};
function clsInstructions()
{
return this;
};
function clsMenu()
{
return this;
};
function clsPermit(hsh)
{
this.SerialNumber="";
this.iKey="";
this.Permit="";
this.RegionID="";
this.LicType=1; // 1 - Purchase, 2 - Rental
this.Folio=0;
this.OrderID=0;
this.DetailID=0;
this.Date="";
for(var h in hsh)
{
this[h] = hsh[h];
}
this.SerialNumber = String(this.SerialNumber).toUpperCase();
this.fDrawPS = _fDrawPS;
return this;
};
function clsUnLock(hsh)
{
this.SerialNumber = "";
this.iKey         = "";
this.Permit       = "";
this.UpgradeID    = "";
this.Type         = "";
this.Name         = "";
this.ProductID    = 0;
for(var h in hsh)
{
this[h] = hsh[h];
}
return this;
};
function clsProduct(hsh)
{
this.ProductID=0;
this.SKU='';
this.PartNumber='';
this.Name='';
this.ProductType='';
this.Description='';
this.Image='';
this.Inventory=1;
this.Retail=0.0;
this.Dealer=0.0;
this.Distributor=0.0;
this.RetailUpdate=0.0;
this.DealerUpdate=0.0;
this.DistributorUpdate=0.0;
this.Weight=0.0;
this.Freight=0.0;
this.fCalcPrice=null;
this.fWeight=function (v){if(v != null)this.Weight = v; return this.Weight;}
this.fFreight=function (v){if(v != null)this.Freight = v; return this.Freight;}
this.fInventory=function (v){if(v != null)this.Inventory = v; return this.Inventory;}
this.fPrice=function (v){if(v != null)this.Retail = v; return this.Retail;}
this.fGetPrice=function (hsh){return this.Retail;}
this.fMSRP=function (){}
if(hsh && typeof(hsh)=="object")
{
for(var h in hsh)
this[h]=hsh[h];
}
return this;
};
function clsBOM()
{
return this;
};
function clsMapping(passport,mega,wide)
{
this.Passport=passport;
this.AllWide=String(wide).replace(/undefined/,"").indexOf("&")>0;
this.AllMega=String(mega).replace(/undefined/,"").indexOf("&")>0;
this.aWide=String(wide).replace(/undefined/,"").fMakeArray(this);
this.aMega=String(mega).replace(/undefined/,"").fMakeArray(this);
this.Used=0;
this.fToString = function (){
return 'new clsMapping("'+this.Passport+'","'
+this.aMega.join(this.AllMega?"&":",")+'","'
+this.aWide.join(this.AllWide?"&":",")+'")';
}
this.fSetUsed=function()
{
if((this.aWide.length>0 && this.AllWide < 0)||(this.aMega.length>0 && this.AllMega < 0))
this.Used=1;
}
this.fClearUsed=function()
{
if((this.aWide.length>0 && this.AllWide < 0)||(this.aMega.length>0 && this.AllMega < 0))
this.Used=0;
}
this.fMapsTo = function ()
{
var promo = "";//"<br><span CLASS='txtDisclaimer' style='color:#ff0000;'> Promotional Pricing for this region is available to you as an owner of Passport Chart Region "+passport+"</span></font>";
var aTxt = [];
if(this.aWide.length==0)
{
for(var m=0;m<this.aMega.length;m++)
aTxt.push("<a href='#' helpkey='UpdateMap' passport='"+this.Passport+"' maxpro='"+this.aMega[m]+"' onclick='return fPageHandler().fHelpHandler(this);'>"+this.aMega[m]+"</a>");
return "MegaWide :"+aTxt.join(this.AllMega?" and ":" or ")+promo;
}
if(this.aMega.length==0)
{
for(var m=0;m<this.aWide.length;m++)
aTxt.push("<a href='#' helpkey='UpdateMap' passport='"+this.Passport+"' maxpro='"+this.aWide[m]+"' onclick='return fPageHandler().fHelpHandler(this);'>"+this.aWide[m]+"</a>");
return "Wide :"+aTxt.join(this.AllWide?" and ":" or ")+promo;
}
for(var m=0;m<this.aMega.length;m++)
aTxt.push("<a href='#' helpkey='UpdateMap' passport='"+this.Passport+"' maxpro='"+this.aMega[m]+"' onclick='return fPageHandler().fHelpHandler(this);'>"+this.aMega[m]+"</a>")+promo;
var aTxt2 = [];
for(var m=0;m<this.aWide.length;m++)
aTxt2.push("<a href='#' helpkey='UpdateMap' passport='"+this.Passport+"' maxpro='"+this.aWide[m]+"' onclick='return fPageHandler().fHelpHandler(this);'>"+this.aWide[m]+"</a>");
return "Wide :"+aTxt2.join(this.AllMega?" and ":" or ")+ " OR MegaWide :"+aTxt.join(this.AllWide?" and ":" or ")+promo;
}
this.fMapsFrom = function (s)
{
if(this.aWide.length>0)
{
for(var i=0;i<this.aWide.length;i++)
{
if(s==this.aWide[i])
return this.Passport;
}
}
if(this.aMega.length>0)
{
for(var i=0;i<this.aMega.length;i++)
{
if(s==this.aMega[i])
return this.Passport;
}
}
return null;
}
return this;
};
clsMapping.prototype.fPreProcess = function(s){return String(s).replace(/ /g,"").replace(/\&/g,",");};
function clsRegion(hsh)
{
this.Region="";
this.RegionID="";
this.ProductID="";
this.TransasCharts=0;
this.hPermits = {};
for(var h in hsh)
{
switch(h)
{
case "hPermits":
for(var rp in hsh[h])
eval("this[h][rp] = new clsPermit(hsh[h][rp]);");
break;
default:
this[h] = hsh[h];
}
}
this.fDrawPS = function(ps)
{
var aTxt = [];
for(var t in this)
{
if(ps.indexOf("["+t+"]") >= 0)
{
if(t=="Region") continue;
var re=new RegExp("\\["+t+"\\]","ig");
re.global="g";
if(t=="RegionID")
ps = ps.replace(re,(this.Region!=this.RegionID)?(this[t].replace(/^M\-/g,"")+"("+this.Region+")"):this[t].replace(/^M\-/g,""));
else
ps = ps.replace(re,(t=="RegionID" && this.Region!=this.RegionID)?(this[t]+"("+this.Region+")"):this[t]);
for(var p in this.hPermits)
{
aTxt[aTxt.length] = this.hPermits[p].fDrawPS(ps);
//    if(PH.hPreferences.fMember("AllPermits")) continue;
break;
}
}
}
return aTxt.join("");
}
return this;
};
function clsRegProduct(hsh)
{
this.RegID=0;
this.CustID=0;
this.RegDate = new Date("1/1/1900");
this.ProductID=0;
this.ProductName="";
this.Version=0.0;
this.SerialNumber="";
this.Counter=0;
this.Prefix="0086";
this.UsedOn=""
this.MarketSegment="";
this.VesselName="";
this.Product="";
this.Type="COM";
this.SubType="";
this.Use="";
this.Class="REC";
this.SubClass="JM";
this.hRegions = {};
this.hUnLocks = {};
for(var h in hsh)
{
switch(h)
{
case "hRegions":
for(var rp in hsh[h])
{
eval("this[h][rp] = new clsRegion(hsh[h][rp]);");
}
break;
default:
this[h] = hsh[h];
}
}
this.fProductName = function(){if(this.SubClass=="NS")return "NorthStar "+this.SubType;if(this.SubClass=="SR")return "SIMRAD "+this.SubType;return this.ProductName;}
this.fUnlockCount = function(){var c = 0;for(var r in this.hUnLocks)c++; return c;}
this.fRegionCount = function(){var c = 0;for(var r in this.hRegions)c++; return c;}
this.fMapsToMAXPro = function(mp){for(var r in this.hRegions){if(hMappings[r] && hMappings[r].fMapsFrom(mp)) return this.hRegions[r];} return null;}
this.fMember=_fMember;
this.fSerialNumber=function ()
{
if(this.SerialNumber!="")
{
if(this.SerialNumber.length==19)
{
return this.HardwareKey=String(this.SerialNumber).replace(/\-/g,"").replace(/(.{4})(.{4})(.{4})(.{4})/,"$1-$2-$3-$4");
}
if(this.SubClass=="MP")
{
try
{
if(this.HardwareKey == null)
{
var pg = clsMaxProPermitGenerator();
this.HardwareKey = pg.fValidateSerialNumber(this.SerialNumber);
}
return String(this.HardwareKey).replace(/\-/g,"").replace(/(.{4})(.{4})(.{4})(.{4})/,"$1-$2-$3-$4");
}
catch(e)
{
// Did not validate return as JeppesenMarine
}
}
return String(this.SerialNumber).replace(/\-/g,"").replace(/(.{4})(.{6})(.{4})(.{6})/,"$1-$2-$3-$4");
}
return "";
}
return this;
};
function clsRegProducts(hsh)
{
this.Active = "";
this.hChildren = {};
for(var h in hsh)
{
switch(h)
{
case "hChildren":
for(var rp in hsh[h])
{
eval("this[h][rp] = new clsRegProduct(hsh[h][rp]);");
}
break;
default:
this[h] = hsh[h];
}
}
this.fActive = function (a)
{
if(a != null) this.Active=a; return this.Active;
}
this.fGetActiveProduct = function ()
{
for(var h in this.hChildren)
{
//alert("FIRST:"+h)
if(this.Active=="" || this.Active==h)
return this.hChildren[this.Active=h];
}
for(var h in this.hChildren)
{
//alert("SECOND:"+h)
return this.hChildren[this.Active=h];
}
return this.hChildren["new"] = new clsRegProduct();
}
return this;
};
function clsCookie()
{
var Name="";
var SerialNumber="";
var CookieName="JM_STORE";
var Site="";
var Branding="";
var Expire=new Date("12/12/2100").toGMTString();
var Domain="www.nobeltec.com";
this.fName = function(name){if(name != null)Name=name;return Name};
this.fSerialNumber = function(serialnumber){if(serialnumber != null)SerialNumber=String(serialnumber);return SerialNumber};
this.fSite = function(site){if(site != null)Site=String(site);return Site};
this.fBranding = function(branding){if(branding != null)Branding=String(branding);return Branding};
this.fExists = function(){return Name==""?false:true;}
this.fDraw = function(elid)
{
try
{
if(this.fExists())
{
document.getElementById(elid).style.display="";
try{document.getElementById("SerialNumber").value = SerialNumber;}catch(ee){}
document.getElementById(elid).innerHTML= Name+', you last logged on with the following serial number: '
+SerialNumber.replace(/\-/g,"&minus;");
}
else
document.getElementById(elid).style.display="none";
}catch(e){}
}//end of fDraw function
this.fLoad = function (hsh)
{
if(!this.fExists())
{
if(hsh && typeof(hsh)=="hCookie")
{
for(var h in hsh)
{
this[h]=hsh[h];
}
}
try
{
Name = this.fGetCrumb(CookieName, "Name");
Name = (Name == null)?"":Name;
SerialNumber = this.fGetCrumb(CookieName, "SerialNumber");
SerialNumber = (SerialNumber == null)?"":SerialNumber;
Branding = this.fGetCrumb(CookieName, "Branding");
Branding = (Branding == null)?"":Branding;
Site = this.fGetCrumb(CookieName, "Site");
Site = (Site == null)?"":Site;
}catch(e){}
}
}//end of fLoad function
this.fSave = function (hsh)
{
if(hsh && typeof(hsh)=="hCookie")
{
for(var h in hsh)
{
this[h]=hsh[h];
}
}
try
{
this.fSetCrumb(CookieName, "Name",this.fName());
this.fSetCrumb(CookieName, "SerialNumber", this.fSerialNumber());
this.fSetCrumb(CookieName, "Branding", this.fBranding());
this.fSetCrumb(CookieName, "Site", this.fSite());
}catch(e){Response.Write(e.description());}
}//end of fSave function
// Use this function to retrieve a cookie.
this.fGetCookie = function (name)
{
var bReturn = null;
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;
bReturn = unescape(dc.substring(begin, end));
}
}
return bReturn;
}//end of fGetCookie function
// Use this function to save a cookie.
this.fSetCookie = function (name, value, expires)
{
document.cookie = name + "=" + escape(value) + "; "//domain=" +Domain
+ ((expires == null) ? "expires=" + Expire : "; expires=" + expires);
}//end of fSetCookie function
// Use this function to delete a cookie.
this.fDelCookie = function (name)
{
var expire = new Date("07/21/1969").toGMTString();
document.cookie = name + "=; expires=" + expire +  "; ";//domain=" +Domain;
}//end of fDelCookie function
// Use this function to retrieve a Crumb inside a cookie.
this.fGetCrumb = function (cookie, name)
{
var bReturn = null;
var cn = name + '=';
var dc = this.fGetCookie(cookie);
if (dc != null)
{
var start = dc.indexOf(cn);
if (start != -1)
{
start += cn.length;
var end = dc.indexOf(':', start);
if (end != -1) bReturn = unescape(dc.substring(start, end));
}
}
return bReturn;
}//end of fGetCrumb function
//Use this function to get save a Crumb inside a cookie.
this.fSetCrumb = function (cookie, name, value)
{
var dc = this.fGetCookie(cookie);
var cc = this.fGetCrumb(cookie, name);
var exp = Expire;
var cn = name + '=';
if (cc != null)
{
var start = dc.indexOf(cn);
if (start != -1)
{
var end = dc.indexOf(':', start);
this.fSetCookie(cookie, dc.substring(0, start) + cn + value + ':' + dc.substring(end + 1, dc.length), exp);
}
}
else
{
if (dc != null) dc += cn + value + ':';
else dc = cn + value + ':';
this.fSetCookie(cookie, dc, exp);
}
}//end of fSetCrumb function
// Use this function to delete a Crumb inside a cookie.
this.fDelCrumb = function (cookie, name)
{
var dc = this.fGetCookie(cookie);
var cc = this.fGetCrumb(cookie, name);
var cn = name + '=';
if (cc != null)
{
var start = dc.indexOf(cn);
var end = dc.indexOf(':', start);
this.fSetCookie(cookie, dc.substring(0, start) + dc.substring(end + 1, dc.length), exp);
}
}//end of fDelCrumb function
};
function clsNavigator(hsh)
{
this.ID = "";
this.Text = "";
this.bIsOpen = 0;
this.bKeepOpen = 0;
this.pParent = 0;
this.pNext = 0;
this.pChildren = 0;
this.fAdd=function(hsh)
{
try
{
if(this.ID.length==hsh.ID.length)
{
if(this.ID > hsh.ID)
{ // 'on return replace this with n
var n = new clsNavigator(hsh);
n.pParent = this.pParent;
n.pNext = this;
return n;
}
if(this.ID < hsh.ID)
{
if(this.pNext)
this.pNext = this.pNext.fAdd(hsh);
else
{
this.pNext = new clsNavigator(hsh);
this.pNext.pParent = this.pParent;
}
}
}
else if(this.ID==hsh.ID.substr(0,this.ID.length))
{
if(this.pChildren)
{
this.pChildren = this.pChildren.fAdd(hsh);
}
else
{
this.pChildren=new clsNavigator(hsh);
this.pChildren.pParent=this;
}
}
else
this.pNext.fAdd(hsh);
}
catch(e){}
return this;
}
/* Client Prototypes */
/**
* fDraw - Draws the chart directory
* If el has fDraw - send to el.fDraw
* @author Richard Taylor-Kenny
* date:
*
*/
this.fDraw = function (el)
{
if(el && el.fDraw)
return el.fDraw(this);
var aTxt = [];
aTxt[aTxt.length] = "<li id='liNav_"+this.ID+"' class='liNavItem' "
+"><a href='#' onclick='fPageHandler().fNavigator().f"+(this.pChildren?"Toggle":"Toggle")+"(\""+this.ID+"\");return false;'"+">"+this.Text+"</a></li>";
if(this.pChildren)
{
if(this.bIsOpen==1)
aTxt[aTxt.length] = "<div class='Nav' id='dvNav_"+this.ID+"' >"+this.pChildren.fDraw()+"</div>";
else
aTxt[aTxt.length] = "<div class='Nav' id='dvNav_"+this.ID+"' style='display:none;'></div>";
}
if(this.pNext)
aTxt[aTxt.length] = this.pNext.fDraw();
return aTxt.join("");
}
/**
* fOpen - Finds and Opens the node id
* @author Richard Taylor-Kenny
* date:
*
*/
this.fOpen = function (id)
{
if(this.ID==id)
{
if(this.bIsOpen != 1)
{
if(this.pChildren)
{
this.bIsOpen = 1;
var el = document.getElementById("dvNav_"+this.ID);
if(el)
{
el.style.display="";
el.innerHTML = this.pChildren.fDraw();
}
}
}
else
{
this.bIsOpen = 0;
try{document.getElementById("dvNav_"+this.ID).style.display="none";}catch(e){};
}
return this;
}
if(this.pChildren)
{
var p = this.pChildren.fOpen(id);
if(p)
return p;
}
if(this.pNext)
return this.pNext.fOpen(id);
return null;
}
this.fFirstOpen = function ()
{
if(this.bIsOpen==1)
{
if(this.pChildren && this.pChildren.fFirstOpen())
return this.pChildren.fFirstOpen();
return this;
}
if(this.pNext && this.pNext.fFirstOpen())
return this.pNext.fFirstOpen();
return null;
}
/**
* fToggle - Finds and Toggles the node id
* @author Richard Taylor-Kenny
* date:
*
*/
this.fToggle = function (id)
{
if(this.ID==id)
{
if(this.bIsOpen == 1)
return this.fClose(id);
return this.fOpen(id);
}
if(this.pChildren)
{
var p = this.pChildren.fToggle(id)
if(p)
return p;
}
if(this.pNext)
{
return this.pNext.fToggle(id);
}
return null;
}
/**
* fClose - Finds and Closes the node id
* @author Richard Taylor-Kenny
* date:
*
*/
this.fClose = function (id)
{
if(this.ID==id)
{
if(this.bIsOpen == 1)
{
this.bIsOpen = 0;
var el = document.getElementById("dvNav_"+this.ID);
if(el)
el.style.display="none";
//  try{document.getElementById("liNav_"+this.ID).className="";}catch(e){};
}
return this;
}
if(this.pChildren)
{
var p=this.pChildren.fOpen(id);
if(p)
return p;
}
if(this.pNext)
return this.pNext.fOpen(id);
return null;
}
for(var h in hsh)
{
if(h == "pNext")
this[h] = new clsNavigator(hsh[h]);
else if(h == "pChildren")
this[h] = new clsNavigator(hsh[h]);
else
this[h] = hsh[h];
}
return this;
};
function clsRootNavigator(hsh)
{
this.CurrentEdition=34; // Action item : get the current edition for the data set
this.LatestEdition=34; // Action item : get the latest edition for the data set
this.clsNavigator = clsNavigator;
this.clsNavigator(hsh);
this.fToggle=function (id)
{
var p = this.pChildren.fToggle(id);
this.fDrawCharts(p);
}
this.fOpen=function (id)
{
var p = this.pChildren.fOpen(id);
this.fDrawCharts(p);
}
this.fDraw=function (el)
{
return this.pChildren.fDraw(el);
}
return this;
};
function clsPassportNavigator(hsh)
{
this.clsRootNavigator = clsRootNavigator;
this.clsRootNavigator(hsh);
this.fLoadDirectory();
return this;
};
function clsMaxProNavigator(hsh)
{
this.clsRootNavigator = clsRootNavigator;
this.clsRootNavigator(hsh);
this.fLoadDirectory();
return this;
};
function clsPageHandler(hsh)
{
var hCookie = new clsCookie();
this.hSite = new clsSite();
this.hMenu = new clsMenu();
this.hBusinessUnit = new clsBusinessUnit();
this.hProducts = {};
this.hOperator = new clsOperator();
this.aCustomers = [new clsCustomer()];
this.afResize = new Array();
var Requestor="";
var Receiver="";
var hHandlers =
{
Login:{ID:"Login",fcallback:fCallBack,url:"pages/Login.asp"}
,Profile:{ID:"Profile",fcallback:fCallBack,url:"pages/Profile.asp"}
,Charts:{ID:"Charts",fcallback:fCallBack,url:"pages/Browse.asp"}
,Vouchers:{ID:"Vouchers",fcallback:fCallBack,url:"pages/Vouchers.asp"}
,Customer:{ID:"Customer",fcallback:fCallBack,url:"pages/Customer.asp"}
,Dealers:{ID:"Dealers",fcallback:fCallBack,url:"pages/Dealers.asp"}
,MiscItems:{ID:"Cart",fcallback:fCallBack,url:"pages/MiscItems.asp"}
,Cart:{ID:"Cart",fcallback:fCallBack,url:"pages/Cart.asp"}
,Receipt:{ID:"Receipt",fcallback:fCallBack,url:"pages/Receipt.asp"}
,Contact:{ID:"Contact",fcallback:fCallBack,url:"pages/contact.asp"}
,Privacy:{ID:"Privacy",fcallback:fCallBack,url:"pages/privacy.asp"}
,FAQs:{ID:"FAQs",fcallback:fCallBack,url:"pages/FAQs.asp"}
,HowToUse:{ID:"HowToUse",fcallback:fCallBack,url:"pages/howtouse.asp"}
,NewsLetter:{ID:"NewsLetter",fcallback:fCallBack,url:"pages/NewsLetter.asp"}
,_Estimates:{ID:"_Estimates",fcallback:fCallBack,url:"specifications/estimates.asp"}
,_UseCases:{ID:"_UseCases",fcallback:fCallBack,url:"specifications/UseCases.asp"}
}
this.fCookie=function (){return hCookie;}
this.fAssignRequestor=function (obj){Requestor=obj;}
this.fAssignReceiver=function (obj){Receiver=obj;}
this.fHandler=function (handler,obj){if(obj){hHandlers[handler]=obj;} return hHandlers[handler];}
this.fDeleteHandler    = function(handler){delete hHandlers[handler];}
this.fGetActiveCustomer =function(){return this.aCustomers[0];}
this.fBranding         = function (v){return this.hSite.fBranding(v);}
this.fSite             = function (){return this.hSite;}
this.fDataSet          = function (v){return this.hSite.fDataSet(v);}
this.fDealer           = function (v){return this.hSite.fDealer(v);}
if(hsh != null && typeof(hsh)=="object")
{
for(var h in hsh)
{
if(h == "hSite")
this[h]= new clsSite(hsh[h]);
else if(h == "hCookie")
this[h]= new clsCookie(hsh[h]);
else if(h == "hBusinessUnit")
this[h]= new clsBusinessUnit(hsh[h]);
else if(h == "hOperator")
this[h]= new clsOperator(hsh[h]);
else
this[h]=hsh[h];
}
}
return this;
};
function clsValidate()
{
//CONSTANT VARIABLES
this.DIGITS = "0123456789";
this.LWR = 'abcdefghijklmnopqrstuvwxyz';
this.UPR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
this.SPACE = " ";
this.WHITESPACE = " \t\n\r";
this.PHONEPATTERN = "()-+ ";
this.POSTALPATTERN = "-";
this.EMAILPATTERN = /^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.(([0-9]{1,3})|([a-zA-Z]{2,3})|(aero|coop|info|museum|name))$/;
this.NAMEPATTERN = this.DIGITS+this.LWR+this.UPR+this.SPACE+".\\#-/`'";
this.ADDRESSPATTERN = this.DIGITS+this.LWR+this.UPR+this.SPACE+".\\#-/`':";
this.aTxt = new Array();
this.aInvalid = new Array();
//common tests for validation
this.fIsWhitespace=function(s)
{
try
{
var i;
if(this.fIsEmpty(s)) return true;
for(i = 0; i < s.length; i++)
{
//check that current character isn't whitespace.
var c = s.charAt(i);
if(this.WHITESPACE.indexOf(c) == -1) return false;
}
return true;
}
catch(e){return false;}
}//end fIsWhitespace function
this.fIsValid=function(s,delimiter)
{
this.aInvalid = new Array();
try
{
if(this.fIsWhitespace(s)) return false;
for(i=0; i<s.length; i++)
{
if(delimiter.indexOf(s.charAt(i),0) == -1)
this.aInvalid.push(s.charAt(i));
}
if(this.aInvalid.length > 0)
{
return false;
}
return true;
}
catch(e){return false;}
}//end fIsValid function
this.fIsNumeric=function(s) {return this.fIsValid(s,DIGITS);}
this.fIsPhone=function(s) {return this.fIsValid(s,this.DIGITS+this.PHONEPATTERN);}
this.fIsPostalCode=function(s) {return this.fIsValid(s.replace(/ /g,""),this.DIGITS+this.POSTALPATTERN+this.SPACE);}
this.fIsLower=function(s) {return this.fIsValid(s,this.LWR);}
this.fIsUpper=function(s) {return this.fIsValid(s,this.UPR);}
this.fIsAlpha=function(s) {return this.fIsValid(s,this.LWR+this.UPR+this.SPACE);}
this.fIsAlphanum=function(s) {return this.fIsValid(s,this.LWR+this.UPR+this.DIGITS+this.SPACE);}
this.fIsName=function(s) {return this.fIsValid(s,this.NAMEPATTERN);}
this.fIsCompany=function(s) {return this.fIsValid(s,this.NAMEPATTERN+"&,");}
this.fIsStreetAddress=function(s) {return this.fIsValid(s,this.LWR+this.UPR+this.DIGITS+this.ADDRESSPATTERN);}
this.fIsEmailAddress=function(s) {return this.EMAILPATTERN.test(s);}
this.fIsEmpty=function(s) {return ((s == null) || (s.length == 0))}
this.fSetErrorMessage=function(s) {this.aTxt.push(s); if(this.aInvalid.length > 0){this.aTxt.push("Remove :<b><u>"+this.aInvalid.join("").replace(/ /,"[space]")+"</u></b>");this.aInvalid=[];}}
this.fGetErrorMessage=function() {return this.aTxt;}
this.fClearErrorMessage=function() {this.aTxt=[];}
return this;
};
/**
 * Class clsPageHandler Client Prototypes
 * 
 * @author Richard Taylor-Kenny
 * @date May 2007
 * 
 */

/**
 * Draw prototype for clsPageHandler
 * @param el  an element that the will contain what is drawn.
*/
clsPageHandler.prototype.OVERWEIGHT=2.0;
var fImgRotator=function(f,elid,aray,opts)
{
 var el = fGD(elid);
 try
 {
  if(el==null)
   return;
  if(opts.controllerid)
  {
   var controller=fGDS(opts.controllerid);
   if(controller==null || controller.display=="none")
   return;
  }
 }
 catch(e)
 {
  return;
 }
 var img;
 var imgnum;
 if(opts && opts.cycle!=null)
 {
  opts.cycle=imgnum=((++opts.cycle)%aray.length);
  img = aray[imgnum];
 }
 else
 {
  imgnum= parseInt(Math.random()*aray.length);
  img = aray[imgnum];
  if(String(el.getAttribute("src")).indexOf(img)>0)
  {
   window.setTimeout(function (){fImgRotator(fImgRotator,elid,aray,opts);},1)
   return;
  }
 }
 fFadeOutTimer(elid,99,20);
 el.setAttribute("src",img);
 fFadeInTimer(elid,0,20);
 window.setTimeout(function (){fImgRotator(fImgRotator,elid,aray,opts);},(opts && opts.waittime?opts.waittime:4000))
}

clsPageHandler.prototype.fTaxAmount = function()
{
 var dealer = this.fDealer();
 var cust = this.fGetActiveCustomer();
 var cart = this.fCart();
 var exchange=this.fSite().fExchange(1.0,"USD",this.fSite().Currency);
 var el = fGD("tdTaxAmount");
 if(el)
  el.innerHTML=Number(cart.fTaxAmount(cust.hShipping,dealer)*exchange).fFormatCurrency(2);
 else
  cart.fTaxAmount(cust.hShipping,dealer);

 el = fGD("tdFreight");
 if(el)
  el.innerHTML=Number(cart.fFreightAmount(cust)*exchange).fFormatCurrency(2);

 el = fGD("tdTotal");
 if(el)
  el.innerHTML=Number(cart.fTotal()*exchange).fFormatCurrency(2);
}
clsPageHandler.prototype.fExchangeRate=function(elid,handler)
{
	try
 {
  var el = fGD(elid);
  fAjaxCall({ID:"none",script:1,url:"include/Server/DBI.asp?VERB=ExchangeRate&CURRENCY="+String(el.options[el.selectedIndex].value)});
		if(handler)
		{
//			alert(handler);
		 this.fOnSubmit(handler);
		}
 }
 catch(e)
 {
  this.fError(e);
 }
 return false;
}
clsPageHandler.prototype.fChartSearch=function(elid)
{
	try
 {
  var el = fGD(elid);
  if(String(el.value).replace(/ /g,"") == "")
   throw({number:1,description:"Please, provide a search string."});
  if(fGD("dvSubMainBody"))
  {
   fAjaxCall({ID:"dvSubMainBody",fcallback:fCallBack,url:"include/Server/DBI.asp?VERB=ChartTable&Search="+String(el.value)});
   this.fGetActiveCustomer().fCart().fFixFields("Charts");
  }
 }
 catch(e)
 {
  this.fError(e);
 }
 return false;
}
/*
clsPageHandler.prototype.fSetCartHandler = function()
{
 var str = escape(fSerialize(fPageHandler().fGetActiveCustomer()));
 //alert(str.length+"\n"+str.substr(9,60)+":"+unescape(str.substr(9,60)));
 //fGD("specialTest").innerHTML=str;
 this.fHandler("CompleteOrder",{ID:"none",script:1,url:"include/server/DBI.asp?VERB=ProcessOrder&CLASS=clsCustomer&VALUE="+str.substr(9,6)});
}
*/
clsPageHandler.prototype.fGetActiveSerialNumber = function()
{
 return this.fGetActiveCustomer().fGetActiveRegProduct().SerialNumber;
}
clsPageHandler.prototype.fIsLoggedIn = function()
{
 return this.fGetActiveCustomer().CustID > 0 && (this.fGetActiveSerialNumber().length==23 || this.fGetActiveSerialNumber().length==19);
}
clsPageHandler.prototype.fOnSubmit = function(handler)
{
 try
 {
  if(handler=="Profile" && !this.fIsLoggedIn())
  {
   handler="Login";
  }
  else if(handler=="Cart")
  {
   if(this.ProductStatus=="UPGRADE" || this.ProductStatus=="DEAD")
   {
    this.fHelpHandler("UpgradeError");
    handler="Profile";
   }
   else
    this.fRefreshCart();
  }
  var h = this.fHandler(handler);
  if(h.fOnSubmit != null && !h.fOnSubmit())
  {
   return false;
  }
/*
  if(handler=="CompleteOrder")
  {
   alert(unescape(fSerialize(h)));
   return false;
  }
*/
  fAjaxCall(h);
  if(h.fOnLoad != null)
  {
   h.fOnLoad(this);
  }
 }
 catch(e){alert("Handler Error["+handler+"] "+e.description);}
 return false;
}
clsPageHandler.prototype.fMaxProCart = function (page)
{
 try
 {
  var c = this.fGetActiveCustomer();
  if(c.hMaxProCart==null)
  {
//   alert("TODO:"+"\n Transfer cart items"+"\n Convert Regions To MAX Pro DataSet"+"\n Caller:"+page);
   fAjaxCall({ID:"none",script:1,url:"include/server/DBI.asp?VERB=DataSetChange&Page="+page+"&DataSet=MAXPro"});
   c.hMaxProCart = new clsCart();
  }
  c.hMaxProCart.hItems={};
  for(var i in c.hCart.hItems)
  {
   if(c.hCart.hItems[i].ProductType=="ChartUpdate" || c.hCart.hItems[i].ProductType=="ChartRegion" || i==1262)
    continue;
   c.hMaxProCart.hItems[i] = c.hCart.hItems[i];
  }
  
  return c.fCart();
 }
 catch(e){}
}
clsPageHandler.prototype.fPassportCart = function (page)
{
 try
 {
  var c = this.fGetActiveCustomer();
//  alert("TODO:"+"\n Transfer cart items"+"\n Revert Regions To Passport DataSet"+"\n Caller:"+page);
  delete c.hMaxProCart;
  c.hMaxProCart=null;
  fAjaxCall({ID:"none",script:1,url:"include/server/DBI.asp?VERB=DataSetChange&Page="+page+"&DataSet=Passport"});
  return c.fCart();
 }
 catch(e){}
}
clsPageHandler.prototype.fCart = function ()
{
 try
 {
  return this.fGetActiveCustomer().fCart();
 }
 catch(e){}
}
clsPageHandler.prototype.fDrawCart = function (el)
{
 try
 {
  this.fGetActiveCustomer().fDrawCart(el);
  var c = this.fGetActiveCustomer();
  for(var d in c.hShipping)
  {
   try
   {
    var e = fGD(d);
    if(e && e.getAttribute("objClass")=="clsShipping")
    {
     if(d == "Address1")
     {
      e.value = String(c.hShipping.Address1+"\r\n"+c.hShipping.Address2+"\r\n"+c.hShipping.Address3+"\r\n"+c.hShipping.Address4).replace(/\r\n(\r\n)+/g,"\r\n").replace(/^(\r\n| )+|( |\r\n)+$/g,"");
     }
     else
      e.value = c.hShipping[d];
    }
   }catch(ee){};
  }
  for(var d in c.hPayment)
  {
   try
   {
    var e = fGD(d);
    if(e && e.getAttribute("objClass")=="clsPayment")
    {
     if(d == "Address1")
     {
      e.value = String(c.hPayment.Address1+"\r\n"+c.hPayment.Address2+"\r\n"+c.hPayment.Address3+"\r\n"+c.hPayment.Address4).replace(/\r\n(\r\n)+/g,"\r\n").replace(/^(\r\n| )+|( |\r\n)+$/g,"");
     }
     else
      e.value = c.hPayment[d];
    }
   }catch(ee){};
  }
 }
 catch(e){}
}
clsPageHandler.prototype.fRefreshCart = function (hCart)
{
 try
 {
  if(hCart==null)
   hCart = this.fCart();
  var items = hCart.fItemCount();

  var cart = fGD("mnuCart1");
  cart.style.display=items?"":"none";
      
  cart = fGD("mnuCart2");
  cart.style.display=items?"":"none";
  
  cart = fGD("mnuCart3");
  cart.style.display=items?"":"none";
          
  var cartsummary=fGD("dvCartSummary");
  if(cartsummary)
  {
   cartsummary.style.display=items?"":"none";
   if(items)
    cartsummary.innerHTML=hCart.fDrawCartSummary();
  }
/*
  if(items)
   cart.innerHTML="("+items+")";
  else
   cart.innerHTML="(empty)";
*/
 }
 catch(e){}
}
clsPageHandler.prototype.fRemoveCartItem = function (pid)
{
 var hCart = this.fGetActiveCustomer().fCart();
 var item = hCart.fFindItem(pid);
 hCart.fRemoveItem(pid);
 if(item.ProductType=="ProgramUpgrade")
  this.fPassportCart();
 this.fRefreshCart(hCart);
}
clsPageHandler.prototype.fCartAction = function (el)
{
 try
 {
  if(el.getAttribute("producttype")=="ChartUpdate")
  {
   if(this.hSite.fDataSet().toLowerCase()=="maxpro")
   {
    if(el.getAttribute("name").indexOf("-") < 0)
    {
     alert(el.getAttribute("name") + " is not available with "+this.hSite.fDataSet()+ " products.");
     return false;
    }
   }
  } 
  var cartaction = el.getAttribute("CartAction");
  var hCart = this.fGetActiveCustomer().fCart();
  var rc = hCart["f"+cartaction](el);
  if(el.getAttribute("refresh"))
   this.fOnSubmit(el.getAttribute("refresh"))
  else
   this.fRefreshCart(hCart);
  return rc;
 }
 catch(e)
 {
  if(el)
   alert("Cart Error\r\n"+el.getAttribute("ProductID")+"\r\n"+e.description);
  else
   alert("Cart Error\r\n\r\n"+e.description);
 }
 return false;
}
clsPageHandler.prototype.fToggleBox = function (el)
{
 try
 {		
		//initialize variables
		var bReturn = false;
  var boxId   = el.getAttribute("id");
  var boxGroup   = el.getAttribute("group");
  var pid = el.getAttribute("ProductID");
		var aTags     = document.getElementsByTagName("input");
		for(var t=0;t<aTags.length;t++)
		{
		 if(aTags[t].getAttribute("group")==boxGroup)
		 {
		  if(aTags[t].getAttribute("id")!=boxId && aTags[t].checked)
		  {
			  //change checked status and call cart action to remove item from cart
		   aTags[t].checked = false;
			  if(fPageHandler().fCartAction(aTags[t])==false)
			   return false;
			 }
		 }
		}
		//call cart action to add/remove clicked item
  if(el.checked)
  {
   if(el.getAttribute("actionadd"))
    eval(el.getAttribute("actionadd"));
  }
		bReturn = fPageHandler().fCartAction(el);
  if(!el.checked)
  {
   if(el.getAttribute("actionremove"))
    eval(el.getAttribute("actionremove"));
  }
 }
 catch(e){}
	return bReturn;
}
clsPageHandler.prototype.fProgramUpgrades = function ()
{
 if(this.ProductStatus.indexOf("UPGRADE")>-1)
  return this.hProgramUpgrades={};
 if(this.hProgramUpgrades == null)
  fAjaxCall({ID:0,script:1,url:"include/Server/DBI.asp?VERB=LoadProgramUpgrades"});
 return this.hProgramUpgrades;
}
clsPageHandler.prototype.fLicenseFile = function ()
{
 try
 {
  var hRegProduct = this.fGetActiveCustomer().fGetActiveRegProduct();
  if(hRegProduct.fRegionCount() == 0)
   alert("You have no regions!");
  else
  {
   window.open("include/Server/DBI.asp?VERB=LicenseFile&SN="+hRegProduct.SerialNumber,"LicenseFile");
  }
  return false;
 }
 catch(e){}
 return false;
}
clsPageHandler.prototype.fSoftwareUpgrades = function ()
{
 if(this.hSoftwareUpgrades == null)
  fAjaxCall({ID:0,script:1,url:"include/Server/DBI.asp?VERB=LoadSoftwareUpgrades"});
 return this.hSoftwareUpgrades;
}
clsPageHandler.prototype.fLoadedProduct = function (pid)
{
 if(this.hLoadedProducts[String(pid)])
  return this.hLoadedProducts[String(pid)];
 if(this.hSoftwareUpgrades)
 {
  for(var u in this.hSoftwareUpgrades)
  {
   if(this.hSoftwareUpgrades[u].ProductID==pid) 
    return this.hSoftwareUpgrades[u];
  }
 }
 return null;
}
clsPageHandler.prototype.fLoadProducts = function (hlist)
{
 this.hLoadedProducts = {};
 var aList = faListMembers(hlist,"ProductID");
 fAjaxCall({ID:0,script:1,url:"include/Server/DBI.asp?VERB=LoadRegionProducts&LIST="+aList.join(",")});
 return this.hLoadedProducts;
}
clsPageHandler.prototype.fLoadMiscItems = function (hlist)
{
 fAjaxCall({ID:0,script:1,url:"include/Server/DBI.asp?VERB=LoadMiscItems"});
 return this.hMiscItems;
}
clsPageHandler.prototype.fSetDealer = function (dealerid,dealer)
{
 //var c = this.fGetActiveCustomer();
	//var demographics = "hDemographics";
 //fGD("Dealer").setAttribute("DealerID",dealerid);
 //fGD("Dealer").value=dealer;
 //fGD('dvDealerList').style.display='none';
	//c[demographics].DealerID=dealerid;
 return false;
}
clsPageHandler.prototype.fSetRegionCountry = function (region,country)
{
 fGD("Region").value=region;
 fGD("Country").value=country;
 fSetErrorClass(fGD("Region"),country==""?"REQUIRED":"");
 fGD('dvStateCountryList').style.display='none';
 return false;
}
clsPageHandler.prototype.fCustomerUpdate = function (elid)
{
 try
 {
  var OVERRIDEADDRESS=0;
  if(elid=="btnOverride")
  {
   if(fGD("btnComplete"))
    elid="btnComplete";
   else if(fGD("btnRegister"))
    elid="btnRegister";
   OVERRIDEADDRESS=1;
  }
  if(elid == "btnComplete")
  {
	/*
	Get active customer's cart and see if there are unassigned 
	vouchers inside.  If there are then send an alert box and 
	return, so that the customer can correct the problem.
	*/
	var voucherKey = null;
	var activeCustomer = fPageHandler().fGetActiveCustomer();
	for(var v in activeCustomer.hCart.aVouchers)
	{
		//copy the voucher key code
		voucherKey = activeCustomer.hCart.aVouchers[v].Key;
		
		//if there is no region assigned and it is a MAXPRO chart
		if((!activeCustomer.hCart.aVouchers[v].RegionID) && voucherKey.substr(0, 2) == "MP")
		{
			var msg = "Currently you have unassigned vouchers inside your order.\n\r\n\r"
			+ "Please return to the voucher page and select a chart for each \n\r"
			+ "voucher or remove the unassigned voucher from your cart \n\r"
			+"before continuing.\n\r\n\rThank you.";
			alert(msg);
			return;
		}
	}
  }
  
  
  var el = fGD(elid);
  var cls = el.getAttribute("objClass") || "clsCustomer";
  var c = this.fGetActiveCustomer();
		var activeSN = c.hRegProducts["Active"];
		var children = "hChildren";
		var hValidate = new clsValidate();
		var hDemographics = c.fDemographics();
		var hShipping = c.fShipping();
		var hPayment = c.fPayment();
		var errors  = null;
		var v  = null;
		var value="";
		if(el.value)
		 value=String(el.value).replace(/^( )+|( )+$/g,"");
// *
		if(0 && elid=="ShipName1" && value=="JME")
		{
		 hShipping.ShipName1="Jeppesen M. Employee";
		 hShipping.Address1="15160 NW Laidlaw Rd";
		 hShipping.Address2="";
		 hShipping.Address3="";
		 hShipping.Address4="";
		 hShipping.City="Portland";
   hShipping.Country="US";
		 hShipping.Region="OR";
		 hShipping.PostalCode="97229";
		 if(!dlr)
		 {
		  hPayment.CCName="JM";
		  hPayment.CCNumber="4460 5404 9012 3536";
		  hPayment.CCType="VISA";
		  hPayment.CCMonth="11";
    hPayment.CCYear="11";
   }
   this.fDrawCart(fGD("dvSubMainBody"));
   this.fDrawShipMethods();
   return;
		}
//* /
		if(elid=="OrderType")
		{
		 hPayment.OrderType=value;
		 // Found in pages/Cart.asp
		 this.fLoadPaymentSection();
		 return;
		}
  if(elid=="btnRegister")
		{
   if(0) 
   {
    this.fHelpHandler("Maintenance");
		  return false;
		 }
			//0086-460646-6261-751088
		 errors  = "";
			v  = null;

			//clear out the previous errors before any validation
			hValidate.fClearErrorMessage(); 
			
			//validate data in demographics hash
			if(!hValidate.fIsName(hDemographics.FirstName))
				hValidate.fSetErrorMessage("Error in \"First Name\" box.");
			if(!hValidate.fIsName(hDemographics.LastName))
				hValidate.fSetErrorMessage("Error in \"Last Name\" box.");
			if(hDemographics.Company != "" && !hValidate.fIsCompany(hDemographics.Company))
				hValidate.fSetErrorMessage("Error in \"Company\" box.");
			var address = hDemographics.Address1+hDemographics.Address2+hDemographics.Address4+hDemographics.Address4;
			if(!hValidate.fIsStreetAddress(address))
				hValidate.fSetErrorMessage("Error in \"Address\" box.");
			if(!hValidate.fIsAlpha(hDemographics.City))
				hValidate.fSetErrorMessage("Error in \"City\" box.");
			if(hDemographics.Country == "")
				hValidate.fSetErrorMessage("Error in \"Country\" dropdown.");
			v = fGD("dvState").innerHTML;
			if(!hValidate.fIsWhitespace(v))
			 if(hDemographics.Region == "")
				 hValidate.fSetErrorMessage("Error in \"Region/State\" dropdown.");
			if(hDemographics.Country == "United States")
			{
			 if(hValidate.fIsWhitespace(hDemographics.PostalCode))
			 {
				 hValidate.fSetErrorMessage("Error in \"Zip/PostalCode\" box.");
				}
				else
				{
					if(hDemographics.PostalCode.length >= 5 && hDemographics.PostalCode.length <= 11)
					{
						if(!hValidate.fIsPostalCode(hDemographics.PostalCode))
						{
							hValidate.fSetErrorMessage("Error in \"Zip/PostalCode\" box.");
						}
					}
					else
					{
						hValidate.fSetErrorMessage("Error in \"Zip/PostalCode\" box.");
					}					
				}
			}
			else if(!hValidate.fIsWhitespace(hDemographics.PostalCode))
			{
		 }
			if(!hValidate.fIsWhitespace(hDemographics.DayPhone))
			{
				if(!hValidate.fIsPhone(hDemographics.DayPhone))
					hValidate.fSetErrorMessage("Error in \"Phone\" box.");
			}
			if(!hValidate.fIsWhitespace(hDemographics.MobilePhone))
			{
				if(!hValidate.fIsPhone(hDemographics.MobilePhone))
					hValidate.fSetErrorMessage("Error in \"Mobile\" box.");
			}
			if(!hValidate.fIsWhitespace(hDemographics.EvePhone))
			{
				if(!hValidate.fIsPhone(hDemographics.EvePhone))
					hValidate.fSetErrorMessage("Error in \"Evening Phone\" box.");
			}
			if(!hValidate.fIsWhitespace(hDemographics.FaxPhone))
			{
				if(!hValidate.fIsPhone(hDemographics.FaxPhone))
					hValidate.fSetErrorMessage("Error in \"Mobile\" box.");
			}
			if(!hValidate.fIsWhitespace(hDemographics.NewsLetter) && !hValidate.fIsEmailAddress(hDemographics.NewsLetterEmail))
				hValidate.fSetErrorMessage("Error in \"NewsLetter\" box.");
			
			if(!hValidate.fIsEmailAddress(hDemographics.EmailAddress))
				hValidate.fSetErrorMessage("Error in \"Email\" box.");
			
		 if(c.fGetActiveRegProduct().Class=="DMAX")
			{
			 ; //if(fGD("Dealer").selectedIndex <=0 ) hValidate.fSetErrorMessage("Dealer cannot be Jeppesen Marine.");
			}
			
			if(hDemographics.Version == "")
				hValidate.fSetErrorMessage("Error in \"Version\" box.");
			
			//get any errors
			errors = hValidate.fGetErrorMessage();
			if(errors.length > 0)
			{
				fGD("dvMsg").innerHTML=(errors.join("<br>"));
			}
			else
			{
				//call to process the page
//				fGDS("dvGMap").display=""; 
//			 fGD("dvGMap").innerHTML=("CLASS=clsCustomer&OVERRIDEADDRESS="+OVERRIDEADDRESS+"&VALUE="+escape(fSerialize(this.fGetActiveCustomer())));
			 fAjaxCall({ID:0,script:1,url:"include/Server/DBI.asp?VERB=RegisterCustomer"
													,method:"POST",content:"CLASS=clsCustomer&OVERRIDEADDRESS="+OVERRIDEADDRESS+"&VALUE="+escape(fSerialize(this.fGetActiveCustomer()))});
			}
   return;
  }
  fSetErrorClass(el,"");
  if(elid=="Address1")
  {
   value= String(value).replace(/\r\n(\r\n)+/g,"\r\n").replace(/^(\r\n| )+|( |\r\n)+$/g,"");
   el.value = value = String(value).split("\r\n").splice(0,2).join("\r\n");
//    alert(escape(value));
  }
  //else if(elid=="Dealer")
 // {
   
		//	fAjaxCall({ID:0,script:1,url:"include/Server/DBI.asp?VERB=DealerDropdown&CLASS="+cls+"&VALUE="+value});
			
 // }
  else 
  {
   if(elid == "EmailAddress" || elid == "NewsLetterEmail")
   {
    var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
    if(value == "" && !fIsRequired(elid)) 
     fSetErrorClass(el,"");
    else if (!value.match(re)) 
     fSetErrorClass(el,"FAILURE");
    else
     fSetErrorClass(el,"SUCCESS");
//   alert("Required:"+fGD(elid).getAttribute("Required")
//   +"\n["+String(value)+"]");
   }
   else if(fIsRequired(elid) && String(value).replace(/ /g,"")=="")
    fSetErrorClass(el,"REQUIRED");
  }
		if(cls=="clsShipping")
		 cls="hShipping"
  else if(cls=="clsPayment")
		 cls="hPayment";
  else if(cls=="clsCustomer")
		 cls="hDemographics";
			
  if(elid=="Country")
  {
			try
			{
			 c[cls].Country=fGD("Country").value;
			 c[cls].Region="";
    if(cls=="hShipping")
    {
     c[cls].ShipperID=-1;
     this.fDrawShipMethods();
    }   
			}
			catch(e){}
		}
		else if(elid=="Region")
		 try
			{
    c[cls].Region=fGD("Region").value;
    if(cls=="hShipping")
    {
     c[cls].ShipperID=-1;
     this.fDrawShipMethods();
    }   
			}
			catch(e){}
	 else if(elid=="Address1")
  {
   c[cls].Address1=c[cls].Address2=c[cls].Address3=c[cls].Address4="";
   var aLines = String(value).split("\r\n");
   for(var l=1,a=0;a < aLines.length;a++)
    if(aLines[a])
     c[cls]["Address"+(l++)]=aLines[a].substr(0,50);
  }
  else if(elid=="CCType")
		{
			var oCCType = document.getElementsByName("CCType");
			for (var i=0;i<oCCType.length;i++)
			{
				if (oCCType[i].checked==true)
				 c[cls].CCType=oCCType[i].cardType;
			}
		}
  else if(elid=="AssignToDealer")
  {
   try
   {
    c[cls][elid]=el.options[el.selectedIndex].value;
		  c[cls].DealerName=el.options[el.selectedIndex].text;
				fAjaxCall({ID:0,script:1,url:"include/Server/DBI.asp?VERB=LoadDealerForPayment&DealerID="+c[cls][elid]});
   }
   catch(de)
   {
    alert(de.description);
   }
  }
  else if(elid=="Dealer")
		 c[cls].DealerID=fGD("Dealer").value;
  else if(elid=="VesselName")
   c.hRegProducts[children][activeSN].VesselName=fGD("VesselName").value;
  else if(elid=="Version")
   c.hRegProducts[children][activeSN].Version=fGD("Version").value;
  else if(elid=="MarketSegment")
   c.hRegProducts[children][activeSN].MarketSegment=fGD("MarketSegment").value;
  else if(elid=="UsedOn")
   c.hRegProducts[children][activeSN].UsedOn=fGD("UsedOn").value;		
		else if(elid=="ShipperID")
		{
		 c[cls][elid]=value;
		 c.fCart().fFreightAmount(c);
		 fGD("dvNavBar").innerHTML=""+c.fCart().fDrawSummaryHeader();
		}
		else
		 c[cls][elid]=value;
		
		if(elid=="btnComplete")
		{
   if(0) 
   {
    this.fHelpHandler("Maintenance");
		  return false;
		 }
   var dlr = this.fDealer();
			errors = "";
			v = null;

		 c.fCart().fFreightAmount(c);

		 fGD("dvNavBar").innerHTML=""+c.fCart().fDrawSummaryHeader();

   if(hShipping.ShipperID==-1 && c.fCart().fWeight() > 0)
    hValidate.fSetErrorMessage("A shipping method must be chosen.");

   if(!hValidate.fIsName(hShipping.ShipName1))
    hValidate.fSetErrorMessage("Error in \"Shipping Name\" box.");

   var address = hShipping.Address1+hShipping.Address2+hShipping.Address4+hShipping.Address4;
   if(!hValidate.fIsStreetAddress(address))
    hValidate.fSetErrorMessage("Error in \"Address\" box.");
   if(!hValidate.fIsWhitespace(hShipping.ShipName2))
    if(!hValidate.fIsName(hShipping.ShipName2))
     hValidate.fSetErrorMessage("Error in \"Secondary Name\" box.");
   if(!hValidate.fIsAlpha(hShipping.City))
    hValidate.fSetErrorMessage("Error in \"City\" box.");
   if(hShipping.Country == "")
    hValidate.fSetErrorMessage("Error in \"Country\" dropdown.");
   v = fGD("dvState").innerHTML;
   if(!hValidate.fIsWhitespace(v))
   {
    if(hShipping.Region == "")
     hValidate.fSetErrorMessage("Error in \"Region/State\" dropdown.");
   }
			if(hShipping.Country == "United States")
			{
    if(hShipping.PostalCode.length >= 5 && hShipping.PostalCode.length < 11)
    {
     if(!hValidate.fIsPostalCode(hShipping.PostalCode))
     {
      hValidate.fSetErrorMessage("Error in \"Zip/PostalCode\" box.");
     }
    }
    else 
    {
     hValidate.fSetErrorMessage("Error in \"Zip/PostalCode\" box.<br>Length is invalid.");
    }
   }
			if(dlr)
			{
			 if(!dlr.fInternal())
			 {
			    if(hPayment.OrderType=="PO")
                {
                    // First check to make sure that the dealer's credit is 
                    // not on hold.  A dealer cannot place a PO order with 
                    // a Credit on Hold state.
                    if (fPageHandler().fDealer().fCreditOnHold() == 1)
                    {                        
                        hValidate.fSetErrorMessage("Attention: Your Dealer Account is suspended and your Credit Line is on hold due to nonpayment.  Please remit payment to Jeppesen to reconcile your account.  You will not be able to place a Purchase Order through our on-line Store until your account has been reconciled.  Please contact the Jeppesen Account Receivables department at 1-800-353-2107 to discuss or reconcile your account."); 
                    }
                }     
			 
     if(hValidate.fIsWhitespace(hPayment.PONumber))
     {
        hValidate.fSetErrorMessage("PO Number field needs attention.");   
     }
			 }
			 else
			 {
     if(hPayment.OrderType=="PO")
     {
        // First check to make sure that the dealer's credit is 
        // not on hold.  A dealer cannot place a PO order with 
        // a Credit on Hold state.
        if (fPageHandler().fDealer().fCreditOnHold() == 1)
        {
            hValidate.fSetErrorMessage("Attention: Your Dealer Account is suspended and your Credit Line is on hold due to nonpayment.  Please remit payment to Jeppesen to reconcile your account.  You will not be able to place a Purchase Order through our on-line Store until your account has been reconciled.  Please contact the Jeppesen Account Receivables department at 1-800-353-2107 to discuss or reconcile your account.");
        }     
      if(hValidate.fIsWhitespace(hPayment.PONumber))
       hValidate.fSetErrorMessage("PO Number field needs attention.");
      if(hPayment.AssignToDealer <=0)
       hValidate.fSetErrorMessage("Dealer Orders must to be assigned to a Dealer.");
     }
			  else if(hPayment.OrderType=="OR")
			  {
      if(hValidate.fIsWhitespace(hPayment.PONumber))
       hValidate.fSetErrorMessage("PO Number field requires an Oracle Reference #.");
			  }
			  else if(hPayment.OrderType=="")
			  {
      hValidate.fSetErrorMessage("Choose the Type of Order you are placing.");
			  }
			  else if(hPayment.OrderType!="CC")
			  {
      if(hValidate.fIsWhitespace(hPayment.PONumber))
       hValidate.fSetErrorMessage("PO Number field requires a brief description for this order.");
			  }
			 }
   }
   if(hPayment.OrderType=="CC")
   {
			 var bFilled = 0;
    if(!hValidate.fIsName(hPayment.CCName))
     hValidate.fSetErrorMessage("Error in \"Credit Card Name\" box.");
    if(hValidate.fIsWhitespace(hPayment.CCType))
		  { 
			 	hValidate.fSetErrorMessage("Error in \"Credit Card Type\" box.");
			 }
			 else
			  bFilled++;
			 if(hValidate.fIsWhitespace(hPayment.CCNumber))
    {
			 	hValidate.fSetErrorMessage("Error in \"Credit Card Number\" box.");
			 }
			 else
			 {
			 	hPayment.fCCNumber(hPayment.CCNumber);
			  bFilled++;
			 }
			 if(hValidate.fIsWhitespace(hPayment.CCMonth))
    {
			 	hValidate.fSetErrorMessage("Error in \"Expiration Date \(month\)\" box.");
			 }
			 else
			  bFilled++;
			 if(hValidate.fIsWhitespace(hPayment.CCYear))
    {
			 	hValidate.fSetErrorMessage("Error in \"Expiration Date \(year\)\" box.");
			 }
			 else
			  bFilled++;
			 if(bFilled==4)
			 {
			  if(!hPayment.fCheckCreditCard())
      hValidate.fSetErrorMessage("Error validating credit card number.");
			 }
			}
			//get any errors
			errors = hValidate.fGetErrorMessage();
			if(errors.length > 0)
			{
				fGD("dvMsg").innerHTML=(errors.join("<br>"));
			}
			else
			{
			 if(OVERRIDEADDRESS)
			 {
				 fGD("dvMsg").innerHTML = "";
				}
				else
			 {
					fAjaxCall({ID:0,script:1,url:"include/Server/DBI.asp?VERB=ValidateShipping"
					,method:"POST",content:"CLASS=clsCustomer&VALUE="+escape(fSerialize(this.fGetActiveCustomer()))});
				}
				if(fGD("dvMsg").innerHTML == "")
			 {
				 //call to process the page
	    fGDS("tblOrderDealer").display  = "none";
     fGDS("tblOrderType").display    = "none";
			  fAjaxCall({ID:0,script:1,url:"pages/Confirm.asp"});
				}
			}
   return;
		}
	}
 catch(e){alert(e.description)};
}	

clsPageHandler.prototype.fChangeCustomer = function (hsh)
{
 this.oldCustomer=this.aCustomers[0];
 fGD("dvHeaderUser").innerHTML="";
 if(hsh != null)
 {
  this.aCustomers[0] = new clsCustomer(hsh);
  try
  {
   fGD("dvHeaderUser").innerHTML="Welcome "+this.aCustomers[0].hDemographics.fGetFullName();
  }
  catch(e)
  {
   alert(e.description);
  }
  this.fRefreshCart(this.aCustomers[0].fCart());
  this.fRefreshMenu();
  if(fGD("dvReceipt") != null)
  {
  }
  else if(this.aCustomers[0].CustID<=0)
   this.fOnSubmit('Customer');
  else 
  {
   this.fOnSubmit('Profile');
  }
  fPageHandler().fLoadMiscItems();
 }
}
clsPageHandler.prototype.hHelpInfo = 
{
 "":{Title:"",Description:"",Message:""}
 ,"WrongBrowser":
 {
  Title:"Browser Not Supported"
  ,Description:"<center>Browser Not Supported</center>"
  ,Message:"<p >This website is currently set up to only run under Microsoft's Internet Explorer."
	   +"<br><br>We have detected that you are not running Internet Explorer and "
	   +"while you may be able to browse the site, not all the functionality will be available. "
	   +"Please be aware that you may experience errors or be unable to perform certain functions."
	   +"<br><br>If you have problems running under Internet Explorer please contact Nobeltec Marine Sales office at :"
	   +"<br><b>Telephone :</b> (800) 946-2877(Toll-Free); +1 503 579 1414(Global)"
	   +"<br><b>Email :</b> support@nobeltec.com"
	   +"<br><br>If you are not running Internet Explorer please re-open our website using Internet Explorer."
	   +"<br><br>Thank you,"
    +"<br><i>The Nobeltec Team</i>"
    +"</p>"
 }
 ,"Maintenance":
 {
  Title:"Scheduled Maintenance"
  ,Description:"<center>Scheduled Maintenance</center>"
  ,Message:"<p class='Error'>Please excuse the interuption. "
  +"We will undergo maintenance Saturday evening from 9:00&nbsp;PM until approximately 10:00&nbsp;PM&nbsp; Pacific Daylight Time. "
  +"You will be unable to perform transactions during that period until our maintenance is complete."
  +"<p>You may continue to browse the store, although your activities may be disrupted."
  +"<p>Thank you for bearing with us during this period of down-time."
  +"<p>The Nobeltec Team"
  +"</p>"
 }
 ,"Upgrade":
 {
  Title:"<img src='/images/logo_jepp.gif' style='margin-top:-4px;' align=center>"
  ,Description:""
  ,Message:""
   +'<p width="100%" align=left>'
   +'<b>Admiral 10&reg;</b> —the Most Powerful Electronic Navigation Solution Available and '
   +'<b>VNS 10&reg;</b> —the Most Popular Navigation Software with '
   +'<b>C-Map&reg; MAX Pro&trade; Charts</b> —the Best Marine Cartography</b>'
   +'<img src="/images/MAXPro/2DVDs.gif" align=right>'
   +'<br><br>Discover a new world of navigation performance and cartographic accuracy.'
   +'<br><br>Upgrade to our award winning software online —'
   +'<br><b>VNS 10</b>* upgrades from <b>$179</b> <small>USD</small>'
   +'<br><b>Admiral 10</b>* upgrades from <b>$379</b> <small>USD</small>'
   +'<br><br>...Or visit a <a href="/services/dealerlocater.asp" target="_new">Nobeltec Marine Dealer</a> '
   +'near you for new software purchases.'
   +'</p>'
   +'<p width="100%">'
   +'<STRONG>Contact our sales department for assistance*:</STRONG>'
   +'<br><br><STRONG>Toll-Free:</STRONG> (800) 946-2877'
   +'<br><STRONG>Direct:</STRONG> +1 503 579 1414'
   +'<br><STRONG>Email:</STRONG> <a href="mailto:sales@nobeltec.com">sales@nobeltec.com</a>'
   +'<p width="100%">'
   +'<small><i>*Upgrade price is based on the version of your current software product being upgraded.</i></small>'
   +'</p>'
   +""
  ,OldMessage:""
   +'<p width="100%" align=center>'
   +'<b>Special Upgrade Offers&nbsp;...&nbsp;For a Limited Time Only!</b>'
   +'<br><br>'
   +'<b>Offers Expire July 15, 2008</b>'
   +'</p>'
   +'<p width="100%">'
   +'<STRONG>Contact our sales department to inquire about special upgrade&nbsp;offers*:</STRONG>'
   +'<img src="/images/MAXPro/2DVDs.gif" align=right>'
   +'<br><br><STRONG>Toll-Free:</STRONG> (800) 946-2877'
   +'<br><STRONG>Direct:</STRONG> +1 503 579 1414'
   +'<br><STRONG>Email:</STRONG> <a href="mailto:sales@nobeltec.com">sales@nobeltec.com</a>'
   +'<br><br><br><br><br></p>'
   +'<p width="100%">'
   +'<small><i>*Nobeltec Navigation Software and Chart Users must meet eligibility requirements to receive special upgrade offers on Admiral MAX Pro, VNS MAX Pro, Raster Plus Pack, MAX Pro Charts.</i></small>'
   +'</p>'
   +""
  }
 ,"UpgradeError":
 {
  Title:"<img src='/images/logo_jepp.gif' style='margin-top:-4px;' align=center>"
  ,Description:""
  ,Message:""
   +'<p width="100%" align=center>'
   +'<b>Serialnumber No Longer Available For Purchasing</b>'
   +'</p>'
   +'<p width="100%">'
   +'This serialnumber you entered is currently in the upgrade process. You will not be able to make further purchases with it.'
   +'<br><br>Permits purchased during your last upgrade order will not be available until the upgrade order has been processed.'
   +'<br><br>If you have questions please contact our sales department:'
   +'<br><br><STRONG>Toll-Free:</STRONG> (800) 946-2877'
   +'<br><STRONG>Direct:</STRONG> +1 503 579 1414'
   +'<br><STRONG>Email:</STRONG> <a href="mailto:sales@nobeltec.com">sales@nobeltec.com</a>'
   +'</p>'
   +""
  }
 ,"MAXCharts":{Title:"NOBELTEC® AND C-MAP® Cartography!",Description:"",Message:""
 +"<div class='fr ac' style='width:200px;'>"
 +"<p class='ac bold'>MAX Pro™ Data Layers</p>"
 +"<img id='img_MAXCharts' src='images/advimgs/maxcharts_adv_0.png' width=200 border=0></div>"
 +"New Visual Navigation Suite™ MAX Pro (VNS MAX Pro™) and Admiral™ MAX Pro deliver the “Best of Both Worlds” —the powerful features of Nobeltec Navigation Software combined with C-Map MAX Pro™ electronic charts, the most advanced cartography available for the leisure marine market."
 +"<p>These new systems provide you a whole new level of navigational performance, delivering popular Nobeltec features with the incomparable cartographic detail and accuracy of MAX Pro.  In addition, MAX Pro’s Quick Sync Updates allows you to download recent Notice to Mariner advisories, so every voyage can begin with the most accurate, up-to-date data available." 
 +"<p><a href=# onclick='fFadeOutTimer(\"dvHelpfulInfo\");return fPageHandler().fOnSubmit(\"Charts\");'>Browse MAX Pro Charts</a>"
 +""}
 ,"PlusPacks":{Title:"UNLOCK NOBELTEC PLUS PACKS<br>TO ENHANCE YOUR ON-WATER EXPERIENCE!"
 ,Description:"Check out our feature add-on packs for Admiral MAX Pro and VNS MAX Pro:"
 ,Message:""
 +"<b>Sailing Plus Pack</b>"
 +"<img src='images/pluspack_adv_sailing.jpg' align=right border=0 width=60>"
 +"<br>Introducing Windvantage™ Weather Router, the newest feature we’ve added to the popular Sailing Plus Pack. This feature relies on the Route Wizard to make calculations based on your boat's performance characteristics, which are stored in the polar files, and a GRIB weather file. The calculations then create the best possible route. Upgrade Now"
 +"<P>"
 +"<b>Weather Plus Pack</b>"
 +"<img src='images/pluspack_adv_weather.jpg' align=right border=0 width=60>"
 +"<br>Jeppesen Marine® is dedicated to providing navigators key weather data at the right time and displaying it over navigation charts and routes for real-time analysis and trip planning. Our new weather options transform simple weather data for informed navigation decision-making and extended time on the water without compromising safety. Choose from free GRIB support, OCENS WeatherNet GRIB data service*, XM Satellite Weather overlay**, SkyMate integrated weather†, WxWorx on Water***, and Nobeltec WeatherMail options.††  Upgrade Now"
 +"<P>"
 +"<b>Bathy Recorder Plus Pack</b>"
 +"<img src='images/pluspack_adv_fishing.jpg' align=right border=0 width=60>"
 +"<br>Sold as a Plus Pack to VNS™ and Admiral™, Bathy Recorder enables you to record sea floor topographic information using your depth sounder device, and to incorporate that data into your 3D charts. When you use the Bathy Recorder to customize your sea floor charts, those charts will constantly improve with repeat trips over the same areas, enabling you to have a perfect picture of important sea floor terrain, as well as your favorite fishing and diving spots. Upgrade Now"
 +"<P>"
 +"<b>Tender Tracker Plus Pack^</b>"
 +"<img src='images/pluspack_adv_tender.jpg' align=right border=0 width=60>"
 +"<br>Jeppesen Marine® teams with Seetrac® Tender Tracking™ to introduce the safest and best way to instantly know the location of jet skis, wave runners, and tenders. Very simply, the solution tracks the location of each tender and instantly reports it back to the mother yacht for immediate on-chart display inside Nobeltec Admiral software. When security and safety are at stake, Nobeltec and Seetrac Tender Tracking deliver peace of mind. Upgrade Now"
 +"<P>"
 +"<i style='font-size:8pt;'>"
 +"<br>*OCENS WeatherNet service is included with Admiral 9 and requires an annual license fee and per usage charges."
 +"<br>** XM Satellite Weather overlay requires purchase of Nobeltec’s XM Weather Plus Pack and an XM Satellite Weather hardware/data subscription."
 +"<br>† SkyMate weather data solutions available through SkyMate, Inc."
 +"<br>***WxWorx on Water weather data solution available through WxWorx."
 +"<br>†† Nobeltec WeatherMail data solution information is available through the Jeppesen Marine sales office (800) 946-2877 (U.S.) or (503) 579-1414 (Global)"
 +"<P>"
 +"^Tender Tracker Plus Pack works with Admiral version 9 and higher only."
 +"</i>"
 +""}
};


clsPageHandler.prototype.fHelpHandler = function (el)
{
 var helpkey=null;
 try
 {
  helpkey=el.getAttribute("HelpKey");
 }
 catch(e)
 {
  helpkey=el;
 }
 if(helpkey && clsPageHandler.prototype.hHelpInfo[helpkey])
 {
  this.fHelpfulInfo(clsPageHandler.prototype.hHelpInfo[helpkey]);
  if(helpkey=="MAXCharts")
   window.setTimeout(function (){fImgRotator(fImgRotator,'img_MAXCharts',['images/advimgs/maxcharts_adv_0.png','images/advimgs/maxcharts_adv_1.png','images/advimgs/maxcharts_adv_2.png','images/advimgs/maxcharts_adv_3.png']
   ,{controllerid:'dvHelpfulInfo',cycle:0,waittime:5000});},5000);

 }
 else if(helpkey=="Currency")
 {
	 try
  {
   fAjaxCall({ID:"none",script:1,url:"include/Server/DBI.asp?VERB=ExchangeTable"});
  }
  catch(e)
  {
   this.fError(e);
  }
  return false;
 }
 else if(helpkey=="VoucherAssignment")
 {
	 try
  {
    // Call down to the Voucher Assignment code with the Voucher number that the user
    // typed in.
   fAjaxCall({ID:"none",script:1,url:"include/Server/DBI.asp?VERB=VoucherAssignment&Key=" + 
    el.getAttribute("Key") + "&RegionID=" + el.getAttribute("RegionID")});
  }
  catch(e)
  {
   this.fError(e);
  }
  return false;
 }
 else if(helpkey=="HowToUse")
 {
	 try
  {
    this.fHelpfulInfo(
    {
     Title:"How To Use"
     ,Description:""
     ,Message:""
      +""
    });
   fAjaxCall({ID:"dvHIMessage",fcallback:fCallBack,url:"pages/howtouse.htm"});
  }
  catch(e)
  {
   this.fError(e);
  }
  return false;
 }
 else if(helpkey=="UpdateMap")
 {
	 try
  {
    this.fHelpfulInfo(
    {
     Title:"Chart Region Updates"
     ,Description:"<br>Updating from your Passport Region <b>"+el.getAttribute("passport")+"</b> to the MAX Pro Chart Region <b>"+el.getAttribute("maxpro")+"</b>.<br>"
     ,Message:""
      +""
    });
   fAjaxCall({ID:"dvHIMessage",fcallback:fCallBack,url:"include/Server/DBI.asp?VERB=RegionUpdate&MaxPro="+el.getAttribute("maxpro")+"&passport="+el.getAttribute("passport")});
  }
  catch(e)
  {
   this.fError(e);
  }
  return false;
 }
 else
 {
  this.fHelpfulInfo(
   {
    Title:"Adv/Help Information"
    ,Description:"<b>Handle click on '"+(helpkey||"No Help")+"' element.</b>"
    ,Message:"Message area."
     +""
   }
  );
 }
 return false;
}
clsPageHandler.prototype.fSiteChange = function (hsh)
{
 if(hsh != null)
 {
  this.hSite = new clsSite(hsh);
 }
 var rules = document.styleSheets[0].rules==null?"cssRules":"rules";
 var ruleserror="";
 try
 {
  if(this.hRules == null)
  {
   this.hRules = {};
   ruleserror="hRules";
   for(var r=0;r<document.styleSheets[0][rules].length;r++)
   {
    if(document.styleSheets[0][rules][r].style.display)
     this.hRules[String(document.styleSheets[0][rules][r].selectorText).toLowerCase()]=r;
   }
  }
  if(this.hSite.fDataSet().toLowerCase()=="maxpro")
  {
   ruleserror="maxpro";
   document.styleSheets[0][rules][this.hRules[".passport"]].style.display="none";
   document.styleSheets[0][rules][this.hRules[".maxpro"]].style.display="block";
   this.fNavigator(new clsMaxProNavigator({ID:"",Handle:"A",Text:"Browse Charts"}));
  }
  else
  {
   ruleserror="passport";
   document.styleSheets[0][rules][this.hRules[".passport"]].style.display="block";
   document.styleSheets[0][rules][this.hRules[".maxpro"]].style.display="none";
   this.fNavigator(new clsPassportNavigator({ID:"",Handle:"A",Text:"Browse Charts"}));
  }
 }
 catch(e)
 {
  alert("Style Error:"+e.description+":"+ruleserror); 
 }
 this.fRefreshMenu();
 this.fLogo("dvTitle");
}
clsPageHandler.prototype.fFAQs = function (id)
{
 fAjaxCall({ID:id,fcallback:fCallBack,url:"pages/"+this.hSite.Site+"faqs.asp"});
}
clsPageHandler.prototype.fLogin = function (id)
{
 fAjaxCall({ID:id,fcallback:fCallBack,url:"pages/"+this.hSite.Site+"Login.asp"});
}
clsPageHandler.prototype.fLogo = function (elid)
{
	var sHTML="";
	sHTML = '<img class="fl" id="imgLogo" src="images/nobelteclogo.jpg" border="0">'
 + '<img class="fr" id="imgBrand" src="'+this.hSite.fBrandImg()+'" border="0">';
	try{fGD(elid).innerHTML = sHTML}catch(e){};
}
clsPageHandler.prototype.fError = function (e)
{
 if(e != null)
 {
  alert("Error:"+e.description);
 }
}


clsPageHandler.prototype.fRefreshMenu = function ()
{
 this.hMenu.fShowProfile(this.aCustomers[0].CustID > 0);
 
 var showVouchers = false;
 // Only show vouchers for MaxPro serial numbers:
 if (this.aCustomers[0].CustID > 0 && 
    this.aCustomers[0].fGetActiveRegProduct().Version >= 10.0)
 {
    // Is this a dealer?  Don't show the tab if this is a dealer:
    if (!fPageHandler().fDealer())
    {
        showVouchers = true;
    }
 }    
 this.hMenu.fShowVouchers(showVouchers);
}


clsPageHandler.prototype.fReSize = function()
{
 for(var r=0;r<this.afResize.length;r++)
 {
  try
  {
   this.afResize[r]();
  }
  catch(e)
  {
   this.afResize.splice(r,1);
  }
 }
}
clsPageHandler.prototype.fAddReSize = function (f)
{
 for(var r=0;r<this.afResize.length;r++)
 {
  if(this.afResize[r] == f)
   return;
 }
 this.afResize.push(f);
}
clsPageHandler.prototype.fViewCharts=function(elid,regionid,sort)
{
 try
 {
  var el = fGD(elid);
  if(sort)
  {
   fAjaxCall({ID:elid,fcallback:fCallBack,url:"include/Server/DBI.asp?VERB=ChartView&RegionID="+regionid+"&Sort="+sort});
  }
  else if(el.style.display =="")
  {
   el.style.display="none";
   el.innerHTML="";
  }
  else
  {
   if(el.innerHTML=="")
    fAjaxCall({ID:elid,fcallback:fCallBack,url:"include/Server/DBI.asp?VERB=ChartView&RegionID="+regionid});
   el.style.display="";
  }
 }
 catch(e){}
 return false;
}
clsPageHandler.prototype.fNavigator=function(nav)
{
 if(nav && typeof(nav)=="object") this.hNavigator=nav; return this.hNavigator;
}
/** 
* This is a common function called in the browse.asp page, profile.asp, newsletter.asp
*/
clsPageHandler.prototype.fSubContainerResize = function()
{
 var ctr = fGD("dvContainer");
 var subcon = fGD("dvSubContainer");
 var submain = fGD("dvSubMain");
 var subheader = fGD("dvSubMainHeader");
 var subbody = fGD("dvSubMainBody");
 var navbar = fGD("dvNavBar");
 var ltnav = fGD("dvLeftNav");
 var rtnav = fGD("dvRightNav");
 try
 {
    subcon.style.height=(ctr.offsetHeight-(subcon.offsetTop+1))+"px";
    try
    {
     submain.style.left = (ltnav.offsetLeft+ltnav.offsetWidth)+"px";
    }
    catch(e2){}
    submain.style.width=Math.max(500,Math.min(700,parseInt(ctr.offsetWidth)-submain.offsetLeft))+"px";
    if(submain.scrollHeight < submain.clientHeight)
     subcon.style.overflow="hidden";
    else
     subcon.style.overflow="auto";
    try
    {
     rtnav.style.display="";
     if((rtnav.offsetWidth+submain.offsetLeft+submain.offsetWidth) > subcon.offsetWidth)
     {
      rtnav.style.display="none";
     }
     //else if(rtnav.offsetWidth > 0)
      rtnav.style.left = (submain.offsetLeft+submain.offsetWidth)+"px";
    }
    catch(e2){}
    if(navbar)
    {
     navbar.style.top=Math.max(1,subheader.offsetTop+subheader.offsetHeight)+"px";
     subbody.style.top=Math.max(1,navbar.offsetTop+navbar.offsetHeight)+"px";
    }
    else
     subbody.style.top=(subheader.offsetHeight)+"px";
    subbody.style.height=Math.max(1,submain.offsetHeight-(subbody.offsetTop))+"px";
    subheader.style.width=((submain.offsetWidth-(window.event?0:28))+"px");
    subbody.style.width=((submain.offsetWidth-(window.event?0:28))+"px");
 }
 catch(e){}
}
clsPageHandler.prototype.fHelpfulInfo = function (hsh)
{
 var hi = fGD("dvHelpfulInfo");
 try
	{
	 if(hsh==null) ;
		else 
		{
			fGD("dvHITitle").innerHTML="Helpful Information";
			fGD("dvHIDescription").innerHTML="";
			fGD("dvHIDescription").style.display="none";
			fGD("dvHIMessage").innerHTML="";
		 if(typeof(hsh) == "object")
			{
					if(hsh.Title)
						fGD("dvHITitle").innerHTML=hsh.Title;
					if(hsh.Description)
					{
						fGD("dvHIDescription").innerHTML=hsh.Description;
			   fGD("dvHIDescription").style.display="";
					}
					if(hsh.Message)
						fGD("dvHIMessage").innerHTML=hsh.Message;
			}
			else
			{
				fGD("dvHIMessage").innerHTML=hsh;
			}
		}
	}
 catch(e)
	{
  fGD("dvHIMessage").innerHTML=e.description;
	}
 hi.style.display="";
 fFadeInTimer("dvHelpfulInfo");
}
clsPageHandler.prototype.fHideHelpfulInfo = function ()
{
 try
	{
	 fGD("dvHelpfulInfo").style.display="none";
	}
 catch(e)
	{
	  alert(e.description);
	}
}
 
/**
 * Class clsNavigator Client Prototypes
 * 
 * @author Richard Taylor-kenny
 * @date May 2007
 * 
 */
  /**
  * Draw prototype for clsRegProduct
  * @param el  an element that the will contain what is drawn.
  */
clsPassportNavigator.prototype.fDrawCharts=function (p)
{
 if(p==null)
  p = this.pChildren.fFirstOpen();
 //document.getElementById("dvChartHeader").innerHTML="Passport World Charts"):"")
 //alert(p+":"+(p?p.Handle:"xxx"))
 fAjaxCall({ID:"dvCharts",script:1,url:"include/Server/DBI.asp?VERB=Navigate&Handle="+(p?p.Handle:"A")});
 try
 {
  
  if(document.getElementById("dvSubMainBody"))
  {
   fAjaxCall({ID:"dvSubMainBody",fcallback:fCallBack,url:"include/Server/DBI.asp?VERB=ChartTable&Handle="+(p?p.Handle:"A")});
   fPageHandler().fGetActiveCustomer().fCart().fFixFields("Charts");
  }
 }
 catch(e){}
 return p;
}

clsPassportNavigator.prototype.fLoadDirectory = function ()
{
 var p = this.pChildren = new clsNavigator({ID:"A",Handle:"A",Text:"World View"});
 p.pNext = new clsNavigator({ID:"NA",Handle:"AA",Text:"North America"});
 p.pNext.pChildren=new clsNavigator({ID:"NA.WC",Handle:"AAA",Text:"West Coast"});
 p.pNext.pChildren.pNext=new clsNavigator({ID:"NA.EC",Handle:"AAB",Text:"East And Gulf Coast"});
 p.pNext.pChildren.pNext.pNext=new clsNavigator({ID:"NA.XL",Handle:"AAC",Text:"Extra-Large Regions"});
 p.pNext.pChildren.pNext.pNext.pNext=new clsNavigator({ID:"NA.GL",Handle:"AAD",Text:"Great Lakes"});

 p.pNext.pNext=new clsNavigator({ID:"CC",Handle:"AB",Text:"Central &amp; Caribbean"});

 p.pNext.pNext.pChildren=new clsNavigator({ID:"CC.CN",Handle:"ABA",Text:"Central"});
 p.pNext.pNext.pChildren.pNext=new clsNavigator({ID:"CC.CB",Handle:"ABB",Text:"Caribbean"});

 p.pNext.pNext.pNext=new clsNavigator({ID:"SA",Handle:"AC",Text:"South America"});

 p.pNext.pNext.pNext.pNext=new clsNavigator({ID:"EM",Handle:"AD",Text:"Europe/Mediterranean"});
 p.pNext.pNext.pNext.pNext.pChildren=new clsNavigator({ID:"EM.SC",Handle:"ADA",Text:"Scandinavia"});
 p.pNext.pNext.pNext.pNext.pChildren.pNext=new clsNavigator({ID:"EM.WE",Handle:"ADB",Text:"Western Europe"});
 p.pNext.pNext.pNext.pNext.pChildren.pNext.pNext=new clsNavigator({ID:"EM.UI",Handle:"ADC",Text:"U.K. &amp; Ireland"});
 p.pNext.pNext.pNext.pNext.pChildren.pNext.pNext.pNext=new clsNavigator({ID:"EM.ME",Handle:"ADD",Text:"Mediterranean"});

 p.pNext.pNext.pNext.pNext.pNext=new clsNavigator({ID:"AM",Handle:"AE",Text:"Africa &amp; Middle East"});

 p.pNext.pNext.pNext.pNext.pNext.pNext=new clsNavigator({ID:"AS",Handle:"AF",Text:"Asia"});
 p.pNext.pNext.pNext.pNext.pNext.pNext.pChildren=new clsNavigator({ID:"AS.NA",Handle:"AFA",Text:"Northeast Asia"});
 p.pNext.pNext.pNext.pNext.pNext.pNext.pChildren.pNext=new clsNavigator({ID:"AS.JKC",Handle:"AFB",Text:"Japan, Korea &amp; China"});
 p.pNext.pNext.pNext.pNext.pNext.pNext.pChildren.pNext.pNext=new clsNavigator({ID:"AS.SE",Handle:"AFC",Text:"S.E. Asia &amp; Indian Oc."});

 p.pNext.pNext.pNext.pNext.pNext.pNext.pNext=new clsNavigator({ID:"AN",Handle:"AG",Text:"Australia/New Zealand"});

 p.pNext.pNext.pNext.pNext.pNext.pNext.pNext.pNext=new clsNavigator({ID:"SR",Handle:"AH",Text:"Super Regions"});
 p.pNext.pNext.pNext.pNext.pNext.pNext.pNext.pNext.pChildren=new clsNavigator({ID:"SR.XL",Handle:"AHA",Text:"XLg:N Am &amp; Caribbean"});
}
clsMaxProNavigator.prototype.fLoadDirectory = function ()
{
 var p = this.pChildren = new clsNavigator({ID:"A",Handle:"0",Text:"World View",ImgSrc:"worldmap.gif"});

  p.fAdd({ID:"AA",Handle:"A",Text:"North America",ImgSrc:"",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"AB",Handle:"B",Text:"Western Europe",ImgSrc:"",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"AC",Handle:"C",Text:"Northern Europe",ImgSrc:"",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"AD",Handle:"D",Text:"Europe Mediterrean",ImgSrc:"",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"AF",Handle:"F",Text:"Southeast Asia",ImgSrc:"",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"AG",Handle:"G",Text:"Australia",ImgSrc:"",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"AH",Handle:"H",Text:"South America",ImgSrc:"",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"AI",Handle:"I",Text:"Africa",ImgSrc:"",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"AAA",Handle:"AA",Text:"Additional Lake Coverage",ImgSrc:"ALC.gif",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"AAB",Handle:"AB",Text:"Alaska &amp; Western Canada (MW)",ImgSrc:"AWC.gif",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"AAC",Handle:"AC",Text:"Eastern Canada (W)",ImgSrc:"ECA.gif",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"AAD",Handle:"AD",Text:"The Great Lakes (W)",ImgSrc:"GLK.gif",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"AAE",Handle:"AE",Text:"North America E&amp;W Coasts (MW)",ImgSrc:"NAM.gif",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"AAF",Handle:"AF",Text:"North America East &amp; Central Coasts (W)",ImgSrc:"NCA.gif",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"AAG",Handle:"AG",Text:"North America West coasts &amp; Hawaii",ImgSrc:"WAM.gif",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"AAH",Handle:"AH",Text:"Alaska &amp; Western Canada (W)",ImgSrc:"WCA.gif",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"ABA",Handle:"BA",Text:"Western &amp; Central Europe (W)",ImgSrc:"WCE.gif",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"ACA",Handle:"CA",Text:"Benelux, Germany, Poland &amp; Denmark (W)",ImgSrc:"BGD.gif",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"ACB",Handle:"CB",Text:"Baltic Sea, G. of Bothnia &amp; Finland (W)",ImgSrc:"BSC.gif",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"ACC",Handle:"CC",Text:"Northern Europe (MW)",ImgSrc:"NEU.gif",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"ACD",Handle:"CD",Text:"Norwegian Coasts (W)",ImgSrc:"NRC.gif",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"ACE",Handle:"CE",Text:"Russian Federation (W)",ImgSrc:"RFD.gif",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"ACF",Handle:"CF",Text:"Russian Federation (MW)",ImgSrc:"RUS.gif",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"ACG",Handle:"CG",Text:"River Volga (W)",ImgSrc:"VOL.gif",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"ACH",Handle:"CH",Text:"Western Europe (MW)",ImgSrc:"WEU.gif",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"ADA",Handle:"DA",Text:"Med &amp; Red Sea, Caspian &amp; Black Sea (W)",ImgSrc:"MBC.gif",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"ADB",Handle:"DB",Text:"Med &amp; Red Sea, Caspian &amp; Black Sea (MW)",ImgSrc:"MCB.gif",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"AFA",Handle:"FA",Text:"Indian Ocean, Asia &amp; Oceania (MW)",ImgSrc:"A&O.gif",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"AFB",Handle:"FB",Text:"Indian Ocean &amp; Asia (W)",ImgSrc:"ASI.gif",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"AGA",Handle:"GA",Text:"Oceania (W)",ImgSrc:"OCE.gif",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"AHA",Handle:"HA",Text:"Central &amp; South America (W)",ImgSrc:"ACS.gif",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"AHB",Handle:"HB",Text:"Central &amp; South America (MW)",ImgSrc:"CSA.gif",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"AIA",Handle:"IA",Text:"Africa &amp; The Middle East (MW)",ImgSrc:"AMI.gif",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"AIB",Handle:"IB",Text:"Antarctic (MW)",ImgSrc:"ANT.gif",ImgMap:"null",PolyPts:"null"})

  p.fAdd({ID:"AIC",Handle:"IC",Text:"Africa &amp; The Middle East (W)",ImgSrc:"MIA.gif",ImgMap:"null",PolyPts:"null"})

 p.pNext=p.pChildren;
 p.pChildren=null;
}
clsMaxProNavigator.prototype.fDrawCharts=function (p)
{
 if(p==null)
  p = this.pChildren.fFirstOpen();
 //document.getElementById("dvChartHeader").innerHTML="Passport World Charts"):"")
 //alert(p+":"+(p?p.Handle:"xxx"))
 if(p==null) 
  p = this.pChildren;
	fAjaxCall({ID:"dvCharts",script:1,url:"include/Server/DBI.asp?VERB=Navigate&Handle="+(p?p.Handle:"")});
	if(!p || p.Handle=="0")
	{
		document.getElementById("dvSubMainHeader").innerHTML="<img "
			+ ' onmouseover="document.getElementById(\'img_wmw\').style.height=\'auto\';document.getElementById(\'img_wmw\').style.width=\'auto\';"'
			+ ' onmouseout="document.getElementById(\'img_wmw\').style.height=\'200px\';document.getElementById(\'img_wmw\').style.width=\'auto\';"'
			+ " style='height:200px;' id='img_wmw' SRC='images/maps/wmw.gif'>";
	}
	try
	{
		
		if(document.getElementById("dvSubMainBody"))
		{
			fAjaxCall({ID:"dvSubMainBody",fcallback:fCallBack,url:"include/Server/DBI.asp?VERB=ChartTable&Handle="+(p?p.Handle:"0")});
			fPageHandler().fGetActiveCustomer().fCart().fFixFields("Charts");
		}
	}
	catch(e){}
 return p;
}

/**
* Class clsRegProduct Client Prototypes
* 
* This class 
* program uses multiple arrays for colors, color names (to  
* create image names), gravity check boxes and number of balls.  
* For alignment I also use an array of panels.
* 
* Follow instructions at top of the dialog window.
* 
* @author Terry McEntee
* @date May 2007
* 
*/
/**
* Draw prototype for clsRegProduct
* @param el  an element that the will contain what is drawn.
*/
clsRegProduct.prototype.fDraw = function (elProgram,elPermits)
{   
 var aTxt=[];
 var exchange = fPageHandler().fSite().fExchange(1.0,"USD",fPageHandler().fSite().Currency);
 var dataset=fPageHandler().fSite().fDataSet().toUpperCase();
 var cust=fPageHandler().fGetActiveCustomer();
 if(fPageHandler().fDealer())
 {  
  aTxt[aTxt.length] = ""
   +"<table id=tblCustomerInformation class='m0px p0px' border='0' cellspacing='0' cellpadding='0' width='100%'>"
   +"<caption id='dvProductHeading' class='dvGrayBar al'>Customer Information</caption>"
   +"<tr><td class='bold bbgry brgry pl2px'>"+cust.hDemographics.fGetFullName()+"</td></tr>"
   +"<tr><td class='bold bbgry brgry pl2px'>"+cust.hDemographics.Address1+"</td></tr>"
   +"<tr><td class='bold bbgry brgry pl2px'>"+cust.hDemographics.DayPhone+"</td></tr>"
   +"<tr><td class='bold bbgry brgry pl2px'>"+cust.hDemographics.EmailAddress+"</td></tr>"
  aTxt[aTxt.length] = "</table>";    
 }
 
 // Instead of just using a number for the version, we need
 // certain string values depending on the product that has been 
 // registered:
 var versionString = "";
 if (cust && (cust.fGetActiveRegProduct().SubType == "SRGB60"))
 {
    // This is a GB60 customer:
    versionString = "GB60";
 }
 else if (cust && (cust.fGetActiveRegProduct().SubType == "SRGB65"))
 {
    // This is a GB65 customer:
    versionString = "GB65";
 }
 else if (this.fMember("Version")== 10)
 {
    // Use the string "MAX Pro" instead of 10:
    versionString = "MAX Pro";
 }
 else
 {
    // Nothing special -- just use the numbered version string:
    versionString = String(this.fMember("Version"));
 }
 
 aTxt[aTxt.length] = ""
  +"<table class='m0px p0px' border='0' cellspacing='0' cellpadding='0' width='100%'>"
  +"<caption id='dvProductHeading'><img src='images/productinfo.jpg' width='702px' height='26px'></caption>"
  +"<tr>"
  +"<th class='bold bgGold blgry ac'>Program</th>"
  +"<th class='bold bgGold blgry ac'>Serial Number</th>"
  +"<th class='bold bgGold blgry ac'>Version</th>"
  +"<th class='bold bgGold blgry brgry ac'>Registration Date</th>"
  +"</tr>"
  +"<tr>"
  +"<td class='bdrgry brn ac'>"+this.fProductName()+"&nbsp;</td>"
  +"<td class='bdrgry brn ac'>"+(this.newSN||this.fSerialNumber())+"&nbsp;</td>"
  +"<td class='bdrgry brn ac'>"+(this.newSN || versionString) +"&nbsp;</td>"
  +"<td class='bdrgry ac'>"+this.fMember("RegDate")+"&nbsp;</td>"
  +"</tr>";
 if(this.newSN)
 {
  aTxt[aTxt.length] = "<tr>"
  +"<th class='bdrgry brn ac'>Old Passport Program</th>"
  +"<td class='bdrgry brn ac'>"+this.fSerialNumber()+"&nbsp;</td>"
  +"<td class='bdrgry brn ac'>"+this.fMember("Version")+"&nbsp;</td>"
  +"<th class='bdrgry ac'>To Be Deactivated</th>"
  +"</tr>";
 }
 if(this.fMember("Version") < 10 && this.fMember("SubClass") == "JM" && this.newSN == null)
 {
  var hUpgrades = fPageHandler().fProgramUpgrades();
//    alert(fSerialize(hUpgrades))
  for(var u in hUpgrades)
  {
   var Retail=hUpgrades[u].Retail;
   var Dealer=hUpgrades[u].Dealer;
   var Distributor=hUpgrades[u].Distributor;
   var VAD=hUpgrades[u].VAD;
   var TRX=hUpgrades[u].TRX;
   if(hUpgrades[u].FromID==this.fMember("ProductID"))
   {
    /*
// Code block for Upgrade Special Promotion
    if(hUpgrades[u].FromID==hUpgrades[u].ToID)
    {
     try
     {
      switch(parseInt(this.fMember("Version")))
      {
       case 9:
        Dealer=Distributor=VAD=TRX=Retail=0.0;
        break;
       case 8: case 7: case 6: case 5:
        Retail=(this.fMember("ProductID")==6?130.0:280.0);
        break;
      }
     }
     catch(e){
      alert(""
      +"There was a problem determining your Upgrade Price."
      +"\r\nWe are on hand to assist you with your upgrade."
      +"\r\nPlease, contact Jeppesen Marine Sales for assistance:\r\n\r\n(800) 946-2877\r\nDirect: (503) 579-1414"
      +"\r\n\r\nError:"+e.description);
     }
    }
    */
    aTxt[aTxt.length] = ""
     +"<tr>"
     +"<td class='pl2px bdrgry brn'><b><i>Upgrade&nbsp;Now&nbsp;Available!</i></b></td>"
     +"<td class='bdrgry brn'>"+hUpgrades[u].Description+"&nbsp;</td>"
     +"<td class='ac bdrgry brn'><input type='checkbox' "
     +" onclick='return fPageHandler().fToggleBox(this);' "
     +" cartaction='Toggle' "
     +" refresh='Profile' "
     +" actionadd='fPageHandler().fMaxProCart(\"Profile\")' " 
     +" actionremove='fPageHandler().fPassportCart(\"Profile\")' " 
     +" producttype='ProgramUpgrade' "
     +" weight='"+hUpgrades[u].Weight+"' "
     +" group='ProgramUpgrade' "
     +" productid='"+hUpgrades[u].ProductID+"' "
     +" Description='"+hUpgrades[u].Description.replace(/v10/,"v1")+"' "
     +" Retail='"+Retail+"' "
     +" Dealer='"+Dealer+"' "
     +" Distributor='"+Distributor+"' "
     +" VAD='"+VAD+"' "
     +" TRX='"+TRX+"' "
     +" id='ckPID_"+hUpgrades[u].ProductID+"' "
     +"></td>"
     +"<td class='bdrgry brn ar'>"+(Retail?Number(Retail*exchange).fFormatCurrency(2):"<i style='color:#FF0000;'>No Charge!</i>")+"</td>"
     +"</tr>";
   }
  }
 }
 //alert("["+this.fMember("Class")+"]");
 if(this.fMember("Class").charAt(0) != "P")
 {
  hUpgrades = fPageHandler().fSoftwareUpgrades();
  aTxt[aTxt.length] = "<tr><td colspan=4 class='brgry'>"
  aTxt[aTxt.length] = "<table width='100%' border=0 cellpadding=0 cellspacing=0>";
   aTxt[aTxt.length] = "<tr>"
   +"<th class='pl0px bold bgGold bbgry ac'>Software&nbsp;Upgrades</th>"
   +"<th class='bold bgGold bbgry blgry ac'>Unlock&nbsp;Code</th>"
   +"<th class='bold bgGold bbgry blgry ac'>Price&nbsp;"+fPageHandler().fSite().Currency+"</th>"
   +"</tr>"
  for(var r in this.hUnLocks)
  {
   try
   {
    if(hUpgrades[r])
    {
     aTxt[aTxt.length] = "<tr>"
      +"<td class='pl2px bbgry MAXPRO'>"+hUpgrades[r].Name+"&nbsp;</td>"
      +"<td class='bbgry blgry ac MAXPRO'>Add&nbsp;To&nbsp;Cart&nbsp;<input type='checkbox' "
      +" onclick='return fPageHandler().fCartAction(this);' cartaction='Toggle' "
      +" producttype='"+hUpgrades[r].ProductType+"' "
      +" name='"+hUpgrades[r].Name+"' "
      +" group='"+hUpgrades[r].ProductID+"' "
      +" productid='"+hUpgrades[r].ProductID+"' "
      +" weight='"+hUpgrades[r].Weight+"' "
      +" partnumber='"+hUpgrades[r].PartNumber+"' "
      +" id='ckPID_"+hUpgrades[r].ProductID+"'"
      +" description='"+hUpgrades[r].Description+"'"
      +" Retail='0.0'"
      +" Dealer='0.0'"
      +" Distributor='0.0'"
      +" VAD='0.0'"
      +" TRX='0.0'"
      +"></td>"
      +"<td height=22 class='bbgry blgry ar MAXPRO'><i style='color:#FF0000;'>No Charge Upgrade!</i></td>"
      +"</tr>";
    }
    aTxt[aTxt.length] = "<tr>"
     +"<td class='pl2px pl0px bbgry PASSPORT'>"+hUpgrades[r].Name+"&nbsp;</td>"
     +"<td class='bbgry blgry ac PASSPORT'>"+this.hUnLocks[r].Permit+"&nbsp;</td>"
     +"<td height=22 class='bbgry blgry PASSPORT'>&nbsp;</td>"
     +"</tr>";
//     if(this.SetupNFR)  this.SetupNFR=0;
   }
   catch(e){}
  }
  var aNFRCartAutomation=new Array();
  if(this.Class=="DMAX" && this.SetupNFR!=1)
   this.SetupNFR=1;


  for(var r in hUpgrades)
  {
   var maxproonlyclass="";
   if(this.hUnLocks[r]==null)
   {
    aNFRCartAutomation.push("fPageHandler().fCartAction(fGD('ckPID_"+hUpgrades[r].ProductID+"'));");
    
    
    // comment below section of code out to have NFR unlock code always appear!!
    
    if(hUpgrades[r].ProductID==1457) // NFR Unlock code
    {
    //alert("NFR unlock code product here! " + hUpgrades[r].Name);
     aTxt[aTxt.length] = ""
      +"<input type='hidden' "
      +" cartaction='Toggle' "
      +" producttype='"+hUpgrades[r].ProductType+"' "
      +" name='"+hUpgrades[r].Name+"' "
      +" group='"+hUpgrades[r].ProductID+"' "
      +" productid='"+hUpgrades[r].ProductID+"' "
      +" weight='"+hUpgrades[r].Weight+"' "
      +" partnumber='"+hUpgrades[r].PartNumber+"' "
      +" id='ckPID_"+hUpgrades[r].ProductID+"'"
      +" description='"+hUpgrades[r].Description+"'"
      +" retail='"+hUpgrades[r].Retail+"'"
      +" dealer='"+hUpgrades[r].Dealer+"'"
      +" distributor='"+hUpgrades[r].Distributor+"'"
      +">";
    }
    else
    
    // comment above section of code out to have NFR unlock code always appear!!
    
    {
     var Retail=hUpgrades[r].fPrice();
     var Dealer=hUpgrades[r].Dealer;
     var Distributor=hUpgrades[r].Distributor;
     var VAD=hUpgrades[r].VAD;
     var TRX=hUpgrades[r].TRX;
/*
// Code block for Raster Plus Pack Special Promotion
     if(hUpgrades[r].Name=="Raster Plus Pack")
     {
      maxproonlyclass=this.newSN==null?" MAXPRO":"";
      try
      {
       switch(parseInt(this.fMember("Version")))
       {
        case 9:
         Dealer=Distributor=VAD=TRX=Retail=0.0;
         break;
        case 8: case 7: case 6: case 5:
         Retail=(this.fMember("ProductID")==6?50.0:50.0);
         break;
       }
      }
      catch(e)
      {
       alert(""
       +"There was a problem determining your Raster Upgrade Price."
       +"\r\nWe are on hand to assist you with your upgrade."
       +"\r\nPlease, contact Jeppesen Marine Sales  for assistance:\r\n\r\n(800) 946-2877\r\nDirect: (503) 579-1414"
       +"\r\n\r\nError:"+e.description);
      }
     }
     else 
*/
     if(this.hUnLocks[r])
     {
      maxproonlyclass=" MAXPRO";
      Dealer=Distributor=VAD=TRX=Retail=0.0;
     }
        
     aTxt[aTxt.length] = "<tr>"
      +"<td class='pl2px bbgry"+maxproonlyclass+"'>"+hUpgrades[r].Name+"&nbsp;</td>"
      +"<td class='bbgry blgry ac"+maxproonlyclass+"'>Add&nbsp;To&nbsp;Cart&nbsp;<input type='checkbox' "
      +" onclick='return fPageHandler().fCartAction(this);' cartaction='Toggle' "
      +" producttype='"+hUpgrades[r].ProductType+"' "
      +" name='"+hUpgrades[r].Name+"' "
      +" group='"+hUpgrades[r].ProductID+"' "
      +" productid='"+hUpgrades[r].ProductID+"' "
      +" weight='"+hUpgrades[r].Weight+"' "
      +" partnumber='"+hUpgrades[r].PartNumber+"' "
      +" id='ckPID_"+hUpgrades[r].ProductID+"'"
      +" description='"+hUpgrades[r].Description+"'"
      +" Retail='"+Retail+"'"
      +" Dealer='"+Dealer+"'"
      +" Distributor='"+Distributor+"'"
      +" VAD='"+VAD+"'"
      +" TRX='"+TRX+"'"
      +"></td>"
      +"<td height=22 class='bbgry blgry ar"+maxproonlyclass+"'>"+(Retail?Number(Retail*exchange).fFormatCurrency(2):"<i style='color:#FF0000;'>&nbsp;&nbsp;&nbsp;&nbsp;No Charge!</i>")+"&nbsp;</td>"
      +"</tr>";
    }
   }
  }
  aTxt[aTxt.length] = "</td></tr><tr></tr></table></td></tr>";
 }
 aTxt[aTxt.length] = "</table>";    
 elProgram.innerHTML=aTxt.join("");
 if(this.Class=="DMAX" && this.SetupNFR)
 {
  for(var a=0;a<aNFRCartAutomation.length;a++)
  {
   try
   {
//     alert(aNFRCartAutomation[a]);
    eval(aNFRCartAutomation[a]);
   }
   catch(e){alert("NFR Automation Failed :"+e.description);};
  }
  this.SetupNFR=0;
 }
 aTxt = [];
 if(this.fRegionCount() > 0) // && this.newSN == null)
 {			
  aTxt[aTxt.length] = ""
   +"<table class='m0px p0px bdrgry' border='0' cellspacing='0' cellpadding='0' width='100%'>"
   +"<caption id='dvPermitHeading'>"
   +"<a href='#' onclick='return fPageHandler().fLicenseFile();'><img src='images/permits.jpg' width='703' height='26'></a>"
   +"</caption>"
   +"<tr>"
   +"<th class='bold bgGold blgry bln ac'>Region</th>"
   +"<th class='bold bgGold blgry ac'>Permit Number</th>"
   +"<th class='bold bgGold blgry ac'>"+(parseFloat(this.Version)>=10.0?"Date":"Folio")+"</th>"
   +"<th class='bold bgGold blgry ac' width='10'>&nbsp;Update&nbsp;</th>"
   +"<th class='bold bgGold blgry brgry brn ac' width='10'>&nbsp;Price&nbsp;"+fPageHandler().fSite().Currency+"&nbsp;</th>"
   +"</tr>";
    
  var hRegions = this.fMember("hRegions");
  var hProducts = fPageHandler().fLoadProducts(hRegions);
  for(var r in hRegions)
  {
   try
   {
    var QSED = "";
    var DDD = "";
    if(hRegions[r].RegionID.charAt(1)=="-")
    {
     //alert(fSerialize(hRegions[r]));
     var d=new Date(hRegions[r].Date);
     DDD = (d.getMonth()+1)+"/"+d.getDate()+"/"+d.getFullYear();
     if(String(hRegions[r].Oracle_Item).charAt(3)=="R")
      d.setMonth(d.getMonth()+4);
     else
      d.setFullYear(d.getFullYear()+1);
     QSED = (d.getMonth()+1)+"/"+d.getDate()+"/"+d.getFullYear();
    }

    aTxt[aTxt.length] = hRegions[r].fDrawPS("<tr>"
     +"<td class='bdrgry brn bln ac'>[RegionID]</td>"
     +"<td class='bdrgry brn ac'><b>[Permit]</b></td>"
     +"<td class='bdrgry brn ac'>"+(parseFloat(this.Version)>=10.0?DDD:"[Folio]")+"</td>"
     +"<td class='bdrgry brn ac'><input type='checkbox' "
     +(this.newSN != null ?" DISABLED ":"")
     +" onclick='return fPageHandler().fCartAction(this);' "
     +" cartaction='Toggle' "
     +(String(hRegions[r].Oracle_Item).charAt(3)=="R"?" DISABLED":"")
     +" producttype='ChartUpdate' "
     +" PriceReg= '"+hProducts[String(hRegions[r].ProductID)].PriceReg+"' "
     +" productid='"+hRegions[r].ProductID+"' "
     +" weight='"+hProducts[String(hRegions[r].ProductID)].Weight+"' "
     +" group='"+hRegions[r].ProductID+"' "
     +" id='ckPID_"+hRegions[r].ProductID+"'"
     +" name='"+String(hRegions[r].RegionID).replace(/^M\-/,"")+"'" 
     +" description='"+hProducts[String(hRegions[r].ProductID)].Description+"'"
     +" retail='"+hProducts[String(hRegions[r].ProductID)].Retail+"'"
     +" retailupdate='"+hProducts[String(hRegions[r].ProductID)].RetailUpdate+"'"
     +" dealer='"+hProducts[String(hRegions[r].ProductID)].Dealer+"'" 
     +" dealerupdate='"+hProducts[String(hRegions[r].ProductID)].DealerUpdate+"'" 
     +" distributor='"+hProducts[String(hRegions[r].ProductID)].Distributor+"'" 
     +" distributorupdate='"+hProducts[String(hRegions[r].ProductID)].DistributorUpdate+"'" 
     +" vad='"+hProducts[String(hRegions[r].ProductID)].VAD+"'" 
     +" vadupdate='"+hProducts[String(hRegions[r].ProductID)].VADUpdate+"'" 
     +" trx='"+hProducts[String(hRegions[r].ProductID)].TRX+"'" 
     +" trxupdate='"+hProducts[String(hRegions[r].ProductID)].TRXUpdate+"'" 
     +"></td>"
     +"<td class='bdrgry brn ar'>"+Number(hProducts[String(hRegions[r].ProductID)].RetailUpdate*exchange).fFormatCurrency(2)+"</td>"
     +"</tr>"
     +(this.fMember("SubClass") != "JM"?"":(""
       +"<tr><td colspan='6'><div style='margin-left:30px;' class='MaxPro bdr' id='dvMore_[RegionID][Folio]'>"
					  +"<br>"
					  +(hMappings[r]
					    ?
					     ("Your Passport Region <b>[RegionID]</b>is equivalent to the following C-MAP MAX Pro regions:<br>"+hMappings[r].fMapsTo())
					    :
					     (
					      String(hRegions[r].Oracle_Item).charAt(3)=="R"?("<b style='background-color:yellow;'>[RegionID] Quick Sync End Date - "+QSED+"</b><br>Updates are not available for rental licenses.")
					      :("<b style='background-color:yellow;'>[RegionID] Quick Sync End Date - "+QSED+"</b>")
					     )
					   )
					 )
					 )
					+""
//						+"<br>Edition differences for [RegionID] from WF[Folio] to WF34"
					+"</div></td>"
     +"</tr>");
    }
    catch(e){}
  }
  aTxt[aTxt.length] = "</table>";
  aTxt[aTxt.length] = "<span id=dvHeaderPurchase class='ap w100pct txtPageHeader xoverflowauto' >"
    + "<a href=\"#\" id=\"mnuCart1\" style=\"margin-left:40px;padding:0px;\" onclick=\"return fPageHandler().fOnSubmit('Cart');\"><img src=\"images/PlaceOrder.gif\" border=0><strong id=mnuCartItems></strong></a>"
    + "</span>";
 }
 elPermits.innerHTML=aTxt.join("");
}
 
clsDealer.prototype.fRunReport = function (rpt)
{
 if(rpt.id=="DlrAccountRpt")
  this.RptRep=document.getElementById('selAccountRpt').options[document.getElementById('selAccountRpt').selectedIndex].value;
 this.RptReport = String(rpt.id).replace(/Dlr/,"");
 var hAjax = {
  ID:"dvSubMainBody"
  ,fcallback:fCallBack
  ,method:"post"
  ,url:"include/Server/DBI.asp?VERB=DealerReport&Operator="+fSerialize(this).replace(/\&/g," and ")
 };
 fAjaxCall(hAjax);
}
clsDealer.prototype.fOpen = function (rpt)
{
 this.RptReport = String(rpt.id).replace(/Dlr/,"");
 var hAjax = {
  ID:"dvSubMainBody"
  ,fcallback:fCallBack
  ,method:"post"
  ,url:"include/Server/DBI.asp?VERB=DealerReport&Operator="+fSerialize(this).replace(/\&/g," and ")
 };
 fAjaxCall(hAjax);
}
clsCustomer.prototype.fDrawCart = function (el)
{
 try
 {
  el = document.getElementById("dvCartTable")
  return this.fCart().fDraw(el);
 }
 catch(e){}
}
clsDemographics.prototype.fGetFullName = _fGetFullName;
/**
 * Class clsMenu Client Prototypes
 * 
 * @author Richard Taylor-Kenny
 * @date May 2007
 * 
 */

/**
 * Draw prototype for clsMenu
 * @param el  an element that the will contain what is drawn.
*/
 clsMenu.prototype.fShowProfile = function(how)
 {
  try{document.getElementById("mnuProfile").style.display=how?"":"none";}catch(e){};
 }
 clsMenu.prototype.fShowVouchers = function(how)
 {
  try{document.getElementById("mnuVouchers").style.display=how?"":"none";}catch(e){};
 }


/**
 * Draw prototype for clsMenu
 * @param el  an element that the will contain what is drawn.
*/
 clsMenu.prototype.fShowCart = function(how)
 {
  try{document.getElementById("mnuCart3").style.display=how?"":"none";}catch(e){};
 }

clsCart.prototype.fRemoveVoucher = function (v)
{
 var voucher=this.aVouchers.splice(v,1);
 try
 {
  fGD("msgVoucher").innerHTML=voucher.Key+" has been removed.";
  this.fDrawGoodVouchers();
 }
 catch(e){}
}
clsCart.prototype.fValidateVoucher = function (elid)
{
    // Do not allow dealers to redeem vouchers.
    // Dealers must not be logged in:
    if (fPageHandler().fDealer())
    {
        fGD("msgVoucher").innerHTML = "You must log off of the dealer account in order to redeem a voucher.";    
        return;    
    }

 var el = fGD(elid);
 if(String(el.value).replace(/ /g,"") == "")
  fGD("msgVoucher").innerHTML="Please, provide a voucher to validate.";
 else 
 {
  el.value=String(el.value).toUpperCase();
  if(String(el.value).charAt(0) != "U" && String(el.value).charAt(0) != "M")
  {
   fGD("msgVoucher").innerHTML="<font class='txtRed'>The voucher you entered, "+el.value+", is invalid.</font>";
  }
  else if(this.fFindVoucher(String(el.value).replace(/ /g,"")))
  {
   fGD("msgVoucher").innerHTML="<font class='txtRed'>The voucher you entered, "+el.value+", is already in the list.</font>";
   el.value = "";
  }
  else
  {
   try
   {
    fAjaxCall({ID:"none",script:1,url:"include/server/DBI.asp?VERB=VoucherValidation&Voucher="+el.value});
    el.value="";
    this.fDrawGoodVouchers();
   }
   catch(e)
   {
    this.fError(e);
   }
  }
 }
 el.focus();
}
clsCart.prototype.fDrawGoodVouchers = function ()
{
 var aTxt = new Array();
 for(var v=0;v<this.aVouchers.length;v++)
 {
  aTxt.push("<tr><th class='ar vt'>"+(v+1)+")</th>"
  +"<td nowrap>"+this.aVouchers[v].Key
  +" "
  +(this.aVouchers[v].RegionID?("Assigned To ["+this.aVouchers[v].RegionID.substr(2)+"]"):"(Region Currently Unassigned)")
  +"</td>"
  +"<td class='vt'>"
   +"<input type=button onclick='fPageHandler().fCart().fRemoveVoucher("+v+");return false' value='Remove' class='clsButton' onmouseover='this.style.border=\"2px inset\";' onmouseout='this.style.border=\"2px outset\";'>"
   +(this.aVouchers[v].Key.substr(0,2)!="MP"?"":("<input type=button onclick='fPageHandler().fHelpHandler(this);return false' value='Browse Regions' "
   +"HelpKey='VoucherAssignment' Key='"+this.aVouchers[v].Key+"' RegionID='"+this.aVouchers[v].RegionID+"' class='clsButton' onmouseover='this.style.border=\"2px inset\";' onmouseout='this.style.border=\"2px outset\";'>"))
  +"</td></tr>");
 }
 if(this.aVouchers.length == 0)
  fGD("GoodVouchers").innerHTML="";
 else
 {
  fGD("GoodVouchers").innerHTML="<table class='bdr'><caption>Validated Vouchers</caption>"
   +"<tr><th colspan=3 style='padding-bottom:5px;'>All licenses will be applied to serial number :<u>"+fPageHandler().fGetActiveSerialNumber()+"</u></th></tr>"
   +aTxt.join("")+"</table>"
   +"<p><input type=button value='Check Out' onclick='return fPageHandler().fOnSubmit(\"Cart\");' "
   +" class='clsButton' "
   +" onmouseover='this.style.border=\"2px inset\";'"
   +" onmouseout='this.style.border=\"2px outset\";'"
   +" >&nbsp;&nbsp;&nbsp;or continue browsing";
 }
}
clsCart.prototype.fFindVoucher = function (f)
{
 for(var v=0;v<this.aVouchers.length;v++)
 {
  if(f==this.aVouchers[v].Key)
   return this.aVouchers[v];
 }
 return null;
}
clsCart.prototype.fFreightAmount= function (cust)
{	
 try
 {
  if(cust)
  {
	 	var extra=this.fWeight()-fPageHandler().OVERWEIGHT;
	 	var cost=Math.max(0.0,this.fWeight()?1.0:0.0)*cust.hShipping.$hShippingMethods[cust.hShipping.ShipperID].FreightCharge;
	 	if(extra > 0.0)
	 	 cost += Math.ceil(extra)*cust.hShipping.$hShippingMethods[cust.hShipping.ShipperID].PerPoundExtra;
	 	this.fFreight(cost);
	 }
	}
	catch(e){/*alert("ERROR:Calculating Freight Charges");*/}
 return this.Freight;
}


function fCallBack(doc)
{
 if(doc.responseText.substr(1,12).replace(/SCRIPT/i,"")!=doc.responseText.substr(1,12))
 {
  var idx = doc.responseText.indexOf(">");
  var script = doc.responseText.substr(idx+1);
  idx = script.toUpperCase().indexOf("</SCRIPT>");
  script=script.substr(0,idx);
  if(this.ID && document.getElementById(this.ID))
   document.getElementById(this.ID).innerHTML=""+doc.responseText.substr(doc.responseText.toUpperCase().indexOf("</SCRIPT>")+9);  
  else
   document.getElementById("dvContainer").innerHTML=""+doc.responseText.substr(doc.responseText.toUpperCase().indexOf("</SCRIPT>")+9);  
  if(script.length>0)
   eval(script);
  return;
 }
 //alert(this.ID);
 if(this.ID && document.getElementById(this.ID))
  document.getElementById(this.ID).innerHTML=""+doc.responseText;
 else
  document.getElementById("dvContainer").innerHTML=""+doc.responseText;
}
var PH=new clsPageHandler({hSite:{}});
fPageHandler().fAddReSize(PH.fSubContainerResize);

function fPageHandler()
{
 return PH;
}
function fNavigator()
{
 fPageHandler().fNavigator();
}
var hMappings={ "AF0010L":new clsMapping("AF0010L","AF-P002","AF-P202&AF-P203"), "AF0020L":new clsMapping("AF0020L","AF-P001","AF-P205"), "EE0010L":new clsMapping("EE0010L","EN-P006","EN-P325&EN-P327"), "EG0010L":new clsMapping("EG0010L","ME-P001","ME-P202"), "ES0010L":new clsMapping("ES0010L","EW-P005","EP100"), "ES0020L":new clsMapping("ES0020L","EW-P005","EW-P204"), "ES0030L":new clsMapping("ES0030L","EW-P005","EP100,EP094"), "ES0040L":new clsMapping("ES0040L","EW-P005","EW-P204"), "ES0050L":new clsMapping("ES0050L","EW-P005","EP100"), "ES0060L":new clsMapping("ES0060L","EW-P005","EP100"), "ES0070L":new clsMapping("ES0070L","EW-P005","EP100"), "ES0080L":new clsMapping("ES0080L","EW-P005","EW-P204"), "ES0100L":new clsMapping("ES0100L","EP001,EW-P005",""), "EUR0010L":new clsMapping("EUR0010L","EW-P001&EW-P005",""), "FI0010L":new clsMapping("FI0010L","EN-P012,EN-P010","EN-P325"), "FI0040L":new clsMapping("FI0040L","EN-P012","EN-P259"), "FI0070L":new clsMapping("FI0070L","EN-P012","EN-P259"), "FI0100L":new clsMapping("FI0100L","M-EN-P007","EN-P326"), "FR0010L":new clsMapping("FR0010L","EM-P001",""), "FR0020L":new clsMapping("FR0020L","EM-P002,EM-P001",""), "FR0030L":new clsMapping("FR0030L","EW-P005","EW-P203"), "FR0040L":new clsMapping("FR0040L","EW-P005","EW-P203"), "FR0050L":new clsMapping("FR0050L","EW-P001","EW-P203"), "FR0060L":new clsMapping("FR0060L","EM-P101","EM-P101"), "FR0070L":new clsMapping("FR0070L","EW-P203","EW-P203"), "FR0080L":new clsMapping("FR0080L","EM-P101","EM-P101"), "FR0100L":new clsMapping("FR0100L","PC-P204","PC-P204"), "GB0010L":new clsMapping("GB0010L","EN-P070","EN-P070"), "GB0020L":new clsMapping("GB0020L","EW-P205","EW-P205"), "GB0030L":new clsMapping("GB0030L","EW-P201","EW-P201"), "GB0040L":new clsMapping("GB0040L","EW-P201","EW-P201"), "GB0050L":new clsMapping("GB0050L","EW-P201","EW-P201"), "GB0060L":new clsMapping("GB0060L","EW-P007","EW-P207"), "GB0070L":new clsMapping("GB0070L","EW-P007","EW-P209"), "GB0080L":new clsMapping("GB0080L","EW-P208","EW-P208"), "GB0090L":new clsMapping("GB0090L","EW-P202","EW-P202"), "GB0100L":new clsMapping("GB0100L","EW-P007","EW-P224"), "GB0110L":new clsMapping("GB0110L","EW-P220","EW-P220"), "GB0120L":new clsMapping("GB0120L","EW-P220","EW-P220"), "GB0130L":new clsMapping("GB0130L","EW-P220","EW-P220"), "GB0140L":new clsMapping("GB0140L","EW-P214","EW-P214"), "GB0150L":new clsMapping("GB0150L","EW-P007","EW-P205"), "GB0210L":new clsMapping("GB0210L","EW-P007","EW-P201"), "GB0220L":new clsMapping("GB0220L","EW-P007",""), "GR0010L":new clsMapping("GR0010L","EM-P003","EM-P104"), "GR0020L":new clsMapping("GR0020L","EM-P003",""), "GR0030L":new clsMapping("GR0030L","EM-P003",""), "GW0010L":new clsMapping("GW0010L","AF-P002","AF-P203"), "ID0010L":new clsMapping("ID0010L","IN-P001","IN-P203"), "ID0020L":new clsMapping("ID0020L","IN-P001","AS-P206"), "ID0030L":new clsMapping("ID0030L","AU-P002","AU-P207"), "ID0040L":new clsMapping("ID0040L","AS-P206","AS-P206"), "ID0050L":new clsMapping("ID0050L","IN-P001",""), "IN0010L":new clsMapping("IN0010L","ME-P001,IN-P002",""), "IN0020L":new clsMapping("IN0020L","IN-P002,ME-P002","IN-P202"), "IN0030L":new clsMapping("IN0030L","IN-P002","IN-P202,IN-P201"), "IT0010L":new clsMapping("IT0010L","EM-P002","EM-P994,EM-P997"), "IT0020L":new clsMapping("IT0020L","EM-P994","EM-P994"), "IT0030L":new clsMapping("IT0030L","EM-P002","EM-P997"), "IT0040L":new clsMapping("IT0040L","EM-P001","EM-P995"), "JP0010L":new clsMapping("JP0010L","AN-P001","AN-P204"), "JP0030L":new clsMapping("JP0030L","AN-P204","AN-P204"), "JP0040L":new clsMapping("JP0040L","AN-P001","AN-P204"), "JP0050L":new clsMapping("JP0050L","AN-P001","AN-P204"), "JP0060L":new clsMapping("JP0060L","AN-P001","AN-P204"), "MG0010L":new clsMapping("MG0010L","ME-P203","ME-P203"), "MX0010L":new clsMapping("MX0010L","NA-P010","NA-P502"), "MX0020L":new clsMapping("MX0020L","NA-P010","NA-P402"), "MX0030L":new clsMapping("MX0030L","NA-P010,NA-P012",""), "MZ0010L":new clsMapping("MZ0010L","AF-P001","AF-P205"), "NAC0010L":new clsMapping("NAC0010L","NA-P004&EW-P005&EW-P007&EW-P001",""), "NAC0020L":new clsMapping("NAC0020L","NA-P004&EW-P005&EW-P007&EW-P001",""), "NG0010L":new clsMapping("NG0010L","AF-P002",""), "NL0010L":new clsMapping("NL0010L","EW-P001",""), "NLV0050L":new clsMapping("NLV0050L","EW-P001",""), "NLV0070L":new clsMapping("NLV0070L","EW-P001&EN-P004",""), "NO0010L":new clsMapping("NO0010L","EN-P003,EN-P004","EN-P565"), "NO0020L":new clsMapping("NO0020L","EN-P003,EN-P002,EN-P004","EN-P566+EN-P568"), "NO0030L":new clsMapping("NO0030L","EN-P003","EN-P568"), "NO0040L":new clsMapping("NO0040L","EN-P003","EN-P569"), "NO0050L":new clsMapping("NO0050L","EN-P003","EN-P569"), "NO0060L":new clsMapping("NO0060L","EN-P001","EN-P571"), "NO0070L":new clsMapping("NO0070L","EN-P001","EN-P571"), "NO0080L":new clsMapping("NO0080L","EN-P002",""), "NO0090L":new clsMapping("NO0090L","EN-P001",""), "NO0500L":new clsMapping("NO0500L","EN-P001&EN-P002",""), "NZ0010L":new clsMapping("NZ0010L","AU-P001",""), "NZ0020L":new clsMapping("NZ0020L","AU-P001",""), "NZ0030L":new clsMapping("NZ0030L","AU-P001",""), "NZ0040L":new clsMapping("NZ0040L","AU-P001",""), "NZ0050L":new clsMapping("NZ0050L","AU-P001",""), "NZ0110L":new clsMapping("NZ0110L","AU-P001",""), "NZ0120L":new clsMapping("NZ0120L","AU-P001",""), "PA0010L":new clsMapping("PA0010L","NA-P011",""), "PA0020L":new clsMapping("PA0020L","NA-P010",""), "PAC0010L":new clsMapping("PAC0010L","PC-P204",""), "PAC0020L":new clsMapping("PAC0020L","PC-P203",""), "PG0010L":new clsMapping("PG0010L","AU-P002",""), "PH0010L":new clsMapping("PH0010L","AN-P001",""), "PT0010L":new clsMapping("PT0010L","EW-P204",""), "RU0010L":new clsMapping("RU0010L","EN-P006",""), "RU0020L":new clsMapping("RU0020L","EM-P102",""), "RU0030L":new clsMapping("RU0030L","AN-P001,RS-P002",""), "RU0040L":new clsMapping("RU0040L","AN-P001",""), "RU0050L":new clsMapping("RU0050L","AN-P001",""), "RU0055L":new clsMapping("RU0055L","RS-P002",""), "RU0060L":new clsMapping("RU0060L","AN-P001",""), "RU0070L":new clsMapping("RU0070L","AN-P001",""), "RU0080L":new clsMapping("RU0080L","ME-P005",""), "RU0100L":new clsMapping("RU0100L","RS-P001",""), "RU0130L":new clsMapping("RU0130L","RS-P203",""), "RUS0900L":new clsMapping("RUS0900L","RS-P001&EN-P001",""), "SA0010L":new clsMapping("SA0010L","ME-P001",""), "SAM0010L":new clsMapping("SAM0010L","SA-P501",""), "SAM0020L":new clsMapping("SAM0020L","SA-P500",""), "SB0010L":new clsMapping("SB0010L","EN-P012","AU-P210"), "SE0030L":new clsMapping("SE0030L","EN-P012","EN-P259"), "SE0040L":new clsMapping("SE0040L","EN-P008","EN-P255"), "SE0050L":new clsMapping("SE0050L","EN-P007","EN-P260"), "SE0060L":new clsMapping("SE0060L","EN-P006","EN-P257"), "SE0070L":new clsMapping("SE0070L","EN-P010","EN-P327"), "SE0080L":new clsMapping("SE0080L","EN-P005","EN-P257"), "SE0090L":new clsMapping("SE0090L","EN-P006","EN-P257"), "SE0100L":new clsMapping("SE0100L","EN-P004&EN-P005&EN-P008","EN-P253"), "SE0110L":new clsMapping("SE0110L","EN-P004","EN-P253"), "SE0120L":new clsMapping("SE0120L","EN-P005","EN-P565"), "SE0130L":new clsMapping("SE0130L","EN-P005","EN-P255"), "SE0140L":new clsMapping("SE0140L","EN-P008&EN-P004&EN-P002&EN-P001","EN-P565"), "SG0010L":new clsMapping("SG0010L","IN-P001","AS-P201"), "SG0020L":new clsMapping("SG0020L","IN-P001","IN-P203"), "SO0010L":new clsMapping("SO0010L","ME-P001","ME-P202"), "TR0010L":new clsMapping("TR0010L","EP003",""), "US0010L":new clsMapping("US0010L","NA-P006","NA-P302"), "US0011M":new clsMapping("US0011M","NA-P003","NA-P301"), "US0012M":new clsMapping("US0012M","NA-P006","NA-P302"), "US0013M":new clsMapping("US0013M","NA-P006","NA-P301"), "US0014M":new clsMapping("US0014M","NA-P006","NA-P301"), "US0015M":new clsMapping("US0015M","NA-P007","NA-P301"), "US0016M":new clsMapping("US0016M","NA-P006,NA-P007",""), "US0020L":new clsMapping("US0020L","NA-P006,NA-P007",""), "US0021M":new clsMapping("US0021M","NA-P006,NA-P007",""), "US0022M":new clsMapping("US0022M","NA-P001",""), "US0023M":new clsMapping("US0023M","NA-P006,NA-P007","NA-P301"), "US0024M":new clsMapping("US0024M","NA-P018","NA-P302"), "US0025M":new clsMapping("US0025M","NA-P301",""), "US0026M":new clsMapping("US0026M","NA-P004",""), "US0027M":new clsMapping("US0027M","NA-P007",""), "US0030L":new clsMapping("US0030L","NA-P007",""), "US0031M":new clsMapping("US0031M","NA-P018",""), "US0032M":new clsMapping("US0032M","NA-P007",""), "US0033M":new clsMapping("US0033M","NA-P007",""), "US0034M":new clsMapping("US0034M","NA-P007",""), "US0035M":new clsMapping("US0035M","NA-P303",""), "US0036M":new clsMapping("US0036M","NA-P303",""), "US0037M":new clsMapping("US0037M","NA-P303,NA-P310",""), "US0041M":new clsMapping("US0041M","NA-P304,NA-P310",""), "US0042M":new clsMapping("US0042M","NA-P303,NA-P304",""), "US0043M":new clsMapping("US0043M","NA-P304,NA-P310",""), "US0044M":new clsMapping("US0044M","NA-P304,NA-P310",""), "US0045M":new clsMapping("US0045M","NA-P019",""), "US0050L":new clsMapping("US0050L","NA-P305",""), "US0051M":new clsMapping("US0051M","NA-P305",""), "US0052M":new clsMapping("US0052M","NA-P305",""), "US0053M":new clsMapping("US0053M","NA-P305",""), "US0054M":new clsMapping("US0054M","NA-P305",""), "US0055M":new clsMapping("US0055M","NA-P305",""), "US0060L":new clsMapping("US0060L","NA-P305",""), "US0061M":new clsMapping("US0061M","NA-P305,NA-P401",""), "US0062M":new clsMapping("US0062M","NA-P012",""), "US0063M":new clsMapping("US0063M","NA-P009",""), "US0064M":new clsMapping("US0064M","NA-P018&NA-P019",""), "US0080L":new clsMapping("US0080L","NA-P011",""), "US0090L":new clsMapping("US0090L","NA-P601",""), "US0091M":new clsMapping("US0091M","NA-P012",""), "US0092M":new clsMapping("US0092M","NA-P020",""), "US0093M":new clsMapping("US0093M","NA-P012",""), "US0094M":new clsMapping("US0094M","NA-P012",""), "US0100L":new clsMapping("US0100L","NA-P001",""), "US0101M":new clsMapping("US0101M","NA-P001",""), "US0102M":new clsMapping("US0102M","NA-P001",""), "US0103M":new clsMapping("US0103M","NA-P001",""), "US0104M":new clsMapping("US0104M","NA-P001",""), "US0110L":new clsMapping("US0110L","NA-P601",""), "US0111M":new clsMapping("US0111M","NA-P013&NA-P020",""), "US0112M":new clsMapping("US0112M","NA-P020",""), "US0113M":new clsMapping("US0113M","NA-P202",""), "US0114M":new clsMapping("US0114M","NA-P020",""), "US0120L":new clsMapping("US0120L","NA-P601",""), "US0121M":new clsMapping("US0121M","NA-P013",""), "US0122M":new clsMapping("US0122M","NA-P020",""), "US0123M":new clsMapping("US0123M","NA-P013",""), "US0124M":new clsMapping("US0124M","NA-P013",""), "US0130L":new clsMapping("US0130L","NA-P601",""), "US0131M":new clsMapping("US0131M","NA-P009",""), "US0132M":new clsMapping("US0132M","NA-P009",""), "US0133M":new clsMapping("US0133M","NA-P009",""), "US0134M":new clsMapping("US0134M","NA-P009",""), "US0135M":new clsMapping("US0135M","NA-P009,NA-P008",""), "US0140L":new clsMapping("US0140L","NA-P009","NA-P103"), "US0141M":new clsMapping("US0141M","NA-P001",""), "US0142M":new clsMapping("US0142M","NA-P001",""), "US0143M":new clsMapping("US0143M","NA-P001",""), "US0144M":new clsMapping("US0144M","NA-P001",""), "US0150L":new clsMapping("US0150L","NA-P001",""), "US0151M":new clsMapping("US0151M","NA-P001/NA-P002",""), "US0152M":new clsMapping("US0152M","NA-P002",""), "US0153M":new clsMapping("US0153M","NA-P017,NA-P020,NA-P012,AU-P001","AU-P222,PC-P204"), "US0154M":new clsMapping("US0154M","NA-P002",""), "US0160L":new clsMapping("US0160L","NA-P002",""), "US0161M":new clsMapping("US0161M","NA-P002",""), "US0162M":new clsMapping("US0162M","NA-P002",""), "US0170L":new clsMapping("US0170L","NA-P014",""), "US0171M":new clsMapping("US0171M","NA-P014",""), "US0172M":new clsMapping("US0172M","NA-P014",""), "US0173M":new clsMapping("US0173M","NA-P014",""), "US0174M":new clsMapping("US0174M","NA-P014",""), "US0180L":new clsMapping("US0180L","NA-P015",""), "US0181M":new clsMapping("US0181M","NA-P015,NA-P014","NA-P801,NA-P802"), "US0182M":new clsMapping("US0182M","NA-P015",""), "US0183M":new clsMapping("US0183M","NA-P015",""), "US0184M":new clsMapping("US0184M","NA-P015",""), "US0190L":new clsMapping("US0190L","NA-P015",""), "US0200L":new clsMapping("US0200L","NA-P012","NA-P603"), "US0201M":new clsMapping("US0201M","NA-P012",""), "US0202M":new clsMapping("US0202M","NA-P012",""), "US0203M":new clsMapping("US0203M","NA-P007,NA-P008,AN-P011,NA-P012",""), "VE0010L":new clsMapping("VE0010L","NA-P011",""), "ZA0010L":new clsMapping("ZA0010L","AF-P001,AF-P002",""), "ZA0020L":new clsMapping("ZA0020L","AF-P001&AF-P002&IN-P002",""), "ZR00":new clsMapping("ZR00","AA-A000","AA-A000"), "ZR01":new clsMapping("ZR01","EW-P007",""), "ZR04":new clsMapping("ZR04","ME-P001",""), "ZR05":new clsMapping("ZR05","IN-P001,AN-P001",""), "ZR06":new clsMapping("ZR06","AU-P005",""), "ZR07":new clsMapping("ZR07","NA-P010,SA-P501,SA-P500",""), "ZR101":new clsMapping("ZR101","AA-A000","AA-A000"), "ZR900":new clsMapping("ZR900","NA-P002,NA-P003,NA-P004",""), "ZR901":new clsMapping("ZR901","NA-P009,NA-P008,NA-P008",""), "ZR902":new clsMapping("ZR902","NA-P008,NA-P007",""), "ZR903":new clsMapping("ZR903","NA-P012",""), "ZR904":new clsMapping("ZR904","NA-P012",""), "ZR912":new clsMapping("ZR912","NA-P009,NA-P011",""), "ZR914":new clsMapping("ZR914","ME-P201,EM-P104",""), "ZR915":new clsMapping("ZR915","EM-P001",""), "ZR916":new clsMapping("ZR916","EW-P004&EN-P013&EN-P009&EW-P007",""), "ZR917":new clsMapping("ZR917","EW-P007",""), "ZR919":new clsMapping("ZR919","","EN-P565&EN-P566"), "ZR920":new clsMapping("ZR920","","EN-P579"), "ZR921":new clsMapping("ZR921","","EN-P325"), "ZR922":new clsMapping("ZR922","","EN-P325"), "ZR923":new clsMapping("ZR923","","EN-P325,EN-P330"), "ZR924":new clsMapping("ZR924","NA-P001&NA-P002&NA-P003",""), "AF0030L":new clsMapping("AF0030L","AF-P002",""), "AR0010L":new clsMapping("AR0010L","ME-P001",""), "AU00100L":new clsMapping("AU00100L","AU-P005",""), "AU0010L":new clsMapping("AU0010L","AU-P005",""), "AU0020L":new clsMapping("AU0020L","AU-P005",""), "AU0030L":new clsMapping("AU0030L","AU-P005",""), "AU0040L":new clsMapping("AU0040L","AU-P005",""), "AU0050L":new clsMapping("AU0050L","AU-P005",""), "AU0060L":new clsMapping("AU0060L","AU-P005","AU-P250"), "AU0070L":new clsMapping("AU0070L","AU-P005","AU-P250"), "AU0080L":new clsMapping("AU0080L","AU-P005","AU-P250"), "AU0090L":new clsMapping("AU0090L","AU-P005","AU-P251"), "BR0010L":new clsMapping("BR0010L","SA-P501","AU-P251"), "BR0020L":new clsMapping("BR0020L","SA-P004",""), "BR0030L":new clsMapping("BR0030L","SA-P004",""), "BS0010L":new clsMapping("BS0010L","NA-P008&NA-P004","NA-P305&NA-P503&NA-P304"), "CA0010L":new clsMapping("CA0010L","","NA-P205"), "CA0020L":new clsMapping("CA0020L","","NA-P230"), "CA0030L":new clsMapping("CA0030L","","NA-P202"), "CA0050L":new clsMapping("CA0050L","NA-P013","NA-P701&NA-P702"), "CA0061S":new clsMapping("CA0061S","","NA-P101"), "CA0062S":new clsMapping("CA0062S","","NA-P101,NA-P104"), "CA0063S":new clsMapping("CA0063S","","NA-P103"), "CA0065S":new clsMapping("CA0065S","","NA-P101,NA-P102,NA-P104"), "CA0070L":new clsMapping("CA0070L","","NA-P103"), "CA0080L":new clsMapping("CA0080L","","NA-P103"), "CA0090L":new clsMapping("CA0090L","","NA-P204"), "CA0150L":new clsMapping("CA0150L","","NA-P703"), "CAR0010L":new clsMapping("CAR0010L","NA-P011","NA-P501,NA-P503"), "CAR0020L":new clsMapping("CAR0020L","NA-P501",""), "CAR0100L":new clsMapping("CAR0100L","NAP502",""), "CL0010L":new clsMapping("CL0010L","SA-P500","SA-P002&SA-P003"), "CL0020L":new clsMapping("CL0020L","SA-P500",""), "CL0030L":new clsMapping("CL0030L","SA-P500","SA-P002"), "CL0040L":new clsMapping("CL0040L","SA-P500","SA-P002"), "CL0050L":new clsMapping("CL0050L","SA-P500","SA-P002"), "CL0060L":new clsMapping("CL0060L","SA-P500","SA-P002"), "CN0010L":new clsMapping("CN0010L","IN-P001","AS-P204"), "CN0020L":new clsMapping("CN0020L","AS-P001","AS-P204"), "CO0010L":new clsMapping("CO0010L","SA-P005&NA-P011","SA-P001"), "CU0010L":new clsMapping("CU0010L","NA-P011","NA-P503"), "DE0010L":new clsMapping("DE0010L","EW-P006","EN-P159"), "DE0020L":new clsMapping("DE0020L","EW-P006","EN-P160"), "DE0030L":new clsMapping("DE0030L","EN-P004","EN-P159"), "DK0010L":new clsMapping("DK0010L","EN-P004","EN-P160"), "DK0020L":new clsMapping("DK0020L","EN-P006&EN-P006&EN-P012","EM-P253"), "DK0030L":new clsMapping("DK0030L","EN-P004","EM-P253") };
