//Portions are Copyright (c) 2000-2005, Mobular Technologies&#174;, Inc.  All Rights Reserved.
//Mobular and Mobular Technologies are Registered Trademarks of Mobular
//Technologies, Inc.
//All rights reserved.  Unauthorized reproduction prohibited.
//http://www.mobular.com/
//

// Any of the values below can be inserted into the docinfo.txt file in order to customize
// the contact module and footer of an e-document/kit.  These variables also exist at the
// top of the index.html file.  Any value passed in through the docinfo.txt file will override
// an entry defined in the index.html file.  Therefore, the template can be customized specifically
// to a client in the index.html file, but can in turn be overridden on a case-by-case basis
// through the docinfo.txt file.
//
// Note: If a value is defined in the index.html or sent in through the docinfo.txt for a given
// variable, it will cause that particular link to display the e-document/kit.  If you want to
// remove a value that is defined in the index.html (so it will display), pass in the variable
// name and "remove" as the name/value pair in the docinfo.txt file.  For example:
//
//   g_callmenow_link|remove

//var g_orderonline_link = "";
//var g_textchat_link = "";
//var g_requestaquote_link = "";
//var g_callmelater_link = "";
//var g_callmenow_link = "";
//var g_emailus_link = "";
//var g_contact_rc_link = "";
//var g_contact_footer_link = "";
//var g_about_link = "";
//var g_termsofuse_link = "";
//var g_privacy_link = "";
//var g_phone_number = "";
//var g_feeds_link = "";
//var g_contact_module_title = "";

var g_rssSize = "350px";

var g_any_contact_module_links = "";

var g_contact_footer_link  = 'http://www.ibm.com/contact/us/en/';
var g_about_link           = 'http://www.ibm.com/ibm/us/en/';
var g_termsofuse_link      = 'http://www.ibm.com/legal/us/en/';
var g_privacy_link         = 'http://www.ibm.com/privacy/us/en/';
var g_feeds_link	       = 'http://www.ibm.com/ibm/syndication/us/en/';

// Variable set in catchPreview.js if there is a query string on the URL.  Used as a pass through
// in addSurfAid if defined.
var g_saCurrentQueryString = "";

// Pop an alert box with the SurfAid parameter string for
// debugging purposes
var g_alertSurfAid = 0;


//rc_offers rotation config values
var g_max_rc_count = 100;
var g_max_rc_desc_length = 10000;
var g_rc_rotate = 0;
var g_rc_offer_timing = 5000; // In milliseconds.

// Global variables used by the system for right column display.  Not typically (overridden by input values)
var g_rc_currently_rotating = 0;
var g_master_rc_offers = new Array();
var g_active_rc_offers = new Array();
var g_current_rc_offer = -1;
var g_rc_nav_offer_timing = 3000; // In milliseconds.
var g_rc_timeout_id = 0;
var g_rc_nav_timeout_id = 0;
var g_rc_action_description = "Learn more";

//initiate random number class
var rand = new RandomNumberGenerator();


//-----------------------------------------------------------------------------
// Begin - 9.2+ event listeners
//-----------------------------------------------------------------------------

function onEngineViewed() {
	// The values below are used to customize the contact module and footer of the standard e-doc/e-kit.
	// Any of the values below can also be inserted into the docinfo.txt file in order to customize
	// the contact module and footer of a specific e-document/e-kit.  Any value passed in through
	// the docinfo.txt file will override an entry defined here in the index.html file.  Therefore,
	// the template can be customized specifically to a client in the index.html file, but can in
	// turn be overridden on a case-by-case basis through the docinfo.txt file.
	//
	// Note: If a value is defined here in the index.html or sent in through the docinfo.txt for a given
	// variable, it will cause that particular link to display the e-document/e-kit.  If you want to
	// remove a value that is defined in the index.html (so it will display), pass in the variable
	// name and "remove" as the name/value pair in the docinfo.txt file.  For example:
	//
	//   g_callmenow_link|remove
	eengine.g_orderonline_link     = g_orderonline_link;
	eengine.g_callmenow_link       = g_callmenow_link;
	eengine.g_textchat_link        = g_textchat_link;
	eengine.g_requestaquote_link   = g_requestaquote_link;
	eengine.g_callmelater_link     = g_callmelater_link;
	eengine.g_emailus_link         = g_emailus_link;
	eengine.g_contact_rc_link      = g_contact_rc_link;
	eengine.g_contact_footer_link  = g_contact_footer_link;
	eengine.g_about_link           = g_about_link;
	eengine.g_termsofuse_link      = g_termsofuse_link;
	eengine.g_privacy_link         = g_privacy_link;
	eengine.g_feeds_link	       = g_feeds_link;
	eengine.g_phone_number         = g_phone_number;
	eengine.g_contact_module_title = g_contact_module_title;

	var _rebuildCover = false;

	if (window.g_kitCoverMatch) {
		var _re = /\n/g;
		var _ekitcover = g_kitCoverMatch.replace(_re, "");
		if ((new String).trim(_ekitcover) != "") {
			// Override the standard g_ekitCover (eKitCover.html) with the IBM template version g_kitCoverMatch (showkitcovermatch.html)
			eengine.eeUtility.ekitCover = g_kitCoverMatch;
			eengine.eeUtility.ekitCoverItemLayout = g_kitCoverSpread;
			_rebuildCover = true;
		} else {
			// Using the standard g_ekitCover (eKitCover.html)
			//alert('Using standard eKitCover.html.');
		}
	}

	//make sure prtDocsSubtitles array is populated and has items
	if (typeof window.prtDocsSubtitles !== 'undefined'){
		var _altered = [];
		if ( window.prtDocsSubtitles.items ) {
			for (var i = 0; i < window.prtDocsSubtitles.items.length; i++) {
				var _item = window.prtDocsSubtitles.items[i];
				var _doc = _item.document;
				if (binder.kitData.documents.length == 1) {
					_doc = _doc - 1;
				}

				binder.kitData.documents[_doc].description = "<br />" + _item.subtitle + "</span>";

				_altered[_altered.length] = _doc;
			}

			for ( var i=0; i < binder.kitData.documents.length; i++ ) {
				var _isOk = 1;
				for ( var a=0; a < _altered.length; a++ ) {
					if ( _altered[a] == i ) {
						_isOk = 0;
						break;
					}
				}

				if ( _isOk == 1 ) {
					binder.kitData.documents[i].description = '';
				}
				//replace &nbsp;  with actual space char in order to allow title to wrap to another line if to long to fit in cover space
				binder.kitData.documents[i].title = binder.kitData.documents[i].title.replace(/&nbsp;/gi, ' ');
			}
	/*
			for ( var i=1; i < binder.kitData.documents.length; i++ ) {
				var j = i-1;

				//compensate for any &nbsp; in the title
				binder.kitData.documents[i].title = binder.kitData.documents[i].title.replace(/&nbsp;/gi, ' ');

				if (prtDocsSubtitles[j] && (new String).trim(prtDocsSubtitles[j]) != "" ) {
					binder.kitData.documents[i].description = "<br />" + prtDocsSubtitles[j];
				} else {
					binder.kitData.documents[i].description = "";
				}
			}*/
			_rebuildCover = true;
		}
	}else{ //if no subtitle - clean up subtitles
		var docs = eengine.kitData.documents;
		for( var d=0; d <docs.length; d++){
			if(docs[d].description !== 'undefined'){
				docs[d].description = "";
			}
			//replace &nbsp;  with actual space char in order to allow title to wrap to another line if to long to fit in cover space
			docs[d].title = docs[d].title.replace(/&nbsp;/gi, ' ');			
		}
	}
	

	if (_rebuildCover) {
		binder.kitData.documents.shift();
		eengine.covers["3"].assembleDynamicCover();
	}

	// Clean the table of contents of any "no_toc_defined" entries
	for (i=0; i < binder.kitData.documents.length; i++) {
		if (binder.kitData.documents[i].pages[0].toc[0] == "no_toc_defined") {
			binder.kitData.documents[i].pages[0].toc = "";
		}
	}

	if ( document.getElementById('toc_placeholder') ) {
		var _div = document.getElementById('toc_placeholder');
		var _title = _div.innerHTML;
		var _param = {
			buttonText: ''+_title,
			id: 'toc_placeholder',
			buttonTemplate: "<span class=\"dijit dijitReset dijitLeft dijitInline\" dojoAttachEvent=\"onmouseenter:_onMouse,onmouseleave:_onMouse,onmousedown:_onMouse,onclick:_onDropDownClick,onkeydown:_onDropDownKeydown,onblur:_onDropDownBlur,onkeypress:_onKey\" waiRole=\"presentation\"><div class='dijitReset dijitRight' waiRole=\"presentation\"><button class=\"dijitReset dijitStretch  dijitButtonContents ddButtonNode\" type=\"${type}\"dojoAttachPoint=\"focusNode,titleNode\" waiRole=\"button\" waiState=\"haspopup-true,labelledby-${id}_label\"><div class=\"dijitReset dijitInline dijitButtonText\"  dojoAttachPoint=\"containerNode,popupStateNode\" waiRole=\"presentation\"id=\"${id}_label\">${label}</div></button></div></span>"
		};
		new display.dropDownTOC.dropDownTOC(_param, _div);
	}

	//I2U_loadRCOffers();
	//I2U_setContactModuleLinks();
	I2U_setFooterLinks();

//	I2U_updateRC();
	
	//*** Build right column offers ****************************
	var rc = eengine.makeRC();
	if (document.getElementById('dynamicRC')) { 
		document.getElementById('dynamicRC').innerHTML = rc; 
		document.getElementById('dynamicRC').style.visibility = "visible";
	}
	clearTimeout(g_rc_timeout_id);

	//if (g_rc_rotate && g_rc_currently_rotating)
	if (g_rc_rotate && g_rc_currently_rotating && rc_offers.length > g_max_rc_count){
		g_rc_timeout_id = setTimeout("eengine.updateRC()", "" + g_rc_offer_timing);  
	}



	    
	
	recreateShowShow();

	eengine.total_load = 1;
}
eengineConfig.subscribe( "onEngineViewed()" ,"eengine.postProcess.engineviewed");

//-----------------------------------------------------------------------------
// End - 9.2+ event listeners
//-----------------------------------------------------------------------------


//-----------------------------------------------------------------------------
// Begin - IBM specific code to accomodate RSS and their JSON passthrough script
//-----------------------------------------------------------------------------

// This allows access to the rss 'crumb' so that items may be altered and reset before display.
function alterRSSItemLayout(widget, mySession) {
	try {
		// test to make sure items in a given crumb may be accessed.
		if ( mySession.event == 900 ) {
			// access widget itself
			var _w = dojo.widget.widgetIds[widget];

			if ( _w.crumbDescription != '' ) {
				_w.rssCrumbDescription.innerHTML = _w.crumbDescription;
			}

			/*
				Here the actual code to alter the items may be placed.
				In the 'rssCrumb' there are three basic items at this time that are displayed:
				title, description and link. Their attach points are rssCrumbTitle, rssCrumbDescription,
				and rssCrumbLink respectively.

				To alter them, perform whatever mechinations that need doing then call any of the 3 like so:
				_w.rssCrumbTitle.innerHTML = "this is my new widget title";
				or
				var descr = _w.rssCrumbDescription.innerHTML;
				_w.rssCrumbDescription.innerHTML = "Description : " + descr;

				and so on.

			*/

			// cleanup?
			var _num = _w.widgetId.replace( 'dojo_rssCrumb_', '');
			_num = parseInt(_num, 10);

			if ( _num-10 > 0 ) {
				var _final = (_num-10);
				for ( var _i=0; _i < _final; _i++ )
				{
					try {
						var _oldW = dojo.widget.byId('dojo_rssCrumb_'+_i);
						_oldW.destroy();
					} catch (e) {}
				}
			}
		}
	} catch (e) {}
}
eengineConfig.subscribe( "alterRSSItemLayout", "rssCrumb");

