var $j = jQuery.noConflict();

//  CLIENT_SIDE SNIFFER CODE
// convert all characters to lowercase
var agt=navigator.userAgent.toLowerCase();

// *** BROWSER VERSION ***
// Note: On IE5, these return 4, so use is_ie5up to detect IE5.
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);

// *** BROWSER TYPE ***
var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
            && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
            && (agt.indexOf('webtv')==-1));
var is_nav4 = (is_nav && (is_major == 4));
var is_nav5 = (is_nav && (is_major == 5));
var is_nav5up = (is_nav && (is_major >= 5));
var is_nav6 = (is_nav && (is_major == 6));
var is_nav4up = (is_nav && (is_major >= 4));
var is_nav6up = (is_nav && (is_major >= 6));
var is_ie   = (agt.indexOf("msie") != -1);
var is_ie3  = (is_ie && (is_major < 4));
var is_ie5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
var is_ie5up  = (is_ie  && !is_ie3 && !is_ie4);
var is_ie6    = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
var is_ie7    = (is_ie && (is_major == 4) && (agt.indexOf("msie 7.")!=-1) );
var is_ie8    = (is_ie && (is_major == 4) && (agt.indexOf("msie 8.")!=-1) );
var is_ie4  = (is_ie && (is_major <= 4) && !is_ie5 && !is_ie6 && !is_ie7);
var is_opera = (agt.indexOf("opera") != -1);

// *** PLATFORM ***
var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
var is_mac    = (agt.indexOf("mac")!=-1);
var is_sun   = (agt.indexOf("sunos")!=-1);
var is_irix  = (agt.indexOf("irix") !=-1);    // SGI
var is_hpux  = (agt.indexOf("hp-ux")!=-1);
var is_aix   = (agt.indexOf("aix") !=-1);      // IBM
var is_linux = (agt.indexOf("inux")!=-1);
var is_sco   = (agt.indexOf("sco")!=-1) || (agt.indexOf("unix_sv")!=-1);
var is_unixware = (agt.indexOf("unix_system_v")!=-1);
var is_mpras    = (agt.indexOf("ncr")!=-1);
var is_reliant  = (agt.indexOf("reliantunix")!=-1);
var is_dec   = ((agt.indexOf("dec")!=-1) || (agt.indexOf("osf1")!=-1) ||
       (agt.indexOf("dec_alpha")!=-1) || (agt.indexOf("alphaserver")!=-1) ||
       (agt.indexOf("ultrix")!=-1) || (agt.indexOf("alphastation")!=-1));
var is_sinix = (agt.indexOf("sinix")!=-1);
var is_freebsd = (agt.indexOf("freebsd")!=-1);
var is_bsd = (agt.indexOf("bsd")!=-1);
var is_unix  = ((agt.indexOf("x11")!=-1) || is_irix || is_sco ||
is_unixware || is_mpras || is_reliant ||
             is_dec || is_sinix || is_aix || is_bsd || is_freebsd);

// START CONFIG VARIABLES
var hpHomePageName = '/welcome.html';
var hpVersion = 'accordion'; // hybrid || accordion
var hpCoreDir = 'http://welcome.hp-ww.com/country/us/en/';
var hpImgDir = 'img/welcome/';
var hpMenuType = (hpVersion == 'hybrid') ? 'flyout' : hpVersion ;

// cookie default values
var hp_cookie_domain = 'localhost:8080';
//var hp_cookie_domain = '';
var hp_cookie_path = '/';
var hp_cookie_expiration = 90; // in days
var _Ck_ = new _CK_(hp_cookie_expiration, hp_cookie_path, hp_cookie_domain );
var product_cookie = 'hp_product';
// END CONFIG VARIABLES

// START GLOBAL VARIABLES
var hp_prod_img_num = null;
var hp_explore_img_num = null;
var rememberMe = false;
var supportPgType = '';
var hp_acc_segment = null;
// END GLOBAL VARIABLES
function setCk(_name, _value, _duration, _path, _domain){ _Ck_.set(_name, _value, _duration, hp_cookie_path, hp_cookie_domain); }
function getCk(_name){ _Ck_.get(_name); }

$j(document).ready(function(){
	 $j(function(){ if(is_ie8){$j('ul.jd_menu').jdMenu({offsetY: 0, offsetX: 0});}
			src_primary = setMsgSrc(src_primary);
			$j('#priImg').html(setPrimaryImgSrc());			
		 });
});

// Handle tab change as history event
var expHash = "";
function saveHist(newHash) {
	window.location.hash = newHash;
	expHash = window.location.hash;
	return true;
}

function checkHistory() {
	if (window.location.hash != expHash) {
		expHash = window.location.hash;
		var expTab = expHash.substring(1, expHash.length).split('_')[0];
		if(expTab) tabChanged(expTab);
		else window.location = hpHomePageName;
	} return true;
}

function checkTab() {
	checkHistory();
	window.setInterval("checkHistory()", 1000);
	return true;
}

var lh = new listHandler(); 

// This function looks for the tab last viewed by the user
function findUserTab() {
	var userTab = window.location.hash;
	userTab = userTab.substring(1, userTab.length).split('_')[0];  //Remove # character from the string
	var userTab_check = /\w+/.exec(userTab);  //Check the value, should contain only alphanumeric characters
	userTab = (userTab_check) ? userTab_check.toString(): null;

	if ( userTab ) {
		activeTab = 'Main';
		tabChanged(userTab);
	}
}

function clearDefault(el) {
	if (el.defaultValue==el.value) { el.value = ''; el.select();}
}

function getFirstChild(element) {
	return (element.firstChild.nodeType == 3) ? element.childNodes[1] : element.firstChild; 
}

function getSegment(segment) {
	document.getElementById('messagingAreaScreen').style.display = 'block';
	GetContentByToken("/hp/"+segment.toLowerCase()+"_segment.html", false, "segmentsShowUp", false, "Wait...", "Error...", "<!-- BEGIN " + segment + " -->", "<!-- END " + segment + " -->");
}

function getProduct() {
	var products = "/country/us/en/products.html";	
	var compare = (hp_prod_img_num && hp_prod_img_num > -1);
	
	if ((hpVersion == 'hybrid' && _Ck_.get('hp_cust_seg_sel')!= null) || hpVersion == 'accordion') {
		var beginVar = '<!-- BEGIN PRODUCTS ACCORDION -->'; var endVar = '<!-- END PRODUCTS ACCORDION -->';
	} else {	var beginVar = '<!-- BEGIN PRODUCTS HYBRID -->'; var endVar = '<!-- END PRODUCTS HYBRID -->'; }
	
	if(GetContentByToken){		
		GetContentByToken(products, false, "dynamicArea", false, "Wait...", "Error...", beginVar, endVar);	
		addProductToggleEvents();
		initAccordion();
		
		var customerSegment = (_Ck_.get('hp_cust_seg_sel')) ? _Ck_.get('hp_cust_seg_sel') : 'HHO'; 
		customerSegment = (hp_acc_segment) ? hp_acc_segment : customerSegment;
		var prodAreas = $j('#productList map area')[hp_prod_img_num];
		var prodDefaultImage = (compare)? hpCoreDir+hpImgDir+hpSS[hp_prod_img_num].img : shopSegmentPreloadImage[customerSegment.toUpperCase()].src;
		var prodImgHolder = '<img id="exploreMain" name="exploreMain" src="' + prodDefaultImage + '" alt="" height="425" width="683" />';		
		$j('#prdWideColumn').html(prodImgHolder);		
		
	
		if((hpVersion == 'hybrid' && _Ck_.get('hp_cust_seg_sel')!=null)||hpVersion=='accordion') {
			
			hpMenuType = 'accordion';
			
			$j('.acc_content a').click( 
				function(){ 
					var cls = this.className.split(' '); 
					if(cls[1] && cls[1] == 'sw'){
						setCk(product_cookie, 'software'); 
						setCk('hp_cust_seg_sel', 'LEB');
					}else{ 
						setCk('hp_cust_seg_sel', cls[0].toUpperCase());
					}					
					var accSegment = $j(this).parent().parent().parent().attr('id').split('-')[0];					
						accSegment = (accSegment == 'gs') ? accSegment : '';					
					saveHist(getHash(hp_prod_img_num, accSegment)); 
					document['rememberMe'] = true; 
				});
			setAccDefault(customerSegment.toLowerCase());
			
			if(hp_prod_img_num)
				prdImageChange(hp_prod_img_num, eval(customerSegment.toUpperCase()));
			
		}else{
			hpMenuType = 'flyout';
			if(hp_prod_img_num && prodAreas){
				var prdMap = '<map name="prodSegImgMap_HHO"><area id="'+prodAreas.id+'" shape="rect" coords="3,3,680,422" href="'+prodAreas.href+'" alt="'+prodAreas.alt+'" onMouseDown="s_objectID=objIDver(\''+productMapsMetrics[hp_prod_img_num]+'\'); s_hp_fixObjectID(s_objectID);" onClick="saveHist(getHash(hp_prod_img_num));" tabIndex="'+prodAreas.tabIndex+'"></map>';
			}else{
				var prdMap	= prodSegmentImageMaps['HHO'];
			}
			
			var mainNodeImg = $j('#exploreMain');
			mainNodeImg.attr('useMap', '#prodSegImgMap_HHO');
			$j('#prdWideColumn').empty().html(mainNodeImg).children().after(prdMap);
			
			$j('#productList ul li a').click( function(){var cls = this.className.split(' '); if(cls[1] && cls[1] == 'sw'){setCk(product_cookie, 'software'); setCk('hp_cust_seg_sel', 'LEB'); }else if(cls[0] == "fullBlack"){ saveHist(getHash(hp_prod_img_num)); return; }else{ setCk('hp_cust_seg_sel', cls[0].toUpperCase());} saveHist(getHash(hp_prod_img_num)); }, function(){} );
		}
	}
}

function getSupport() {
	var beginVar = '<!-- BEGIN SUPPORT -->';
	var endVar = '<!-- END SUPPORT -->';
	GetContentByToken('/country/us/en/welcome_support.html', false, 'dynamicArea', false, 'Wait...', 'Error...', beginVar, endVar);
	drawGMNButton();
	supportSelectedRadio = _Ck_.get('hp_support_selection');

	if (supportSelectedRadio == null) {
		toggleSupportBottom(false);
	}else{
		// User has already visited this tab and clicked on a radio button so no need to gray-out the bottom part
		document.getElementById(supportSelectedRadio).checked = true;
		supportPgType = (supportSelectedRadio=='drivers') ? 's-002' : 's-001';
	}
	$j('.supportContentBlock a').click( function(){ if(supportPgType){ this.href = this.href.replace(/h_pagetype=s-00(\d)/,'h_pagetype='+supportPgType); } else return; } );
}

function getExplore() {
	GetContentByToken('/country/us/en/explore.html', false, 'dynamicArea', false, 'Wait...', 'Error...', '<!-- BEGIN EXPLORE -->', '<!-- END EXPLORE -->');	
	//Add mouse-over behavior of links
	$j('#mainNarrowColumn a').hoverIntent( function(){exploreSwap( this.id.substring( 11, this.id.length ) );}, function(){} );
	$j('#mainNarrowColumn a').focus( function(){delay_exploreLink(true, this.id.substring( 11, this.id.length ))} );	
	$j('#mainNarrowColumn a').click( function(){setCk('hp_cust_seg_sel', this.className.toUpperCase()); saveHist(getHash(hp_explore_img_num)); }, function(){} );

	if(hp_explore_img_num)
		document.getElementById('mainWideColumn').innerHTML = '<img id="exploreMain" name="exploreMain" src="'+explore_src[hp_explore_img_num]+'" alt="'+explore_alt[hp_explore_img_num]+'" usemap="#expSegImgMap_' + hp_explore_img_num +'" height="425" width="683">'+explore_map[hp_explore_img_num];		
	hp_explore_img_num = null;
	preLoadExplore();
}

function toggleResources(visible) {
	var ulResources = document.getElementById('resourcesList');
	ulResources.style.display = (visible) ? 'block' : 'none';
}

function HideCountries() {
	ulCollection = document.getElementById('countryList').getElementsByTagName('UL');
	
	for (cnt = 0; cnt < ulCollection.length; cnt++) {
		ulCollection[cnt].style.display = 'none';
	}
}

function toggleCountry(visible) {
	var ulCountry = document.getElementById('countryList');
	ulCountry.style.display = (visible) ? 'block' : 'none';
}

function toggleSubMenu (liItem, visible) {
	var ulSection = liItem.getElementsByTagName('UL')[0];
	
	if (visible) {
		HideCountries();
		ulSection.style.display = 'block';
	} else {
		ulSection.style.display = 'none';
	}
}

/*************** Segment Functions ***************************/
function segOver(evt, element) {
	if (isMouseLeaveOrEnter(evt, element)) checkSegClose(evt);
}

function segTabOut(evt, element) {
	if (isMouseLeaveOrEnter(evt, element)) checkTabClose(evt);
}

function segButtonOver(evt, element, isOn, segName) {
	if (isMouseLeaveOrEnter(evt, element)) delay_changeSeg(isOn, segName);
}

function checkSegClose (evt) {
	var overSegment = getonMouseOutId(evt);
	var segName = 'container' + activeSeg;
	
	if (segName != overSegment)
		closeSegment();	
}

function checkTabClose (evt) {
	if (getonMouseOutId(evt) != '')
		closeSegment();	
}

function getonMouseOutId (e) {
	try {
		if (!e) var e = window.event;
		relTarg = e.relatedTarget || e.toElement;
		return relTarg.id;
	}
	catch(exc) {	
		return 'Some Error';
	}
}

