/*
	Supports Omniture tagging by 
	assigning values to the variables submitted.
	
	Includes block initiating call to Omniture
*/

function populateSectionVariables(){
	var arrUrl = new String(window.location);
	
	// drop the page's name from the url. Base on ".htm" rather "."?
	if(arrUrl.substring(arrUrl.lastIndexOf('/'),arrUrl.length -1).indexOf('.') > 0 ){
		arrUrl = arrUrl.substring(0, arrUrl.lastIndexOf('/'));
	}
	
	arrUrl = arrUrl.split("/");
	
	if(arrUrl.length > 3 && arrUrl[3] != ''){
		s.channel = arrUrl[3];
	}	
	if(arrUrl.length > 4 && arrUrl[4] != ''){
		s.prop5 = s.channel + ":" + arrUrl[4];
	}
	
	for (i=5; i<arrUrl.length && i<6; i++){
		//start on prop 6 and always add previous
		if(arrUrl[i] != ''){
			eval("s.prop" + (i+1) + " = s.prop" + (i) + " + ':" + arrUrl[i] + "';");			
		}
	}
}

if (document.getElementById("Omni_pageName")){
	s.pageName = document.getElementById("Omni_pageName").value;
}

populateSectionVariables();

/*
	props 1 & 2 
*/

if (document.getElementById("Omni_searchTerms")){
	s.prop1 = document.getElementById("Omni_searchTerms").value;
}
if (document.getElementById("Omni_searchHits")){
	s.prop2 = document.getElementById("Omni_searchHits").value;
}