// This is a custom function to process the specific rss routine returned by IBM.
function ibmProcessJSON(content) {

	// creates a new reference to the rssJSONModule.
	var jsonParser = new rss.rssJSONModule;

	// IBM transmits part of their JSON structure. The initializers are missing.
	// This provides those.
	var prefix = "var arrayrdm = [ {},";
	prefix += "{";
	prefix += "rssLang: '',";
	prefix += "newsitem: [],";
	prefix += "validate: function() {";
	prefix += "}";
	prefix += "}";
	prefix += "];";
	content = prefix + content;
	try {
		// eval the incoming JS code from them.
		eval(content);
	} catch (e) {}

	// init mobular model
	var _rss = [];

	var channel = {
		version : "2.0",
		language: '',
		title: 'ibm_' + (new Date),
		description: '',
		lastBuildDate: new Date,
		generator: 'ibm.com',
		link: 'http://www.ibm.com/ibm/syndication/',
		items: []
	}

	// convert ibm model to mobular model
	channel.language = arrayrdm[1].rssLang;

	var _params = [
		"title",
		"description",
		"link",
		"guid",
		"date"
	];

	// walk their newsitems and turn them into our items.
	var _news = arrayrdm[1].newsitem;
	for ( var i=0; i < _news.length; i++ ) {
		var _ibm_item = _news[i];

		// map ibm item to mobular item
		var _item = {};
		for ( var p=0; p < _params.length; p++ ) {
			try {
				_item[ _params[p] ] = jsonParser.pullJSONEntry(_ibm_item, _params[p] );
				if (! _item[ _params[p] ] ) {
					_item[ _params[p] ] = '';
				}
			} catch (e) {
				_item[ _params[p] ] = '';
			}
		}

		// assign into channel
		channel.items[channel.items.length] = _item;
	}
	// assign to base rss object
	_rss[_rss.length] = channel;

	// send object into jsonParser, another json object is returned and then sent on through the rest of the processing.
	return jsonParser.processJSONFeed(_rss);
}

// Force an override to one of the two rss feed interfaces. Reference internally is either text/plain or text/xml as
// those are the only two possibilities that can be AJAX'd back.
function overrideInterface(widget, mySession) {
	try {
		if ( mySession.event == 900 ) {
			var _w = dojo.widget.widgetIds[widget];

			// add an override to process their non-standard json code that returns
			_w._feedInterface["text/plain"] = ibmProcessJSON;
		}
	} catch (e) {}
}
eengineConfig.subscribe( "overrideInterface", "rssObj");

function _newGetParameters() {
	// check for feeds inline.
	var reFeeds = /\<feeds\>(.+?)\<\/feeds\>/i;
	var reItem = /(\<item\>(.+?)\<\/item\>)/i;

	var _return = [];

	var ct = document.getElementById('inlineFeed').innerHTML;
	ct = ct.replace(/\n/gi, '');
	if ( reFeeds.test(ct) ) {
		var inner = RegExp.$1;
		var cId = -1;
		while ( reItem.test(inner)) {
			var _itemCt = RegExp.$1;

			var reTitle = /\<title\>(.+)\<\/title\>/i;
			var reLink = /\<link\>(.+)\<\/link\>/i;
			var reDescription = /\<description\>(.+)\<\/description\>/i;
			var repubDate = /\<pubDate\>(.+)\<\/pubDate\>/i;

			if ( reTitle.test(_itemCt) ){
				var _title = RegExp.$1;

				cId++;
				var _itemVal = {
					Id: "rssCrumb" + (cId),
					crumbTitle: _title,
					crumbLink:  '',
					crumbDescription:  '',
					crumbDate:  '',
					crumbGUID: ''
				};

				if ( reLink.test(_itemCt) ){
					_itemVal.crumbLink = RegExp.$1;
				}
				if ( reDescription.test(_itemCt) ){
					_itemVal.crumbDescription = RegExp.$1;
				}
				if ( repubDate.test(_itemCt) ){
					_itemVal.crumbDate = RegExp.$1;
				}

				_return[_return.length] = _itemVal;
			}
			inner = inner.replace(_itemCt, '');
		}

		document.getElementById('inlineFeed').innerHTML = '';
		document.getElementById('inlineFeed').style.height = "1px";
	}
	return _return;
}

function captureInline(widget, mySession) {
	try {
		if ( mySession.event == -900 ) {
			var _w = dojo.widget.widgetIds[widget];
			_w._inlineItems = [];

			var _items = _newGetParameters();
			_w._inlineItems = _items;

			if ( _items.length > 0 ) {
				var _feed = {
					"404": false,
					JSONData: '',
					loaded: true,
					url: "index.html"
				};
				var _json = [{
					title: "inlineFeed",
					items: _items
				}];
				_feed.JSONData = _json;
				_w._inlineFeed = _feed;

				// put in a placeholder
				g_RSSWidget_rssFeeds.push("index.html");
			}
		}
		if ( mySession.event == 901 ) {
			var _w = dojo.widget.widgetIds[widget];
			var _myFeed = _w._inlineFeed;
			var _items = _w._inlineItems;
			var _json = [{
				title: "inlineFeed",
				items: _items
			}];
			_myFeed.JSONData = _json;

			for ( var f=0; f < _w.rssFeeds.length; f++ ) {
				if ( _w.rssFeeds[f].url == 'index.html' ) {
					_w.rssFeeds[f] = _myFeed;

					if ( dojo.widget.byId('rssObj').containerNode.style.height != "1px" ) {
						dojo.widget.byId('rssObj').containerNode.style.height = "1px";
					}
					break;
				}
			}
		}
	} catch (e) {}
}
eengineConfig.subscribe( "captureInline", "rssObj");


// this is a workaround until the full themes system can be implemented.
function injectStyle(widget, mySession) {
	try {
		if ( mySession.event == -900 ) {
			/* add stylesheet code here like so:
				var css = '.rssCrumbBaseMiddle { background-color: #CCC; }';
			*/
			var css = '';
			css += '.rssCrumbImgLink { height: 16px; width: 16px; background: url(images/fw.gif) no-repeat left center; } \n';
			css += 'a.rssCrumbLink:link { text-decoration:none; color:#5c81a7; } \n';
			css += 'a.rssCrumbLink:visited { text-decoration:none; color:#969; } \n ';
			css += 'a.rssCrumbLink:hover { text-decoration:underline; color:#5c81a7; } \n';
			css += '.rssCrumbTitleMiddle { height: 15px; font-family: verdana,arial,sans-serif; font-weight: bold; font-size:10px; padding-bottom: 5px; } \n';
			css += '.rssCrumbMiddleMiddle { height: 0px; margin-bottom: 2px; font-family: verdana,arial,sans-serif; font-size: 10px; } \n';
			css += '.rssSpacerLine { border-bottom: 1px solid #CCCCCC; border-top: 0px solid #CCCCCC; font-size:1px; } \n';
//			css += '.rssCrumbTable { height: 70px; } \n';

			// css strings may be entered
			if ( css != '' ) {
				dojo.html.insertCssText(css);
			}
		}
	} catch (e) {}
}
eengineConfig.subscribe( "injectStyle", "rssCrumb");

//-----------------------------------------------------------------------------
// End - IBM specific code to accomodate RSS and their JSON passthrough script
//-----------------------------------------------------------------------------


//-----------------------------------------------------------------------------
// Begin - Cover page manipulations at startup
//-----------------------------------------------------------------------------

function recreateShowShow() {

	//run old catchPreview Code here in the recreateShowShow
	try {
        eengine.loadRCOffers();

        eengine.show2pg = eengine.g_show2pgDefault;
        eengine.searchType = "AND";
        eengine.loadDropdownMenus();
        eengine.g_saCurrentQueryString = "";

        eengine.setContactModuleLinks();
        eengine.setFooterLinks();

        if (typeof(g_prtDocs) !== "undefined"  && g_prtDocs.length > 1)

        {
          g_solution_type = "kit";
        }
        else
        {
          g_solution_type = "e-document";
        }

        var g_toc_title = "Table of contents";
        var g_blankPagetxt = "<br><br><br><br><span class=\"blank_page\">This page<br>intentionally left  blank</span>";
        var g_animaoff = "<!-- pa_status_start -->Page animation off<!-- pa_status_end -->";
        var g_animaon = "<!-- pa_status_start -->Page animation on<!-- pa_status_end -->";
        var g_cover = "Cover";
        var g_spacecover = " cover";
        var g_searchfor = "Search for ";
        var g_previoustxt = "Previous";
        var g_nexttxt = "Next";
        var g_downloadthetxt = "Download the ";
        var g_linknotdefinetxt = " link is not defined at the bottom of the index.html file.";
        var g_helptxt = "Help";
        var g_printtxt = "Print";
        var g_singpgtxt = "Single page view";
        var g_twopgtxt = "Two page view";
        var g_ecathometxt = "E-catalog home";

        // Warning message for doClickThrough2 from inside the static exe
        var g_exeWarningMessage = 'Accessing content external to the e-document requires that you be online.\n\nNote: You will only be shown this message once.';
        var g_exeWarningMessageShown = false;

        // Warning/error messages
        var g_Messages = new Array(
          "You have reached the beginning of the e-document." ,
          "You have reached the end of the e-document.",
          "You have reached the beginning of the kit.",
          "You have reached the end of the kit.",
          "Your page number is out of range for the current document.  There are only [[total_pages_in_doc]] pages in the [[doc_name]].",
          "Your page range is invalid.  You should have a single page number or an upper and lower bound separated by a dash (e.g. 3-5).\n\nYou entered '[[page_range]]'.  Please reenter your page range and try again.",
          "Please enter a valid page range.",
          "Your page number/range is outside of the range for the current document.  There are only [[total_pages_in_doc]] pages in the [[doc_name]] document.\n\nYou entered '[[page_range]]'.  Please reenter your page range and try again.",
          "There is a ten (10) page limit for low resolution print jobs.  Please reduce your print range and try again.",
          "The calling location for a call to doStandardClickThrough must be either 'ContactModule' or 'Footer'.  Please fix the showglobalrc.html and/or footer.html accordingly.  Exiting."
        );


        // Clean out anything that has been know to appear in the e-document database that
        // is incorrect.

        // Database cleaner array
		var g_db_fixes = new Array(
			"i 5|i5",
			"i series|iseries",
			"x series|xseries",
			"&#222;|fi",
			"&#151; |",
			"&#170;|&trade;",
			"&#208;|-",
			"&#223;|fl",
			"&#151;|-"
        );

		if(typeof(database) !== "undefined"){
			// Database cleaner code
			for(var i=0;i<database.length;i++){

				for (var j=0;j<g_db_fixes.length;j++){

					var fix_tokens = g_db_fixes[j].split('|');
					database[i] = database[i].replace(eval('/' + fix_tokens[0] + '/g'), fix_tokens[1]);
				}
			}
		}

        // gather location, if 'location' bar is not there a blank
        // string is returned
        var t = new String(""+parent.location);


        // turn tracking off (value = 1).. IBM request
        eengine.track = 1;

        // provide custom/generic url for tracking if desired.
        eengine.track_url_gen = "";

        // warn user if needed.
        eengine.wrnUsr();

        // check for '?'.   If present, process name / value pairs.
        if (t.indexOf("?") != -1) {

             // For some unknown reason, some the SMB group starts their query string with
             // an ampersand, which should only be a separator.  If you see this situation,
             // fix it and remove this leading ampersand.
             t = t.replace("?&", "?");

             // strip off html file name
             t = t.substring(t.indexOf("?")+1);
             t = unescape(t);

             // clear out any Image#.x or Image#.y that can confuse split functions.
             var iChk = /(Image[0123456789]+)\.([xy]+)=/gi;
             t=t.replace( iChk, "$1_$2=" );

             var iChkS = /(search[0123456789]+)\.([xy]+)=/gi;
             t=t.replace( iChkS, "$1_$2=" );

             var iChkG = /(go[0123456789]+)\.([xy]+)=/gi;
             t=t.replace( iChkG, "$1_$2=" );

             // stores the value taken from the name value pair
             var paren1 = "";
             var dCT = 0;

             // this is the only special regular expression..
             // this is the catch-all that runs most href engine commands.
             var objRegExpBtn   = /[\?]*where=(.+)[&]*/;

             var _prm = t.split('&');

             // remove any stray '?' items that would prevent parsing
             for ( var i=0; i < _prm.length; i++ ) {
                 if ( _prm[i].indexOf("?") > 0 ) {
                   _prm[i] = _prm[i].substring( _prm[i].indexOf("?")+1 );
                 }
             }

             var frmObj = new Array();
             for ( var i=0; i<document.forms.length; i++ ) {
                if ( document.forms[i].name )
                  frmObj[frmObj.length] = "document."+document.forms[i].name;

             }

             // check for a staticframe if necessary
             // This should work for a framed and non framed build
             if ( parent ) {
               if ( parent.staticFrame ) {
                 if ( parent.staticFrame.document ) {
                   for ( var i=0; i<parent.staticFrame.document.forms.length; i++ ) {
                      if ( parent.staticFrame.document.forms[i].name )
                        frmObj[frmObj.length] = "parent.staticFrame.document."+parent.staticFrame.document.forms[i].name;

                   }
                 }
               }
             }

             // process the url string from the user action...
             for ( var j=0; j < frmObj.length; j++ ) {
                for ( var i=0; i < _prm.length; i++ ) {

                     var elem = _prm[i].split('=');
                     var _obj = frmObj[j] + "." + elem[0];

                     if ( eval(_obj) ) {
                        // pull action sequence from form tag
                        var act = pullAction( frmObj[j] );

                        switch ( eval(_obj + ".type" ) ) {
                          case "select-one":
                             // process combo box like prodGroup, brandGroup
                             if ( act != "" ) {
                               cbxFillValue( eval(_obj), elem[1]);
                               if ( paren1 == "" ) paren1 = act;
                             }

                             // this is the default choice for a drop down
                             if ( paren1 == "" ) paren1 = "eengine.writePage(document.prodForm.prodGroup.options[document.prodForm.prodGroup.selectedIndex].value)";

                             break;
                          case "text":
                             // process text box... like query, pagenumber and so on

                             // compensate if the user has entered a single tick mark
                             t=0;
      		       if ( elem[1].indexOf("'") != -1 ) dCT = 1;

                             paren1 = processQuery(elem[1], _obj, act);

                             break;
                        }

                     }

                }
             }

             // final check.. look for standard where= commands
             if (objRegExpBtn.test(t)) {
                 paren1 = RegExp.$1;
                 if ( paren1.toLowerCase().indexOf("doclickthrough") != -1 ) dCT = 1;
             }

             // clear out any pesky encoded characters.
             if ( dCT == 0 ) {
               paren1 = unescape(paren1);
               var stopspot = paren1.indexOf("?");
               if(stopspot != -1){paren1 = paren1.substring(0,stopspot);}
             }

             // hand the query string to the global parameter that SurfAid will use if present.
             eengine.g_saCurrentQueryString = t;

	     // if blank.. must be the start.. assume this and push b level
             if ( paren1 == '' ) {
             //   eengine.writePage2(1);
             // DKR/2005-04-08...For IBM this needs to call showShow2 not writePage2(1)
                eengine.showShow();
             }

             // Special checks to enable a few functions for IBM.
             if ( (paren1.toLowerCase().indexOf("writepage2") != -1) ||
                  (paren1.toLowerCase().indexOf("writeseries") != -1) ||
                  (paren1.toLowerCase().indexOf("godetail") != -1) ||
                  (paren1.toLowerCase().indexOf("goproductlist") != -1) ||
                  (paren1.toLowerCase().indexOf("showfeaturedoffers") != -1) ||
                  (paren1.toLowerCase().indexOf("gotodocumentbynumber") != -1) ||
                  (paren1.toLowerCase().indexOf("alertsurfaid") != -1)
                ) {
                eval(paren1);
             }

             // go ahead and run paren1.. no matter what is in it
             // since by this time it contains a reference to something in the
             // engine
             // IBM requested we disable this.  Since they're not using S2F, Chris says no problem.
             //eval(paren1);
        }
          else {
          eengine.showShow();
        }
	} catch (e) {
		//alert("CatchPreview ERROR = " + e);
	}


}

