// HP Common Metrics Architecture 20060415a
// BEGIN Clickstream:

/* HP BSD Production */
var s_account=""
var s_pageName=""
var s_server=""
var s_pageType=""
var s_prop1=""

/* E-commerce Variables */
var s_campaign=""
var s_state=""
var s_zip=""
var s_events=""
var s_products=""
var s_purchaseID=""
var s_eVar1=""
var s_code=""

var s_hp_optOut = false // WARNING: IF SET TO TRUE, PAGE WILL NOT BE TRACKED

// Common Dynamic Account structure - please do not use unless authorized by CKM&A Ops
/* Specify the Report Suite ID(s) to track here */
var s_dynamicAccountSelection=false
var s_dynamicAccountList="hphqqatest1=itg.hp.com"
var s_dynamicAccountMatch=window.location.hostname

// Account for Omniture to use.  Set in bottom.jsp from environmental variables
s_account=page_omniture_accounts;  

//Link Tracking Config
var s_trackDownloadLinks=true
var s_trackExternalLinks=true
var s_trackInlineStats=true
var s_linkDownloadFileTypes="exe,zip,wav,mp3,mov,mpg,avi,doc,pdf,xls,cgi,dot,pot,ppt,wmv,asx,chm,asf,avi,swf,wma,wrn,wvx,flv"
var s_linkInternalFilters="hp,compaq,cpqcorp,javascript:"
var s_linkLeaveQueryString=true
var s_linkTrackVars="s_prop5,s_prop2,s_prop4,s_prop8"
var s_linkTrackEvents="s_prop5,s_prop2,s_prop4,s_prop8"

var s_prop7 = page_cc;  // current country selection
var s_prop8 = page_lang; // current UI language selection
var s_prop9='SMB'; // segment
//var s_prop10=s_prop7+'/'+s_prop8+'/'+s_prop9+'/support';
// later--> s_prop13=s_account ;
//var s_prop13=s_account + ' why-locale:' + _av(location.search,"locale=","&","");


// Common metrics plugin function - do not remove
function s_hp_doMetricsPlugins() { 
	// Page Type
	var _index1 = location.pathname.lastIndexOf("/");
	if (_index1<0){
	  s_pageName='unknown';
	}else{
		var _index2 = location.pathname.indexOf(".",_index1);
		if (_index2<0) {
			s_pageName=location.pathname.substring(_index1+1);
		}else{
			s_pageName=location.pathname.substring(_index1+1,_index2);
		}
	}


	// shows the authentication source, if any, of the session.  Otherwise: "Anonymous"
	s_prop1= page_authentication_source; 
	// ITRC Registered user is in BSBSC (a forum or ITRC user until they too go to passport)
	if (document.cookie.indexOf("HP-ESC-USERID")>=0) {s_prop1=s_prop1+' w/ ITRC(ESC)';}

	// product line code
	s_prop2 = page_prod_line_code;
	// server's page response calculation
	s_prop3 = page_response_value;

	//objectID
	s_prop4 = _av(location.search,"objectID=","&","");
	s_prop5 = page_product_series_id+'-' + page_english_prod_series_name;

	s_server=location.hostname+' ['+page_localHostName+']';

	s_prop6=_av(location.search,"tx=","&","");  // search
} // end function ()

function _av(_u,_lb,_rb,_dv){
var _i=_u.indexOf(_lb);
if(_i>=0){_u=_u.substring(_i+_lb.length);var _j=_u.indexOf(_rb);if(_j<0){_dv=_u}else{_dv=_u.substring(0,_j)}}
return _dv;
}

/*** DO NOT MODIFY THIS SECTION ***/
/* Under no circumstances should you modify this code */
//s_hp_includeJavaScriptFile("welcome.hp-ww.com","/cma/metrics/sc/s_code_remote.js");
s_hp_includeJavaScriptFile("welcome.hp-ww.com","/cma/metrics/sc/s_code_remote.js");

function s_hp_includeJavaScriptFile(hp_hostname,hp_path) {
	if(!(window.s_hp_optOut && window.s_hp_optOut == true)) {
		var hp_ssl=(window.location.protocol.toLowerCase().indexOf('https')!=-1)
		if(hp_hostname && hp_hostname.length>0) {
			if(hp_ssl == true && hp_hostname.toLowerCase().indexOf("welcome.") != -1) { hp_hostname = "secure.hp-ww.com"; }
			var fullURL = "http" + (hp_ssl?"s":"") + "://" + hp_hostname + hp_path
		}
		else
			var fullURL=hp_path;
		document.write("<sc" + "ript language=\"JavaScript\" src=\""+fullURL+"\"></sc" + "ript>");
	}
}
// END Clickstream:
