function getBaseDomain()
{
  var domain = document.domain;
  var ifirst= domain.indexOf(".");
  domain=domain.substring(ifirst+1);		
  return domain;
}

// for netcrm the appdomain is netsuite, perform this replacement.
function getAppDomain()
{
  var domain = getBaseDomain();
  var iCRM=domain.indexOf("netcrm");
  if (iCRM != -1)
        domain=domain.substring(0,iCRM)+"netsuite"+domain.substring(iCRM+6);
  return domain;
}


function getQueryParameter(param)
{
  var idx = document.URL.indexOf(param+"=");
  if (idx != -1)
  {
    var sidx = idx+param.length+1;
    var len = document.URL.substring(sidx).indexOf("&");
    if (len == -1)
      return document.URL.substring(sidx);
    else
      return document.URL.substring(sidx, sidx+len);
  }
  else
    return null;
}

function getCookie(name)
{
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0)
      return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

function setCookie(name, value, expires, path, domain, secure)
{
  if (value == "")
  {
  	value = null;
  	expires = new Date();
  }

  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

function setCookieFromParam(name)
{
  var value = getQueryParameter(name);
  //set the cookie to expire 10 years from the day it is set
  var expiresDate = new Date(new Date().getTime() + (10 * 365 * 1000 * 3600 * 24));

  if (value != null)
    setCookie(name, value, expiresDate, "/", getBaseDomain(), null);
  return value;  
}

//sets the cookie and returns the partner code
function setPartnerCookie()
{
  var partner = getQueryParameter("partner");
  //set the cookie to expire 10 years from the day it is set
  var expiresDate = new Date(new Date().getTime() + (10 * 365 * 1000 * 3600 * 24));
  if(partner == null)
     partner = getQueryParameter("affiliateid");

  if (partner != null)
    setCookie("partner", partner, expiresDate, "/", getBaseDomain(), null);

   return partner;
}

//JS function to extract the partnercode from cookies
function getPartnerCode()
{
    // check for the partner code from the query parameters, return if
    // return that value if we retreived the partner code
    var partner = setPartnerCookie();
    if(partner != null)
       return partner;

    //partner will replace the overloaded visitorCookie going forward
    partner = getCookie("partner");

    // visitorCookie is deprecated going forward so we want to extract the partner code (if one exists)
    // and re-cookie with partner
    if(partner == null)
    {
       
       partner = getCookie("visitorCookie");
       if(partner != null && partner.length > -1)
       {
            var vCookieVals = partner.split(",");
            partner = vCookieVals[1];
            //document.cookie = "visitorCookie; path=/portal/; domain="www.<%=NLConfig.getSystemDomain()%>"; expires=Fri, 02-Jan-1970 00:00:00";
            //    setCookie("visitorCookie", null, null, , "www.<%=NLConfig.getSystemDomain()%>", secure)
            if(partner != null && partner != "")
               setCookie("partner", partner, "/", null, getBaseDomain(), null)
       }
    }

    //return null if no partner code exists for consistency's sake
    if(partner == "")
       partner = null;

    return partner;
}

// the following cookies all for the standard parameters that we're interested in if available.
function setleadformparams()
{
    var partner = getPartnerCode();
    setCookieFromParam("promocode");
    setCookieFromParam("osb");
    setCookieFromParam("id");
    setCookieFromParam("email");
	
	// this represents the add medium.
	setCookieFromParam("custentity210");
	
	// this represents scompid for the referring partner.
	// id of corresponding custom field in ns is custentity_ref_comp_id
	setCookieFromParam("origin");
	
	return partner;
}

function writecobrandimage(defaultImage)
{
    // use the Std. NetSuite logo as the default if no image is specified
    if (defaultImage == null) {defaultImage="http://www.netsuite.com/portal/sg/images/pages/logo_netsuite.gif";}
    
    
    var partner = setleadformparams();  
    
    if(partner != null)
    {
        var imageurl = "http://content."+getAppDomain()+"/app/crm/common/nlcorp/partnercobrand.nl?image=" + partner + "_30.gif";
        document.write("          <TD WIDTH='100%' HEIGHT='69'>\n");
        document.write("          <TABLE WIDTH='375' BORDER='0' CELLSPACING='0' CELLPADDING='0'>\n");
        document.write("            <TR HEIGHT='10'>\n");
        document.write("              <TD ROWSPAN='3' WIDTH='173' HEIGHT='69'><A HREF='http://www.netsuite.com/portal/sg/home.shtml'><IMG SRC='" + defaultImage + "' ALT='NetSuite Business Software: Accounting, CRM, Ecommerce, ERP, Inventory' HEIGHT='69' WIDTH='173' BORDER='0'></A></TD>\n");
        document.write("              <TD ROWSPAN='3' WIDTH='16' HEIGHT='69'><IMG SRC='http://www.netsuite.com/portal/sg/images/pages/spacer.gif' ALT='' HEIGHT='69' WIDTH='16' BORDER='0'></TD>\n");
        document.write("              <TD WIDTH='10' HEIGHT='10'><IMG SRC='http://www.netsuite.com/portal/sg/images/pages/spacer.gif' ALT='' HEIGHT='10' WIDTH='10' BORDER='0'></TD>\n");
        document.write("              <TD ROWSPAN='3' WIDTH='175' HEIGHT='69'><img src='" + imageurl + "' height=30 width=175 vspace=7 border=0></TD>\n");
        document.write("            </TR>\n");
        document.write("            <TR HEIGHT='49'>\n");
        document.write("              <TD WIDTH='1' HEIGHT='49' BACKGROUND='http://www.netsuite.com/portal/sg/images/pages/dots_vert.gif'><IMG SRC='http://www.netsuite.com/portal/sg/images/pages/spacer.gif' ALT='' HEIGHT='49' WIDTH='1' BORDER='0'></TD>\n");
        document.write("            </TR>\n");
        document.write("            <TR HEIGHT='10'>\n");
        document.write("              <TD WIDTH='1' HEIGHT='10'><IMG SRC='http://www.netsuite.com/portal/sg/images/pages/spacer.gif' ALT='' HEIGHT='10' WIDTH='1' BORDER='0'></TD>\n");
        document.write("            </TR>\n");
        document.write("          </TABLE>\n");
        document.write("        </TD>\n");
    }
    else
    {
        document.write("<TD WIDTH='100%' HEIGHT='69'><A HREF='http://www.netsuite.com.sg/portal/sg/home.shtml'><IMG SRC='" + defaultImage + "' ALT='NetSuite Business Software: Accounting, CRM, Ecommerce, ERP, Inventory' HEIGHT='69' WIDTH='173' BORDER='0'></A></TD>\n");
    }

    return true;
}


function redirecttologin()
{
    var redirect = getCookie("loginredirect");
    var noredirect = getQueryParameter("noredirect");

	// cmk 3/9/2005 -- need to explicitly send them to the secure pages
    if(noredirect == null && redirect != null)
        document.location = "https://system.netsuite.com/pages/customerlogin.jsp?country=SG";

    return true;
}



function gotoform(formid)
{
    document.location = 'http://shopping.'+getAppDomain()+'/internal/portal/formredirect.nl?formid=' + formid;
    return true;
}

function gototestdrive()
{
   document.location = 'http://testdrive.'+getAppDomain()+'/internal/trial/testdrivelogin.nl';
   return true;
}

function selectAndGo(newLoc)
{
    newPage = newLoc.options[newLoc.selectedIndex].value;
    if(newPage != "")
        window.location.href = newPage;
}
function openTourWindow()
{
  tour = window.open('/portal/popuptour.nl','Tour','scrollbars=yes,resizable=yes,width=820,height=508');
  tour.focus();
}
function closeAndGoTo(url)
{
  opener.location = url;
  window.close();
}

function populateEmailFromCookie()
{
	var cookieVal = "";
	if (document.cookie.indexOf("OSBuserName=") > -1)
	{
		thisCookie = document.cookie.split("; ");
		for(i=0; i<thisCookie.length; i++)
		{
			if("OSBuserName" == thisCookie[i].split("=")[0])
			{
				cookieVal = thisCookie[i].split("=")[1];
				document.forms[0].elements['email'].value = cookieVal;
				document.forms[0].elements['rememberme'].checked = "T";
				document.forms[0].elements['password'].focus();
				return;
			}
		}
	}
	else
	{
		document.forms[0].elements['email'].focus();
	}
}

function hasFlash()
{
    if ((navigator.appName == "Microsoft Internet Explorer" &&
                navigator.appVersion.indexOf("Mac") == -1 &&
                navigator.appVersion.indexOf("3.1") == -1) ||
                (navigator.plugins && navigator.plugins["Shockwave Flash"])
                || navigator.plugins["Shockwave Flash 2.0"])
    {
        return true;
    }
    else
    {
        return false;
    }
}



/********
 * displays flash content or alternate
 * content is flash not detected. 
********/

function getSecureFlash(width, height, file, loop, alternate, classid)
{
	if (MM_FlashCanPlay)
	{
		var oeTags = '<OBJECT CLASSID="' + classid + '"'
         + 'WIDTH="' + width + '" HEIGHT="' + height + '"'
		 + 'CODEBASE="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
         + '<PARAM NAME="MOVIE" VALUE="' + file + '">'
         + '<PARAM NAME="PLAY" VALUE="true">'
         + '<PARAM NAME="LOOP" VALUE="' + loop + '">'
         + '<PARAM NAME="QUALITY" VALUE="high">'
         + '<PARAM NAME="MENU" VALUE="false">'
         + '<EMBED SRC="' + file + '"'
         + 'WIDTH="' + width + '" HEIGHT="' + height + '"'
         + 'PLAY="true"'
         + 'LOOP="' + loop + '"'
         + 'QUALITY="high"'
         + 'MENU="false"'
         + 'TYPE="application/x-shockwave-flash"'
		 + 'PLUGINSPAGE="https://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">'
         + '</EMBED>'
         + '</OBJECT>';
		document.write(oeTags);
	}
	else
	{
		var alternateContent = '<IMG SRC="' + alternate + '" HEIGHT="' + height + '" WIDTH="' + width + '" BORDER="0">'
		document.write(alternateContent);
	}
}

/********
 * displays flash content or alternate
 * content is flash not detected. 
********/

function getFlash(width, height, file, loop, alternate, classid, usemap)
{
	if (MM_FlashCanPlay)
	{
		var curProtocol = "http:";
		if (null != top.location.protocol && top.location.protocol=='https:')
		{
			curProtocol = "https:";
		}
		var oeTags = '<OBJECT CLASSID="' + classid + '"'
         + 'WIDTH="' + width + '" HEIGHT="' + height + '"'
         + 'CODEBASE="' + curProtocol + '//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0">'
         + '<PARAM NAME="MOVIE" VALUE="' + file + '">'
         + '<PARAM NAME="PLAY" VALUE="true">'
         + '<PARAM NAME="LOOP" VALUE="' + loop + '">'
         + '<PARAM NAME="QUALITY" VALUE="high">'
         + '<PARAM NAME="MENU" VALUE="false">'
         + '<EMBED SRC="' + file + '"'
         + 'WIDTH="' + width + '" HEIGHT="' + height + '"'
         + 'PLAY="true"'
         + 'LOOP="' + loop + '"'
         + 'QUALITY="high"'
         + 'MENU="false"'
         + 'TYPE="application/x-shockwave-flash"'
         + 'PLUGINSPAGE="' + curProtocol + '//www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">'
         + '</EMBED>'
         + '</OBJECT>';
		document.write(oeTags);
	}
	else
	{

		var alternateContent = '<IMG SRC="' + alternate + '" HEIGHT="' + height + '" WIDTH="' + width + '" BORDER="0" usemap="' +usemap+ '">'

		document.write(alternateContent);
	}
}

/********
 * Image rollovers for global navigation
********/

function globalNavOver(image_name) {
	image_name.src = "/web-common/assets/rt_blu_arrow.gif";
}

function globalNavOut(image_name) {
	image_name.src = "/web-common/assets/1x1_spacer.gif";
}

/********
 * Image swaping (mouseover) for the Web site
********/

function swapImage(daImage, daSrc){
var objStr, obj;
    if(document.images){
        if (typeof(daImage) == 'string') {
            objStr = 'document.' + daImage;
            obj = eval(objStr);
            obj.src = daSrc;
        } else if ((typeof(daImage) == 'object') && daImage && daImage.src) {
            daImage.src = daSrc;
        }
    }
}

//getFlash//
if(typeof dontDetectFlash == 'undefined') dontDetectFlash = false;
if(!dontDetectFlash){
	var MM_contentVersion = 5;
	var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
	if ( plugin ) {
			var words = navigator.plugins["Shockwave Flash"].description.split(" ");
		    for (var i = 0; i < words.length; ++i)
		    {
			if (isNaN(parseInt(words[i])))
			continue;
			var MM_PluginVersion = words[i]; 
		    }
		var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
	}
	else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
	   && (navigator.appVersion.indexOf("Win") != -1)) {
		document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
		document.write('on error resume next \n');
		document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
		document.write('</SCR' + 'IPT\> \n');
	}
}