function pullAction(f_obj) {

   var r_val = "";

   var act = eval(f_obj + ".action");
   if ( act != "" ) {
      var act_ar = act.split('=');
      if ( act_ar.length > 1 ) r_val = act_ar[1];
   }

   return r_val;
}

// processes any search requests
function processQuery(_p, obj, act) {

   // replace any spaces
   if ( _p != "" ) {
      var regrep = /\+/ig
      _p = _p.replace( regrep, ' ' );
   }

   // push value back into text box
   eval(obj + ".value = _p");

   // compensate if the user has entered a single tick mark
   if ( _p.indexOf("'") != -1 ) {
     _p = "eengine.search(\""+_p+"\", '*')";
   } else {
     _p = "eengine.search('"+_p+"', '*')";
   }

   if ( act )
     if ( act != "" )
       _p = act;

   return _p;
}

// this was added to accomodate the capture of the drop down
// box values when exploding out of an Outlook preview window.
function cbxFillValue(cbx, val) {
  if ( val != "" ) {
    // remove '+' if present
    var regrep = /\+/ig

	 // replace and spaces
	 val = val.replace( regrep, ' ' );

	 // reverse any encoding
	 val = unescape(val);

       for (var ii=0; ii < cbx.length; ii++) {
	   var cbxVal = cbx.options[ii].value;
	   if ( cbxVal.toUpperCase() == val.toUpperCase() ) {
	     cbx.selectedIndex = ii;
	     break;
         }
       }
  }
}


function I2U_setCurrentLocationInfo(n)
{

	var doc_num = "";
	var doc_name = "";
	var start_page_num = "";
	var end_page_num = "";
  
	var section_name = "";
	var doc_section_page = "";
	var section_start_page_num = "";
 
	g_last_page_absolute = g_current_page_absolute;
	g_current_page_absolute = n;
  
	if (g_current_page_absolute > 0)
	{
		//alert ("Inside setCurrentLocationInfo...New page:" + g_current_page_absolute + "  Last page:" + g_last_page_absolute);
      
		// Set the document related global variables based on the input 
		// absolute page number.
    
		for (var i=0; i < g_prtDocs.length; i++)
		{
			var doc_info = g_prtDocs[i].split('|');
    
			doc_num = doc_info[0];
			doc_name = doc_info[1];
			start_page_num = doc_info[2];
			end_page_num = doc_info[3];
      
			pdf_filesize = prtDocsFileSizes[i];
      
			if (parseInt(n) <= parseInt(end_page_num))
			{
				break;
			}
		}
    
		g_current_document_number = parseInt(doc_num);
		g_current_document_name = doc_name;
		g_current_document_start_page = parseInt(start_page_num);
		g_current_document_end_page = parseInt(end_page_num);
		g_current_document_page = parseInt(n) - parseInt(start_page_num) + 1;
		g_current_document_page_count = parseInt(end_page_num) - parseInt(start_page_num) + 1;
		g_current_document_pdf_filesize = pdf_filesize;
    
		var rec_num = g_current_page_absolute - 1;
		var _db = this.db[rec_num].split('|');
		g_current_document_page_title =_db[0];
    
		// Set the section related global variables based on the input 
		// absolute page number.
    
		g_current_section_name = "";
		g_current_section_start_page = 1;
    
		for (var i=0; i < g_TocRef.length; i++)
		{
			var section_info = g_TocRef[i].split('|');
    
			doc_num = section_info[0];
			section_start_page_num = section_info[1];
			section_name = section_info[2];
      
			if (doc_num == g_current_document_number)
			{
				if (g_current_document_page >= parseInt(section_start_page_num))
				{
					g_current_section_name = section_name;
					g_current_section_start_page = parseInt(section_start_page_num) + parseInt(g_current_document_start_page) - 1;
				}
				else
				{
					break;
				}
			}
		}
	}
	else
	{
		// Reset all variables to their initial values
        
		g_current_page_absolute = 0;
		g_current_document_name = "";
		g_current_document_number = 0;
		g_current_document_start_page = 0;
		g_current_document_end_page = 0;
		g_current_document_page = 0;
		g_current_section_name = "";
		g_current_section_start_page = 0;
    
		g_last_page_absolute = 0;
    }
  
	var t_string = "";
	t_string += "g_current_page_absolute: \t\t" + g_current_page_absolute + "\n";
	t_string += "\n";
	t_string += "g_current_document_number: \t" + g_current_document_number + "\n";
	t_string += "g_current_document_name: \t\t" + g_current_document_name + "\n";
	t_string += "g_current_document_start_page: \t" + g_current_document_start_page + "\n";
	t_string += "g_current_document_end_page: \t" + g_current_document_end_page + "\n";
	t_string += "g_current_document_page: \t\t" + g_current_document_page + "\n";
	t_string += "\n";
	t_string += "g_current_section_name: \t\t" + g_current_section_name + "\n";
	t_string += "g_current_section_start_page: \t" + g_current_section_start_page + "\n";
	//alert (t_string);  
}

// *************************************
//Clear keyword if it is the default
function resetForm() {
   parent.searchFrame.document.searchForm.reset();
}

function I2U_doClickThrough2(theurl, _poph, _popw, _fw) 
{
	// Execute the click through
	//this.executeClickThrough(theurl, _poph, _popw, _fw);
	var t_pdf = this._pdf;
	this._pdf = 1;
	this.doClickThrough(theurl, _poph, _popw, _fw);
	this._pdf = t_pdf;
}

var total_load = 1;


//-----------------------------------------------------------------------------
// End - Cover page manipulations at startup
//-----------------------------------------------------------------------------


//-----------------------------------------------------------------------------
// Begin - Utility functions (right column std links, footer links, 4D S2F, etc.)
//-----------------------------------------------------------------------------

function I2U_searchIBM(form) {

	// we are wanting to run a search across IBM's own web site..
	// call their search page and pass the value in from 'q' to seed the search
	var url = "http://www.ibm.com/search?en=utf&v=11&lang=en&cc=us&q=" + form.q.value;

	this.doClickThrough(url, 600, 800, 2);

	return false;
}

// Note:  This version of showForward is specifically for IBM where Send to Friend is handled by
//        the Circle/4D application.
function I2U_showForward2()
{
	var url = g_showForward;
	url = url.replace("\n",'');

	var title = encodeURL(g_engineTitle);

	var t_baseUrl = baseUrl.replace(/(.*)(\/document)/, "$1");

	url += "?url=" + t_baseUrl + "&title=" + title;

	this.doClickThrough( url, 480, 780, 2);
	//this.reporting.trackAction(100, 'ClickThrough', this.cno, "SendToFriend");
}

function I2U_doStandardClickThrough(item, calling_location)
{
	// Note:  Calling location should be either ContactModule or Footer.

	var url = "";
	var surfaid_page = "";
	var surfaid_qkwd = "";
	var surfaid_qresult = null;

	var window_height = 600;
	var window_width  = 1000;

	if (calling_location.toLowerCase() != "contactmodule" && calling_location.toLowerCase() != "footer")
	{
		var t_message = g_Messages[9];
		alert (t_message);
		return 0;
	}

	surfaid_page = calling_location;

	switch (item.toLowerCase())
	{
		case "orderonline":
			url           = this.g_orderonline_link;
			surfaid_qkwd  = "OrderOnline";
			break;

		case "callmenow":
			url           = this.g_callmenow_link;
			surfaid_qkwd  = "CallMeNow";
			break;

		case "textchat":
			url           = this.g_textchat_link;
			surfaid_qkwd  = "TextChat";
			window_height = 220;
			window_width  = 600;
			break;

		case "requestaquote":
			url           = this.g_requestaquote_link;
			surfaid_qkwd  = "RequestAQuote";
			break;

		case "callmelater":
			url           = this.g_callmelater_link;
			surfaid_qkwd  = "CallMeLater";
			break;

		case "emailus":
			url           = this.g_emailus_link;
			surfaid_qkwd  = "EmailUs";
			break;

		case "contact":
			if (calling_location.toLowerCase() == "footer")
			{
				url           = this.g_contact_footer_link;
			}
			else
			{
				url           = this.g_contact_rc_link;
			}
			surfaid_qkwd  = "Contact";
			break;

		case "legal":
			url           = this.g_legal_link;
			surfaid_qkwd  = "Legal";
			break;

		case "about":
			url           = this.g_about_link;
			surfaid_qkwd  = "About";
			break;

		case "termsofuse":
			url           = this.g_termsofuse_link;
			surfaid_qkwd  = "TermsOfUse";
			break;

		case "privacy":
			url           = this.g_privacy_link;
			surfaid_qkwd  = "Privacy";
			break;

		case "feeds":
			url           = this.g_feeds_link;
			surfaid_qkwd  = "IBMFeeds";
			break;
	}

	if ((new String).trim(url) != "")
	{
		this.reporting.trackAction(100, surfaid_page, this.cno, surfaid_qkwd);
		this.doClickThrough(url, window_height, window_width, 2);
	}
	else
	{
		alert(item + g_linknotdefinetxt);
	}

}