function closeSegment() {
	var segShow = document.getElementById('segmentsShowUp');	
	if (activeSeg != 'None') {
		segShow.innerHTML = '&nbsp;';
		restoreSegment('tab'+activeSeg);
		document.getElementById('messagingAreaScreen').style.display = 'none';
		slideShowSuspended = false;
		playSlide();
		activeSeg = 'None';
	}
}

/*************** Explore Functions ***************************/
var exploreImageCurrent = -1;
var explorePreloadCount = 0;
var explorePreloadImage = new Array();
var explore_map = new Array();
var explore_src = new Array();
explore_src[0] = hpCoreDir+hpImgDir+"explore/Snapfish_E&C.jpg";
explore_src[1] = hpCoreDir+hpImgDir+"explore/Digital_Photography-E&C.jpg";
explore_src[2] = hpCoreDir+hpImgDir+"explore/Print_Studio-HHO.jpg";
explore_src[3] = hpCoreDir+hpImgDir+"explore/Activity_Center.jpg";
explore_src[4] = hpCoreDir+hpImgDir+"explore/Print_Studio_SMB.jpg";
explore_src[5] = hpCoreDir+hpImgDir+"explore/Business_templates.jpg";
explore_src[6] = hpCoreDir+hpImgDir+"explore/Logoworks.jpg";
explore_src[7] = hpCoreDir+hpImgDir+"explore/Smart_Printing.jpg";
explore_src[8] = hpCoreDir+hpImgDir+"explore/Graphic_Arts_Tools.jpg";
explore_src[9] = hpCoreDir+hpImgDir+"explore/PC_Discovery_Center.jpg";
explore_src[10] = hpCoreDir+hpImgDir+"explore/Digital_Home_Entertainment.jpg";
explore_src[11] = hpCoreDir+hpImgDir+"explore/Videos.jpg";

var explore_alt = new Array();
explore_alt[0] = "Snapfish. Now even better! 9 cent prints everyday. First 25 prints free.";
explore_alt[1] = "Digital Photographer Center. Take better photos with our easy tips and  techniques.";
explore_alt[2] = "HP Print Studio. Try HP's newest and coolest home printing projects - easier than ever!";
explore_alt[3] = "Activity Center. Bring your favorite memories to life with our exclusive scrapbooking projects";
explore_alt[4] = "HP Print Studio. Try HP's newest business printing projects to help your brand soar";
explore_alt[5] = "Business Templates & Images. Choose from a variety of templates such as letterhead, business cards, brochures, even restaurant menus";
explore_alt[6] = "Logoworks by HP. All the custom design your business needs starting at just $99";
explore_alt[7] = "Smart Web Printing. Select and organize text and graphics from multiple web pages and print  exactly what you see onscreen";
explore_alt[8] = "Graphic Arts Tools. Photo galleries and tutorials to drive a project from conception to completion";
explore_alt[9] = "Do more with your PC. Uncover the possibilities, inspire creativity and power your play";
explore_alt[10] = "Digital Home Entertainment. Interact with your TV - take control of a new world of entertainment";
explore_alt[11] = "Videos. Watch how Achievers use their PC's";

explore_map[0] = '<map name="expSegImgMap_0"><area shape="rect" coords="362,0,683,134" href="http://www.snapfish.com/hp_newweb_25free_reg_2008" alt="Snapfish. Now even better! 9 cent prints everyday. First 25 prints free." title="Snapfish. Now even better! 9 cent prints everyday. First 25 prints free." onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(0));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l1/snapfish-9 cent prints everyday/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="151"><area shape="rect" coords="362,131,683,148" href="http://www.snapfish.com/hp_newweb_25free_prints_2008" alt="Order digital camera prints" title="Order digital camera prints" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(0));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l2/snapfish-order digital camera prints/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="151"><area shape="rect" coords="362,148,683,177" href="http://www.snapfish.com/hp_newweb_25free_photogifts_2008" alt="Create photo gifts: Photobooks, cards, mugs & more" title="Create photo gifts: Photobooks, cards, mugs & more" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(0));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l3/snapfish-create photo gifts/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="151"><area shape="rect" coords="362,177,683,195" href="http://www.snapfish.com/hp_newweb_25free_share_2008" alt="Share photos online FREE" title="Share photos online FREE" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(0));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l4/snapfish-share photos online free/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="151"><area shape="rect" coords="362,195,683,210" href="http://www.snapfish.com/hp_newweb_25free_upload_2008" alt="Upload and store photos FREE" title="Upload and store photos FREE" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(0));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l5/snapfish-upload and store photos free/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="151"><area shape="rect" coords="362,210,683,226" href="http://www.snapfish.com/hp_newweb_25free_howitworks_2008" alt="How Snapfish works" title="How Snapfish works" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(0));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l6/snapfish-how snapfish works/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="151"></map>';

explore_map[1] = '<map name="expSegImgMap_1"><area shape="rect" coords="362,0,683,105" href="http://www.hp.com/united-states/consumer/digital_photography/take_better_photos/index.html" alt="Digital Photography Center. Take better photos with our easy tips and  techniques." title="Digital Photography Center. Take better photos with our easy tips and  techniques." onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(1));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l1/better photos-take better photos - easy tips/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="152"><area shape="rect" coords="362,105,683,121" href="http://www.hp.com/united-states/consumer/digital_photography/print_better_photos/index.html" alt="Print better photos" title="Print better photos" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(1));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l2/better photos-print better photos/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="152"><area shape="rect" coords="362,121,683,137" href="http://www.hp.com/united-states/consumer/digital_photography/edit_restore_photos/index.html" alt="Edit photos" title="Edit photos" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(1));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l3/better photos-edit photos/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="152"><area shape="rect" coords="362,137,683,154" href="http://www.hp.com/united-states/consumer/digital_photography/organize_archive_photos/index.html" alt="Organize and archive photos" title="Organize and archive photos" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(1));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l4/better photos-organize and archive photos/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="152"><area shape="rect" coords="362,154,683,171" href="http://www.hp.com/united-states/consumer/digital_photography/tours/do_more/index.html" alt="Ideas to do more with your photos" title="Ideas to do more with your photos" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(1));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l5/better photos-ideas to do more with your photos/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="152"><area shape="rect" coords="362,171,683,188" href="http://www.hp.com/united-states/consumer/digital_photography/share_photos_creative/index.html" alt="Share photos and get creative" title="Share photos and get creative" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(1));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l6/better photos-share photos and get creative/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="152"><area shape="rect" coords="362,188,683,205" href="http://www.hp.com/united-states/consumer/digital_photography/home_f.html" alt="Explore all" title="Explore all" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(1));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l7/better photos-explore all/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="152"></map>';

explore_map[2] = '<map name="expSegImgMap_2"><area shape="rect" coords="362,0,680,82" href="http://h30393.www3.hp.com/printing/app/us/en/consumer.aspx" alt="HP Print Studio. Try HP\'s newest and coolest home printing projects - easier than ever!" title="HP Print Studio. Try HP\'s newest and coolest home printing projects - easier than ever!" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(2));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l1/Print Studio-try hp newest and coolest home printing projects/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="153"><area shape="rect" coords="362,85,680,104" href="http://h30393.www3.hp.com/printing/app/us/en/consumer/calendar.aspx" alt="Calendars" title="Calendars" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(2));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l2/Print Studio-calendars/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="153"><area shape="rect" coords="362,104,680,119" href="http://h30393.www3.hp.com/printing/app/us/en/consumer/greeting-cards.aspx" alt="Greeting cards" title="Greeting cards" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(2));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l3/Print Studio-greeting cards/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="153"><area shape="rect" coords="362,119,680,133" href="http://h30393.www3.hp.com/printing/app/us/en/consumer/invitations-announcements.aspx" alt="Invitations &amp; announcements" title="Invitations &amp; announcements" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(2));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l4/Print Studio-invitations and announcements/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="153"><area shape="rect" coords="362,133,680,149" href="http://h30393.www3.hp.com/printing/app/us/en/consumer/iron-ons.aspx" alt="Iron-ons" title="Iron-ons" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(2));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l5/Print Studio-iron-ons/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="153"></map>';

explore_map[3] = '<map name="expSegImgMap_3"><area shape="rect" coords="362,0,683,86" href="http://h10025.www1.hp.com/ewfrf/wc/acCategory?lc=en&cc=us&dlc=en&extcat=scrapbooking&" alt="Activity Center. Bring your favorite memories to life with our exclusive scrapbooking projects" title="Activity Center. Bring your favorite memories to life with our exclusive scrapbooking projects" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(3));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l1/Activity Center-bring your favorite memories to life/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="154"><area shape="rect" coords="362,86,683,101" href="http://h10025.www1.hp.com/ewfrf/wc/acCategory?lc=en&cc=us&dlc=en&extcat=calendars&" alt="Calendars" title="Calendars" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(3));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l2/Activity Center-calendars/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="154"><area shape="rect" coords="362,101,683,115" href="http://h10025.www1.hp.com/ewfrf/wc/acCategory?lc=en&cc=us&dlc=en&extcat=cards&" alt="Cards" title="Cards" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(3));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l3/Activity Center-cards/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="154"><area shape="rect" coords="362,115,683,134" href="http://h10025.www1.hp.com/ewfrf/wc/acCategory?lc=en&cc=us&dlc=en&extcat=invitationsstationery&" alt="Invitations and stationary" title="Invitations and stationary" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(3));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l4/Activity Center-invitations and stationary/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="154"><area shape="rect" coords="362,134,683,149" href="http://h10025.www1.hp.com/ewfrf/wc/acCategory?lc=en&cc=us&dlc=en&extcat=labelscovers&" alt="Labels and covers" title="Labels and covers" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(3));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l5/Activity Center-labels and covers/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="154"><area shape="rect" coords="362,149,683,165" href="http://h10025.www1.hp.com/ewfrf/wc/acCategory?lc=en&cc=us&dlc=en&extcat=scrapbooking&" alt="Scrapbooking" title="Scrapbooking" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(3));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l6/Activity Center-scrapbooking/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="154"><area shape="rect" coords="362,165,683,180" href="http://h10025.www1.hp.com/ewfrf/wc/activityCenterHome?lc=en&cc=us" alt="Explore all" title="Explore all" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(3));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l7/Activity Center-explore all/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="154"></map>';

explore_map[4] = '<map name="expSegImgMap_4"><area shape="rect" coords="362,0,680,86" href="http://h30393.www3.hp.com/printing/app/us/en/smb/smb.aspx" alt="HP Print Studio. Try HP\'s newest business printing projects to help your brand soar" title="HP Print Studio. Try HP\'s newest business printing projects to help your brand soar" onClick="setCk(\'hp_cust_seg_sel\',\'SMB\'); saveHist(getHash(4));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l1/Print Studio-try hp newest and coolest business printing projects/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="155"><area shape="rect" coords="362,86,680,101" href="http://h30393.www3.hp.com/printing/app/us/en/smb/business-kits.aspx" alt="Business identity kits" title="HP Print Studio. Business identity kits" onClick="setCk(\'hp_cust_seg_sel\',\'SMB\'); saveHist(getHash(4));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l2/Print Studio-business identity kits/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="155"></map>';

explore_map[5] = '<map name="expSegImgMap_5"><area shape="rect" coords="362,0,683,115" href="http://www.hp.com/sbso/productivity/office/identity-kits.html" alt="Business Templates & Images. Choose from a variety of templates such as letterhead, business cards, brochures, even restaurant menus" title="Business Templates & Images. Choose from a variety of templates such as letterhead, business cards, brochures, even restaurant menus" onClick="setCk(\'hp_cust_seg_sel\',\'SMB\'); saveHist(getHash(5));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/smb/l6/bus templates-choose from a variety of templates/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="156"><area shape="rect" coords="362,115,683,135" href="http://www.hp.com/sbso/productivity/office/logolib.html" alt="Free image library" title="Free image library" onClick="setCk(\'hp_cust_seg_sel\',\'SMB\'); saveHist(getHash(5));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/smb/l6/bus templates-free image library/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="156"><area shape="rect" coords="362,135,683,152" href="http://www.hp.com/sbso/productivity/office/istockphoto.html?jumpid=reg_R1002_USEN" alt="iStockphoto images" title="iStockphoto images" onClick="setCk(\'hp_cust_seg_sel\',\'SMB\'); saveHist(getHash(5));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/smb/l6/bus templates-istock images/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="156"></map>';