<!--main menu start-->

<!--
var timeout         = 500;
var closetimer		= 0;
var ddmenuitem      = 0;

// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
document.onclick = mclose; 
// -->

<!--main menu end -->


<!--pull-down start -->

<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->

<!--pull-down end -->

<!--popup start -->
<!--

function openPopup(url) {
	remoteWindow = window.open(url,"mynewWindow","toolbar=1,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=650,height=500");
}

//-->
<!--popup end -->

<!--mbox start -->
var mboxCopyright = "Copyright 1996-2010. Adobe Systems Incorporated. All rights reserved.";mboxUrlBuilder = function(a, b) { this.a = a; this.b = b; this.c = new Array(); this.d = function(e) { return e; }; this.f = null;};mboxUrlBuilder.prototype.addParameter = function(g, h) { var i = new RegExp('(\'|")'); if (i.exec(g)) { throw "Parameter '" + g + "' contains invalid characters"; } for (var j = 0; j < this.c.length; j++) { var k = this.c[j]; if (k.name == g) { k.value = h; return this; } } var l = new Object(); l.name = g; l.value = h; this.c[this.c.length] = l; return this;};mboxUrlBuilder.prototype.addParameters = function(c) { if (!c) { return this; } for (var j = 0; j < c.length; j++) { var m = c[j].indexOf('='); if (m == -1 || m == 0) { continue; } this.addParameter(c[j].substring(0, m), c[j].substring(m + 1, c[j].length)); } return this;};mboxUrlBuilder.prototype.setServerType = function(n) { this.o = n;};mboxUrlBuilder.prototype.setBasePath = function(f) { this.f = f;};mboxUrlBuilder.prototype.setUrlProcessAction = function(p) { this.d = p;};mboxUrlBuilder.prototype.buildUrl = function() { var q = this.f ? this.f : '/m2/' + this.b + '/mbox/' + this.o; var r = document.location.protocol == 'file:' ? 'http:' : document.location.protocol; var e = r + "//" + this.a + q; var s = e.indexOf('?') != -1 ? '&' : '?'; for (var j = 0; j < this.c.length; j++) { var k = this.c[j]; e += s + encodeURIComponent(k.name) + '=' + encodeURIComponent(k.value); s = '&'; } return this.t(this.d(e));};mboxUrlBuilder.prototype.getParameters = function() { return this.c;};mboxUrlBuilder.prototype.setParameters = function(c) { this.c = c;};mboxUrlBuilder.prototype.clone = function() { var u = new mboxUrlBuilder(this.a, this.b); u.setServerType(this.o); u.setBasePath(this.f); u.setUrlProcessAction(this.d); for (var j = 0; j < this.c.length; j++) { u.addParameter(this.c[j].name, this.c[j].value); } return u;};mboxUrlBuilder.prototype.t = function(v) { return v.replace(/\"/g, '&quot;').replace(/>/g, '&gt;');};mboxStandardFetcher = function() { };mboxStandardFetcher.prototype.getType = function() { return 'standard';};mboxStandardFetcher.prototype.fetch = function(w) { w.setServerType(this.getType()); document.write('<' + 'scr' + 'ipt src="' + w.buildUrl() + '" language="JavaScript"><' + '\/scr' + 'ipt>');};mboxStandardFetcher.prototype.cancel = function() { };mboxAjaxFetcher = function() { };mboxAjaxFetcher.prototype.getType = function() { return 'ajax';};mboxAjaxFetcher.prototype.fetch = function(w) { w.setServerType(this.getType()); var e = w.buildUrl(); this.x = document.createElement('script'); this.x.src = e; document.body.appendChild(this.x);};mboxAjaxFetcher.prototype.cancel = function() { };mboxMap = function() { this.y = new Object(); this.z = new Array();};mboxMap.prototype.put = function(A, h) { if (!this.y[A]) { this.z[this.z.length] = A; } this.y[A] = h;};mboxMap.prototype.get = function(A) { return this.y[A];};mboxMap.prototype.remove = function(A) { this.y[A] = undefined;};mboxMap.prototype.each = function(p) { for (var j = 0; j < this.z.length; j++ ) { var A = this.z[j]; var h = this.y[A]; if (h) { var B = p(A, h); if (B === false) { break; } } }};mboxFactory = function(C, b, D) { this.E = false; this.C = C; this.D = D; this.F = new mboxList(); mboxFactories.put(D, this); this.G = typeof document.createElement('div').replaceChild != 'undefined' && (function() { return true; })() && typeof document.getElementById != 'undefined' && typeof (window.attachEvent || document.addEventListener || window.addEventListener) != 'undefined' && typeof encodeURIComponent != 'undefined'; this.H = this.G && mboxGetPageParameter('mboxDisable') == null; var I = D == 'default'; this.J = new mboxCookieManager( 'mbox' + (I ? '' : ('-' + D)), (function() { return mboxCookiePageDomain(); })()); this.H = this.H && this.J.isEnabled() && (this.J.getCookie('disable') == null); if (this.isAdmin()) { this.enable(); } this.K(); this.L = mboxGenerateId(); this.M = mboxScreenHeight(); this.N = mboxScreenWidth(); this.O = mboxBrowserWidth(); this.P = mboxBrowserHeight(); this.Q = mboxScreenColorDepth(); this.R = mboxBrowserTimeOffset(); this.S = new mboxSession(this.L, 'mboxSession', 'session', 31 * 60, this.J); this.T = new mboxPC('PC', 1209600, this.J); this.w = new mboxUrlBuilder(C, b); this.U(this.w, I); this.V = new Date().getTime(); this.W = this.V; var X = this; this.addOnLoad(function() { X.W = new Date().getTime(); }); if (this.G) { this.addOnLoad(function() { X.E = true; X.getMboxes().each(function(Y) { Y.setFetcher(new mboxAjaxFetcher()); Y.finalize(); }); }); this.limitTraffic(100, 10368000); if (this.H) { this.Z(); this._ = new mboxSignaler(function(ab, c) { return X.create(ab, c); }, this.J); } }};mboxFactory.prototype.forcePCId = function(bb) { if (this.T.forceId(bb)) { this.S.forceId(mboxGenerateId()); }};mboxFactory.prototype.forceSessionId = function(bb) { this.S.forceId(bb);};mboxFactory.prototype.isEnabled = function() { return this.H;};mboxFactory.prototype.getDisableReason = function() { return this.J.getCookie('disable');};mboxFactory.prototype.isSupported = function() { return this.G;};mboxFactory.prototype.disable = function(cb, db) { if (typeof cb == 'undefined') { cb = 60 * 60; } if (typeof db == 'undefined') { db = 'unspecified'; } if (!this.isAdmin()) { this.H = false; this.J.setCookie('disable', db, cb); }};mboxFactory.prototype.enable = function() { this.H = true; this.J.deleteCookie('disable');};mboxFactory.prototype.isAdmin = function() { return document.location.href.indexOf('mboxEnv') != -1;};mboxFactory.prototype.limitTraffic = function(eb, cb) {};mboxFactory.prototype.addOnLoad = function(fb) { if (this.isDomLoaded()) { fb(); } else { var gb = false; var hb = function() { if (gb) { return; } gb = true; fb(); }; this.ib.push(hb); if (this.isDomLoaded() && !gb) { hb(); } }};mboxFactory.prototype.getEllapsedTime = function() { return this.W - this.V;};mboxFactory.prototype.getEllapsedTimeUntil = function(jb) { return jb - this.V;};mboxFactory.prototype.getMboxes = function() { return this.F;};mboxFactory.prototype.get = function(ab, kb) { return this.F.get(ab).getById(kb || 0);};mboxFactory.prototype.update = function(ab, c) { if (!this.isEnabled()) { return; } if (!this.isDomLoaded()) { var X = this; this.addOnLoad(function() { X.update(ab, c); }); return; } if (this.F.get(ab).length() == 0) { throw "Mbox " + ab + " is not defined"; } this.F.get(ab).each(function(Y) { Y.getUrlBuilder() .addParameter('mboxPage', mboxGenerateId()); Y.load(c); });};mboxFactory.prototype.create = function( ab, c, lb) { if (!this.isSupported()) { return null; } var e = this.w.clone(); e.addParameter('mboxCount', this.F.length() + 1); e.addParameters(c); var kb = this.F.get(ab).length(); var mb = this.D + '-' + ab + '-' + kb; var nb; if (lb) { nb = new mboxLocatorNode(lb); } else { if (this.E) { throw 'The page has already been loaded, can\'t write marker'; } nb = new mboxLocatorDefault(mb); } try { var X = this; var ob = 'mboxImported-' + mb; var Y = new mbox(ab, kb, e, nb, ob); if (this.H) { Y.setFetcher( this.E ? new mboxAjaxFetcher() : new mboxStandardFetcher()); } Y.setOnError(function(pb, n) { Y.setMessage(pb); Y.activate(); if (!Y.isActivated()) { X.disable(60 * 60, pb); window.location.reload(false); } }); this.F.add(Y); } catch (qb) { this.disable(); throw 'Failed creating mbox "' + ab + '", the error was: ' + qb; } var rb = new Date(); e.addParameter('mboxTime', rb.getTime() - (rb.getTimezoneOffset() * 60000)); return Y;};mboxFactory.prototype.getCookieManager = function() { return this.J;};mboxFactory.prototype.getPageId = function() { return this.L;};mboxFactory.prototype.getPCId = function() { return this.T;};mboxFactory.prototype.getSessionId = function() { return this.S;};mboxFactory.prototype.getSignaler = function() { return this._;};mboxFactory.prototype.getUrlBuilder = function() { return this.w;};mboxFactory.prototype.U = function(e, I) { e.addParameter('mboxHost', document.location.hostname) .addParameter('mboxSession', this.S.getId()); if (!I) { e.addParameter('mboxFactoryId', this.D); } if (this.T.getId() != null) { e.addParameter('mboxPC', this.T.getId()); } e.addParameter('mboxPage', this.L); e.addParameter('screenHeight', this.M); e.addParameter('screenWidth', this.N); e.addParameter('browserWidth', this.O); e.addParameter('browserHeight', this.P); e.addParameter('browserTimeOffset', this.R); e.addParameter('colorDepth', this.Q); e.addParameter('mboxXDomain', "enabled"); e.setUrlProcessAction(function(e) { e += '&mboxURL=' + encodeURIComponent(document.location); var sb = encodeURIComponent(document.referrer); if (e.length + sb.length < 2000) { e += '&mboxReferrer=' + sb; } e += '&mboxVersion=' + mboxVersion; return e; });};mboxFactory.prototype.tb = function() { return "";};mboxFactory.prototype.Z = function() { document.write('<style>.' + 'mboxDefault' + ' { visibility:hidden; }</style>');};mboxFactory.prototype.isDomLoaded = function() { return this.E;};mboxFactory.prototype.K = function() { if (this.ib != null) { return; } this.ib = new Array(); var X = this; (function() { var ub = document.addEventListener ? "DOMContentLoaded" : "onreadystatechange"; var vb = false; var wb = function() { if (vb) { return; } vb = true; for (var i = 0; i < X.ib.length; ++i) { X.ib[i](); } }; if (document.addEventListener) { document.addEventListener(ub, function() { document.removeEventListener(ub, arguments.callee, false); wb(); }, false); window.addEventListener("load", function(){ document.removeEventListener("load", arguments.callee, false); wb(); }, false); } else if (document.attachEvent) { if (self !== self.top) { document.attachEvent(ub, function() { if (document.readyState === 'complete') { document.detachEvent(ub, arguments.callee); wb(); } }); } else { var xb = function() { try { document.documentElement.doScroll('left'); wb(); } catch (yb) { setTimeout(xb, 13); } }; xb(); } } if (document.readyState === "complete") { wb(); } })();};mboxSignaler = function(zb, J) { this.J = J; var Ab = J.getCookieNames('signal-'); for (var j = 0; j < Ab.length; j++) { var Bb = Ab[j]; var Cb = J.getCookie(Bb).split('&'); var Y = zb(Cb[0], Cb); Y.load(); J.deleteCookie(Bb); }};mboxSignaler.prototype.signal = function(Db, ab ) { this.J.setCookie('signal-' + Db, mboxShiftArray(arguments).join('&'), 45 * 60);};mboxList = function() { this.F = new Array();};mboxList.prototype.add = function(Y) { if (Y != null) { this.F[this.F.length] = Y; }};mboxList.prototype.get = function(ab) { var B = new mboxList(); for (var j = 0; j < this.F.length; j++) { var Y = this.F[j]; if (Y.getName() == ab) { B.add(Y); } } return B;};mboxList.prototype.getById = function(Eb) { return this.F[Eb];};mboxList.prototype.length = function() { return this.F.length;};mboxList.prototype.each = function(p) { if (typeof p != 'function') { throw 'Action must be a function, was: ' + typeof(p); } for (var j = 0; j < this.F.length; j++) { p(this.F[j]); }};mboxLocatorDefault = function(g) { this.g = 'mboxMarker-' + g; document.write('<div id="' + this.g + '" style="visibility:hidden;display:none">&nbsp;</div>');};mboxLocatorDefault.prototype.locate = function() { var Fb = document.getElementById(this.g); while (Fb != null) { if (Fb.nodeType == 1) { if (Fb.className == 'mboxDefault') { return Fb; } } Fb = Fb.previousSibling; } return null;};mboxLocatorDefault.prototype.force = function() { var Gb = document.createElement('div'); Gb.className = 'mboxDefault'; var Hb = document.getElementById(this.g); Hb.parentNode.insertBefore(Gb, Hb); return Gb;};mboxLocatorNode = function(Ib) { this.Fb = Ib;};mboxLocatorNode.prototype.locate = function() { return typeof this.Fb == 'string' ? document.getElementById(this.Fb) : this.Fb;};mboxLocatorNode.prototype.force = function() { return null;};mboxCreate = function(ab ) { var Y = mboxFactoryDefault.create( ab, mboxShiftArray(arguments)); if (Y) { Y.load(); } return Y;};mboxDefine = function(lb, ab ) { var Y = mboxFactoryDefault.create(ab, mboxShiftArray(mboxShiftArray(arguments)), lb); return Y;};mboxUpdate = function(ab ) { mboxFactoryDefault.update(ab, mboxShiftArray(arguments));};mbox = function(g, Jb, w, Kb, ob) { this.Lb = null; this.Mb = 0; this.nb = Kb; this.ob = ob; this.Nb = null; this.Ob = new mboxOfferContent(); this.Gb = null; this.w = w; this.message = ''; this.Pb = new Object(); this.Qb = 0; this.Jb = Jb; this.g = g; this.Rb(); w.addParameter('mbox', g) .addParameter('mboxId', Jb); this.Sb = function() {}; this.Tb = function() {}; this.Ub = null;};mbox.prototype.getId = function() { return this.Jb;};mbox.prototype.Rb = function() { if (this.g.length > 250) { throw "Mbox Name " + this.g + " exceeds max length of " + "250 characters."; } else if (this.g.match(/^\s+|\s+$/g)) { throw "Mbox Name " + this.g + " has leading/trailing whitespace(s)."; }};mbox.prototype.getName = function() { return this.g;};mbox.prototype.getParameters = function() { var c = this.w.getParameters(); var B = new Array(); for (var j = 0; j < c.length; j++) { if (c[j].name.indexOf('mbox') != 0) { B[B.length] = c[j].name + '=' + c[j].value; } } return B;};mbox.prototype.setOnLoad = function(p) { this.Tb = p; return this;};mbox.prototype.setMessage = function(pb) { this.message = pb; return this;};mbox.prototype.setOnError = function(Sb) { this.Sb = Sb; return this;};mbox.prototype.setFetcher = function(Vb) { if (this.Nb) { this.Nb.cancel(); } this.Nb = Vb; return this;};mbox.prototype.getFetcher = function() { return this.Nb;};mbox.prototype.load = function(c) { if (this.Nb == null) { return this; } this.setEventTime("load.start"); this.cancelTimeout(); this.Mb = 0; var w = (c && c.length > 0) ? this.w.clone().addParameters(c) : this.w; this.Nb.fetch(w); var X = this; this.Wb = setTimeout(function() { X.Sb('browser timeout', X.Nb.getType()); }, 15000); this.setEventTime("load.end"); return this;};mbox.prototype.loaded = function() { this.cancelTimeout(); if (!this.activate()) { var X = this; setTimeout(function() { X.loaded(); }, 100); }};mbox.prototype.activate = function() { if (this.Mb) { return this.Mb; } this.setEventTime('activate' + ++this.Qb + '.start'); if (this.show()) { this.cancelTimeout(); this.Mb = 1; } this.setEventTime('activate' + this.Qb + '.end'); return this.Mb;};mbox.prototype.isActivated = function() { return this.Mb;};mbox.prototype.setOffer = function(Ob) { if (Ob && Ob.show && Ob.setOnLoad) { this.Ob = Ob; } else { throw 'Invalid offer'; } return this;};mbox.prototype.getOffer = function() { return this.Ob;};mbox.prototype.show = function() { this.setEventTime('show.start'); var B = this.Ob.show(this); this.setEventTime(B == 1 ? "show.end.ok" : "show.end"); return B;};mbox.prototype.showContent = function(Xb) { if (Xb == null) { return 0; } if (this.Gb == null || !this.Gb.parentNode) { this.Gb = this.getDefaultDiv(); if (this.Gb == null) { return 0; } } if (this.Gb != Xb) { this.Yb(this.Gb); this.Gb.parentNode.replaceChild(Xb, this.Gb); this.Gb = Xb; } this.Zb(Xb); this.Tb(); return 1;};mbox.prototype.hide = function() { this.setEventTime('hide.start'); var B = this.showContent(this.getDefaultDiv()); this.setEventTime(B == 1 ? 'hide.end.ok' : 'hide.end.fail'); return B;};mbox.prototype.finalize = function() { this.setEventTime('finalize.start'); this.cancelTimeout(); if (this.getDefaultDiv() == null) { if (this.nb.force() != null) { this.setMessage('No default content, an empty one has been added'); } else { this.setMessage('Unable to locate mbox'); } } if (!this.activate()) { this.hide(); this.setEventTime('finalize.end.hide'); } this.setEventTime('finalize.end.ok');};mbox.prototype.cancelTimeout = function() { if (this.Wb) { clearTimeout(this.Wb); } if (this.Nb != null) { this.Nb.cancel(); }};mbox.prototype.getDiv = function() { return this.Gb;};mbox.prototype.getDefaultDiv = function() { if (this.Ub == null) { this.Ub = this.nb.locate(); } return this.Ub;};mbox.prototype.setEventTime = function(_b) { this.Pb[_b] = (new Date()).getTime();};mbox.prototype.getEventTimes = function() { return this.Pb;};mbox.prototype.getImportName = function() { return this.ob;};mbox.prototype.getURL = function() { return this.w.buildUrl();};mbox.prototype.getUrlBuilder = function() { return this.w;};mbox.prototype.ac = function(Gb) { return Gb.style.display != 'none';};mbox.prototype.Zb = function(Gb) { this.bc(Gb, true);};mbox.prototype.Yb = function(Gb) { this.bc(Gb, false);};mbox.prototype.bc = function(Gb, cc) { Gb.style.visibility = cc ? "visible" : "hidden"; Gb.style.display = cc ? "block" : "none";};mboxOfferContent = function() { this.Tb = function() {};};mboxOfferContent.prototype.show = function(Y) { var B = Y.showContent(document.getElementById(Y.getImportName())); if (B == 1) { this.Tb(); } return B;};mboxOfferContent.prototype.setOnLoad = function(Tb) { this.Tb = Tb;};mboxOfferAjax = function(Xb) { this.Xb = Xb; this.Tb = function() {};};mboxOfferAjax.prototype.setOnLoad = function(Tb) { this.Tb = Tb;};mboxOfferAjax.prototype.show = function(Y) { var dc = document.createElement('div'); dc.id = Y.getImportName(); dc.innerHTML = this.Xb; var B = Y.showContent(dc); if (B == 1) { this.Tb(); } return B;};mboxOfferDefault = function() { this.Tb = function() {};};mboxOfferDefault.prototype.setOnLoad = function(Tb) { this.Tb = Tb;};mboxOfferDefault.prototype.show = function(Y) { var B = Y.hide(); if (B == 1) { this.Tb(); } return B;};mboxCookieManager = function mboxCookieManager(g, ec) { this.g = g; this.ec = ec == '' || ec.indexOf('.') == -1 ? '' : '; domain=' + ec; this.fc = new mboxMap(); this.loadCookies();};mboxCookieManager.prototype.isEnabled = function() { this.setCookie('check', 'true', 60); this.loadCookies(); return this.getCookie('check') == 'true';};mboxCookieManager.prototype.setCookie = function(g, h, cb) { if (typeof g != 'undefined' && typeof h != 'undefined' && typeof cb != 'undefined') { var gc = new Object(); gc.name = g; gc.value = escape(h); gc.expireOn = Math.ceil(cb + new Date().getTime() / 1000); this.fc.put(g, gc); this.saveCookies(); }};mboxCookieManager.prototype.getCookie = function(g) { var gc = this.fc.get(g); return gc ? unescape(gc.value) : null;};mboxCookieManager.prototype.deleteCookie = function(g) { this.fc.remove(g); this.saveCookies();};mboxCookieManager.prototype.getCookieNames = function(hc) { var ic = new Array(); this.fc.each(function(g, gc) { if (g.indexOf(hc) == 0) { ic[ic.length] = g; } }); return ic;};mboxCookieManager.prototype.saveCookies = function() { var jc = new Array(); var kc = 0; this.fc.each(function(g, gc) { jc[jc.length] = g + '#' + gc.value + '#' + gc.expireOn; if (kc < gc.expireOn) { kc = gc.expireOn; } }); var lc = new Date(kc * 1000); document.cookie = this.g + '=' + jc.join('|') + '; expires=' + lc.toGMTString() + '; path=/' + this.ec;};mboxCookieManager.prototype.loadCookies = function() { this.fc = new mboxMap(); var mc = document.cookie.indexOf(this.g + '='); if (mc != -1) { var nc = document.cookie.indexOf(';', mc); if (nc == -1) { nc = document.cookie.indexOf(',', mc); if (nc == -1) { nc = document.cookie.length; } } var oc = document.cookie.substring( mc + this.g.length + 1, nc).split('|'); var pc = Math.ceil(new Date().getTime() / 1000); for (var j = 0; j < oc.length; j++) { var gc = oc[j].split('#'); if (pc <= gc[2]) { var qc = new Object(); qc.name = gc[0]; qc.value = gc[1]; qc.expireOn = gc[2]; this.fc.put(qc.name, qc); } } }};mboxSession = function(rc, sc, Bb, tc, J) { this.sc = sc; this.Bb = Bb; this.tc = tc; this.J = J; this.uc = false; this.Jb = typeof mboxForceSessionId != 'undefined' ? mboxForceSessionId : mboxGetPageParameter(this.sc); if (this.Jb == null || this.Jb.length == 0) { this.Jb = J.getCookie(Bb); if (this.Jb == null || this.Jb.length == 0) { this.Jb = rc; this.uc = true; } } J.setCookie(Bb, this.Jb, tc);};mboxSession.prototype.getId = function() { return this.Jb;};mboxSession.prototype.forceId = function(bb) { this.Jb = bb; this.J.setCookie(this.Bb, this.Jb, this.tc);};mboxPC = function(Bb, tc, J) { this.Bb = Bb; this.tc = tc; this.J = J; this.Jb = typeof mboxForcePCId != 'undefined' ? mboxForcePCId : J.getCookie(Bb); if (this.Jb != null) { J.setCookie(Bb, this.Jb, tc); }};mboxPC.prototype.getId = function() { return this.Jb;};mboxPC.prototype.forceId = function(bb) { if (this.Jb != bb) { this.Jb = bb; this.J.setCookie(this.Bb, this.Jb, this.tc); return true; } return false;};mboxGetPageParameter = function(g) { var B = null; var vc = new RegExp(g + "=([^\&]*)"); var wc = vc.exec(document.location); if (wc != null && wc.length >= 2) { B = wc[1]; } return B;};mboxSetCookie = function(g, h, cb) { return mboxFactoryDefault.getCookieManager().setCookie(g, h, cb);};mboxGetCookie = function(g) { return mboxFactoryDefault.getCookieManager().getCookie(g);};mboxCookiePageDomain = function() { var ec = (/([^:]*)(:[0-9]{0,5})?/).exec(document.location.host)[1]; var xc = /[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/; if (!xc.exec(ec)) { var yc = (/([^\.]+\.[^\.]{3}|[^\.]+\.[^\.]+\.[^\.]{2})$/).exec(ec); if (yc) { ec = yc[0]; } } return ec ? ec: "";};mboxShiftArray = function(zc) { var B = new Array(); for (var j = 1; j < zc.length; j++) { B[B.length] = zc[j]; } return B;};mboxGenerateId = function() { return (new Date()).getTime() + "-" + Math.floor(Math.random() * 999999);};mboxScreenHeight = function() { return screen.height;};mboxScreenWidth = function() { return screen.width;};mboxBrowserWidth = function() { return (window.innerWidth) ? window.innerWidth : document.documentElement ? document.documentElement.clientWidth : document.body.clientWidth;};mboxBrowserHeight = function() { return (window.innerHeight) ? window.innerHeight : document.documentElement ? document.documentElement.clientHeight : document.body.clientHeight;};mboxBrowserTimeOffset = function() { return -new Date().getTimezoneOffset();};mboxScreenColorDepth = function() { return screen.pixelDepth;};if (typeof mboxVersion == 'undefined') { var mboxVersion = 40; var mboxFactories = new mboxMap(); var mboxFactoryDefault = new mboxFactory('netsuite.tt.omtrdc.net', 'netsuite', 'default');};if (mboxGetPageParameter("mboxDebug") != null || mboxFactoryDefault.getCookieManager() .getCookie("debug") != null) { setTimeout(function() { if (typeof mboxDebugLoaded == 'undefined') { alert('Could not load the remote debug.\nPlease check your connection' + ' to Test&amp;Target servers'); } }, 60*60); document.write('<' + 'scr' + 'ipt language="Javascript1.2" src=' + '"http://admin5.testandtarget.omniture.com/admin/mbox/mbox_debug.jsp?mboxServerHost=netsuite.tt.omtrdc.net' + '&clientCode=netsuite"><' + '\/scr' + 'ipt>');};mboxFactoryDefault.addOnLoad(mboxAppendSession);
var mboxSessionKeyword = "OFM";
function mboxAppendAnchorTags() {
 var anchorTags = document.getElementsByTagName('a');
 for(i = 0; i < anchorTags.length; i++) {
 if (anchorTags[i].href.indexOf(mboxSessionKeyword) != -1) {
 anchorTags[i].href = anchorTags[i].href.replace(
 mboxSessionKeyword,"mboxSession="+mboxFactoryDefault.getSessionId().getId());
 }
 }
}
function mboxAppendForm() {
 var formTags = document.getElementsByTagName('form');
 for(i = 0; i < formTags.length; i++) {
 if (formTags[i].action.indexOf(mboxSessionKeyword) != -1) {
 formTags[i].action = formTags[i].action.replace(
 mboxSessionKeyword,"mboxSession="+mboxFactoryDefault.getSessionId().getId());
 }
 }
}
function mboxAppendSession() {
 mboxAppendAnchorTags();
 mboxAppendForm();
}
<!--mbox end -->

<!-- baynote starts -->

var BaynoteJSVersion="$Revision: 1.24 $";var BN_READY_SIGNAL="ReadySignal";if(typeof(baynote_globals)=="undefined")var baynote_globals=new Object();baynote_globals.waitForReady=false;function BNLog(){this.timeBase=new Date().getTime();this.lines=new Array();this.lastLine="";this.repCount=0;}
BNLog.prototype.log=function(str){if(str==this.lastLine){++this.repCount;return;}
if(this.repCount>0){this.lines.push("___ ABOVE REPEATED "+this.repCount+" TIME"+((this.repCount>1)?"S":""));}
this.lastLine=str;this.repCount=0;var elapsed=new Date().getTime()-this.timeBase
this.lines.push(elapsed+": "+str);}
BNLog.prototype.toString=function(){if(this.repCount>0){this.lines.push("___ ABOVE REPEATED "+this.repCount+" TIME"
+((this.repCount>1)?"S":""));this.lastLine="";this.repCount=0;}
return this.lines.join("\n");}
if(typeof(bnLog)=="undefined"){var bnLog=new BNLog();}
function BNCriticalSectionQueue(){this.waitList=new Object();this.lastId=0;}
BNCriticalSectionQueue.prototype.issueId=function(){return++this.lastId;}
BNCriticalSectionQueue.prototype.enqueue=function(id,item){this.waitList[id]=item;}
BNCriticalSectionQueue.prototype.getWaiter=function(id){return(id==null)?null:this.waitList[id];}
BNCriticalSectionQueue.prototype.firstWaiter=function(){return this.getWaiter(this.nextWaiterKeyAfter(null));}
BNCriticalSectionQueue.prototype.nextWaiterAfter=function(id){return this.getWaiter(this.nextWaiterKeyAfter(id));}
BNCriticalSectionQueue.prototype.nextWaiterKeyAfter=function(id){for(var currKey in this.waitList){if(typeof(this.waitList[currKey])!="object")continue;if(id==null)return currKey;if(id==currKey)id=null;}
return null;}
BNCriticalSectionQueue.prototype.nextPredecessor=function(target,start){for(var currWaiter=start;currWaiter!=null;currWaiter=this.nextWaiterAfter(currWaiter.id)){if(currWaiter.enter||(currWaiter.number!=0&&(currWaiter.number<target.number||(currWaiter.number==target.number&&currWaiter.id<target.id)))){return currWaiter;}}
return null;}
function BNCriticalSection(csQueue){this.csQueue=csQueue;this.debug=1;}
BNCriticalSection.prototype.enter=function(enterFunc){this.enterFunc=enterFunc;this.id=this.csQueue.issueId();this.csQueue.enqueue(this.id,this);this.enter=true;this.number=(new Date()).getTime();this.enter=false;this.attempt(this.csQueue.firstWaiter());}
BNCriticalSection.prototype.leave=function(){if(this.debug)bnLog.log("LEAVE "+this.id);this.number=0;}
BNCriticalSection.prototype.attempt=function(start){var nextReady=this.csQueue.nextPredecessor(this,start);if(nextReady!=null){if(this.debug)bnLog.log("WAIT "+this.id);var me=this;return setTimeout(function(){me.attempt(nextReady);},50);}
if(this.debug)bnLog.log("ENTER "+this.id);this.enterFunc();}
function BNResourceManager(){this.csQueue=new BNCriticalSectionQueue();this.critSec=null;this.debug=1;this.resources=new Object();this.waiting=new Object();}
BNResourceManager.prototype.getResource=function(rId){return this.resources[rId];}
BNResourceManager.prototype.loadResource=function(rId,rAddress,rType){if(typeof(this.resources[rId])!="undefined")return;this.resources[rId]=null;var critSec=new BNCriticalSection(this.csQueue);critSec.enter(function(){bnResourceManager.inject(rId,rAddress,rType,critSec);});}
BNResourceManager.prototype.inject=function(rId,rAddress,rType,critSec){this.critSec=critSec;if(this.debug)bnLog.log("INJECT "+this.critSec.id+" ("+rId+")");if(!rType||rType=="script"){var scriptTag1=document.createElement("script");scriptTag1.language="javascript";scriptTag1.src=rAddress;var head=document.getElementsByTagName("head");head[0].appendChild(scriptTag1);}
else if(rType=="img"){var img=document.createElement("IMG");var handler=function(){bnResourceManager.registerAndAddResource(rId,img);};if(img.addEventListener)img.addEventListener("load",handler,false);else if(img.attachEvent)img.attachEvent("onload",handler);else img["onload"]=handler;img.src=rAddress;}
else alert("Unexpected resource type to loadResource: "+rType);}
BNResourceManager.prototype.waitForResource=function(rId,callbackCode,rAddress,rType){with(this){if(getResource(rId)){this.runCallback(callbackCode);}
else{if(typeof(waiting[rId])=="undefined")waiting[rId]=new Array();var waitingList=waiting[rId];waitingList[waitingList.length]=callbackCode;if(rAddress)this.loadResource(rId,rAddress,rType);}}}
BNResourceManager.prototype.wakeUpWaiting=function(rId){with(this){var waitingList=waiting[rId];if(!waitingList)return;for(var i=0;i<waitingList.length;i++){if(waitingList[i]){var codeToEval=waitingList[i];waitingList[i]=null;if(this.debug&&codeToEval)bnLog.log("CALLBACK "+rId+": "+codeToEval);this.runCallback(codeToEval);}}}}
BNResourceManager.prototype.registerAndAddResource=function(rId,resource){if(this.debug)bnLog.log("REGISTER "+(this.critSec?this.critSec.id:"")+" ("+rId+")");this.resources[rId]=resource;this.wakeUpWaiting(rId);this.critSec.leave();setTimeout("bnResourceManager.wakeUpWaiting('"+rId+"')",5000);}
BNResourceManager.prototype.registerResource=function(rId){this.registerAndAddResource(rId,true);}
BNResourceManager.prototype.runCallback=function(callback){if(typeof(callback)=="string")eval(callback);else if(typeof(callback)=="function")callback();else alert("Invalid callback, type="+typeof(callback));}
if(typeof(bnResourceManager)=="undefined"){var bnResourceManager=new BNResourceManager();}
function BNSystem(){this.testServer=null;}
BNSystem.prototype.getCookieValue=function(cookieName,cookieSubDomain){if(!cookieSubDomain)cookieSubDomain=baynote_globals.cookieSubDomain;if(cookieSubDomain)cookieName+=("-"+cookieSubDomain);var sRE="(?:; )?"+cookieName+"=([^;]*);?";var oRE=new RegExp(sRE);if(oRE.test(document.cookie)){return decodeURIComponent(RegExp["$1"]);}else{return null;}}
BNSystem.prototype.setCookie=function(cookieName,cookieValue,cookiePath,cookieExpires,cookieDomain,cookieSubDomain){cookieValue=encodeURIComponent(cookieValue);if(cookieExpires=="NEVER"){var nowDate=new Date();nowDate.setFullYear(nowDate.getFullYear()+500);cookieExpires=nowDate.toGMTString();}
else if(cookieExpires=="SESSION")cookieExpires="";if(cookiePath!="")cookiePath=";Path="+cookiePath;if(cookieExpires!="")cookieExpires=";expires="+cookieExpires;if(!cookieDomain)cookieDomain=(baynote_globals.cookieDomain)?baynote_globals.cookieDomain:"";if(cookieDomain!="")cookieDomain=";domain="+cookieDomain;if(!cookieSubDomain)cookieSubDomain=baynote_globals.cookieSubDomain;if(cookieSubDomain)cookieName+=("-"+cookieSubDomain);var cookieStr=cookieName+"="+cookieValue+cookieExpires+cookiePath+cookieDomain;if(cookieStr.length>4096)return false;document.cookie=cookieStr;return true;}
BNSystem.prototype.removeCookie=function(cookieName,cookieDomain){this.setCookie(cookieName,"","/","Mon, 1 Jan 1990 00:00:00",cookieDomain);}
BNSystem.prototype.getURLParam=function(name,url){if(!url)var url=window.location.href;var regex=new RegExp("[\\?&]"+name+"=([^&#]*)");var match=regex.exec(url);if(!match)return null;else return match[1];}
BNSystem.prototype.getTestServer=function(){if(this.testServer!=null)return this.testServer;var testServer=this.getURLParam("bn_test");if(testServer)this.setCookie("bn_test",testServer,"/","SESSION");else if(testServer=="")this.removeCookie("bn_test");else{testServer=this.getCookieValue("bn_test");if(!testServer)testServer="";}
this.testServer=testServer;return testServer;}
if(typeof(bnSystem)=="undefined"){var bnSystem=new BNSystem();}
if(typeof(BNTag)=="undefined"){function BNTag(previousTag){if(previousTag){this.id=previousTag.id+1;this.server=previousTag.server;this.customerId=previousTag.customerId;this.code=previousTag.code;}
else this.id=0;this.attrs=new Object();this.docAttrs=new Object();this.css=new Object();}}
BNTag.prototype.getCommonResourceId=function(){return"Common";}
BNTag.prototype.getCommonResourceAddress=function(tag){return(this.server+"/baynote/tags2/common.js");}
BNTag.prototype.getFailsafeResourceId=function(){return"Failsafe";}
BNTag.prototype.getFailsafeResourceAddress=function(){return(this.server+"/baynote/customerstatus2?customerId="+this.customerId+"&code="+this.code+"&x="+this.id+(new Date().getTime()));}
BNTag.prototype.show=function(parentElemId){if(this.id==0)document.write("<span id='bn_placeholder_global'></span>");this.placeHolderId="bn_placeholder"+this.id;var placeHolderType;if(this.placeHolderElement)placeHolderType=this.placeHolderElement;else placeHolderType=this.popup?"span":"div";if(parentElemId){var placeHolder=document.createElement(placeHolderType);placeHolder.id=this.placeholderId;document.getElementById(parentElemId).appendChild(placeHolder);}
else document.write("<"+placeHolderType+" id='"+this.placeHolderId+"'></"+placeHolderType+">");window["bn_tags"][this.id]=this;var testServer=bnSystem.getTestServer();if(testServer){var reValidTestServer=new RegExp("^https?://[^/]*\.baynote\.(com|net)(:\d+)?(/.*)?");if(reValidTestServer.test(testServer))this.server=testServer;else alert("Ignoring invalid test server \""+testServer+"\"");}
this.showWhenReady(this);baynote_tag=new BNTag(this);}
BNTag.prototype.showWhenReady=function(tag){if(baynote_globals.waitForReady&&!bnResourceManager.getResource(BN_READY_SIGNAL)){bnResourceManager.waitForResource(BN_READY_SIGNAL,function(){tag.showWhenReady(tag);});return;}
var failsafeId=this.getFailsafeResourceId();if(!bnResourceManager.getResource(failsafeId)){bnResourceManager.waitForResource(failsafeId,function(){tag.showWhenReady(tag);},this.getFailsafeResourceAddress(),"img");return;}
var commonId=this.getCommonResourceId();if(!bnResourceManager.getResource(commonId)){bnResourceManager.waitForResource(commonId,function(){tag.showWhenReady(tag);},this.getCommonResourceAddress(),"script");return;}
bnTagManager.show(tag.id);}
BNTag.prototype.noshow=function(){window["bn_tags"][this.id]=this;baynote_tag=new BNTag(this);}
BNTag.prototype.getParam=function(name,defaultValue){var value=this[name];if(typeof(value)=="undefined"||value==null)return defaultValue;else return value;}
if(typeof(baynote_tag)=="undefined"){window["bn_tags"]=new Array();var baynote_tag=new BNTag(null);}
function bnReadySignal(){bnResourceManager.registerResource(BN_READY_SIGNAL);}
function bnCall(resName,methodName,methodArg){var resource=bnResourceManager.getResource(resName);if(!resource){bnResourceManager.waitForResource(resName,function(){bnCall(resName,methodName,methodArg);});return;}
if(typeof(resource)!="object"){return;}
var method=resource[methodName];if(typeof(method)!="function"){return;}
method.call(resource,methodArg);}
//-->
<!-- baynote ends -->
<!-- baynote-guide starts -->
function show_baynote_guide(pagetype) {
	var bn_location_href = window.location.href;
	if (bn_location_href.indexOf("https://") == 0) {
		baynote_tag.server = "https://netsuite-www.baynote.net";
	} else {
		baynote_tag.server = "http://netsuite-www.baynote.net";
	}
	baynote_tag.customerId = "netsuite";
	baynote_tag.code = "www";
	baynote_tag.type="guide";

	if(pagetype == "ContentGuide"){
		baynote_tag.guide = "ContentGuide";
		baynote_tag.listSize = 5;
	}

	baynote_tag.show();
	bnResourceManager.waitForResource("GLResults0", "baynote_waitForGuide(1)");
}

function baynote_isNotEmpty(name) {
	return (typeof(name) != "undefined") && (name != null) && (name != "");
}

function getElementsByClassName(oElm, strTagName, strClassName){
	var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
	var arrReturnElements = new Array();
	strClassName = strClassName.replace(/\-/g, "\\-");
	var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
	var oElement;
	for(var i=0; i<arrElements.length; i++){
		oElement = arrElements[i];
		if(oRegExp.test(oElement.className)){
			arrReturnElements.push(oElement);
		}
	}
	return (arrReturnElements)
}

function baynote_waitForGuide(bn_wait_count) {
           var bn_results = getElementsByClassName(document, "a", "bn_g_result_link");
           if(baynote_isNotEmpty(bn_results)){
                for(var i=0; i<bn_results.length; i++){
					var tmpHref = bn_results[i].getAttribute("href");
					if((bn_results[i].innerHTML).match(/- NetSuite .*/)){
						bn_results[i].innerHTML = bn_results[i].innerHTML.replace(/(.*)- NetSuite .*/, "$1");
					}
				}
			}
           else if(bn_wait_count < 10){
                 bn_wait_count++;
                 setTimeout("baynote_waitForGuide("+bn_wait_count+")", 200);
            }
}
<!-- baynote-guide ends -->