function I2U_setContactModuleLinks()
{
	var standard_links = new Array(
		"g_orderonline_link",
		"g_callmenow_link",
		"g_textchat_link",
		"g_requestaquote_link",
		"g_callmelater_link",
		"g_emailus_link",
		"g_contact_rc_link",
		"g_phone_number",
		"g_contact_module_title",
		"g_any_contact_module_links"
	);

	if (window.g_global_rc) {
		var content = g_global_rc;

		eengine.g_any_contact_module_links = "";

		var obj = /\n/ig;
		content = content.replace ( obj, "temporaryreplaceoflinefeeds" );

		var t_parm = "";
		var l_var = "";
		var g_var = "";

		for (var i=0; i < standard_links.length; i++)
		{
			t_parm = (new String).trim(standard_links[i]);
			l_var = (new String).trim(eval(t_parm));
			g_var = (new String).trim(eval("eengine." + t_parm));

			if (l_var != '')
			{
				if (l_var.toLowerCase() != 'remove')
				{
					g_var = l_var;
				}
				else
				{
					g_var = '';
				}
			}

			if (g_var != '')
			{
				content = content.replace (eval("/\\<\\!\\-\\-\\s+" + t_parm + "(.*?)\\-\\-\\>/ig"), "$1");
				if (t_parm != "g_contact_module_title") { eengine.g_any_contact_module_links = "true"; }

				var ev = "eengine." + t_parm + "='" + g_var + "'";
				eval(ev);
			}
		}

		if ((new String).trim(eengine.g_contact_module_title) != "")
		{
			obj = /\[\[g_contact_module_title\]\]/ig;
			content = content.replace ( obj, eengine.g_contact_module_title );
		}
		else
		{
			obj = /\[\[g_contact_module_title\]\]/ig;
			content = content.replace ( obj, "&nbsp;" );
		}

		if ((new String).trim(eengine.g_phone_number) != "")
		{
			obj = /\[\[g_phone_number\]\]/ig;
			content = content.replace ( obj, eengine.g_phone_number );
		}

		var obj = /temporaryreplaceoflinefeeds/ig;
		content = content.replace ( obj, "\n" );

		// The portal will remove any line that sets the g_global_rc variable before it inserts in
		// the showglobalrc.html.  Therefore, put the if (true) in the line to fake out the portal
		// and have it leave this line alone.
		if (true) { g_global_rc = content; }

		if (document.getElementById('globalRC')) {
			//append g_global_rc to existing global content.
			document.getElementById('globalRC').innerHTML += g_global_rc;
			}

		//Build "Chat Now" link using ibm v16 standards. Code somewhat modified from original code given.
		if(document.getElementById('Chatnow_placeholder')){
			var skill = g_chatnow_skill;
			var srcTC = g_chatnow_srcTC;

			var srcURL = "&SESSIONVAR!pgURL=" + escape(location.protocol+'//'+window.location.hostname+window.location.pathname);
			var srcTitle = "&SESSIONVAR!pgTitle=" + escape(document.title.replace(/\+/g,' '));
			var lpRandomNumber = new Date().getTime();

			var chatdiv_content = "";
			chatdiv_content += "<a class=\"smallplainlink\" href=\"#\" target=\"chat3815120\"";
			chatdiv_content += " onclick=\"javascript:window.open('//sales.liveperson.net/hc/3815120/?cmd=file&file=visitorWantsToChat&site=3815120"+srcURL+srcTitle+srcTC+"&SESSIONVAR!skill="+skill+"&waitTime=0&referrer="+escape(document.location)+"','chat3815120','height=450,width=390,status=no,location=no,toolbar=no,directories=no,menubar=no,resizable=yes,scrollbars=auto');return false;\" >";
			chatdiv_content += g_chatnow_txt + " </a>";

			document.getElementById('Chatnow_placeholder').innerHTML = chatdiv_content;
		}
	}
}

function I2U_setFooterLinks()
{
	var standard_links = new Array(
		"g_contact_footer_link",
		"g_about_link",
		"g_termsofuse_link",
		"g_privacy_link",
		"g_feeds_link"
	);

	var content = g_brandFooter;

	eengine.g_any_contact_module_links = "";

	var obj = /\n/ig;
	content = content.replace ( obj, "temporaryreplaceoflinefeeds" );

	var t_parm = "";
	var l_var = "";
	var g_var = "";

	for (var i=0; i < standard_links.length; i++)
	{
		t_parm = (new String).trim(standard_links[i]);
		l_var = (new String).trim(eval(t_parm));
		g_var = (new String).trim(eval("eengine." + t_parm));

		if (l_var != '')
		{
			if (l_var.toLowerCase() != 'remove')
			{
				g_var = l_var;
			}
			else
			{
				g_var = '';
			}
		}

		if (g_var != '')
		{
			content = content.replace (eval("/\\<\\!\\-\\-\\s+" + t_parm + "(.*?)\\-\\-\\>/ig"), "$1");
			eengine.g_any_contact_module_links = "true";

			var ev = "eengine." + t_parm + "='" + g_var + "'";
			eval(ev);

		}
	}

	var obj = /temporaryreplaceoflinefeeds/ig;
	content = content.replace ( obj, "\n" );

	g_brandFooter = content;

	if (document.getElementById('footer')) { document.getElementById('footer').innerHTML = g_brandFooter; }
    if (document.getElementById('ibm-footer')) { document.getElementById('ibm-footer').style.visibility = "visible"; }
}

//-----------------------------------------------------------------------------
// End - Utility functions
//-----------------------------------------------------------------------------



//-----------------------------------------------------------------------------
// Begin - Right column promotion functions (content from Excel spreadsheet)
//-----------------------------------------------------------------------------

// Normally for replacing columns and labels in the category display.
// could be used by other functions as needed.
function I2U_manageLabels( content, line, f ) {

     // perform swap out for series data
     for ( var i=0; i < line.length; i++ ) {
        // this is to shove out a message
        var lbl = eval("/(\\[\\[lbl=(.+|col[0123456789]+[\\-0123456789]*|.+)\\]\\])/gi");

        // if good, then process user message to push onto page, if the given
        // condition is true.
        if ( lbl.test(content) ) {
            var otr = RegExp.$1;
            var llst = RegExp.$2.split('|');

            // pos is position in lbl parameter list-array
            var pos = 3;
            // check for a range of columns or a single column

            if ( ( llst[1].indexOf("-") != -1 ) || ( llst[1] == ("col"+i) ) ) {
               var s = i;
               var e = i+1;
               // seed (s)tart and (e)nd if a range of columns
               if ( llst[1].indexOf("-") != -1 ) {
                 var lne = llst[1].split('-');
                 s = parseInt( lne[0].substring( 3 ), 10);
                 e = parseInt( lne[1], 10 );
               }

               // perform test for given condition
               for ( var k=s; k < e; k++ ) {
                 if ( ( eval( "line["+k+"] "+llst[2] ) ) || ( llst[2] == "*" ) ) {
                    pos = 0;
                    break;
                 }
               }

               // reset so we don't miss anything
               j=0;
               content = content.replace( otr, llst[pos] );
            }
        }

        // if we want to skip the column swap.. f will have a value.
        if (! f ) {
          // if blank, put 'none' in.
          var col = line[i];
          if ( col == "" ) {
            col = "None";
          }

          // swap out any $ for &#036; to avoid a bug in NN6 and Opera 7.23
          col = col.replace("$", "&&#036;" );
          col = col.replace("&&", "&" );

          // swap out columns
          content = content.replace( eval("/\\[\\[col"+i+"\\]\\]/gi") , col);
        }
     }

     return content;
}


// RSS feed functions for right column promotions
function I2U_loadRCOffers() {

	var proxy 				= "http://www-941.ibm.com/RSS/readxml.php";
	var proxy_parms			= "?id=1&ttl=100&url=";
	var proxy_type 			= "&type=JSON";
	var skip_mobular_proxy 	= "&proxy=1";

	var _loc = new String(""+parent.location);
	if (_loc.indexOf("?") != -1) { _loc = _loc.substr(0,_loc.indexOf("?")) }

	if (window.rc_offers) {
		// If the rc_offers array exists, then the build was done through the white, IBM portal.

		// Make a copy of the rcoffers array for use when processing the dynamic portion of the
		// right column promotions.
		var t_rc_offers = new Array();
		copyArray(rc_offers, t_rc_offers);
		eval('rc_offers = new Array()');

		// Take any RSS feeds out of the rc_offers array and push them into the standard
		// RSS variable -- g_RSSWidget_rssFeeds -- and rebuild the offers with any entries from the input file

		for (var i=0; i < t_rc_offers.length; i++) {
			var line = t_rc_offers[i].split('|');

			if (line[7].toLowerCase().indexOf('.rss') == line[7].length - 4 ||
				line[7].toLowerCase().indexOf('.xml') == line[7].length - 4 ||
				line[7].toLowerCase().indexOf('http') == 0) {

				var feed = "";
				if (line[7].toLowerCase().indexOf('http') == 0) {
					feed = line[7];
				} else {
					feed = _loc + line[7];
				}

				feed = proxy + proxy_parms + feed + proxy_type;
				if (_loc.indexOf("mobular.net") == -1 && _loc.indexOf("10.1.1.") == -1 && _loc.indexOf("10.2.1.") == -1 && _loc.indexOf("localhost") == -1) {
					feed += skip_mobular_proxy;
				}
				g_RSSWidget_rssFeeds.push(feed);
			} else {
				rc_offers[rc_offers.length] = t_rc_offers[i];
			}
		}
    } else {
		// If the rc_offers array does not exist, then the build was done through the purple portal.
		// However, the IBM proxy still needs to be dealt with.
		for (var i=0; i < g_RSSWidget_rssFeeds.length; i++) {
			var feed = "";
			feed = g_RSSWidget_rssFeeds[i];

			if (feed.indexOf(proxy) == -1) {
				feed = proxy + proxy_parms + feed + proxy_type;
			}

			if (_loc.indexOf("mobular.net") == -1 && _loc.indexOf("10.1.1.") == -1 && _loc.indexOf("10.2.1.") == -1 && _loc.indexOf("localhost") == -1) {
				feed += skip_mobular_proxy;
			}

			g_RSSWidget_rssFeeds[i] = feed;

		}
	}
}



// create the right hand column with the featured offers
function I2U_makeRC() {

	// alert('Inside makeRC...');

	var tmp_rc = "";
	var final_rc = "";
	
	copyArray (rc_offers, g_master_rc_offers);
	this.rebuildRCOffersArray();

	if (rc_offers.length > 0) {

		// var randomnumbervalue = random(0, rc_offers.length - 1);
		var rc_start = (g_rc_rotate && rc_offers.length > g_max_rc_count ? random(
				0, rc_offers.length - 1)
				: 0)
		var rc_limit = (rc_offers.length < g_max_rc_count ? rc_offers.length
				: g_max_rc_count)

		for ( var i = rc_start; i < rc_start + rc_limit; i++) {

			var k = i;
			if (k >= rc_offers.length) {
				k = i - rc_offers.length;
			} else if (k < 0) {
				k = i + rc_offers.length;
			}

			var line = rc_offers[k].split('|');

			tmp_rc = g_rc;
			for ( var j = 0; j < line.length; j++) {
				var val = line[j];

				// Certain action/engine calls in the RightColumnOffers do not
				// need to be fully defined.
				// If the entry starts with "http://", it is an external URL so
				// wrap it in a doClickThrough2.
				// If the entry is simply a number, assume it is a page number
				// and call writePage2.
				if (val.indexOf("http://") == 0 || val.indexOf("https://") == 0) {
					val = "eengine.doClickThrough2('" + val
							+ "',600,800,2);return false;";
				} else {
					var tst_field = parseInt(val);
					if ((j > 8) && (!isNaN(tst_field))) {
						val = "eengine.writePage2('" + val + "');return false;";
					}
				}

				// clean up template
				tmp_rc = this.manageLabels(tmp_rc, line, 1);

				// swap out data
				// tmp_rc = tmp_rc.replace("[[col"+j+"]]", val);
				tmp_rc = tmp_rc.replace(eval("/\\[\\[col" + j + "\\]\\]/gi"),
						val);

			}

			final_rc += tmp_rc;

			g_current_rc_offer = k;
			copyArray(rc_offers, g_active_rc_offers);

		}

	}

	// check for any legal tags
	final_rc = this.cleanContent(final_rc);

	return final_rc;

}