explore_map[6] = '<map name="expSegImgMap_6"><area shape="rect" coords="362,0,683,82" href="http://www.logoworks.com/?source=HP|S1|WL|28&lpn=HP+Landing" alt="Logoworks by HP. All the custom design your business needs starting at just $99" title="Logoworks by HP. All the custom design your business needs starting at just $99" onClick="setCk(\'hp_cust_seg_sel\',\'SMB\'); saveHist(getHash(6));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l2/Logoworks-all custom design for your business/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="157"><area shape="rect" coords="362,82,683,106" href="http://www.logoworks.com/?source=HP|S1|WL|29&lpn=HP+Landing" alt="Logo Design" title="Logo Design" onClick="setCk(\'hp_cust_seg_sel\',\'SMB\'); saveHist(getHash(6));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l3/Logoworks-logo design/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="157"><area shape="rect" coords="362,106,683,122" href="http://www.logoworks.com/website-design.html?source=HP|S1|WL|30&lpn=HP+Landing" alt="Websites" title="Websites" onClick="setCk(\'hp_cust_seg_sel\',\'SMB\'); saveHist(getHash(6));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l4/Logoworks-websites/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="157"><area shape="rect" coords="362,122,683,137" href="http://www.logoworks.com/brochure-design.html?source=HP|S1|WL|31&lpn=HP+Landing" alt="Brochures" title="Brochures" onClick="setCk(\'hp_cust_seg_sel\',\'SMB\'); saveHist(getHash(6));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l5/Logoworks-brochures/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="157"><area shape="rect" coords="362,137,683,155" href="http://www.logoworks.com/stationary.html?source=HP|S1|WL|32&lpn=HP+Landing" alt="Stationery" title="Stationery" onClick="setCk(\'hp_cust_seg_sel\',\'SMB\'); saveHist(getHash(6));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l6/Logoworks-stationary/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="157"><area shape="rect" coords="362,155,683,170" href="http://www.logoworks.com/promotional-products.html?source=HP|S1|WL|33&lpn=HP+Landing" alt="Promo Products" title="Promo Products" onClick="setCk(\'hp_cust_seg_sel\',\'SMB\'); saveHist(getHash(6));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l7/Logoworks-promo products/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="157"><area shape="rect" coords="362,170,683,186" href="http://www.logomaker.com/?source=HP|S1|WL|34&lpn=HP+Landing" alt="Create your own logo for free" title="Create your own logo for free" onClick="setCk(\'hp_cust_seg_sel\',\'SMB\'); saveHist(getHash(6));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l8/Logoworks-create your own logo/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="157"><area shape="rect" coords="362,186,683,202" href="http://www.logoworks.com/?source=HP|S1|WL|28&lpn=HP+Landing" alt="Explore all" title="Explore all" onClick="setCk(\'hp_cust_seg_sel\',\'SMB\'); saveHist(getHash(6));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l9/Logoworks-explore all/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="157"></map>';

explore_map[7] = '<map name="expSegImgMap_7"><area shape="rect" coords="362,3,680,100" href="http://h71036.www7.hp.com/hho/cache/482779-0-0-225-121.html" alt="Smart Web Printing. Select and organize text and graphics from multiple web pages and print  exactly what you see onscreen" title="Smart Web Printing. Select and organize text and graphics from multiple web pages and print  exactly what you see onscreen" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(7));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l1/WPE-print exactly what you see onscreen/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="158"></map>';

explore_map[8] = '<map name="expSegImgMap_8"><area shape="rect" coords="362,0,683,82" href="http://h30267.www3.hp.com/country/us/en/products/large_format/Z2100/creative_workflow/index.html" alt="Graphic Arts Tools. Photo galleries and tutorials to drive a project from conception to completion" title="Graphic Arts Tools. Photo galleries and tutorials to drive a project from conception to completion" onClick="setCk(\'hp_cust_seg_sel\',\'GA\'); saveHist(getHash(8));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l2/GA Tools-photo galleries and tutorials to drive a project/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="159"><area shape="rect" coords="362,82,683,101" href="http://h30267.www3.hp.com/country/us/en/designjet/supplies/projectroom_overview.html?pageseq=31905" alt="Large format how-to workshop" title="Large format how-to workshop" onClick="setCk(\'hp_cust_seg_sel\',\'GA\'); saveHist(getHash(8));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l3/GA Tools-large format how to workshop/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="159"><area shape="rect" coords="362,101,683,114" href="http://h30267.www3.hp.com/country/us/en/resolution/index.html?pageseq=22666" alt="Reveal: Your true color" title="Reveal: Your true color" onClick="setCk(\'hp_cust_seg_sel\',\'GA\'); saveHist(getHash(8));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l4/GA Tools-reveal: your true color/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="159"><area shape="rect" coords="362,114,683,131" href="http://h30267.www3.hp.com/country/us/en/designjet/supplies/gallery.html?cc=us&jumpid=reg_R1002_USEN" alt="Tour photo gallery" title="Tour photo gallery" onClick="setCk(\'hp_cust_seg_sel\',\'GA\'); saveHist(getHash(8));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l5/GA Tools-tour photo gallery/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="159"><area shape="rect" coords="362,131,683,145" href="http://h30267.www3.hp.com/country/us/en/products/large_format/Z2100/creative_workflow/index.html" alt="Creative workflows" title="Creative workflows" onClick="setCk(\'hp_cust_seg_sel\',\'GA\'); saveHist(getHash(8));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l6/GA Tools-creative workflows/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="159"></map>';

explore_map[9] = '<map name="expSegImgMap_9"><area shape="rect" coords="362,0,683,85" href="http://h71036.www7.hp.com/hho/cache/565310-0-0-225-121.html" alt="PC Discovery Center. Uncover the possibilities, inspire creativity and power your play" title="PC Discovery Center. Uncover the possibilities, inspire creativity and power your play" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(9));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l1/Do More PC-uncover the possibilities/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="160"><area shape="rect" coords="362,85,683,104" href="http://h71036.www7.hp.com/hho/cache/564384-0-0-225-121.html" alt="Do more with these PC accessories" title="Do more with these PC accessories" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(9));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l2/Do More PC-do more with these pc accessories/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="160"><area shape="rect" coords="362,104,683,119" href="http://h71036.www7.hp.com/hho/cache/564386-0-0-225-121.html" alt="Experience entertainment" title="Experience entertainment" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(9));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l3/Do More PC-experience entertainment/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="160"><area shape="rect" coords="362,118,683,133" href="http://h71036.www7.hp.com/hho/cache/564541-0-0-225-121.html" alt="Connect to family and friends" title="Connect to family and friends" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(9));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l4/Do More PC-connect to families and friends/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="160"><area shape="rect" coords="362,133,683,150" href="http://h71036.www7.hp.com/hho/cache/564391-0-0-225-121.html" alt="Maintain the health of your PC" title="Maintain the health of your PC" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(9));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l5/Do More PC-maintain the health of your pc/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="160"><area shape="rect" coords="362,151,683,168" href="http://h71036.www7.hp.com/hho/cache/564385-0-0-225-121.html" alt="Learn how to protect your PC" title="Learn how to protect your PC" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(9));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l6/Do More PC-learn how to protect your pc/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="160"></map>';

explore_map[10] = '<map name="expSegImgMap_10"><area shape="rect" coords="362,0,683,105" href="http://www.hp.com/united-states/digitalentertainment/?jumpid=re_R602_mktg/hpcom/psg/de" alt="Digital Home Entertainment. Interact with your TV - take control of a new world of entertainment" title="Digital Home Entertainment. Interact with your TV - take control of a new world of entertainment" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(10));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l2/Entertain-interact with your tv/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="161"><area shape="rect" coords="362,105,683,119" href="http://h71036.www7.hp.com/hho/cache/532667-0-0-225-121.html" alt="Transform your living room into a home theater" title="Transform your living room into a home theater" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(10));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l3/Entertain-transform your living room/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="161"><area shape="rect" coords="362,119,683,136" href="http://h71036.www7.hp.com/hho/cache/532676-0-0-225-121.html" alt="Get movies, music and more" title="Get movies, music and more" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(10));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l4/Entertain-get movies, music, and more/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="161"><area shape="rect" coords="362,136,683,152" href="http://h71036.www7.hp.com/hho/cache/313888-0-0-225-121.html" alt="Set your digital music free" title="Set your digital music free" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(10));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l5/Entertain-set your digital music free/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="161"><area shape="rect" coords="362,152,683,170" href="http://h71036.www7.hp.com/hho/cache/533937-0-0-225-121.html" alt="Organize and share your digital photos" title="Organize and share your digital photos" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(10));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l6/Entertain-organize and share your digital photos/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="161"></map>';

explore_map[11] = '<map name="expSegImgMap_11"><area shape="rect" coords="362,46,683,64" href="http://www.hp.com/personalagain/us/en/index.html?product=vrcp" alt="Videos. Watch how Achievers use their PC\'s" title="Videos. Watch how Achievers use their PC\'s" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(11));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l1/Video-watch how achievers use their pcs/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="162"><area shape="rect" coords="362,64,683,84" href="http://www.hp.com/hpinfo/hptv.html" alt="HP Videos" title="HP Videos" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(11));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l2/Video-hp videos/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="162"><area shape="rect" coords="362,84,683,104" href="http://www.hp.com/go/uncut" alt="HP Uncut: Videos made by real HP employees" title="HP Uncut: Videos made by real HP employees" onClick="setCk(\'hp_cust_seg_sel\',\'HHO\'); saveHist(getHash(11));" onMouseDown="s_objectID=objIDver(\'gw/us/en/welcomeOV2-explore/msg-6/any/l3/Video-uncut videos made by real HP employees/var/20080331\'); s_hp_fixObjectID(s_objectID);" tabindex="162"></map>';

function preLoadExplore() {
	exploreImageCurrent = -1;
	if ((explorePreloadCount > 0) && (explorePreloadCount == explorePreloadImage.length)) return;  //Skip preloading if the user has already viewed this tab
	
	for(var i=0; i<explore_src.length; i++){
		explorePreloadImage[i] = new Image;
		explorePreloadImage[i].onload = function(){explorePreloadCount++;};   // When the image is loaded, increment the preloaded counter
		explorePreloadImage[i].src = explore_src[i];
	}
}

function exploreSwap(imgNumber) {
	hp_explore_img_num = imgNumber;
	if ( (explorePreloadCount == explorePreloadImage.length) && (imgNumber != exploreImageCurrent) ) {
		var mainNodeImg = $j('#exploreMain');
		$j('#mainWideColumn').empty().html(mainNodeImg).children().after(explore_map[imgNumber]);
		mainNodeImg.attr('useMap', '#expSegImgMap_' + imgNumber);
		mainNodeImg.attr('src', explorePreloadImage[imgNumber].src);
		mainNodeImg.attr('alt', explore_alt[imgNumber]);		
		$j('#mainWideColumn').SlideInLeft(500);
		exploreImageCurrent = imgNumber;
	}
}

//Fix for focus lost
var linkTimer=null;
function delay_exploreLink(_v,imgNumber) {
	if (linkTimer) {
		clearTimeout(linkTimer);
		linkTimer = null;
	}	
	if(_v)
		linkTimer = setTimeout('exploreSwap('+imgNumber+');',400);
}

/*************** Products Functions ***************************/

var shopImageCurrent = -1;
var shopPreloadCount = 0;
var shopSegmCurrent = null;
var shopPreloadImage = new Array();  // Image Objects Array 
var prdImageLoaded = false;
var g_productLabelCurrent;
var prdTimer=null;

//list of segment aliases
var segment_list = new Array('HHO','SMB','LEB','GHE','GA','GS');
/*** Check cookie for custom product image ***/
function getSegmCookie() {
	var Preference=_Ck_.get('hp_cust_seg_sel');
	if (Preference!=null) {
		var numPreference = 0;
		if(!isNumber(Preference)) {  // map string value to numeric index
			// search index of prefered segment in current list
			for(var nIndex in seg_choices) {
				if(seg_choices[nIndex] == Preference) {
					numPreference = nIndex;
					break;
				}
				numPreference = 0; // prefered segment is not present in current list (segment not in country)
			}
		}		
		return numPreference;
	} else { return -1; }
}

var productHover = new Array();
productHover[0] = "Notebooks &amp; Tablet PCs for:";
productHover[1] = "Desktops &amp; Workstations for:";
productHover[2] = "Gaming Systems:";
productHover[3] = "Printers &amp; All-in-ones for:";
productHover[4] = "Ink, Toner &amp; Paper:";
productHover[5] = "Handhelds &amp; Calculators for:";
productHover[6] = "Scanners &amp; Fax for:";
productHover[7] = "Digital Photography for:";
productHover[8] = "Televisions for:";
productHover[9] = "Servers for:";
productHover[10] = "Blades for:";
productHover[11] = "Storage for:";
productHover[12] = "Services for:";
productHover[13] = "Software:";
productHover[14] = "Networking:";
productHover[15] = "Large Format Printers for:";
productHover[16] = "Digital Presses for:";
productHover[17] = "Accessories &amp; Parts:";

var productDefault = new Array();
productDefault[0] = '<span class="screenReading">Expand </span>Notebooks &amp; Tablet PCs';
productDefault[1] = '<span class="screenReading">Expand </span>Desktops &amp; Workstations';
productDefault[2] = '<span class="screenReading">Expand </span>Gaming Systems';
productDefault[3] = '<span class="screenReading">Expand </span>Printers &amp; All-in-ones';
productDefault[4] = '<span class="screenReading">Expand </span>Ink, Toner &amp; Paper';
productDefault[5] = '<span class="screenReading">Expand </span>Handhelds &amp; Calculators';
productDefault[6] = '<span class="screenReading">Expand </span>Scanners &amp; Fax';
productDefault[7] = '<span class="screenReading">Expand </span>Digital Photography';
productDefault[8] = '<span class="screenReading">Expand </span>Televisions';
productDefault[9] = '<span class="screenReading">Expand </span>Servers';
productDefault[10] = '<span class="screenReading">Expand </span>Blades';
productDefault[11] = '<span class="screenReading">Expand </span>Storage';
productDefault[12] = '<span class="screenReading">Expand </span>Services';
productDefault[13] = '<span class="screenReading">Expand </span>Software';
productDefault[14] = '<span class="screenReading">Expand </span>Networking';
productDefault[15] = '<span class="screenReading">Expand </span>Large Format Printers';
productDefault[16] = '<span class="screenReading">Expand </span>Digital Presses';
productDefault[17] = '<span class="screenReading">Expand </span>Accessories &amp; Parts';

