var PBNCLASS = {
	products:  [
{txt:'239 Motor Protection', link:'239'},
{txt:'269Plus Motor Protection', link:'269p'},
{txt:'3 Series Family', link:'3Series'},
{txt:'339 Motor Protection', link:'339'},
{txt:'345 Transformer Protection', link:'345'},
{txt:'350 Feeder Protection', link:'350'},
{txt:'369 Motor Protection', link:'369'},
{txt:'469 Motor Protection', link:'469'},
{txt:'489 Generator Protection', link:'489'},
{txt:'515 Test Switch', link:'515'},
{txt:'735/737 Feeder Relay', link:'735737'},
{txt:'745 Transformer Protection', link:'745'},
{txt:'750/760 Feeder Protection', link:'750'},
{txt:'ALPS Line Protection', link:'alps'},
{txt:'B30 Bus Protection', link:'b30'},
{txt:'B90 Bus Protection', link:'b90'},
{txt:'BDD Relay', link:'bdd'},
//{txt:'BGFL', link:'tr-ele'},
{txt:'BUS1000/2000 Protection', link:'bus1000'},
{txt:'C30 Controller', link:'c30'},
{txt:'C60 Breaker Protection', link:'c60'},
{txt:'C70 Cap. Bank Protection', link:'c70'},
{txt:'C90Plus Controller', link:'c90plus'},
{txt:'CEB Relay', link:'ceb'},
{txt:'CEH Relay', link:'ceh'},
{txt:'CEX Relay', link:'cex'},
{txt:'CEY Relay', link:'cey'},
{txt:'CEYG Relay', link:'ceyg'},
{txt:'CFD Relay', link:'cfd'},
{txt:'CFVB Relay', link:'cfvb'},
{txt:'CHC Relay', link:'chc'},
{txt:'CIO Remote Module', link:'cio'},
//{txt:'Cntrl Pwr Transformers', link:'sp-pwr'},
//{txt:'CT\'s', link:'tr-ioc'},
{txt:'DART', link:'energy/catalog/dart.htm'},
{txt:'D20/D200 Substation Controllers', link:'energy/catalog/d20-d200.htm'},
{txt:'D25 Substation Controller', link:'energy/catalog/d25.htm'},
{txt:'D30 Line Protection', link:'d30'},
//{txt:'D485', link:'d485'},
{txt:'D400 Substation Data Gateway', link:'energy/catalog/d400.htm'},
{txt:'D60 Line Protection', link:'d60'},
{txt:'D90Plus Line Distance Protection', link:'d90plus'},
{txt:'DBF Breaker Failure', link:'dbf'},
{txt:'DBT Breaker Supervision', link:'dbt'},
{txt:'DDFR Fault Recorder', link:'ddfr'},
{txt:'DDS Distribution System', link:'dds'},
{txt:'DFF Frequency Relay', link:'dff'},
{txt:'DGP Generator Protection', link:'dgp'},
{txt:'DGT Gen. Trip Control', link:'dgt'},
{txt:'DIAC Overcurrent Protection', link:'diac'},
{txt:'DLPD Line Protection', link:'dlpd'},
{txt:'DMS Multifunction System', link:'dms'},
{txt:'DRS Reclosing System', link:'drs'},
{txt:'DTP-B Transformer Prot.', link:'dtp'},
{txt:'DTR Tap Changer', link:'dtr'},
{txt:'EB1/2/4 Terminal Boards', link:'eb1'},
{txt:'EB25/26/27 Term. Boards', link:'eb25'},
//{txt:'Electronic Prod.', link:'tr-ele'},
{txt:'EnerVista Aggregator', link:'enervista/Aggregator/'},
{txt:'EnerVista Integrator', link:'enervista/Integrator/'},
{txt:'EnerVista Launchpad', link:'enervista/Launchpad/'},
{txt:'EnerVista Viewpoint Engineer', link:'enervista/Viewpoint/engineer.htm'},
{txt:'EnerVista Viewpoint Maintenance', link:'enervista/Viewpoint/maintenance.htm'},
{txt:'EnerVista Viewpoint Monitoring', link:'enervista/Viewpoint/monitoring.htm'},
{txt:'EPM 1000 Meter', link:'epm1000'},
{txt:'EPM 2000 Meter', link:'epm2000'},
{txt:'EPM 4000 Meter', link:'epm4000'},
/*{txt:'EPM/EPM 5100 Meter', link:'epm5100'},*/
{txt:'EPM 5200 Meter', link:'epm5200'},
{txt:'EPM 5300 Meter', link:'epm5300'},
{txt:'EPM 5350 Meter', link:'epm5350'},
{txt:'EPM 6000 Meter', link:'epm6000'},
{txt:'EPM 9450 Meter', link:'epm9450'},
{txt:'EPM 9650 Meter', link:'epm9650'},
{txt:'EPM 9800 Meter', link:'epm9800'},
{txt:'EPM Family', link:'epmfamily'},
{txt:'ET-16 LED', link:'et16'},
{txt:'ET-16 Lamp', link:'et1617'},
{txt:'F35 Feeder Protection', link:'f35'},
//{txt:'F485', link:'f485'},
{txt:'F60 Feeder Protection', link:'f60'},
{txt:'F650 Bay Controller', link:'f650'},
//{txt:'FAC1000/2000', link:'fac'},
{txt:'FM2 Feeder Manager', link:'fm2'},
//{txt:'FT Switches', link:'/ITI/catalog/switches.htm'},
{txt:'G30 Generator Protection', link:'g30'},
{txt:'G60 Generator Protection', link:'g60'},
{txt:'G650 Generator Protection', link:'g650'},
{txt:'GCX Relay', link:'gcx'},
{txt:'GCY Relay', link:'gcy'},
{txt:'GGP Relay', link:'ggp'},
{txt:'GSY Relay', link:'gsy'},
{txt:'GXS Relay', link:'gxs'},
{txt:'HardFiber System', link:'hardfiber'},
{txt:'HAA Relay', link:'haa'},
{txt:'HEA Relay', link:'hea'},
{txt:'HFA Relay', link:'hfa'},
{txt:'HFC Relay', link:'hfc'},
{txt:'HGA Relay', link:'hga'},
{txt:'HGA18 Relay', link:'hga18'},
{txt:'HID Differential Module', link:'hid'},
{txt:'HMA Relay', link:'hma'},
{txt:'HSA Relay', link:'hsa'},
{txt:'IAC Relay', link:'iac'},
{txt:'IAV Relay', link:'iav'},
{txt:'IBC Relay', link:'ibc'},
{txt:'IBCG Relay', link:'ibcg'},
{txt:'iBox Serial Substation Controller', link:'energy/catalog/ibox.htm'},
{txt:'ICR Relay', link:'icr'},
{txt:'ICW Relay', link:'icw'},
{txt:'IFC Relay', link:'ifc'},
/*{txt:'IFCS Relay', link:'ifcs'},*/
{txt:'IFCV Relay', link:'ifcv'},
{txt:'IFV Relay', link:'ifv'},
{txt:'IJC Relay', link:'ijc'},
{txt:'IJD Relay', link:'ijd'},
{txt:'IJS Relay', link:'ijs'},
{txt:'JBC/JBCG/JBCV Relay', link:'jbc'},
//{txt:'JungleMUX', link:'jmux'},
{txt:'L30 Line Protection', link:'l30'},
{txt:'L60 Line Protection', link:'l60'},
{txt:'L90 Line Protection', link:'l90'},
//{txt:'Launchpad', link:'enervista/Launchpad/'},
{txt:'LM10 Motor Protection', link:'lm10'},
{txt:'LPS Line Protection', link:'lps'},
{txt:'LPS-O Line Protection', link:'lpso'},
{txt:'M Family', link:'mfamily'},
{txt:'M60 Motor Protection', link:'m60'},
//{txt:'MC-E Series', link:'mceseries'},
{txt:'MFF Frequency Relay', link:'mff'},
{txt:'MGC Relay', link:'mgc'},
{txt:'MIB Bus Differential', link:'mib'},
{txt:'MIC Overcurrent Relay', link:'mic'},
{txt:'MID DDS Family', link:'mid'},
{txt:'MIF Feeder Relay', link:'mif'},
{txt:'MIF II Feeder Relay', link:'mifii'},
{txt:'MIG Machine Protection', link:'mig'},
{txt:'MIG II Generator Protection', link:'migii'},
{txt:'MIN Ground Protection', link:'min'},
{txt:'MIN II Ground Protection', link:'minii'},
{txt:'MIV Voltage/Freq. Relay', link:'miv'},
{txt:'MIV II Voltage/Freq. Relay', link:'mivii'},
{txt:'MIW Directional Relay', link:'miw'},
{txt:'MIW II Directional Relay', link:'miwii'},
{txt:'MLJ Relay', link:'mlj'},
{txt:'MM2 Motor Protection', link:'mm2'},
{txt:'MM3 Motor Protection', link:'mm3'},
{txt:'MM200 Motor Protection', link:'mm200'},
{txt:'MM300 Motor Protection', link:'mm300'},
{txt:'MOV Multifunction Relay', link:'mov'},
{txt:'MPM Motor Protection Meter', link:'mpm'},
{txt:'MultiLink Family', link:'multilink'},
{txt:'ML600 Ethernet Switch', link:'ml600'},
{txt:'ML800 Ethernet Switch', link:'ml800'},
{txt:'ML1200 Ethernet Switch', link:'ml1200'},
{txt:'ML1600 Ethernet Switch', link:'ml1600'},
{txt:'ML2400 Ethernet Switch', link:'ml2400'},
{txt:'MultiNet1000 WAN Router', link:'mn1000'},
{txt:'MultiNet Serial Converter', link:'multinet'},
{txt:'MultiNet4 Serial Server', link:'multinet4'},
{txt:'N60 Network Protection', link:'n60'},
{txt:'NAA Relay', link:'naa'},
{txt:'NBV Relay', link:'nbv'},
{txt:'NGA Relay', link:'nga'},
{txt:'NGV Relay', link:'ngv'},
//{txt:'P485', link:'p485'},
{txt:'PJC Relay', link:'pjc'},
{txt:'PJG Relay', link:'pjg'},
{txt:'PJV Relay', link:'pjv'},
{txt:'PK-2 Test Plugs', link:'pk2'},
{txt:'PMCS Software', link:'enervista/PMCS/'},
{txt:'Power Link Advantage (PLA)', link:'energy/catalog/pla.htm'},
{txt:'PPQM Meter', link:'ppqm'},
{txt:'PQM Meter', link:'pqm'},
{txt:'PQMII Meter', link:'pqmii'},
{txt:'PVD Relay', link:'pvd'},
{txt:'RDB86 Relay', link:'rdb86'},
{txt:'RMIO Remove I/O Module', link:'rmio'},
{txt:'RRTD Remote', link:'rrtd'},
//{txt:'RS232 Converter', link:'rs232485'},
{txt:'RTT Test Set', link:'rtt'},
//{txt:'RT Switches', link:'/ITI/catalog/switches.htm'},
{txt:'SAM Relay', link:'sam'},
{txt:'SB Switches', link:'sb'},
{txt:'SB-1 Switches', link:'sb1'},
{txt:'SB-9 Switches', link:'sb9'},
{txt:'SB-10 Switches', link:'sb10'},
{txt:'SBC Relay', link:'sbc'},
{txt:'SBD Relay', link:'sbd'},
{txt:'SBM Switches', link:'sbm'},
{txt:'SCA Relay', link:'sca'},
{txt:'SFF Relay', link:'sff'},
{txt:'SGC Relay', link:'sgc'},
{txt:'SLJ Relay', link:'slj'},
{txt:'SMOR-B Feeder Protection', link:'smorb'},
{txt:'SPM Synchronous Motor Control', link:'spm'},
{txt:'SR Family', link:'srfamily'},
{txt:'STD Relay', link:'std'},
{txt:'STV Relay', link:'stv'},
{txt:'Substation Systems', link:'energy/catalog/iscs.htm'},
//{txt:'Switches (ITI)', link:'tr-swi'},
{txt:'T35 Transformer Protection', link:'t35'},
{txt:'T60 Transformer Protection', link:'t60'},
{txt:'TCCV Relay', link:'tccv'},
{txt:'TCW Relay', link:'tcw'},
{txt:'Test Rectifier', link:'testrect'},
//{txt:'TN1U', link:'tn1u'},
//{txt:'TN1Ue', link:'tn1ue'},
{txt:'TOV Relay', link:'tov'},
{txt:'Training CD 269', link:'269MotorCD/index.htm'},
{txt:'Training CD 369', link:'trainingcd/369/index.htm'},
{txt:'Training CD 469', link:'469MotorCD/index.htm'},
{txt:'Training CD 745', link:'trainingcd/745/index.htm'},
{txt:'Training CD 750/760', link:'trainingcd/750/index.htm'},
{txt:'Training CD D60', link:'trainingcd/d60/index.htm'},
{txt:'Training CD F60/F35', link:'trainingcd/f60/'},
{txt:'Training CD FMPR', link:'trainingcd/fmpr/index.htm'},
{txt:'Training CD Industrial Comm.', link:'trainingcd/datacomm-ind/'},
{txt:'Training CD Product Maint.', link:'trainingcd/maintenance/'},
{txt:'Training CD UR Apps. 1', link:'trainingcd/info.htm'},
{txt:'Training CD Utility Comm.', link:'trainingcd/datacomm-util/'},
{txt:'Transfer-Trip Panel', link:'testpanl'},
{txt:'Tripping/Blocking Rect.', link:'tbrect'},
{txt:'UR Family', link:'urfamily'},
{txt:'URC Recloser Control', link:'urc'},
{txt:'USB to Serial Cable Converter', link:'usb2serial'},
//{txt:'VistaNET', link:'vistanet'},
//{txt:"VT's", link:'tr-iov'},
{txt:'W650 Wind Generator Protection', link:'w650'},
{txt:'XCA Test Probes/Plugs', link:'xca'},
{txt:'XLA Test Plugs', link:'xla'},
{txt:'XLB Test Panels', link:'xlb'},
{txt:'XRT EM Relay Toolkit', link:'xrt'},
{txt:'XTC10A Test Panel', link:'xtc'},
{txt:'XTM Test Plugs/Extenders', link:'xtm'}
],
	
PBNarrInit: function() 
{

	var sections = 6;		// Number of tab sections
	var blkwidth = 540;		// Width of dropdown block (2 less than jcarousel-clip-horizontal)
	var columns = 3;		// number of columns within each tab
	var prod = this.products
	
	var hdr = '<div id="PBNwrap" style="left:-3000px; top:0px;">'+
			'<div id="PBNspacer">&nbsp;</div>'+
			'<div class="jcarousel-skin-PBN"><div id="PBNcarousel" class="jcarousel-container jcarousel-container-horizontal">'+
			'<div class="PBNcarousel-control"><table border="0" cellpadding="0" cellspacing="0" >'+
			'<TR>'
	var items = '<div class="jcarousel-clip"><UL class="jcarousel-list jcarousel-list-horizontal">';

	var M = Math.ceil(prod.length/sections)
	var S = 0, beg=0, Max = 9, curindex = 0, sct=1;
	var stl, totwidth, tabwidth, spl, i;
	var first, last, tmp1, tmp2, tmp;
	
	for (S=1; S <= sections; S++) {
		tmp1 = M; tmp2 = M
		if (S < sections) {
			while (prod[tmp1].txt.charAt(0).toUpperCase() == prod[tmp1+1].txt.charAt(0).toUpperCase()) {
				if (++tmp1 == prod.length-1) 
					break;
			}
			
			while (prod[tmp2].txt.charAt(0).toUpperCase() == prod[tmp2+1].txt.charAt(0).toUpperCase()) {
				if (--tmp2 == beg) 
					break;
			}
			if (tmp1-M > M-tmp2) tmp=tmp2; else tmp=tmp1;
			prod[tmp+1].brk=1;
			spl = Math.ceil((tmp+1-curindex)/columns)
			for (i=spl; curindex+i < tmp+1 ; i+=spl)
				prod[curindex+i].subbrk=1;
			curindex=tmp+1;
		}
		first = prod[beg].txt.charAt(0).toUpperCase()
		if (first > 'A' && S==1) first='A';
		else if (first > '1' && S==1) first='1';
		else if (S > 1) first = String.fromCharCode(last.charCodeAt(0)+1);
		if (S==sections) last='Z'
		else last = String.fromCharCode(prod[tmp+1].txt.charAt(0).toUpperCase().charCodeAt(0)-1)
		hdr += '<TD><a href="#" id=PBNsection'+S+' hidefocus=true>'+first+(first!=last?'-'+last:'')+'</a></td>'
		if (Math.floor((tmp+1 - beg)/columns) > Max) Max = Math.floor((tmp+1 - beg)/columns);
		beg = tmp+1;
		M = S == sections-1 ? prod.length-1 : beg + Math.ceil(prod.length/ sections);	// Math.floor((prod.length-beg) / (sections-S))
	}
	if (prod.length-curindex > Max) {
		curindex++;
		spl = Math.ceil((prod.length - curindex)/columns)
		//spl = Max;
		var pl=prod.length
		for (i=spl; curindex+i < pl; i+=spl)
				prod[curindex+i].subbrk=1;
	}
	hdr += '</TR></table></div>';
	stl = '<style type="text/css">';
	stl += '.PBNcarousel-control .active#PBNsection'+sections+' { border-right:1px #CCC solid;}\n'
	tabwidth = Math.ceil(blkwidth/sections);
	totwidth = tabwidth * sections;
	stl += '.PBNcarousel-control {	width:'+totwidth+'px !important;}\n';
	stl += '.PBNcarousel-control a {	width:'+tabwidth+'px !important;}\n';
	stl += '.jcarousel-skin-PBN .jcarousel-container-horizontal,#PBNspacer {    width: '+(totwidth+sections-1)+'px;}\n';	// height:'+(Math.ceil(Max/2)*16+43)+'px;}\n';
	stl += '.jcarousel-skin-PBN .jcarousel-clip-horizontal {    width: '+(totwidth+sections-1)+'px !important; height:'+(Max*15+10)+'px;}\n';
	stl += '.jcarousel-skin-PBN .jcarousel-item-horizontal{    height:'+(Max*15+10)+'px;}\n';
	stl += '</style>\n';
	
	//document.write(stl);
	//document.write(hdr);	
	sct=1;	
	for (S=0; S < prod.length; S++) {
		if (S==0 || prod[S].brk) items += (items!=''?'</td></tr></table></li>':'') + '<li class="linkArrows jcarousel-item jcarousel-item-horizontal jcarousel-item-'+(sct)+ ' jcarousel-item-'+(sct++)+'-horizontal"><table width="100%" cellspacing=0 cellpadding=0><TR><TD width="'+Math.ceil(100/columns)+'%" valign=top>';
		else if (prod[S].subbrk) items += '</td><td width="'+Math.ceil(100/columns)+'%" valign=top>';
		items += '<P class=PBNP><a href="'+Uprefix+'multilin/'+(!prod[S].link.match(/[\.\/]/)?'catalog/'+prod[S].link+'.htm':prod[S].link)+'">'+prod[S].txt+'</a></P>'
	}
	items += '</td></tr></table></li></ul></div></div></div></div>';
	//document.write(items);
	$('head').append(stl)
	$('body').append(hdr+items);

	if (typeof(PBNinit)=='function') setTimeout("jQuery(document).ready( PBNinit )",0);
}

};

if(window.jQuery)jQuery(document).ready( function(){ setTimeout('PBNCLASS.PBNarrInit()',50); });