function I2U_rebuildRCOffersArray() {

	var mon_abbr = new Array("Jan", "Feb", "Mar", "April", "May", "June",
			"July", "Aug", "Sept", "Oct", "Nov", "Dec");

	rc_offers.length = 0;

	for ( var i = 0; i < g_master_rc_offers.length; i++) {
		var line = g_master_rc_offers[i].split('|');
		// make sure the key matched

		var keys_from_input_file = line[0].split(',');

		for ( var j = 0; j < keys_from_input_file.length; j++) {
			// now we check date range.
			// dates[0] = start date
			// dates[1] = end date
			var dates = new Array();

			// position 1 is start date, position 2 is end date in rc_offers db
			// line
			for ( var k = 1; k < 3; k++) {
				// check to see if the date needs conversion.
				// it could be coming in various ways.

				// split the date
				var date_array = new Array();
				var divider = '-';
				var y = 0;
				var m = 1;
				var d = 2;
				if (line[k].indexOf("/") != -1) {
					// col 0 = mm
					// col 1 = dd
					// col 2 = yyyy
					y = 2;
					m = 0;
					d = 1;
					divider = '/';
				}

				date_array = line[k].split(divider);

				if (date_array[2].indexOf(" ") != -1) {
					date_array[2] = date_array[2].substring(0, date_array[2]
							.indexOf(" "));
				}

				// rebuild date in the format we need .. we need dd mon yyyy
				var tmp_date = (date_array[d] + " "
						+ mon_abbr[parseInt(date_array[m], 10) - 1] + " " + date_array[y]);

				dates[dates.length] = new Date(Date.parse(tmp_date));

			}

			var now = new Date();

			if ((now.valueOf() > dates[0].valueOf())
					&& (now.valueOf() < dates[1].valueOf())) {
				rc_offers[rc_offers.length] = g_master_rc_offers[i];
			}
		}

	}

}


function I2U_updateRC() {
	// alert('Updating rc...');

	var tmp_rc = "";
	var final_rc = "";

	// There is a situation where if you minimize IE and then return to the
	// e-doc/e-kit,
	// the whole right column is now missing. The content is still present in
	// the div
	// tag; however, it is not displayed. The line below forces a redraw of this
	// section.
	if (document.all) {
		// document.getElementById('globalRC').innerHTML =
		// document.getElementById('globalRC').innerHTML;
		// document.getElementById('globalRC').style.visibility = "visible";
	}

	if (rc_offers.length > 0) {

		if (g_rc_rotate) {
			next_rc = g_current_rc_offer + 1;
		} else {
			next_rc = 0;
		}

		var loop_count = (rc_offers.length > g_max_rc_count ? g_max_rc_count
				: rc_offers.length)

		for ( var i = next_rc; i < next_rc + loop_count; i++) {

			var k = i;
			if (k >= rc_offers.length) {
				k = i - rc_offers.length;
			} else if (k < 0) {
				k = i + rc_offers.length;
			}

			var line = rc_offers[k].split('|');

			tmp_rc = g_rc;
			for ( var j = 0; j < line.length; j++) {
				var val = line[j];

				// Certain action/engine calls in the RightColumnOffers do not
				// need to be fully defined.
				// If the entry starts with "http://", it is an external URL so
				// wrap it in a doClickThrough2.
				// If the entry is simply a number, assume it is a page number
				// and call writePage2.
				if (val.indexOf("http://") == 0 || val.indexOf("https://") == 0) {
					val = "eengine.doClickThrough2('" + val
							+ "',600,800,2);return false;";
				} else {
					var tst_field = parseInt(val);
					if ((j > 8) && (!isNaN(tst_field))) {
						val = "eengine.writePage2('" + val + "');return false;";
					}
				}

				// clean up template
				tmp_rc = this.manageLabels(tmp_rc, line, 1);

				// swap out data
				// tmp_rc = tmp_rc.replace("[[col"+j+"]]", val);
				tmp_rc = tmp_rc.replace(eval("/\\[\\[col" + j + "\\]\\]/gi"),
						val);

			}

			final_rc += tmp_rc;

			g_current_rc_offer = k;
			copyArray(rc_offers, g_active_rc_offers);

		}

	}

	// check for any legal tags
	final_rc = this.cleanContent(final_rc);

	if (document.getElementById('dynamicRC')) {
		document.getElementById('dynamicRC').innerHTML = final_rc;
	}

	if (g_rc_rotate && g_rc_currently_rotating) {
		g_rc_timeout_id = setTimeout("eengine.updateRC()", ""
				+ g_rc_offer_timing);
	}

}


function I2U_rcNavShow()
{

  if (g_rc_rotate && rc_offers.length > g_max_rc_count)
  {
  
    clearTimeout(g_rc_nav_timeout_id);
    
    // CHECK FOR MICROSOFT DOM
    if (document.all) 
    {
  
      var rc_nav_x = 0;
      rc_nav_x = document.all.dynamicRC.offsetLeft;
      document.all.rc_nav.style.left = rc_nav_x;
  
      var rc_nav_y = 0;
      rc_nav_y = document.all.dynamicRC.offsetTop;
      rc_nav_y = rc_nav_y - 40;
      document.all.rc_nav.style.top = rc_nav_y;
  
      document.all.rc_nav.style.visibility = "visible";
    
    }
    // CHECK FOR LEVEL 1 DOM
    else if (document.getElementById)
    {
    
      var noPx = document.childNodes ? 'px' : 0;
  
      var rc_nav_x = 0;
      rc_nav_x = document.getElementById('dynamicRC').offsetLeft;
    
      document.getElementById("rc_nav").style.left = rc_nav_x + noPx;
      document.getElementById("rc_nav").style.pixelLeft = rc_nav_x;
  
      var rc_nav_y = 0;
      rc_nav_y = document.getElementById('dynamicRC').offsetTop;
      rc_nav_y = rc_nav_y - 40;
      document.getElementById("rc_nav").style.top = rc_nav_y + noPx;
      document.getElementById("rc_nav").style.pixelTop = rc_nav_y;
      
      document.getElementById("rc_nav").style.visibility = "visible";
  
    }
    
    g_rc_nav_timeout_id = setTimeout("eengine.rcNavHide()", "" + g_rc_nav_offer_timing);  
  
  }
  
}

function I2U_rcNavHide()
{

  document.getElementById("rc_nav").style.visibility = "hidden";

}

function I2U_rcNavClick(parm)
{

  clearTimeout(g_rc_timeout_id);
  clearTimeout(g_rc_nav_timeout_id);
  
  switch (parm)
  {  
    case 0:
      
      if (g_rc_rotate && g_rc_currently_rotating)
      {
        g_rc_currently_rotating = 0;
        document.getElementById("rc_center_img").src = "images/rc_start.gif";
        document.getElementById("rc_center_img").alt = "Start rotation";
      }
      else
      {
        g_rc_currently_rotating = 1;
        document.getElementById("rc_center_img").src = "images/rc_pause.gif";      
        document.getElementById("rc_center_img").alt = "Pause rotation";     
        g_rc_timeout_id = setTimeout("eengine.updateRC()", "" + g_rc_offer_timing);  
      }
           
      break;
    
    case -1:
   
      //g_current_rc_offer = g_current_rc_offer - g_max_rc_count - 1;
      g_current_rc_offer = g_current_rc_offer - (2 * g_max_rc_count);
      eengine.updateRC();
      break;
    
    case 1:
    
      //g_current_rc_offer = g_current_rc_offer + g_max_rc_count - 1;
      eengine.updateRC();
      break;
    
  }
    
  g_rc_nav_timeout_id = setTimeout("eengine.rcNavHide()", "" + g_rc_nav_offer_timing);  

}



// this performs some post-process routines to the search results
// any time some data needs cleaning.. run it through here
// Such items as dynamic links being inserted and so on, go in here.
function I2U_cleanContent(content) {

	// make link for success lease
	var l1 = "SuccessLease&reg; for Small Business";
	var l2 = "<a class=\"small\" href=\"Javascript:void(0)\" onclick = \"eengine.doClickThrough2('http://www-132.ibm.com/content/home/store_IBMPublicUSA/en_US/buy.html',600,800,2); return false;\">"
			+ l1 + "</a>";

	content = content.replace(l1, l2);

	// make links for footnotes
	for ( var i = 0; i < 1001; i++) {
		var old_link = "";
		var link_hand = "";
		if (content.indexOf("<sup>[<a href='javascript:HandleFootnote(" + i
				+ ")'>" + i + "</a>]</sup>") != -1) {

			link_hand = "<sup>[<a class=\"small\" href=\"Javascript:void(0)\" onclick = \"eengine.HandleFootnote("
					+ i + "); return false;\">";
			link_hand += i + "</a>]</sup>";

			old_link = "\\<sup\\>\\[\\<a href\\=\\'javascript\\:HandleFootnote\\("
					+ i + "\\)\\'\\>" + i + "\\<\\/a\\>\\]\\<\\/sup\\>";

		}

		// make objects for replacement.
		var obj_old = eval("/" + old_link + "/gi");

		content = content.replace(obj_old, link_hand);
	}

	return content;
}



//-----------------------------------------------------------------------------
//End - Right column promotion functions
//-----------------------------------------------------------------------------


//-----------------------------------------------------------------------------
// Begin - Miscellaneous functions
//-----------------------------------------------------------------------------


//The RandomNumberGenerator (RNG) with the function 
//'NextRandomNumber()' and the function 
//'RandomNumberGenerator()' is an implementation of 
//the Park-Miller algorithm. (See 'Random Number Generators: Good 
//Ones Are Hard to Find', by Stephen K. Park and Keith W. Miller, 
//Communications of the ACM, 31(10):1192-1201, 1988.) The JScript 
//version was written by David N. Smith of IBM's T. J. Watson 
//Research Center. Mr. Smith notes that his version has not been 
//subjected to the rigorous testing required of a mission-critical RNG.

//You might have noticed that JScript's Math object includes 
//a built-in random() method. The version presented here should 
//work as well as, if not better than, the built-in implementations, 
//and will work uniformly on all platforms.
function NextRandomNumber() {
	var hi = this.seed / this.Q;
	var lo = this.seed % this.Q;
	var test = this.A * lo - this.R * hi;
	if (test > 0)
		this.seed = test;
	else
		this.seed = test + this.M;
	return (this.seed * this.oneOverM);
}

function RandomNumberGenerator() {
	var d = new Date();
	this.seed = 2345678901 + (d.getSeconds() * 0xFFFFFF)
			+ (d.getMinutes() * 0xFFFF);
	this.A = 48271;
	this.M = 2147483647;
	this.Q = this.M / this.A;
	this.R = this.M % this.A;
	this.oneOverM = 1.0 / this.M;
	this.next = NextRandomNumber;
	return this;
}

function random(lrn, urn) {
	  // Random LowerRange Number (lrn)
	  // Random UpperRange Number (urn)
	  // return Math.round((urn - lrn + 1) * rand.next() + lrn);
	
	  return Math.floor((urn - lrn + 1) * rand.next() + lrn);
}

function copyArray(fromarray, toarray) {

	for (i=0; i<fromarray.length; i++)
	{
		toarray[i] = fromarray[i];
	}
}