var productMapsMetrics = new Array();
productMapsMetrics[0] = 'gw/us/en/welcomeOV2-shop/msg-5/hho/l1/notebook-simplify and save/var/20080331';
productMapsMetrics[1] = 'gw/us/en/welcomeOV2-shop/msg-5/hho/l1/desktops and workstations-find the perfect gift/var/20080331';
productMapsMetrics[2] = 'gw/us/en/welcomeOV2-shop/msg-5/hho/l0/gaming systems-set up your game>/var/20080331';
productMapsMetrics[3] = 'gw/us/en/welcomeOV2-shop/msg-5/hho/l1/printers and all in ones-bring your ideas to life/var/20080331';
productMapsMetrics[4] = 'gw/us/en/welcomeOV2-shop/msg-5/hho/l1/ink toner paper-print your memories/var/20080331';
productMapsMetrics[5] = 'gw/us/en/welcomeOV2-shop/msg-5/hho/l1/handhelds and calculators-be the first to know/var/20080331';
productMapsMetrics[6] = 'gw/us/en/welcomeOV2-shop/msg-5/hho/l1/scanners and fax-preserve what matters/var/20080331';
productMapsMetrics[7] = 'gw/us/en/welcomeOV2-shop/msg-5/hho/l0/digital photography-share your memories>/var/20080331';
productMapsMetrics[8] = 'gw/us/en/welcomeOV2-shop/msg-5/hho/l1/televisions-get the show started/var/20080331';
productMapsMetrics[9] = 'gw/us/en/welcomeOV2-shop/msg-5/hho/l1/servers-dare anyone to keep up/var/20080331';
productMapsMetrics[10] = 'gw/us/en/welcomeOV2-shop/msg-5/hho/l1/blades-build in not out/var/20080331';
productMapsMetrics[11] = 'gw/us/en/welcomeOV2-shop/msg-5/hho/l1/storage-your business lifeblood/var/20080331';
productMapsMetrics[12] = 'gw/us/en/welcomeOV2-shop/msg-5/hho/l1/services-collaborate innovate/var/20080331';
productMapsMetrics[13] = 'gw/us/en/welcomeOV2-shop/msg-5/hho/l1/software-software omniscience/var/20080331';
productMapsMetrics[14] = 'gw/us/en/welcomeOV2-shop/msg-5/hho/l1/networking-networks you can trust/var/20080331';
productMapsMetrics[15] = 'gw/us/en/welcomeOV2-shop/msg-5/hho/l1/large format printers-make a statement/var/20080331';
productMapsMetrics[16] = 'gw/us/en/welcomeOV2-shop/msg-5/hho/l1/digital presses-go digital go far/var/20080331';
productMapsMetrics[17] = 'gw/us/en/welcomeOV2-shop/msg-5/hho/l1/accessories and parts-travel in style/var/20080331';

var productMetrics = new Array();
productMetrics[0] = new Array();
productMetrics[0][0] = "gw/us/en/welcomeOV2-shop/msg-5/hho/l1/notebooks/fixed/20080331";
productMetrics[0][1] = "gw/us/en/welcomeOV2-shop/msg-5/smb/l1/notebooks/fixed/20080331";
productMetrics[0][2] = "gw/us/en/welcomeOV2-shop/msg-5/leb/l3/notebooks/fixed/20080331";
productMetrics[0][3] = "gw/us/en/welcomeOV2-shop/msg-5/ghe/l4/notebooks/fixed/20080331";

productMetrics[1] = new Array();
productMetrics[1][0] = "gw/us/en/welcomeOV2-shop/msg-5/hho/l1/desktops/fixed/20080331";
productMetrics[1][1] = "gw/us/en/welcomeOV2-shop/msg-5/smb/l2/desktops/fixed/20080331";
productMetrics[1][2] = "gw/us/en/welcomeOV2-shop/msg-5/leb/l3/desktops/fixed/20080331";
productMetrics[1][3] = "gw/us/en/welcomeOV2-shop/msg-5/ghe/l4/desktops/fixed/20080331";

productMetrics[2] = new Array();
productMetrics[2][0] = "gw/us/en/welcomeOV2-shop/msg-5/hho/l1/blackbird/fixed/20080331";
productMetrics[2][1] = "gw/us/en/welcomeOV2-shop/msg-5/hho/l2/voodoo/fixed/20080331";

productMetrics[3] = new Array();
productMetrics[3][0] = "gw/us/en/welcomeOV2-shop/msg-5/hho/l1/printers/fixed/20080331";
productMetrics[3][1] = "gw/us/en/welcomeOV2-shop/msg-5/smb/l2/printers/fixed/20080331";
productMetrics[3][2] = "gw/us/en/welcomeOV2-shop/msg-5/leb/l3/printers/fixed/20080331";
productMetrics[3][3] = "gw/us/en/welcomeOV2-shop/msg-5/ga/l4/printers/fixed/20080331";
productMetrics[3][4] = "gw/us/en/welcomeOV2-shop/msg-5/ghe/l5/printers/fixed/20080331";

productMetrics[4] = new Array();
productMetrics[4][0] = "gw/us/en/welcomeOV2-shop/msg-5/any/l4/ink toner paper/fixed/20080331";

productMetrics[5] = new Array();
productMetrics[5][0] = "gw/us/en/welcomeOV2-shop/msg-5/hho/l1/handhelds/fixed/20080331";
productMetrics[5][1] = "gw/us/en/welcomeOV2-shop/msg-5/smb/l2/handhelds/fixed/20080331";
productMetrics[5][2] = "gw/us/en/welcomeOV2-shop/msg-5/leb/l3/handhelds/fixed/20080331";
productMetrics[5][3] = "gw/us/en/welcomeOV2-shop/msg-5/ghe/l4/handhelds/fixed/20080331";

productMetrics[6] = new Array();
productMetrics[6][0] = "gw/us/en/welcomeOV2-shop/msg-5/hho/l1/scanners/fixed/20080331";
productMetrics[6][1] = "gw/us/en/welcomeOV2-shop/msg-5/smb/l2/scanners/fixed/20080331";
productMetrics[6][2] = "gw/us/en/welcomeOV2-shop/msg-5/leb/l3/scanners/fixed/20080331";
productMetrics[6][3] = "gw/us/en/welcomeOV2-shop/msg-5/ghe/l4/scanners/fixed/20080331";

productMetrics[7] = new Array();
productMetrics[7][0] = "gw/us/en/welcomeOV2-shop/msg-5/hho/l1/digital photography/fixed/20080331";
productMetrics[7][1] = "gw/us/en/welcomeOV2-shop/msg-5/smb/l2/digital photography/fixed/20080331";
productMetrics[7][2] = "gw/us/en/welcomeOV2-shop/msg-5/leb/l3/digital photography/fixed/20080331";
productMetrics[7][3] = "gw/us/en/welcomeOV2-shop/msg-5/ghe/l4/digital photography/fixed/20080331";

productMetrics[8] = new Array();
productMetrics[8][0] = "gw/us/en/welcomeOV2-shop/msg-5/hho/l1/televisions/fixed/20080331";
productMetrics[8][1] = "gw/us/en/welcomeOV2-shop/msg-5/smb/l2/televisions/fixed/20080331";
productMetrics[8][2] = "gw/us/en/welcomeOV2-shop/msg-5/leb/l3/televisions/fixed/20080331";
productMetrics[8][3] = "gw/us/en/welcomeOV2-shop/msg-5/ghe/l4/televisions/fixed/20080331";

productMetrics[9] = new Array();
productMetrics[9][0] = "gw/us/en/welcomeOV2-shop/msg-5/hho/l1/servers/fixed/20080331";
productMetrics[9][1] = "gw/us/en/welcomeOV2-shop/msg-5/smb/l2/servers/fixed/20080331";
productMetrics[9][2] = "gw/us/en/welcomeOV2-shop/msg-5/leb/l3/servers/fixed/20080331";
productMetrics[9][3] = "gw/us/en/welcomeOV2-shop/msg-5/ghe/l4/servers/fixed/20080331";

productMetrics[10] = new Array();
productMetrics[10][0] = "gw/us/en/welcomeOV2-shop/msg-5/smb/l1/blades/fixed/20080331";
productMetrics[10][1] = "gw/us/en/welcomeOV2-shop/msg-5/leb/l2/blades/fixed/20080331";
productMetrics[10][2] = "gw/us/en/welcomeOV2-shop/msg-5/ghe/l3/blades/fixed/20080331";

productMetrics[11] = new Array();
productMetrics[11][0] = "gw/us/en/welcomeOV2-shop/msg-5/smb/l1/storage/fixed/20080331";
productMetrics[11][1] = "gw/us/en/welcomeOV2-shop/msg-5/leb/l2/storage/fixed/20080331";
productMetrics[11][2] = "gw/us/en/welcomeOV2-shop/msg-5/ghe/l3/storage/fixed/20080331";

productMetrics[12] = new Array();
productMetrics[12][0] = "gw/us/en/welcomeOV2-shop/msg-5/hho/l1/services/fixed/20080124";
productMetrics[12][1] = "gw/us/en/welcomeOV2-shop/msg-5/smb/l1/services/fixed/20080331";
productMetrics[12][2] = "gw/us/en/welcomeOV2-shop/msg-5/leb/l2/services/fixed/20080331";

productMetrics[13] = new Array();
productMetrics[13][0] = "gw/us/en/welcomeOV2-shop/msg-5/any/l1/software/fixed/20080331";

productMetrics[14] = new Array();
productMetrics[14][0] = "gw/us/en/welcomeOV2-shop/msg-5/any/l1/networking/fixed/20080331";

productMetrics[15] = new Array();
productMetrics[15][0] = "gw/us/en/welcomeOV2-shop/msg-5/smb/l1/lf printers/fixed/20080331";
productMetrics[15][1] = "gw/us/en/welcomeOV2-shop/msg-5/ghe/l2/lf printers/fixed/20080331";
productMetrics[15][2] = "gw/us/en/welcomeOV2-shop/msg-5/ga/l3/lf printers/fixed/20080331";

productMetrics[16] = new Array();
productMetrics[16][0] = "gw/us/en/welcomeOV2-shop/msg-5/ga/l1/digital presses/fixed/20080331";

productMetrics[17] = new Array();
productMetrics[17][0] = "gw/us/en/welcomeOV2-shop/msg-5/any/l1/accessories/fixed/20080331";

// Version D product metrics
var productMetricsD = new Array();
productMetricsD[0] = new Array();
productMetricsD[0][0]='gw/us/en/welcomeOV2-shop/msg-5/hho/l1/notebooks/fixed/20080331';
productMetricsD[0][1]='gw/us/en/welcomeOV2-shop/msg-5/hho/l2/desktops/fixed/20080331';
productMetricsD[0][2]='gw/us/en/welcomeOV2-shop/msg-5/hho/l3/printers/fixed/20080331';
productMetricsD[0][3]='gw/us/en/welcomeOV2-shop/msg-5/hho/l4/ink toner paper/fixed/20080331';
productMetricsD[0][4]='gw/us/en/welcomeOV2-shop/msg-5/hho/l5/handhelds and calculators/fixed/20080331';
productMetricsD[0][5]='gw/us/en/welcomeOV2-shop/msg-5/hho/l6/scanners and fax/fixed/20080331';
productMetricsD[0][6]='gw/us/en/welcomeOV2-shop/msg-5/hho/l7/digital photo/fixed/20080331';
productMetricsD[0][7]='gw/us/en/welcomeOV2-shop/msg-5/hho/l8/televisions/fixed/20080331';
productMetricsD[0][8]='gw/us/en/welcomeOV2-shop/msg-5/hho/l9/servers/fixed/20080331';
productMetricsD[0][9]='gw/us/en/welcomeOV2-shop/msg-5/hho/l10/services/fixed/20080331';
productMetricsD[0][12]='gw/us/en/welcomeOV2-shop/msg-5/hho/l11/accessories and parts/fixed/20080331';

productMetricsD[1] = new Array();
productMetricsD[1][0]='gw/us/en/welcomeOV2-shop/msg-5/smb/l1/notebooks/fixed/20080331';
productMetricsD[1][1]='gw/us/en/welcomeOV2-shop/msg-5/smb/l2/desktops/fixed/20080331';
productMetricsD[1][2]='gw/us/en/welcomeOV2-shop/msg-5/smb/l3/printers/fixed/20080331';
productMetricsD[1][3]='gw/us/en/welcomeOV2-shop/msg-5/smb/l4/ink toner paper/fixed/20080331';
productMetricsD[1][4]='gw/us/en/welcomeOV2-shop/msg-5/smb/l5/monitors/fixed/20080331';
productMetricsD[1][5]='gw/us/en/welcomeOV2-shop/msg-5/smb/l6/servers/fixed/20080331';
productMetricsD[1][6]='gw/us/en/welcomeOV2-shop/msg-5/smb/l7/blades/fixed/20080331';
productMetricsD[1][7]='gw/us/en/welcomeOV2-shop/msg-5/smb/l8/storage/fixed/20080331';
productMetricsD[1][8]='gw/us/en/welcomeOV2-shop/msg-5/smb/l9/networking/fixed/20080331';
productMetricsD[1][9]='gw/us/en/welcomeOV2-shop/msg-5/smb/l10/services/fixed/20080331';
productMetricsD[1][10]='gw/us/en/welcomeOV2-shop/msg-5/smb/l11/software/fixed/20080331';
productMetricsD[1][11]='gw/us/en/welcomeOV2-shop/msg-5/smb/l12/handhelds and calculators/fixed/20080331';
productMetricsD[1][12]='gw/us/en/welcomeOV2-shop/msg-5/smb/l13/scanners and fax/fixed/20080331';
productMetricsD[1][13]='gw/us/en/welcomeOV2-shop/msg-5/smb/l14/digital photo/fixed/20080331';

