var solutionMax = 5;  // If additional solutions are added in the future, increment this value to the appropriate count

function getSolution(){
	 var _dl = document.URL;
                var _tc = _RCV('hbx.lead');
                if(solution !='' && _tc.indexOf(solution)==-1){  
                                var _cookieExp = 86400000 * 365;
                                var _d=new Date();
                                _d.setTime(_d.getTime()+_cookieExp);
                                _tc += solution + ':';
                                _hbCookie('hbx.lead',_tc,_d.toGMTString());
                }
               if(solution !='')
                                _hc1=_tc;
               if(_dl.indexOf('thank') > -1){   //add a conditional value of text from the URL in place of 'thank' to indicate a successful form submit to collect solutions from leads
               	_hc2=_tc;
	}
}

function _hbOnPrePVR(req){
	if(typeof solution != 'undefined'){
                	getSolution();
                	var _hc = _RCV('hbx.lead');
                	var _ct = _hc.match(/:/g);
                              if((_ct.length > 0) && (_ct.length <= solutionMax)){
                		var _a=new Array();
                                	for(var i=1;i<solutionMax+1;i++){             
                                                	if(i==_ct.length){
                                                                	_a[i-1]=i;
                                                	} else {
                                                                	_a[i-1]="-"+i;
                                                	}
                                	}
                                	if(_seg=='')
                                		_seg=_a.join(',');
                                	else if(_a.length>0)                                         
                                                	_seg+=','+_a.join(',');
                	}
	}
}