function encodeURL (str)
{
	var special_characters = new Array(
                                     " |20",
                                     "\\$|24",
                                     "&|26",
                                     "\\+|2B",
                                     ",|2C",
                                     "/|2F",
                                     ":|3A",
                                     ";|3B",
                                     "=|3D",
                                     "\\?|3F",
                                     "@|40",
                                     "\"|22",
                                     "<|3C",
                                     ">|3E",
                                     "#|23",
                                     "{|7B",
                                     "}|7D",
                                     "`|60"
                                    );
	for (var i=0; i < special_characters.length; i++)
	{
		var character_pair = special_characters[i].split('|');
		str = str.replace( eval("/" + character_pair[0] + "/gi") , "%" + character_pair[1]);
	}

	return str;
}


//-----------------------------------------------------------------------------
// End - Miscellaneous functions
//-----------------------------------------------------------------------------



var g_phone_number = "Call us at <br /><strong>1-877-IBM-ACCESS or (426-2223)</strong><br />Mention code: <br /><strong>609AL05W</strong>";

var g_printdetail = "";
    g_printdetail += "\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
    g_printdetail += "\n ";
    g_printdetail += "\n   <tr><td valign=\"middle\"><table border=\"0\"><tr><td><center><img src=\"images/[[col3]]\" border=\"1\"></center></td></tr></table></td></tr>";
    g_printdetail += "\n ";
    g_printdetail += "\n </table>";

var g_global_rc = "";
    g_global_rc += "\n <!--	BEGIN GLOBAL SECTION OF RIGHT COLUMN -->";
    g_global_rc += "\n ";
    g_global_rc += "\n <!-- g_any_contact_module_links";
    g_global_rc += "\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"150\">";
    g_global_rc += "\n ";
    g_global_rc += "\n   <tr>";
    g_global_rc += "\n     <td valign=\"top\"><img src=\"images/c.gif\" alt=\"\" height=\"6\" width=\"1\" border=\"0\" /></td>";
    g_global_rc += "\n   </tr>";
    g_global_rc += "\n ";
    g_global_rc += "\n   <tr>";
    g_global_rc += "\n     <td class=\"v14-header-1-small\">[[g_contact_module_title]]</td>";
    g_global_rc += "\n   </tr>";
    g_global_rc += "\n ";
    g_global_rc += "\n   <tr>";
    g_global_rc += "\n     <td>";
    g_global_rc += "\n       <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"v14-gray-table-border\">";
    g_global_rc += "\n ";
    g_global_rc += "\n 	    <tr>";
    g_global_rc += "\n 	      <td width=\"150\" class=\"no-padding\">";
    g_global_rc += "\n 	        <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"148\">";
    g_global_rc += "\n               <tr valign=\"top\">";
    g_global_rc += "\n                 <td class=\"iltbp\"><img src=\"images/face.gif\" height=\"36\" width=\"36\" alt=\"\"/></td>";
    g_global_rc += "\n                 <td class=\"espl\"><p class=\"smgraytext\">Easy ways to get the answers you need</p></td>";
    g_global_rc += "\n               </tr>";
    g_global_rc += "\n 			  <tr><td colspan=\"2\" class=\"dotted\"><img src=\"images/c.gif\" width=\"1\" height=\"1\" alt=\"\" /></td></tr>";
    g_global_rc += "\n ";
    g_global_rc += "\n             </table>";
    g_global_rc += "\n           </td>";
    g_global_rc += "\n         </tr>";
    g_global_rc += "\n ";
    g_global_rc += "\n -->";
    g_global_rc += "\n ";
    g_global_rc += "\n ";
    g_global_rc += "\n         <!-- g_orderonline_link";
    g_global_rc += "\n         <tr>";
    g_global_rc += "\n           <td><br />";
    g_global_rc += "\n             <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
    g_global_rc += "\n               <tr valign=\"top\">";
    g_global_rc += "\n                 <td><img height=\"21\" src=\"images/arrow_rd.gif\" width=\"21\" alt=\"\"/></td>";
    g_global_rc += "\n                 <td class=\"spl ipt\">";
    g_global_rc += "\n                   <b>";
    g_global_rc += "\n                     <a href=\"index.html\" onclick=\"if(total_load==1){eengine.doStandardClickThrough('OrderOnline','ContactModule')}else{alert(loadWarn)} return false;\" class=\"smallplainlink\">";
    g_global_rc += "\n                       BladeCenter S 3D tour";
    g_global_rc += "\n                     </a>";
    g_global_rc += "\n                   </b>";
    g_global_rc += "\n                 </td>";
    g_global_rc += "\n               </tr>";
    g_global_rc += "\n             </table>";
    g_global_rc += "\n           </td>";
    g_global_rc += "\n         </tr>";
    g_global_rc += "\n ";
    g_global_rc += "\n         <tr><td><img height=\"5\" src=\"images/c.gif\" width=\"1\" alt=\"\"/></td></tr>";
    g_global_rc += "\n         -->";
    g_global_rc += "\n ";
    g_global_rc += "\n ";
    g_global_rc += "\n ";
    g_global_rc += "\n ";
    g_global_rc += "\n         <!-- g_callmenow_link";
    g_global_rc += "\n         <tr>";
    g_global_rc += "\n           <td>";
    g_global_rc += "\n             <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
    g_global_rc += "\n               <tr valign=\"top\">";
    g_global_rc += "\n                 <td><img height=\"21\" src=\"images/phone_rd.gif\" width=\"21\" alt=\"\"/></td>";
    g_global_rc += "\n                 <td class=\"spl ipt\">";
    g_global_rc += "\n                   <b>";
    g_global_rc += "\n                     <a href=\"index.html\" onclick=\"if(total_load==1){eengine.doStandardClickThrough('CallMeNow','ContactModule')}else{alert(loadWarn)} return false;\" class=\"smallplainlink\">";
    g_global_rc += "\n                       Call me now";
    g_global_rc += "\n                     </a>";
    g_global_rc += "\n                   </b>";
    g_global_rc += "\n                 </td>";
    g_global_rc += "\n               </tr>";
    g_global_rc += "\n             </table>";
    g_global_rc += "\n           </td>";
    g_global_rc += "\n         </tr>";
    g_global_rc += "\n ";
    g_global_rc += "\n         <tr><td><img height=\"5\" src=\"images/c.gif\" width=\"1\" alt=\"\"/></td></tr>";
    g_global_rc += "\n         -->";
    g_global_rc += "\n ";
    g_global_rc += "\n ";
    g_global_rc += "\n ";
    g_global_rc += "\n ";
    g_global_rc += "\n ";
    g_global_rc += "\n         <!-- g_callmelater_link";
    g_global_rc += "\n         <tr>";
    g_global_rc += "\n           <td>";
    g_global_rc += "\n             <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
    g_global_rc += "\n               <tr valign=\"top\">";
    g_global_rc += "\n                 <td><img height=\"21\" src=\"images/phone_rd.gif\" width=\"21\" alt=\"\"/></td>";
    g_global_rc += "\n                 <td class=\"spl ipt\">";
    g_global_rc += "\n                   <b>";
    g_global_rc += "\n                     <a href=\"index.html\" onclick=\"if(total_load==1){eengine.doStandardClickThrough('CallMeLater','ContactModule')}else{alert(loadWarn)} return false;\" class=\"smallplainlink\">";
    g_global_rc += "\n                       Call me later";
    g_global_rc += "\n                     </a>";
    g_global_rc += "\n                   </b>";
    g_global_rc += "\n                 </td>";
    g_global_rc += "\n               </tr>";
    g_global_rc += "\n             </table>";
    g_global_rc += "\n           </td>";
    g_global_rc += "\n         </tr>";
    g_global_rc += "\n ";
    g_global_rc += "\n         <tr><td><img height=\"5\" src=\"images/c.gif\" width=\"1\" alt=\"\"/></td></tr>";
    g_global_rc += "\n         -->";
    g_global_rc += "\n ";
    g_global_rc += "\n ";
    g_global_rc += "\n ";
    g_global_rc += "\n ";
    g_global_rc += "\n ";
    g_global_rc += "\n         <!-- g_textchat_link";
    g_global_rc += "\n         <tr>";
    g_global_rc += "\n           <td>";
    g_global_rc += "\n             <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
    g_global_rc += "\n               <tr valign=\"top\">";
    g_global_rc += "\n                 <td><img height=\"21\" src=\"images/chat_rd.gif\" width=\"21\" alt=\"\"/></td>";
    g_global_rc += "\n                 <td class=\"spl ipt\">";
    g_global_rc += "\n                   <b>";
    g_global_rc += "\n                     <a href=\"index.html\" onclick=\"if(total_load==1){eengine.doStandardClickThrough('TextChat','ContactModule')}else{alert(loadWarn)} return false;\" class=\"smallplainlink\">";
    g_global_rc += "\n                       Online text chat";
    g_global_rc += "\n                     </a>";
    g_global_rc += "\n                   </b>";
    g_global_rc += "\n                 </td>";
    g_global_rc += "\n               </tr>";
    g_global_rc += "\n             </table>";
    g_global_rc += "\n           </td>";
    g_global_rc += "\n         </tr>";
    g_global_rc += "\n ";
    g_global_rc += "\n         <tr><td><img height=\"5\" src=\"images/c.gif\" width=\"1\" alt=\"\"/></td></tr>";
    g_global_rc += "\n         -->";
    g_global_rc += "\n ";
    g_global_rc += "\n ";
    g_global_rc += "\n ";
    g_global_rc += "\n ";
    g_global_rc += "\n         <!-- g_requestaquote_link";
    g_global_rc += "\n         <tr>";
    g_global_rc += "\n           <td>";
    g_global_rc += "\n             <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
    g_global_rc += "\n               <tr valign=\"top\">";
    g_global_rc += "\n                 <td><img height=\"21\" src=\"images/arrow_rd.gif\" width=\"21\" alt=\"\"/></td>";
    g_global_rc += "\n                 <td class=\"spl ipt\">";
    g_global_rc += "\n                   <b>";
    g_global_rc += "\n                     <a href=\"index.html\" onclick=\"if(total_load==1){eengine.doStandardClickThrough('RequestAQuote','ContactModule')}else{alert(loadWarn)} return false;\" class=\"smallplainlink\">";
    g_global_rc += "\n                       Request a quote";
    g_global_rc += "\n                     </a>";
    g_global_rc += "\n                   </b>";
    g_global_rc += "\n                 </td>";
    g_global_rc += "\n               </tr>";
    g_global_rc += "\n             </table>";
    g_global_rc += "\n           </td>";
    g_global_rc += "\n         </tr>";
    g_global_rc += "\n ";
    g_global_rc += "\n         <tr><td><img height=\"5\" src=\"images/c.gif\" width=\"1\" alt=\"\"/></td></tr>";
    g_global_rc += "\n         -->";
    g_global_rc += "\n ";
    g_global_rc += "\n ";
    g_global_rc += "\n ";
    g_global_rc += "\n ";
    g_global_rc += "\n ";
    g_global_rc += "\n         <!-- g_emailus_link";
    g_global_rc += "\n         <tr>";
    g_global_rc += "\n           <td>";
    g_global_rc += "\n             <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
    g_global_rc += "\n               <tr valign=\"top\">";
    g_global_rc += "\n                 <td><img height=\"21\" src=\"images/email_rd.gif\" width=\"21\" alt=\"\"/></td>";
    g_global_rc += "\n                 <td class=\"spl ipt\">";
    g_global_rc += "\n                   <b>";
    g_global_rc += "\n                     <a href=\"index.html\" onclick=\"if(total_load==1){eengine.doStandardClickThrough('EmailUs','ContactModule')}else{alert(loadWarn)} return false;\" class=\"smallplainlink\">";
    g_global_rc += "\n                       Email us";
    g_global_rc += "\n                     </a>";
    g_global_rc += "\n                   </b>";
    g_global_rc += "\n                 </td>";
    g_global_rc += "\n               </tr>";
    g_global_rc += "\n             </table>";
    g_global_rc += "\n           </td>";
    g_global_rc += "\n         </tr>";
    g_global_rc += "\n ";
    g_global_rc += "\n         <tr><td><img height=\"5\" src=\"images/c.gif\" width=\"1\" alt=\"\"/></td></tr>";
    g_global_rc += "\n         -->";
    g_global_rc += "\n ";
    g_global_rc += "\n ";
    g_global_rc += "\n ";
    g_global_rc += "\n ";
    g_global_rc += "\n ";
    g_global_rc += "\n         <!-- g_contact_rc_link";
    g_global_rc += "\n         <tr>";
    g_global_rc += "\n           <td>";
    g_global_rc += "\n             <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
    g_global_rc += "\n               <tr valign=\"top\">";
    g_global_rc += "\n                 <td><img height=\"21\" src=\"images/arrow_rd.gif\" width=\"21\" alt=\"\"/></td>";
    g_global_rc += "\n                 <td class=\"spl ipt\">";
    g_global_rc += "\n                   <b>";
    g_global_rc += "\n                     <a href=\"index.html\" onclick=\"if(total_load==1){eengine.doStandardClickThrough('Contact','ContactModule')}else{alert(loadWarn)} return false;\" class=\"smallplainlink\">";
    g_global_rc += "\n                       Contact us";
    g_global_rc += "\n                     </a>";
    g_global_rc += "\n                   </b>";
    g_global_rc += "\n                 </td>";
    g_global_rc += "\n               </tr>";
    g_global_rc += "\n             </table>";
    g_global_rc += "\n           </td>";
    g_global_rc += "\n         </tr>";
    g_global_rc += "\n ";
    g_global_rc += "\n         <tr><td><img height=\"5\" src=\"images/c.gif\" width=\"1\" alt=\"\"/></td></tr>";
    g_global_rc += "\n         -->";
    g_global_rc += "\n ";
    g_global_rc += "\n ";
    g_global_rc += "\n ";
    g_global_rc += "\n ";
    g_global_rc += "\n ";
    g_global_rc += "\n <!-- g_any_contact_module_links";
    g_global_rc += "\n         <tr><td><img height=\"1\" src=\"images/c.gif\" width=\"1\" alt=\"\"/></td></tr>";
    g_global_rc += "\n -->";
    g_global_rc += "\n ";
    g_global_rc += "\n         <!-- g_phone_number";
    g_global_rc += "\n         <tr><td class=\"lgray\"><img height=\"1\" src=\"images/c.gif\" width=\"1\" alt=\"\"/></td></tr>";
    g_global_rc += "\n ";
    g_global_rc += "\n         <tr>";
    g_global_rc += "\n           <td>";
    g_global_rc += "\n             <p class=\"smgraytext\">[[g_phone_number]]</b></p>";
    g_global_rc += "\n           </td>";
    g_global_rc += "\n         </tr>";
    g_global_rc += "\n         -->";
    g_global_rc += "\n ";
    g_global_rc += "\n <!-- g_any_contact_module_links";
    g_global_rc += "\n       </table>";
    g_global_rc += "\n     </td>";
    g_global_rc += "\n   </tr>";
    g_global_rc += "\n </table>";
    g_global_rc += "\n -->";
    g_global_rc += "\n ";
    g_global_rc += "\n <br />";
    g_global_rc += "\n ";
    g_global_rc += "\n <!-- END GLOBAL SECTION OF RIGHT COLUMN -->";