productMetricsD[2] = new Array();
productMetricsD[2][0]='gw/us/en/welcomeOV2-shop/msg-5/leb/l1/servers/fixed/20080331';
productMetricsD[2][1]='gw/us/en/welcomeOV2-shop/msg-5/leb/l2/storage/fixed/20080331';
productMetricsD[2][2]='gw/us/en/welcomeOV2-shop/msg-5/leb/l3/blades/fixed/20080331';
productMetricsD[2][3]='gw/us/en/welcomeOV2-shop/msg-5/leb/l4/services/fixed/20080331';
productMetricsD[2][4]='gw/us/en/welcomeOV2-shop/msg-5/leb/l5/software/fixed/20080331';
productMetricsD[2][5]='gw/us/en/welcomeOV2-shop/msg-5/leb/l6/printers/fixed/20080331';
productMetricsD[2][6]='gw/us/en/welcomeOV2-shop/msg-5/leb/l7/notebooks/fixed/20080331';
productMetricsD[2][7]='gw/us/en/welcomeOV2-shop/msg-5/leb/l8/desktops/fixed/20080331';
productMetricsD[2][8]='gw/us/en/welcomeOV2-shop/msg-5/leb/l9/ink toner paper/fixed/20080331';
productMetricsD[2][9]='gw/us/en/welcomeOV2-shop/msg-5/leb/l10/networking/fixed/20080331';
productMetricsD[2][10]='gw/us/en/welcomeOV2-shop/msg-5/leb/l11/handhelds and calculators/fixed/20080331';
productMetricsD[2][11]='gw/us/en/welcomeOV2-shop/msg-5/leb/l12/scanners and fax/fixed/20080331';
productMetricsD[2][12]='gw/us/en/welcomeOV2-shop/msg-5/leb/l13/digital photo/fixed/20080331';

productMetricsD[2][13]='gw/us/en/welcomeOV2-shop/msg-5/leb/l14/monitors/fixed/20080331';
productMetricsD[2][14]='gw/us/en/welcomeOV2-shop/msg-5/leb/l15/accessories and parts/fixed/20080331';

productMetricsD[3] = new Array();
productMetricsD[3][0]='gw/us/en/welcomeOV2-shop/msg-5/ghe/l1/notebooks/fixed/20080331';
productMetricsD[3][1]='gw/us/en/welcomeOV2-shop/msg-5/ghe/l2/desktops/fixed/20080331';
productMetricsD[3][2]='gw/us/en/welcomeOV2-shop/msg-5/ghe/l3/handhelds and calculators/fixed/20080331';
productMetricsD[3][3]='gw/us/en/welcomeOV2-shop/msg-5/ghe/l4/servers/fixed/20080331';
productMetricsD[3][4]='gw/us/en/welcomeOV2-shop/msg-5/ghe/l5/blades/fixed/20080331';
productMetricsD[3][5]='gw/us/en/welcomeOV2-shop/msg-5/ghe/l6/storage/fixed/20080331';
productMetricsD[3][6]='gw/us/en/welcomeOV2-shop/msg-5/ghe/l7/networking/fixed/20080331';
productMetricsD[3][7]='gw/us/en/welcomeOV2-shop/msg-5/ghe/l8/services/fixed/20080331';
productMetricsD[3][8]='gw/us/en/welcomeOV2-shop/msg-5/ghe/l9/software/fixed/20080331';
productMetricsD[3][9]='gw/us/en/welcomeOV2-shop/msg-5/ghe/l10/monitors/fixed/20080331';
productMetricsD[3][10]='gw/us/en/welcomeOV2-shop/msg-5/ghe/l11/printers/fixed/20080331';
productMetricsD[3][11]='gw/us/en/welcomeOV2-shop/msg-5/ghe/l12/ink toner paper/fixed/20080331';
productMetricsD[3][12]='gw/us/en/welcomeOV2-shop/msg-5/ghe/l13/scanners and fax/fixed/20080331';
productMetricsD[3][13]='gw/us/en/welcomeOV2-shop/msg-5/ghe/l14/large format printers/fixed/20080331';
productMetricsD[3][14]='gw/us/en/welcomeOV2-shop/msg-5/ghe/l15/digital photo/fixed/20080331';

productMetricsD[4] = new Array();
productMetricsD[4][0]='gw/us/en/welcomeOV2-shop/msg-5/ga/l1/digital presses/fixed/20080331';
productMetricsD[4][1]='gw/us/en/welcomeOV2-shop/msg-5/ga/l2/industrial wide format printers/fixed/20080331';
productMetricsD[4][2]='gw/us/en/welcomeOV2-shop/msg-5/ga/l3/large format printers/fixed/20080331';
productMetricsD[4][3]='gw/us/en/welcomeOV2-shop/msg-5/ga/l4/laserjet printers/fixed/20080331';
productMetricsD[4][4]='gw/us/en/welcomeOV2-shop/msg-5/ga/l5/professional photo printers/fixed/20080331';
productMetricsD[4][5]='gw/us/en/welcomeOV2-shop/msg-5/ga/l6/specialty printing systems/fixed/20080331';
productMetricsD[4][6]='gw/us/en/welcomeOV2-shop/msg-5/ga/l7/ink supplies accessories/fixed/20080429';

productMetricsD[5] = new Array();
productMetricsD[5][0]='gw/us/en/welcomeOV2-shop/msg-5/hho/l1/hp blackbird/fixed/20080331';
productMetricsD[5][1]='gw/us/en/welcomeOV2-shop/msg-5/hho/l2/voodoo pc/fixed/20080331';
productMetricsD[5][2]='gw/us/en/welcomeOV2-shop/msg-5/hho/l3/all gaming systems/fixed/20080331';

function getLoadedMetrics(loadedText) {
	var result = "";	
	var parsedMetrics = loadedText.split("/");	
	parsedMetrics[8] += "-not loaded";
	result = parsedMetrics.join("/");
	return result;
}

//Preload hpSS images
function preloadProdImg(s){	
	var flyoutImgLength = 18;
	var segm = getSegmCookie();	
	var imgLength = (segm > -1) ? s.length : flyoutImgLength; // set image length to load depending on page version
	window['imgPreload'] = [];
	
	if(imgLength > 0){	
		var i = imgLength -1;
		do {	if(segm > -1 && s[i].useSS && s[i].imgChild.length > 0){
					window['imgPreload_' + i] = [];
					var imgChild = s[i].imgChild;
					var j = imgChild.length - 1;
					do 	{ 	if(imgChild[j].img){				
								window['imgPreload_' + i][j] = new Image;
								window['imgPreload_' + i][j].src = hpCoreDir + hpImgDir + imgChild[j].img;			
							}
					}  while (j--);
				}
				window['imgPreload'][i] = new Image;
				window['imgPreload'][i].src = hpCoreDir + hpImgDir + hpSS[i].img;			
		}while(i--);
	}
}

function preLoadShopHeaders() {
	shopImageCurrent = -1;
	var prodNavLimit = 18;
	var segm = getSegmCookie();	
	shopSegmentPreloadImage["HHO"] = new Image;
	shopSegmentPreloadImage["HHO"].src = prodSegmentImages["HHO"];

	if(segm>-1 || hpVersion == 'accordion') {		
		shopSegmentPreloadImage["SMB"] = new Image;
		shopSegmentPreloadImage["LEB"] = new Image;
		shopSegmentPreloadImage["GHE"] = new Image;
		shopSegmentPreloadImage["GA"] = new Image;
		shopSegmentPreloadImage["GS"] = new Image;		
		shopSegmentPreloadImage["SMB"].src = prodSegmentImages["SMB"];
		shopSegmentPreloadImage["LEB"].src = prodSegmentImages["LEB"];
		shopSegmentPreloadImage["GHE"].src = prodSegmentImages["GHE"];
		shopSegmentPreloadImage["GA"].src = prodSegmentImages["GA"];
		shopSegmentPreloadImage["GS"].src = prodSegmentImages["GS"];
	}	
	shop_loaded = -1;	
}

function getUlItem(element) {
	return element.parentNode.parentNode;
}

//*** ADDED (Expand Fix for version hybrid)
function setExpand(obj, str, to_rpl){ 		
	var rpl_with = (to_rpl == 'Expand' ) ? 'Expanded': 'Expand';		
	obj.firstChild.innerHTML = str.replace(to_rpl, rpl_with);
}
//*** END ADDED

function toggleProduct(imgNumber, liItem, visible) { hp_prod_img_num = imgNumber;
	var ulSection =	liItem.getElementsByTagName('UL')[0];
	//*** ADDED
	var linkSection = liItem.getElementsByTagName('A')[0];
	var imgNum = parseInt(liItem.getAttribute('id').split('_')[1]);	

	for(var i=0; i < hp_products_li_counter; i++){
		var liItem2 = document.getElementById("productList_"+i);
		var ulSection2 = liItem2.getElementsByTagName('UL')[0];	
		liItem2.style.background = "none";
		ulSection2.style.display = 'none';				
		liItem2.firstChild.innerHTML = productDefault[i];
	}
	if (visible){
		setExpand(liItem, productDefault[imgNum],'Expand');// Line added for expand fix
		liItem.style.backgroundColor = '#CCCCCC';
		linkSection.style.color = '#000000';
		ulSection.style.display = 'block';



	}else {
		liItem.style.backgroundColor = '#FFFFFF';
		ulSection.style.display = 'none';
		linkSection.style.color = '#666666';
	}
}

function changImage(divItem)
{
	divItem.innerHTML = '<img src="images/seg_hho_080326_earthday1.jpg" alt="It\'s easy to recycle your HP ink cartridges and printers. Get the scoop on all our recycling initiatives, like the HP Trade-in Program." width="338" height="336" border="0" />';
}

function toggleProductFromMap(e){
	var obj	= (is_ie) ? window.event.srcElement : e.target;
	var imgNum = parseInt(obj.getAttribute('id').split('_')[1]);
	var liItem = document.getElementById("productList_"+imgNum);	
	toggleProduct(imgNum, liItem, false);
}

function toggleProductFromLI(e){	
	var obj	= (is_ie) ? window.event.srcElement : e.target;	
	var imgNum = parseInt(obj.parentNode.getAttribute('id').split('_')[1]);
	toggleProduct(imgNum, obj.parentNode, false)
}

function keyTab(e){
	this.keyID 	= (window.event) ? event.keyCode : e.keyCode;
	this.obj	= (is_ie) ? window.event.srcElement : e.target;	
	var r = parseID(this.obj);
	var idText = r[0];
	var idNum = parseInt(r[1]);	
	var l = new listHandler();
	var parent = l.getParent(this.obj);
	var parentLIs = l.getProdSubULs(parent);
	var links = l.getProdSubLinks(parent);

	function parseID(_o){
		return _o.getAttribute('id').split('_');
	}
	
	this.moveNext = function(){
		if (r.length == 3){
			var subIdNum = parseInt(r[2]);		
			if (subIdNum < links.length-1)				
				document.getElementById(idText+'_'+(idNum)+'_'+(subIdNum+1)).focus();
			else
			document.getElementById(idText+'_'+(idNum+1)).focus();
		}else{
			if (idNum < parentLIs.length-1)
				document.getElementById(idText+'_'+(idNum+1)).focus();			
		}		
	}
	
	this.moveBack = function(){	
		if (r.length == 3){
			var subIdNum = parseInt(r[2]);		
			if (subIdNum > 0)				
				document.getElementById(idText+'_'+(idNum)+'_'+(subIdNum-1)).focus();
			else
			document.getElementById(idText+'_'+(idNum)).focus();
		}else{
			if (idNum > 0)
				document.getElementById(idText+'_'+(idNum-1)).focus();			
		}
	}
	
	this.moveRight = function()	{
	   var m = document.getElementById(idText+'_'+idNum+'_'+0)
	   if(l.getParent(m).style.display == 'block')
			m.focus();
	   }
	
	this.moveLeft = function() { 
		this.obj.focus();		
	}
	
	switch(this.keyID)
	{
		case 37: //Left Key
			this.moveLeft();			
		break;		
		case 38: //Up Key
			this.moveBack();
		break;		
		case 39: //Down Key
			this.moveRight();		
		break;		
		case 32: //Down Key
			this.moveRight();		
		break;
		case 40: //Right Key
			this.moveNext();
		break;
	}
}

function listHandler(){
	this.getParent = function(_o){
		return _o.parentNode.parentNode;		
	}
	this.getProdSubULs = function (_o){
		return _o.getElementsByTagName('UL');
	}
	this.getProdSubLinks = function(_o){
		return _o.getElementsByTagName('A');
	}
}

function setProductSubLinkId(_o, _idString){
	var l = new listHandler();
	var	subULs = l.getProdSubULs(_o);	
	if(_idString){
		for (var i = 0; i < subULs.length; i++){
			var prodSubLinks = l.getProdSubLinks(subULs[i]);
			for (var j = 0; j < prodSubLinks.length; j++){
				prodSubLinks[j].setAttribute('id', _idString+'_'+i+'_'+j);
				addEvent(prodSubLinks[j],'keyup',keyTab, false);				

			}
		}return true;
	}else{
		return false;
	}
}

function addProductToggleEvents(){	
	//*** MODIFIED
	var segm = getSegmCookie();
	var productList = document.getElementById('productList');
	if((segm > -1 && hpVersion == 'hybrid')|| hpVersion == 'accordion'){
	} else {
	setProductSubLinkId(productList, 'productLink');
	var prodChildLI = productList.childNodes;	
	window["hp_products_li_counter"] = 0;

		for(var i = 0; i < prodChildLI.length; i++){
			if(prodChildLI[i] && (prodChildLI[i]["tagName"] == "LI")){			
				prodChildLI[i].setAttribute('id','productList_'+hp_products_li_counter);
				prodChildLI[i].firstChild.setAttribute('id','productLink_'+hp_products_li_counter);
				addEvent(prodChildLI[i].firstChild,'focus',toggleProductFromLI, false);
				addEvent(prodChildLI[i].firstChild,'keyup',keyTab, false);
				hp_products_li_counter++;
			}		
			if(prodChildLI[i] && (prodChildLI[i]["tagName"] == "MAP")){
				prodChildLI[i].firstChild.setAttribute('id','productMapList_'+(hp_products_li_counter-1));
				addEvent(prodChildLI[i].firstChild,'focus',toggleProductFromMap, false);
			}	
		}			
	}
}