var g_rc = "";
    g_rc += "\n [[lbl=<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"150\"><tr><td class=\"v14-header-4-small\" onmouseover=\"eengine.rcNavShow();\">[[col7]]</td></tr></table>|col7|!= ' '| ]]";
    g_rc += "\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"v14-gray-table-border\" width=\"150\">";
    g_rc += "\n     [[lbl=<tr><td colspan=\"3\" onmouseover=\"eengine.rcNavShow();\"><img src=\"images/[[col3]]\" onerror=\"file='[[col3]]';if(eengine.exe == 1){this.src=eengine.getExeImageName(file,0);}\" width=\"[[col5]]\" height=\"[[col6]]\" alt=\"[[col4]]\" /></td></tr><tr><td colspan=\"3\"><img alt=\"\" height=\"1\" src=\"images/gray_rule.gif\" width=\"148\"/></td></tr>|col3|!= ' '| ]]";
    g_rc += "\n 	<tr><td colspan=\"3\"><img alt=\"\" height=\"5\" src=\"images/c.gif\" width=\"1\" /></td></tr>";
    g_rc += "\n 	[[lbl=<tr><td colspan=\"3\" onmouseover=\"eengine.rcNavShow();\"><p class=\"small\">[[col16]]</p></td></tr>|col16|!= ''| ]]";
    g_rc += "\n     [[lbl=<tr><td colspan=\"3\" class=\"dotted\"><img src=\"images/c.gif\" width=\"1\" height=\"1\" alt=\"\" /></td></tr>|col16|!= ''| ]]";
    g_rc += "\n     [[lbl=<tr><td><img src=\"images/c.gif\" width=\"18\" height=\"5\" alt=\"\" /></td>|col16|!= ''| ]]";
    g_rc += "\n     [[lbl=<td><img src=\"images/c.gif\" width=\"124\" height=\"5\" alt=\"\" /></td>|col16|!= ''| ]]";
    g_rc += "\n     [[lbl=<td><img src=\"images/c.gif\" width=\"5\" height=\"5\" alt=\"\" /></td></tr>|col16|!= ''| ]]";
    g_rc += "\n 	[[lbl=<tr><td class=\"npl\" align=\"right\" valign=\"top\" width=\"17\"><img alt=\"\" height=\"16\" src=\"images/fw.gif\" width=\"16\" /></td><td width=\"124\"><a class=\"smallplainlink\" href=\"index.html\" target=\"newwin\" onclick=\"target='';this.href='#';[[col9]];setTimer();return false;\">[[col8]]</a></td><td width=\"5\">&nbsp;</td></tr>|col9|!= ' '| ]]";
    g_rc += "\n 	[[lbl=<tr><td align=\"right\" valign=\"top\" width=\"17\"><img alt=\"\" height=\"16\" src=\"images/fw.gif\" width=\"16\" /></td><td width=\"124\"><a class=\"smallplainlink\" href=\"index.html\" target=\"newwin\" onclick=\"target='';this.href='#';[[col11]];setTimer();return false;\">[[col10]]</a></td><td width=\"5\">&nbsp;</td></tr>|col11|!= ' '| ]]";
    g_rc += "\n 	[[lbl=<tr><td align=\"right\" valign=\"top\" width=\"17\"><img alt=\"\" height=\"16\" src=\"images/fw.gif\" width=\"16\" /></td><td width=\"124\"><a class=\"smallplainlink\" href=\"index.html\" target=\"newwin\" onclick=\"target='';this.href='#';[[col13]];setTimer();return false;\">[[col12]]</a></td><td width=\"5\">&nbsp;</td></tr>|col13|!= ' '| ]]";
    g_rc += "\n 	[[lbl=<tr><td align=\"right\" valign=\"top\" width=\"17\"><img alt=\"\" height=\"16\" src=\"images/fw.gif\" width=\"16\" /></td><td width=\"124\"><a class=\"smallplainlink\" href=\"index.html\" target=\"newwin\" onclick=\"target='';this.href='#';[[col15]];setTimer();return false;\">[[col14]]</a></td><td width=\"5\">&nbsp;</td></tr>|col15|!= ' '| ]]";
    g_rc += "\n 	<tr><td colspan=\"3\"><img alt=\"\" height=\"5\" src=\"images/c.gif\" width=\"1\" /></td></tr>";
    g_rc += "\n </table>";
    g_rc += "\n <br />";

var g_actionStackNone = "";
    g_actionStackNone += "\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
    g_actionStackNone += "\n   <tr>";
    g_actionStackNone += "\n 	<td valign=\"bottom\">";
    g_actionStackNone += "\n       <img alt=\"Back\" height=\"16\" src=\"images/bk_bold_gray.gif\" width=\"16\"/>";
    g_actionStackNone += "\n     </td>";
    g_actionStackNone += "\n 	<td valign=\"top\">";
    g_actionStackNone += "\n       <span class=\"breadcrumb\" style=\"text-decoration:none; color:#dddddd;\"><b>Back</b></span>";
    g_actionStackNone += "\n     </td>";
    g_actionStackNone += "\n 	<td valign=\"top\">";
    g_actionStackNone += "\n       &nbsp;<span class=\"divider\" style=\"text-decoration:none; font-size:11\">|</span>&nbsp;";
    g_actionStackNone += "\n     </td>";
    g_actionStackNone += "\n 	<td valign=\"top\">";
    g_actionStackNone += "\n       <span class=\"breadcrumb\" style=\"text-decoration:none; color:#dddddd;\"><b>Forward</b></span>";
    g_actionStackNone += "\n     </td>";
    g_actionStackNone += "\n 	<td valign=\"bottom\">";
    g_actionStackNone += "\n       <img alt=\"Forward\" height=\"16\" src=\"images/fw_bold_gray.gif\" width=\"16\"/>";
    g_actionStackNone += "\n     </td>";
    g_actionStackNone += "\n   </tr>";
    g_actionStackNone += "\n </table>";

var g_actionStackBottom = "";
    g_actionStackBottom += "\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
    g_actionStackBottom += "\n   <tr>";
    g_actionStackBottom += "\n 	<td valign=\"bottom\">";
    g_actionStackBottom += "\n       <img alt=\"Back\" height=\"16\" src=\"images/bk_bold_gray.gif\" width=\"16\"/>";
    g_actionStackBottom += "\n     </td>";
    g_actionStackBottom += "\n 	<td valign=\"top\">";
    g_actionStackBottom += "\n       <span class=\"breadcrumb\" style=\"text-decoration:none; color:#dddddd;\"><b>Back</b></span>";
    g_actionStackBottom += "\n     </td>";
    g_actionStackBottom += "\n 	<td valign=\"top\">";
    g_actionStackBottom += "\n       &nbsp;<span class=\"divider\" style=\"text-decoration:none; font-size:11\">|</span>&nbsp;";
    g_actionStackBottom += "\n     </td>";
    g_actionStackBottom += "\n 	<td valign=\"top\">";
    g_actionStackBottom += "\n       <a href=\"Forward\" onclick=\"if(total_load==1){eengine.goForward()}else{alert(loadWarn)}return false;\" onmouseout=\"window.status='';return true;\" onmouseover=\"window.status='Forward';return true;\" class=\"breadcrumb\" style=\"color:#000000;\"><b>Forward</b></a>";
    g_actionStackBottom += "\n     </td>";
    g_actionStackBottom += "\n 	<td valign=\"bottom\">";
    g_actionStackBottom += "\n       <a href=\"Forward\" onclick=\"if(total_load==1){eengine.goForward()}else{alert(loadWarn)}return false;\" onmouseout=\"window.status='';return true;\" onmouseover=\"window.status='Forward';return true;\"><img alt=\"Forward\" height=\"16\" src=\"images/fw_bold_black.gif\" width=\"16\"/></a>";
    g_actionStackBottom += "\n     </td>";
    g_actionStackBottom += "\n   </tr>";
    g_actionStackBottom += "\n </table>";

var g_actionStackTop = "";
    g_actionStackTop += "\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
    g_actionStackTop += "\n   <tr>";
    g_actionStackTop += "\n 	<td valign=\"bottom\">";
    g_actionStackTop += "\n       <a href=\"Back\" onclick=\"if(total_load==1){eengine.goBack()}else{alert(loadWarn)}return false;\" onmouseout=\"window.status='';return true;\" onmouseover=\"window.status='Back';return true;\"><img alt=\"Back\" height=\"16\" src=\"images/bk_bold_black.gif\" width=\"16\"/></a>";
    g_actionStackTop += "\n     </td>";
    g_actionStackTop += "\n 	<td valign=\"top\">";
    g_actionStackTop += "\n       <a href=\"Back\" onclick=\"if(total_load==1){eengine.goBack()}else{alert(loadWarn)}return false;\" onmouseout=\"window.status='';return true;\" onmouseover=\"window.status='Back';return true;\" class=\"breadcrumb\" style=\"color:#000000;\"><b>Back</b></a>";
    g_actionStackTop += "\n     </td>";
    g_actionStackTop += "\n 	<td valign=\"top\">";
    g_actionStackTop += "\n       &nbsp;<span class=\"divider\" style=\"text-decoration:none; font-size:11\">|</span>&nbsp;";
    g_actionStackTop += "\n     </td>";
    g_actionStackTop += "\n 	<td valign=\"top\">";
    g_actionStackTop += "\n       <span class=\"breadcrumb\" style=\"text-decoration:none; color:#dddddd;\"><b>Forward</b></span>";
    g_actionStackTop += "\n     </td>";
    g_actionStackTop += "\n 	<td valign=\"bottom\">";
    g_actionStackTop += "\n       <img alt=\"Forward\" height=\"16\" src=\"images/fw_bold_gray.gif\" width=\"16\"/>";
    g_actionStackTop += "\n     </td>";
    g_actionStackTop += "\n   </tr>";
    g_actionStackTop += "\n </table>";