function addEvent(obj,eve,func,capture){
  if (obj.attachEvent){
    obj.attachEvent('on'+eve,func);
    return true;
  }else  
    if (obj.addEventListener){
      obj.addEventListener(eve,func,capture);
      return true;
    }else
      return false;
}

function globalToggle(obj){
	ulCountries = document.getElementById('countryList');
	ulCountries.style.display = (ulCountries.style.display != 'none') ? 'none' : ulCountries.style.display;
		
	if(!obj || obj.id != 'resourcesMenu'){
		ulResources = document.getElementById('resourcesList');
		ulResources.style.display = (ulResources.style.display != 'none') ? 'none' : ulResources.style.display;	
	}
	var liItem = document.getElementById("productList_"+0);
	if(liItem){ toggleProduct(0, liItem, false); }
}

function prd_changeImg(isOver, prdId, segm) {
	
	hp_prod_img_num = prdId;
	if (prdTimer) {
		clearTimeout(prdTimer);
		prdTimer = null;
	}
	if(typeof(segm) == 'undefined') segm = -1; // segment not specified - gaming systems
	if (isOver)
		prdTimer = setTimeout("prdImageChange(" + prdId + ","+segm+");", 800);	
}

function prdImageChange(imgNumber, segm) {
	hp_prod_img_num = imgNumber;				
	if(typeof(segm) == 'undefined') segm = -1; // segment not specified - gaming systems
	var segment = segment_list[segm];
	
	if ( (shopPreloadCount == shopPreloadImage.length) && (imgNumber != shopImageCurrent || shopSegmCurrent != segment) ) {

		prdImageLoaded = false;
		
		var mainNodeImg = $j('#exploreMain');
		if (hpMenuType == 'flyout'){
			mainNodeImg.attr('src', imgPreload[imgNumber].src); //hpCoreDir+hpImgDir+hpSS[imgNumber].img);
			mainNodeImg.attr('tabIndex', -1);
		}else{
			var imgData = setImageMap(imgNumber, segment);	
			if (imgData){
				mainNodeImg = $j('#exploreMain');
				mainNodeImg.attr('src', imgData['src']);
				$j('#prdWideColumn').empty().html(mainNodeImg).children().after(imgData['map']); // Add the new map to the prdWideColumn Div
				$j('#prdWideColumn area').attr('tabIndex', imgData['tabindex']); //Set the tab index
			}
		}
		try {
			document['exploreMain'].onload = SlideProduct(imgNumber, mainNodeImg);
		} catch (err) {};		
		
		mainNodeImg.attr('useMap', '#imgMap_' + imgNumber); // Add the useMap property
				
		shopImageCurrent = imgNumber;
		shop_loaded = imgNumber;
		currentTabImage = "";
		shopSegmCurrent = segment;
	}
}

function setImageMap(imgNumber, segm){	
	var segment = segm.toLowerCase();
	var imgLi = $j('.img_' + segment + '_' + imgNumber);
	var objLevel = 'l' + $j('#' + segment + '-content .linksUnit li').index(imgLi[0]);
	var result = [];
	var accSegment = (segment == 'gs') ? segment : '';
	if(segment && (imgLi.length>0) && imgNumber>-1){

		//Add the objectId with segment and the onclick event
		var cls = imgLi.children().attr('className').split(' ');
		var onclick =  'onClick="';
			onclick += (cls[1] && cls[1] == 'sw') ? 'setCk(product_cookie, \'software\'); setCk(\'hp_cust_seg_sel\', \'LEB\');' : 'setCk(\'hp_cust_seg_sel\', \''+cls[0].toUpperCase()+'\'); '; 
			onclick += ' saveHist(getHash('+imgNumber+', \''+accSegment+'\'));"';	
							
		var mainNodeImg = $j('#exploreMain');
		var s = hpSS[imgNumber];	
		if(s.useSS && s.imgChild.length > 0){
			var i = s.imgChild.length-1;
			var imgChild = s;
			var imgChildSrc = imgPreload[imgNumber].src;			
			do {	if(eval(segm.toUpperCase()) == s.imgChild[i].segment) {
						if( s.imgChild[i].objId ){
							imgChild.objId = s.imgChild[i].objId;
						}
			
						if( s.imgChild[i].map ){
							imgChild.map = s.imgChild[i].map;							
						}
						
						if( s.imgChild[i].img ){
						imgChildSrc = window['imgPreload_'+imgNumber][i].src; 
						}				
						break;
					}
			} while (i--);
			
			result['src'] = imgChildSrc;		
			result['map'] = imgChild.map.replace(/_OBJECTID_/, imgChild.objId.replace(/_SEGMENT_/, segment).replace(/_LEVEL_/, objLevel)).replace(/_ONCLICK_/, onclick);
			
		}else{
			result['src'] = imgPreload[imgNumber].src;
			result['map'] = hpSS[imgNumber].map.replace(/_OBJECTID_/, hpSS[imgNumber].objId.replace(/_SEGMENT_/, segment).replace(/_LEVEL_/, objLevel)).replace(/_ONCLICK_/, onclick);
		}	
		result['tabindex'] = imgLi.children().attr('tabIndex');
		return result;
	}else{ return false; }
}

function SlideProduct(imgNumber, imgNode) {
	imgNode.show();
	$j('#prdWideColumn').SlideInLeft(500, function(){imgNode.attr('tabIndex', 0); } );	
	prdImageLoaded = true;
}

function getHash(n, seg) {
	var s = seg ? "_"+seg : ''; 
	var newHash = window.location.hash.substring(1, expHash.length).split('_')[0];
	newHash += "_"+n+s;
	return newHash;
}

function checkImageStatus(ulItem, linkItem) {
	s_objectID = (prdImageLoaded) ? objIDver(productMetrics[ulItem][linkItem]) : objIDver(getLoadedMetrics(productMetrics[ulItem][linkItem]));
	s_hp_fixObjectID(s_objectID);
}

function checkImageStatusD(segm, linkItem) {
	s_objectID = (prdImageLoaded)? objIDver(productMetricsD[segm][linkItem]) : s_objectID = objIDver(getLoadedMetrics(productMetricsD[segm][linkItem]));
	s_hp_fixObjectID(s_objectID);
}

/************** Support Functions *************************/
var supportSelectedRadio = null;

function drawGMNButton() {
	// This function decides whether or not to draw the "product detection" button.
	// This button has its own FORM. Nested html forms are invalid, so it is moved into right position in this function.
	var str = "";
	if(is_win && (is_ie6 || is_ie7) && (!is_opera)){
		str = '<div>\n\
			<h3 class="bold" style="font-size: 120%;">Or automatically detect products</h3>\n\
			<div class="topSpaceSmall bottomSpace"></div>\n\
			<form action="http://h20270.www2.hp.com/ediags/gmn2/index.aspx" method="get" name="productDetect" id="productDetect" class="zeroMargin centerAligned">\n\
			<input type="submit" name="detectProducts" class="grayButton" tabindex="130" value="Start Detection &raquo;">\n\
			<input type="hidden" name="lc" value="en">\n\
			<input type="hidden" name="cc" value="us">\n\
			</form>\n\
			<div class="small topSpace linkColor">&raquo;&nbsp;<a href="http://h20270.www2.hp.com/ediags/gmn2/index.aspx?about=yes" tabindex="130">About automatic product detection</a></div>\n\
			</div>';
	}
	if (str != "") {
		var btnNode = document.getElementById("supportProductDetect");

		if (btnNode) {
			btnNode.style.top = document.getElementById("supportProductSearch").offsetParent.offsetTop + "px";
			btnNode.style.display = "block";
			btnNode.innerHTML = str;
		}
	}
}

function toggleSupportBottom(visible) {
	var tabIndex = 30;
	var unClickable = document.getElementById('unClickable');
	if (!visible) {
		document.productQuery.h_query.disabled = true;
		document.getElementById("supportSubmitBtn").disabled = true;
		if ( document.getElementById("detectProducts") )
			document.getElementById("detectProducts").disabled = true;
		$j('#supportLeftColumn a').attr("tabIndex", "-1");
		unClickable.style.display = 'block';
		unClickable.style.height = (unClickable.offsetParent.offsetHeight - unClickable.offsetTop) + 'px';
	} else {
		if (unClickable.style.display == 'block') {
			// If bottom part is grayed-out then activate it else skip
			document.productQuery.h_query.disabled = false;
			document.getElementById("supportSubmitBtn").disabled = false;
			if ( document.getElementById("detectProducts") )
				document.getElementById("detectProducts").disabled = false;
			$j('#supportLeftColumn a').attr("tabIndex", tabIndex);
			unClickable.style.display = 'none';
		}
	}
}

//Begin Empty text field validation
function validText() {
	if  (document.productQuery.h_query.value == "" || document.productQuery.h_query.value == document.productQuery.h_query.defaultValue) {
	}
	return true;
}
	
// Clear text box information function
function clearText(textInfo){
	if (textInfo.value == textInfo.defaultValue)
		textInfo.value = "" ;	
}

// Begin Form Validation
function validateForm(){
	if (!validText())
	return false;
	if ( document.productQuery.h_pagetype[0].checked==false && document.productQuery.h_pagetype[1].checked==false )
		document.productQuery.h_pagetype[1].checked = true;	
	return true;
}

var activeTab = 'Main';
var activeSeg = 'None';
var tabtimerID=null;
var segtimerID=null;

function delay_changeSeg(_v,func) {
	if (segtimerID) {
		clearTimeout(segtimerID);
		segtimerID = null;
	}	
	if(_v){
		segtimerID = setTimeout("segChanged('"+func+"');",400);
	}
}

function delay_changeTab(_v,func,linkID) {
	if(func != activeTab){
		if(_v){
			tabtimerID = setTimeout( "simulateClick('"+linkID+"');", 400 );
		} else {
			if(tabtimerID) {
				clearTimeout(tabtimerID);
				tabtimerID=null;
			}
		}
	}
}

function simulateClick(linkID) {
	if(tabtimerID) {
		clearTimeout(tabtimerID);
		tabtimerID=null;
	}
	var linkNode = document.getElementById(linkID);
	if ( document.createEvent ) {
		var evt = document.createEvent("MouseEvents");
		evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
		linkNode.dispatchEvent(evt);
		location.href = linkNode.href;
	} else {
		linkNode.click();
	}
}

function restoreSegment(segElement) {
	var segStyle = document.getElementById(segElement);	
	if (segStyle != null) {
		segStyle.firstChild.style.color = '#FFFFFF';
		segStyle.parentNode.style.backgroundColor = 'transparent';
		segStyle.style.backgroundColor = '#202020';
		segStyle.style.borderLeft = '4px solid #2D2D2D';
		segStyle.style.borderTop = '9px solid #2D2D2D';
	}
}

function segChanged(segName) {	
	if(activeTab != 'Main') return;
	
	// stop messaging animation
	if(activeSeg == 'None'){
		clearTimeout(timerSlide);
		slideShowSuspended = true;
	}
	
	if (activeSeg != segName) {		
		var newSegment = document.getElementById("tab"+segName);
	
		// Restore previous active tab
		if(activeSeg != 'None'){
			restoreSegment("tab"+activeSeg);
		}
		// Highlight new tab
		if((segName != 'None') && (newSegment)){
			newSegment.firstChild.style.color = '#000000';
			newSegment.parentNode.style.backgroundColor = '#FFFFFF';
			newSegment.style.backgroundColor = '#FFFFFF';
			newSegment.style.borderLeft = '4px solid #FFFFFF';
			newSegment.style.borderTop = '9px solid #FFFFFF';
		}		
		activeSeg = segName;		
		var segmentsShowUp = document.getElementById('segmentsShowUp');
		if (segmentsShowUp){
			var segmentsShowUpStyLeft = segmentsShowUp.style.left;
			if (segName == 'HHO') {segmentsShowUp.style.left = '0px';}
			if (segName == 'SMB') {segmentsShowUp.style.left = '177px';}
			if (segName == 'LEB') {segmentsShowUp.style.left = '173px';}
			if (segName == 'GHE') {segmentsShowUp.style.left = '202px';}
			if (segName == 'GA')  { segmentsShowUp.style.left = '330px';}
			getSegment(segName);
		}
	}
}