var g_actionStackMid = "";
    g_actionStackMid += "\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
    g_actionStackMid += "\n   <tr>";
    g_actionStackMid += "\n 	<td valign=\"bottom\">";
    g_actionStackMid += "\n       <a href=\"Back\" onclick=\"if(total_load==1){eengine.goBack()}else{alert(loadWarn)}return false;\" onmouseout=\"window.status='';return true;\" onmouseover=\"window.status='Back';return true;\"><img alt=\"Back\" height=\"16\" src=\"images/bk_bold_black.gif\" width=\"16\"/></a>";
    g_actionStackMid += "\n     </td>";
    g_actionStackMid += "\n 	<td valign=\"top\">";
    g_actionStackMid += "\n       <a href=\"Back\" onclick=\"if(total_load==1){eengine.goBack()}else{alert(loadWarn)}return false;\" onmouseout=\"window.status='';return true;\" onmouseover=\"window.status='Back';return true;\" class=\"breadcrumb\" style=\"color:#000000;\"><b>Back</b></a>";
    g_actionStackMid += "\n     </td>";
    g_actionStackMid += "\n 	<td valign=\"top\">";
    g_actionStackMid += "\n       &nbsp;<span class=\"divider\" style=\"text-decoration:none; font-size:11\">|</span>&nbsp;";
    g_actionStackMid += "\n     </td>";
    g_actionStackMid += "\n 	<td valign=\"top\">";
    g_actionStackMid += "\n       <a href=\"Forward\" onclick=\"if(total_load==1){eengine.goForward()}else{alert(loadWarn)}return false;\" onmouseout=\"window.status='';return true;\" onmouseover=\"window.status='Forward';return true;\" class=\"breadcrumb\" style=\"color:#000000;\"><b>Forward</b></a>";
    g_actionStackMid += "\n     </td>";
    g_actionStackMid += "\n 	<td valign=\"bottom\">";
    g_actionStackMid += "\n       <a href=\"Forward\" onclick=\"if(total_load==1){eengine.goForward()}else{alert(loadWarn)}return false;\" onmouseout=\"window.status='';return true;\" onmouseover=\"window.status='Forward';return true;\"><img alt=\"Forward\" height=\"16\" src=\"images/fw_bold_black.gif\" width=\"16\"/></a>";
    g_actionStackMid += "\n     </td>";
    g_actionStackMid += "\n   </tr>";
    g_actionStackMid += "\n </table>";

var g_kitCoverMatch = "";
    g_kitCoverMatch += "\n <!--	Begin content -->";
    g_kitCoverMatch += "\n <style type=\"text/css\">";
    g_kitCoverMatch += "\n <!--";
    g_kitCoverMatch += "\n .style1 {";
    g_kitCoverMatch += "\n 	color: #0000FF;";
    g_kitCoverMatch += "\n 	font-weight: bold;";
    g_kitCoverMatch += "\n }";
    g_kitCoverMatch += "\n -->";
    g_kitCoverMatch += "\n </style>";
    g_kitCoverMatch += "\n ";
    g_kitCoverMatch += "\n <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"794\">";
    g_kitCoverMatch += "\n   <tr>";
    g_kitCoverMatch += "\n <!-- Begin ALT TAG Section -->";
    g_kitCoverMatch += "\n     <td colspan=\"3\" align=\"center\"><img src=\"images/stg_bladecenter_july2009.jpg\" border=\"0\" alt=\"Introducing the new energy-efficient IBM BladeCenter HS22 Blade Server\" usemap=\"#hero_map\" /></td>";
    g_kitCoverMatch += "\n <!-- End ALT TAG Section -->";
    g_kitCoverMatch += "\n   </tr>";
    g_kitCoverMatch += "\n   <tr>";
    g_kitCoverMatch += "\n     <td width=\"97\"><img src=\"images/c.gif\" width=\"97\" height=\"1\" alt=\"\" /> </td>";
    g_kitCoverMatch += "\n     <td width=\"600\">";
    g_kitCoverMatch += "\n 	  <table border=\"0\" cellspacing=\"0\" cellpadding=\"8\" width=\"600\" valign=\"top\">";
    g_kitCoverMatch += "\n         <tr>";
    g_kitCoverMatch += "\n           <td colspan=\"2\" style=\"border-bottom:1px solid black;\">";
    g_kitCoverMatch += "\n <p><a href=\"http://syndication.intel.com/DistributeModule.aspx?ppc_cid=WTM_00799099101&contentType=0\" target=\"00799099101undefined\"  onclick=\"JavaScript:win=window.open(&#39;http://syndication.intel.com/DistributeModule.aspx?ppc_cid=WTM_00799099101&amp;contentType=0&#39;,&#39;00799099101undefined&#39;,&#39;resizable=1,scrollbars=0,width=360,height=220&#39;);win.focus();\"><img src='images/xeon_a_pi_m_rgb_58x90_eng.gif' alt='intel Xeon inside. powerful. Intelligent.' width='58' height='90' hspace=\"5\" border='0' align=\"left\" class='ibm-inset' /></a>Introducing the new generation, x86 IBM BladeCenter&reg; HS22 blade server featuring the blazing fast Intel&reg; Xeon&reg; Processor 5500 Series and the revolutionary new IBM server architecture built for performance and energy efficiency. The HS22 offers outstanding performance, flexible configuration options and simple management in an efficient server designed to run a broad range of workloads. This new and affordable blade server is the ideal solution to effectively meet your mid-size business objectives while reducing cost and realizing optimal return on investment.  IBM x86 servers also available in rack and tower options to meet all your IT requirements.</p>";
    g_kitCoverMatch += "\n <p>Additional IBM BladeCenter HS22 Advantages:";
    g_kitCoverMatch += "\n <ul>";
    g_kitCoverMatch += "\n   <li>The IBM BladeCenter HS22 can provide  payback in as little as 3 months <a href=\"http://www-03.ibm.com/innovation/us/smarterplanet/notice/index.shtml\" target=\"_blank\"><font color=\"#0000FF\">*</font></a></li>";
    g_kitCoverMatch += "\n   <li>IBM BladeCenter HS22 Blades with BladeCenter S chassis can decrease hardware costs by 64%, software costs by 81%, operating costs by 20%, and energy costs by 91%.</li>";
    g_kitCoverMatch += "\n <li>Compared to 3yr old servers, the HS22 server is up to 90% more energy efficient at the same or better performance.</li>";
    g_kitCoverMatch += "\n <li>Consolidating with the HS22 helps reduce power and cooling costs while freeing up capacity within your existing data centers, postponing the need for new data centers.</li>";
    g_kitCoverMatch += "\n <li>Built-in IBM Systems Director Active Energy Manager&trade; enables you to measure and monitor power usage</li>";
    g_kitCoverMatch += "\n <li>HS22 with VMware also gives you the power to virtualize your business-critical applications</li></ul>";
    g_kitCoverMatch += "\n </p>";
    g_kitCoverMatch += "\n 	     </td>";
    g_kitCoverMatch += "\n         </tr>";
    g_kitCoverMatch += "\n         <tr>";
    g_kitCoverMatch += "\n           <td><img src=\"images/c.gif\" width=\"16\" height=\"1\" alt=\"\" /></td>";
    g_kitCoverMatch += "\n           <td><img src=\"images/c.gif\" width=\"550\" height=\"1\" alt=\"\" /></td>";
    g_kitCoverMatch += "\n         </tr>";
    g_kitCoverMatch += "\n       </table>";
    g_kitCoverMatch += "\n     </td>";
    g_kitCoverMatch += "\n     <td width=\"97\"><img src=\"images/c.gif\" width=\"97\" height=\"1\" alt=\"\" /></td>";
    g_kitCoverMatch += "\n   </tr>";
    g_kitCoverMatch += "\n </table>";
    g_kitCoverMatch += "\n ";
    g_kitCoverMatch += "\n <table class=\"cover-content\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"794\">";
    g_kitCoverMatch += "\n   <tr>";
    g_kitCoverMatch += "\n     <td width=\"97\"><img src=\"images/c.gif\" width=\"97\" height=\"1\" alt=\"\" /> </td>  ";
    g_kitCoverMatch += "\n     <td class=\"cover-item\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"8\" width=\"100%\">";
    g_kitCoverMatch += "\n       [[PGS]]";
    g_kitCoverMatch += "\n     </table></td>";
    g_kitCoverMatch += "\n     <td width=\"97\"><img src=\"images/c.gif\" width=\"97\" height=\"1\" alt=\"\" /> </td>	";
    g_kitCoverMatch += "\n   </tr>";
    g_kitCoverMatch += "\n </table>  ";
    g_kitCoverMatch += "\n ";
    g_kitCoverMatch += "\n <!--	End content -->";

var g_kitCoverSpread = "";
    g_kitCoverSpread += "\n <td align=\"left\" valign=\"top\">";
    g_kitCoverSpread += "\n   <img src=\"images/mobular_small.gif\" width=\"16\" height=\"16\" alt=\"\" />";
    g_kitCoverSpread += "\n </td>";
    g_kitCoverSpread += "\n <td align=\"left\" valign=\"top\" width=\"584\">";
    g_kitCoverSpread += "\n   <a href=\"[[doc_name]]\" onclick=\"eengine.hideThumb('thumb');eengine.writePage([[book]]);return false;\" onmouseover=\"eengine.showThumb(event,'thumb','[[doc_num]]_cover_thumb');\" onmouseout=\"eengine.hideThumb('thumb');\" style=\"text-decoration:none\">";
    g_kitCoverSpread += "\n     <h2>[[doc_name]]</h2>";
    g_kitCoverSpread += "\n   </a>";
    g_kitCoverSpread += "\n   [[doc-description]]";
    g_kitCoverSpread += "\n </td>";
    g_kitCoverSpread += "\n <div id=\"[[doc_num]]_cover_thumb\" doc=[[doc_num]] style=\"visibility:hidden;position:absolute\">[[lowres]]</div>";

var prtDocsFileSizes = new Array(
"1.6MB",
"1.6MB",
"2.2MB",
"158KB",
"681KB",
"90KB"
);

var rc_offers = new Array(
"*|2009-05-11|2010-12-31|hs22_newgen_148x56.jpg|New x86 Servers:  Racks and Blade|148|56|New x86 Servers:  Racks and Blade|View Rack demo|http://www.ibm.com/systems/data/flash/systemx/hardware/x3650m2/index.html|View demo|http://www.ibm.com/systems/data/flash/bladecenter/hardware/servers/tour/hs22newgen/index.html|Learn more|http://www.ibm.com/systems/express/servers/x/| | |Discover a versatile, easy-to-use blade, optimized for performance, power and cooling.",
"*|2009-05-11|2010-12-31|meeting.jpg|IBM Virtual Conference Series|148|70|IBM Virtual Conference Series|Learn more|http://www.ibm.com/systems/migratetoibm/webseminars/virtualconference/| | | | | | |Experts discuss IBM's New Generation of x86 servers and more",
"*|2009-05-11|2010-12-31|lowrate.jpg|Low rate financing|148|74|Low rate financing|Learn more|http://www-304.ibm.com/jct03004c/financing/us/hardware/offerings/lowrate.html|Rapid Online Financing|http://www-304.ibm.com/jct03004c/financing/partner/tools/rof.html|JumpStart Rates|ftp://ftp.software.ibm.com/common/ssi/pm/fy/n/gff03071usen/GFF03071USEN.PDF| | |Below-market rates for you",
"*|2009-05-11|2010-12-31|intel_banner_solid_blue_148.jpg|Intel Premier IT Professional|148|56|Intel Premier IT Professional|Learn more|http://ipip.intel.com| | | | | | |"
);