function tabChanged(tabName){
	
	var hashArray = window.location.hash.split('_');
	if(hashArray[1] || hashArray[2]){
		rememberMe = true;
		hp_prod_img_num = hashArray[1];
		hp_explore_img_num = hashArray[1];
		hp_acc_segment = hashArray[2];
	}
	if(tabName != activeTab ) {
	
		if(tabtimerID) {
			clearTimeout(tabtimerID);
			tabtimerID=null;
		}		
		// save tab change in history		
		saveHist(tabName);
		
		// stop messaging animation
		if(activeTab == 'Main'){
			clearTimeout(timerSlide);
			slideShowSuspended = true;
		}
		// Restore previous active tab
		if(activeTab != 'Main'){
			var activeTabLink = document.getElementById("tab"+activeTab+"Link");

			activeTabLink.style.fontSize = '100%';
			activeTabLink.style.color = '#FFFFFF';
			activeTabLink.getElementsByTagName("SPAN")[0].firstChild.nodeValue = " - Tab";
			
			document.getElementById("tab"+activeTab).style.marginTop = "";
			document.getElementById("tab"+activeTab+"Bg").style.backgroundColor = "";		
						
			if(activeTab == 'Product') { document.getElementById("grayDividerA").style.borderRight='2px solid #CCCCCC'; document.getElementById("grayDividerB").style.borderRight='2px solid #CCCCCC'; }
			if(activeTab == 'Support') { document.getElementById("grayDividerB").style.borderRight='2px solid #CCCCCC'; document.getElementById("grayDividerC").style.borderRight='2px solid #CCCCCC'; }
			if(activeTab == 'Explore') { document.getElementById("grayDividerC").style.borderRight='2px solid #CCCCCC'; }
		}
		// Highlight new tab
		if(tabName != 'Main'){
			document.getElementById("tabHomeLink").getElementsByTagName("SPAN")[0].firstChild.nodeValue = " - Tab";
			var newTabLink = document.getElementById("tab"+tabName+"Link");
				newTabLink.style.fontSize = '120%';
				newTabLink.style.color = '#000000';
				newTabLink.getElementsByTagName("SPAN")[0].firstChild.nodeValue = " - Tab Selected";

				document.getElementById("homeImg").src = hpCoreDir+hpImgDir+'home_off.gif';
				document.getElementById("tab"+tabName).style.marginTop = "16px";
				document.getElementById("tab"+tabName+"Bg").style.backgroundColor = "#FFFFFF";
						
			if(tabName == 'Product') {
				document.getElementById("grayDividerA").style.borderRight='0px';
				document.getElementById("grayDividerB").style.borderRight='0px';
				// Metrics 
				if (typeof s_sendAnalyticsEvent == "function") {
					s_screen="shop for products"; 
					s_sendAnalyticsEvent("","gw: us/en: welcome OV2 cookies"); 
				}
			}
			if(tabName == 'Support') { 
				document.getElementById("grayDividerB").style.borderRight='0px';
				document.getElementById("grayDividerC").style.borderRight='0px';
				document.getElementById("tabProduct").style.paddingLeft='20px';
				// Metrics
				if (typeof s_sendAnalyticsEvent == "function") {
					s_screen="support & drivers";
					s_sendAnalyticsEvent("","gw: us/en: welcome OV2 cookies");
				}
				hp_prod_img_num = -1; // Accordion fix
			}
			if(tabName == 'Explore') { 
				document.getElementById("grayDividerC").style.borderRight='0px';
				// Metrics
				if (typeof s_sendAnalyticsEvent == "function") {
					s_screen="explore & create";
					s_sendAnalyticsEvent("","gw: us/en: welcome OV2 cookies");
				}
				hp_prod_img_num = -1; // Accordion fix				
			}
		}else{
			goHome();			
			return;
		}
		
		activeTab = tabName;
		eval('get'+tabName+'()');
	}
}

/***** Cookie functions *****/
function isNumber(a) {
	if (a.length>1){return false;}
	var string="1234567890";
	if (string.indexOf(a)!=-1){return true;}
	return false;
}

function _CK_(_duration, _path, _domain){
	this.domain = _domain;
	this.duration = _duration;
	this.path = _path;
	this.exist = function(_n){ var sM = document.cookie.match(new RegExp("(" + _n + "=[^;]*)(;|$)")); return sM ? unescape(sM[1]) : null; }
	this.get = function (_n) { var sR = document.cookie.match ( _n + '=(.*?)(;|$)' ); return sR ? unescape(sR[1]) : null; }
	this.set = function( _name, _value, _duration, _path, _domain, _secure ){ 
		var duration = (_duration) ? _duration : this.duration;
		var path = (_path) ? _path : this.path;
		var domain = (_domain) ? _domain : this.domain;
		if( duration ){ var date = new Date ( ); date.setTime(date.getTime()+(duration*24*60*60*1000));	var dExpires = date.toGMTString(); }	
		document.cookie = _name +"="+ escape(_value) +";expires="+dExpires + ((domain) ? "; domain=" + domain : "") + ((path) ? "; path=" + path : "")};	
	this.del = function(_name, _domain) { 
		var domain = (_domain) ? _domain : this.domain; var date = new Date(); date.setFullYear(date.getYear() - 1); 
		document.cookie=_name + "=; expires=" + date.toGMTString() + ((domain) ? "; domain=" + domain : ""); }
}

function segmCookie() {
	var Preference=_Ck_.get('hp_cust_seg_sel');
	if (Preference!=null) {
		var numPreference = Preference;
		if(!isNumber(Preference)) { // map string value to numeric index
			// search index of prefered segment in current list
			for(var nIndex in seg_choices) {
				if(seg_choices[nIndex] == Preference) {
					numPreference = nIndex;
					break;
				}
				numPreference = -1;
			}
			if(numPreference == -1) 
				numPreference = 0; // prefered segment is not present in current list (segment not in country)			
		} else {  // value stored in cookie is a number, replace by string equivalent
			if(numPreference < seg_choices.length) {
				_Ck_.set( 'hp_cust_seg_sel', seg_choices[numPreference]);				
			} else {				
				_Ck_.set( 'hp_cust_seg_sel', seg_choices[0]);			
				numPreference = 0;
			}
		}
		selectedSegm = numPreference;
	}
}

function setMsgSrc(_sP){
	if(CORPORATE){  return _sP;
	}else{
		var rArray = new Array();
		for(var i=0; i < _sP.length-1; i++ ){
			rArray[i] = _sP[i+1];
		}
		return rArray;
	}
}

if(!CORPORATE) var CORPORATE = false;
var z = (CORPORATE)?0:1;
var CORP = 0 ;
var HHO = 1-z;
var SMB = 2-z;
var LEB = 3-z;
var GHE = 4-z;
var GA = 5-z;
var GS = 6-z; // only for expandable products list version not for cookies
var defaultMsgSegment = HHO; // Set default messaging image map to show
var seglist = (CORPORATE)? "CORP,HHO,SMB,LEB,GHE,GA" : "HHO,SMB,LEB,GHE,GA";   // List of available segments on the welcome page
var seg_choices = seglist.split(",");

var selectedSegm = (CORPORATE) ? CORP : defaultMsgSegment;
segmCookie();
selectedSegm = parseInt(selectedSegm);

/***** Messaging *****/

if(!src_primary) var src_primary = new Array();
var msgImgs = new Array();
var msgImgsPreloadCount = 0;
var activeMsg = selectedSegm;

if(selectedSegm > 2) activeMsg = 3;
if((selectedSegm > 3) && (CORPORATE)) activeMsg = 4;

var numSprite = hpCoreDir+hpImgDir+'num_sprite.png';
var timerSlide=null;
var timerImageFade=null;
var slideOpacity = 100;
var slideStay = 6000;
var slideCyclesMax = (CORPORATE) ? 4:3;
var slideCycle = 1;
var slideshowIsOn = true;
var slideShowSuspended = false;
var slideStateTextPause = 'Pause slideshow';
var slideStateTextPlay = 'Resume slideshow';
var slideMsgImgNode = null;
var totalImgs = (selectedSegm > 2)?4:3;
if(CORPORATE) totalImgs = (selectedSegm > 3)?5:4;

var spriteCoords_3img = new Array();
spriteCoords_3img[0] = '0px 0px';
spriteCoords_3img[1] = '0px -40px';
spriteCoords_3img[2] = '0px -80px';

if(totalImgs >= 5) {
	var spriteCoords_5img = new Array();
	spriteCoords_5img[0] = '0px -280px';
	spriteCoords_5img[1] = '0px -320px';
	spriteCoords_5img[2] = '0px -360px';
	spriteCoords_5img[3] = '0px -400px';
	spriteCoords_5img[4] = '0px -440px';
}else if((CORPORATE) && (totalImgs == 4)) {
	var spriteCoords_4img = new Array();
	spriteCoords_4img[0] = '0px -280px';
	spriteCoords_4img[1] = '0px -320px';
	spriteCoords_4img[2] = '0px -360px';
	spriteCoords_4img[3] = '0px -400px';
	spriteCoords_4img[4] = '0px -440px';
}else if(totalImgs == 4){
	var spriteCoords_4img = new Array();
	spriteCoords_4img[0] = '0px -120px';
	spriteCoords_4img[1] = '0px -160px';
	spriteCoords_4img[2] = '0px -200px';
	spriteCoords_4img[3] = '0px -240px';
}

function preloadMsgImg(){ 
	if ((msgImgsPreloadCount > 0) && (msgImgsPreloadCount == msgImgs.length)) return;  //Skip preloading if already done	
	for(var i=0; i < src_primary.length; i++){
		msgImgs[i] = new Image;
		msgImgs[i].onload = function(){msgImgsPreloadCount++;};   // When the image is loaded, increment the preloaded counter
		msgImgs[i].src = src_primary[i][0];
	}
}

function updateControls(active) {
	var prMap = (CORPORATE) ? active : (active+1);
	if ( document.getElementById("controlsSection") == null ) return;
	document.getElementById("priMapContainer").innerHTML = src_primary[active][1];//Replace image map 
	document.getElementById("msgImg").useMap = "#map_primary" + prMap;
	
	var controlNumImg = document.getElementById("controlNumImg");
	controlNumImg.style.backgroundImage='url('+numSprite+')';
	controlNumImg.style.width=(totalImgs==3 ? 76 : ((totalImgs>4)&&(CORPORATE))?126:101) +'px';
	controlNumImg.style.backgroundPosition=eval('spriteCoords_'+totalImgs+'img')[activeMsg];
}

function setPrimaryImgSrc() { var prImg = (CORPORATE) ? activeMsg : (activeMsg+1);
	return '<div><img id="msgImg" src="' + src_primary[activeMsg][0] + '" width="930" height="405" alt="" usemap="#map_primary'+prImg+'"></div><span id="priMapContainer">' + src_primary[activeMsg][1] + '</span>'; 
}

function changeSlide(to) {
	var mainImage = null;
	mainImage = document.getElementById("msgImg");
	if (mainImage == null) return;
	if (mainImage.filters) {
		//If browser supports IE filters
		mainImage.style.filter = "progid:DXImageTransform.Microsoft.Fade(Duration=1)";  //Set the fade filter
		if (mainImage.filters[0]) {
			mainImage.filters[0].apply();
			mainImage.src = src_primary[to][0];
			mainImage.filters[0].play();
			updateControls(to);
			playSlide();
		}
	} else {
		slideMsgImgNode = document.getElementById("msgImg");
		fadeImages(true, to);  //This function should fade in, swap image, fade out and call updateControls()
	}
}

function backSlide() {
	if(activeMsg==0) activeMsg = msgImgs.length-1;
	else activeMsg -= 1;
	changeSlide(activeMsg);
}

function fwdSlide() {
	if(activeMsg==src_primary.length-1)	activeMsg = 0;
	else activeMsg += 1;
	changeSlide(activeMsg);
	if (slideshowIsOn) {
		slideCycle++;
		if (slideCycle > slideCyclesMax * totalImgs) {
			slideCycle = 1;
			toggleSlide();  //If images complete Max number of cycles then stop auto-rotation
		}
	}
}

function goSlide(to) {
	if ((to-1) != activeMsg) {
		if (slideshowIsOn)
			toggleSlide();		
		activeMsg = to-1;		
		changeSlide(activeMsg);
	}
}

function ubackSlide() {
	if (slideshowIsOn)
		toggleSlide();	
	backSlide();
}
function ufwdSlide() {
	if (slideshowIsOn)
		toggleSlide();
	fwdSlide();
}

function playSlide() {
	if (msgImgsPreloadCount < msgImgs.length) {
		setTimeout('playSlide()', 1300);   //Start auto-rotation after all the messaging images have been preloaded
		return;
	}
	if (slideshowIsOn && !slideShowSuspended)
		timerSlide = setTimeout('fwdSlide()', slideStay);
}

function toggleSlide() {
	var controlPause = document.getElementById("controlPausePlay");
	if (slideshowIsOn) {
		slideshowIsOn = false;
		clearTimeout(timerSlide);
		controlPause.style.backgroundImage='url('+hpCoreDir+hpImgDir+'control_sprite.png)';
		controlPause.style.backgroundPosition='0px -40px';
		var nodeSlideControlArea = document.getElementById("controlPausePlay").getElementsByTagName('A')[0];
		nodeSlideControlArea.alt = slideStateTextPlay;
		nodeSlideControlArea.title = slideStateTextPlay;
	} else { 
		slideshowIsOn = true;
		controlPause.style.backgroundImage='url('+hpCoreDir+hpImgDir+'control_sprite.png)';
		controlPause.style.backgroundPosition='0px 0px';
		var nodeSlideControlArea = document.getElementById("controlPausePlay").getElementsByTagName('A')[0];
		nodeSlideControlArea.alt = slideStateTextPause;
		nodeSlideControlArea.title = slideStateTextPause;
		fwdSlide();
	}
}

function drawControls() {
	if (activeMsg == undefined) activeMsg=0; if (totalImgs == undefined) totalImgs=3;

	var controlNumImg = document.getElementById("controlNumImg");
	var controlWidth = (totalImgs==3 ? 76 : ((totalImgs>4)&&(CORPORATE))?126:101) +'px';
	
	controlNumImg.style.backgroundImage='url('+numSprite+')';
	controlNumImg.style.width=controlWidth;
	controlNumImg.style.backgroundPosition=eval('spriteCoords_'+totalImgs+'img')[activeMsg];
				
	if ((totalImgs == 4) && (CORPORATE))
		controlNumImg.innerHTML = '<a href="javascript:goSlide(1);" alt="1st slide" title="1st slide" tabindex="171"></a>' + '<a href="javascript:goSlide(2);" alt="2nd slide" title="2nd slide" tabindex="171"></a>' + '<a href="javascript:goSlide(3);" alt="3rd slide" title="3rd slide" tabindex="171"></a>' + '<a href="javascript:goSlide(4);" alt="4th slide" title="4th slide" tabindex="171" onFocus="closeSegment();"></a>';
	else if ((totalImgs > 4) && (CORPORATE))
		controlNumImg.innerHTML = '<a href="javascript:goSlide(1);" alt="1st slide" title="1st slide" tabindex="171"></a>' + '<a href="javascript:goSlide(2);" alt="2nd slide" title="2nd slide" tabindex="171"></a>' + '<a href="javascript:goSlide(3);" alt="3rd slide" title="3rd slide" tabindex="171"></a>' + '<a href="javascript:goSlide(4);" alt="4th slide" title="4th slide" tabindex="171" onFocus="closeSegment();"></a>' + '<a href="javascript:goSlide(5);" alt="5th slide" title="5th slide" tabindex="171" onFocus="closeSegment();"></a>';
	else if (totalImgs == 3)
		controlNumImg.innerHTML = '<a href="javascript:goSlide(1);" alt="1st slide" title="1st slide" tabindex="171"></a>' + '<a href="javascript:goSlide(2);" alt="2nd slide" title="2nd slide" tabindex="171"></a>' + '<a href="javascript:goSlide(3);" alt="3rd slide" title="3rd slide" tabindex="171" onFocus="closeSegment();"></a>';
	else
		controlNumImg.innerHTML = '<a href="javascript:goSlide(1);" alt="1st slide" title="1st slide" tabindex="171"></a>' + '<a href="javascript:goSlide(2);" alt="2nd slide" title="2nd slide" tabindex="171"></a>' + '<a href="javascript:goSlide(3);" alt="3rd slide" title="3rd slide" tabindex="171"></a>' + '<a href="javascript:goSlide(4);" alt="4th slide" title="4th slide" tabindex="171" onFocus="closeSegment();"></a>';
}

// Function to implement the fader effect. Can be used for both Mozilla and IE but filterIE() method can be used only for IE.
// Steps for fader: 1)On page load, set timer for fading.  2)On timer, use short timers to repeat fader till opacity is 0.  3)Rotate Images.  4)Reverse fader.  5)On short timers, repeat reverse-fader till opacity is 100.  6)Go to step 1
function fadeImages(fade, to) {
	if (fade == true) {
		slideOpacity -= 20;
		if (slideOpacity > 0) timerImageFade = setTimeout( 'fadeImages(true,'+to+')', 77 );
	} else {
		slideOpacity += 20;
		if (slideOpacity < 100) timerImageFade = setTimeout( 'fadeImages(false)', 87 );
	}
	//containerDiv.style.filter = "alpha(opacity=" + slideOpacity + ")";   //Works in IE
	slideMsgImgNode.style.opacity = slideOpacity/101;   //Works in Mozilla. Divide opacity value by 101 instead of 100 to avoid flickering in firefox (dont go till 100%, stop around 99%).
	if (slideOpacity == 0) {
		document.getElementById("msgImg").src = src_primary[to][0];
		updateControls(to);
		fadeImages(false);
	}
	if (slideOpacity == 100)
		playSlide();
}

// this function determines whether the event is the equivalent of the microsoft
// mouseleave or mouseenter events.
// Code taken from http://dynamic-tools.net/toolbox/isMouseLeaveOrEnter/
function isMouseLeaveOrEnter(e, handler){		
	if (e.type != 'mouseout' && e.type != 'mouseover') return false;
	var reltg = e.relatedTarget ? e.relatedTarget :
	e.type == 'mouseout' ? e.toElement : e.fromElement;
	while (reltg && reltg != handler) reltg = reltg.parentNode;
	return (reltg != handler);
}

/***** BEGIN Ticker Code *****/
var scrollStep = 3;
var scrollSpeed = 67;
var scrollPauseDelay = 5000;  //How long a news item should stay before being scrolled
var scrollPauseTop = 6;   //Top edge of the news item where it be stopped for display
//var fileTickerContent = hpCoreDir+"ticker.rss";
var fileTickerContent = "/country/us/en/ticker.rss";
var arrTickerItems = new Array();
var currentTickerItem = 0;
var scrollStopped = false;
var scrollTimerID = null;
var scrollDiv = null;
var tickerHeight = 0;
var scrollDivHeight = 0;
var tickerItemLink = null;

function AddEventToObject(obj, evt, func) {
	var oldEvtHandler = obj[evt];
	obj[evt] = (typeof obj[evt] != 'function') ? func : function(ev){oldEvtHandler(ev);func(ev);};
}

function InitTicker(id) {
	LoadTickerData();
	if (arrTickerItems.length == 0) return;
	scrollDiv = document.getElementById(id).getElementsByTagName("div")[0];
	scrollDiv.style.visibility = "visible";
	tickerItemLink = scrollDiv.getElementsByTagName("A")[0];
	tickerItemLink.href = arrTickerItems[currentTickerItem].url;
	tickerItemLink.innerHTML = arrTickerItems[currentTickerItem].title;

	if (arrTickerItems.length == 1) return;
	tickerHeight = (scrollDiv.parentNode.offsetHeight) ? scrollDiv.parentNode.offsetHeight : scrollDiv.parentNode.height;
	scrollDiv.style.top = tickerHeight + "px";
	scrollDivHeight = (scrollDiv.offsetHeight) ? scrollDiv.offsetHeight : scrollDiv.height;

	AddEventToObject( scrollDiv, 'onmouseover', function() {if (scrollStopped) scrollStep=0;} );
	AddEventToObject( scrollDiv, 'onmouseout', function() {scrollStep=2} );
	AddEventToObject( tickerItemLink, 'onfocus', function() {if (scrollStopped) scrollStep=0;} );
	AddEventToObject( tickerItemLink, 'onblur', function() {scrollStep=2} );
	
	// Metrics
	AddEventToObject( tickerItemLink, 'onmousedown', function() {s_objectID=objIDver("gw/us/en/welcomeOV2//any/l1/Newsroom/fixed");  s_hp_fixObjectID(s_objectID); } );
	scrollTimerID = setTimeout( 'MoveTicker()', 100 );
}

function MoveTicker() {
	var scrollTop = parseInt( scrollDiv.style.top );
	scrollTop = scrollTop - scrollStep;
	if ( scrollTop <= (scrollDivHeight*(-1)) ) {
		currentTickerItem++;
		if (currentTickerItem == arrTickerItems.length) 
			currentTickerItem = 0;
	
		tickerItemLink.href = arrTickerItems[currentTickerItem].url;
		tickerItemLink.innerHTML = arrTickerItems[currentTickerItem].title;
		scrollTop = tickerHeight;
	}
	if ( (scrollTop >= scrollPauseTop) && (scrollTop-scrollStep < scrollPauseTop) ) {
		scrollTop = scrollPauseTop;
		scrollStopped = true;
		scrollTimerID = setTimeout( 'MoveTicker()', scrollPauseDelay );  //Stop the news heading for a longer duration
	} else {
		scrollStopped = false;
		scrollTimerID = setTimeout( 'MoveTicker()', scrollSpeed );
	}
	scrollDiv.style.top = scrollTop + "px";
}

function LoadTickerData() {
	var obj = null;
	var xmlDoc = null;
	var xmlData = "";
	var tickerItems = null;
	if (window.XMLHttpRequest) {
		obj = new XMLHttpRequest();   // IE7, Mozilla, Safari, ...
	} else if (window.ActiveXObject) {
		try {
			obj = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				obj = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (E) {
				obj = null;
			}
		}
	}

	if (obj) {
		obj.open( "GET", fileTickerContent, false );
		if (obj.overrideMimeType)
			obj.overrideMimeType('text/xml');
		obj.send( null );
		if (obj.status == 200) {
			xmlDoc = obj.responseXML;
			xmlData = obj.responseText;
		}
	}

	if ( xmlDoc && xmlDoc.documentElement ) {
		xmlDoc = xmlDoc.documentElement;
	} else if ( window.ActiveXObject && xmlData ) {
		try {
			xmlDoc = new ActiveXObject("Msxml2.DOMDocument");
			xmlDoc.loadXML( xmlData );
		} catch (e) {
			try {
				xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
				xmlDoc.loadXML( xmlData );
			} catch (E) {
				xmlDoc = null;
			}
		}
	}

	if (xmlDoc)
		tickerItems = xmlDoc.getElementsByTagName( "item" );
	else return;

	for (var i=0; i<tickerItems.length; i++ ) {
		arrTickerItems[i] = new Array();
		arrTickerItems[i].title = tickerItems[i].getElementsByTagName('title')[0].firstChild.nodeValue;
		arrTickerItems[i].url = tickerItems[i].getElementsByTagName('link')[0].firstChild.nodeValue;
	}
}
/***** END Ticker Code *****/

// Metrics
function goHome() {
	window.location = hpHomePageName;
	if (typeof s_sendAnalyticsEvent == "function") {
		s_screen="main";
		s_sendAnalyticsEvent("", "gw: us/en: welcome OV2 cookies");
	}
}

// Start Accordion
var accDelayTime = 800;
var accSlideDuration = 600;
var accTogleDuration = 600;
var accSwapTimer = null;
var accTimer = null;
var imgFlag=true;

function runAccordion(e) {
	if(is_ie){ 
		var obj = window.event.srcElement
	}else{  e.preventDefault();
		var obj = e.target;
	}
	if(accTimer) clearTimeout(accTimer); accTimer = null;
	if(obj){	
		accTimer = setTimeout(function(){
		$j(obj).parent().next('div:hidden').slideToggle(accTogleDuration, function(){ var s = this.id.split('-')[0]; $j('#'+s+'-header-expand').html('Expanded'); delayAccordionSwap(true, s); moveTo(s+'-link'); })	
		.siblings('div:visible').slideUp(accSlideDuration, function(){ var segm = this.id.split('-')[0]; $j('#'+segm+'-header-expand').html('Expand'); });		
		}, accDelayTime);
	}rememberMe = false;
	return false;
}

function initAccordion(){        	
	$j('div.menu_expand:eq(0)> div').hide();
	$j('div.menu_expand:eq(0)> h3> a').click( function(){ var s = this.id.split('-')[0]; moveTo(s+'-link'); });
	$j('div.menu_expand:eq(0)> h3> a').mouseover(runAccordion);
	$j('div.menu_expand:eq(0)> h3> a').focus(function() {			
			$j(this).parent().next('div:hidden').slideToggle(accTogleDuration, function(){ 
			var s = this.id.split('-')[0]; 
			$j('#'+s+'-header-expand').html('Expanded'); 
			delayAccordionSwap(true, s); 			
			// IE text selection issue fix
			if ($j.browser.msie) {
				$j('.menu_expand').get(0).ondrag = function () { return false; };
				$j('.menu_expand').get(0).onselectstart = function () { return false; };	
  			}
			moveTo(s+'-link');
		}).siblings('div:visible').slideUp(accSlideDuration, function(){ var segm = this.id.split('-')[0]; $j('#'+segm+'-header-expand').html('Expand'); });	
	});	 
}
  
function setAccDefault(_m){
	$j('#'+_m+'-content').show().slideDown(accSlideDuration); //Set the default accordion open menu
	$j('#'+_m+'-header-expand').html('Expanded');
	accordionSwap(_m);
}

function delayAccordionSwap(_v, tab) {
	if (accSwapTimer){ clearTimeout(accSwapTimer); accSwapTimer = null;	}
	if(_v) accSwapTimer = setTimeout('accordionSwap("'+tab+'");',700);
}

function accordionSwap(tab) {	
	if(tab && !rememberMe){
		var tabname = tab.toUpperCase();		
		var segmentLink = $j('#'+tab.toLowerCase()+'-link');		
		var map = prodSegmentImageMaps[tabname].replace('tabIndex','tabindex');
			map = map.replace('tabindex="9"','tabindex="-1"');
		var prodDefaultImage = (hp_prod_img_num && hp_prod_img_num>-1) ? hpCoreDir+hpImgDir+hpSS[hp_prod_img_num].img : shopSegmentPreloadImage[tabname].src;
		$j('#exploreMain').hide();
		$j('#prdWideColumn').html('<img id="exploreMain" name="exploreMain" src="' + shopSegmentPreloadImage[tabname].src + '" alt="" height="425" width="683" usemap="#prodSegImgMap_' + tabname + '"> \n' + map + '\n\n');
		$j('#exploreMain').show();
		$j('#prdWideColumn').SlideInLeft(500, function(){var imgAreaId = document.getElementById('prodSegImgArea_'+tab); if(imgAreaId){imgAreaId.tabIndex = segmentLink.tabIndex; }; } );
	}rememberMe = false; shopSegmCurrent = null;
}
//End Accordion

function moveTo(id) {
	var e = $j('#'+id.toLowerCase());
	//var e = document.getElementById(id.toLowerCase());
	e.focus();
}

//*** Add page version letter to ObjectID - only for A/B/C/D test
var pageVersion = (hpVersion == null) ? '': hpVersion;
function objIDver(objID) {
	return objID;
	//return(objID.replace('welcomeOV2','welcomeOV2-'+pageVersion.toLowerCase()));
}

function hpInit() { preloadMsgImg(); preLoadShopHeaders(); preloadProdImg(hpSS); 
	InitTicker('newsTicker'); findUserTab();  playSlide(); checkTab();
	$j('ul.jd_menu').jdMenu({offsetY: 0, offsetX: 0});
}
function supportSessionCk(v) {
	document.cookie = "hp_support_selection="+ escape(v) +"; " + ((hp_cookie_domain) ? "; domain=" + hp_cookie_domain : "") + ((hp_cookie_path) ? "; path=" + hp_cookie_path : "");
}
// Reset product cookie

$j(window).one("unload", function(){ leavingHP(); });

function leavingHP(){ if(_Ck_.get('hp_cust_seg_sel') != 'LEB' && _Ck_.get(product_cookie) == 'software' ) { _Ck_.set(product_cookie, "false"); _Ck_.del(product_cookie); } };
// 20080507