window.addEvent('domready',function() {
	
	if (typeof pattern_togglers != 'undefined') {
	  if (document.location.hash == '#static') {
  	  pattern_togglers.toggleTo('static',true);
  	} else if (document.location.hash == '#dynamic') {
  	  pattern_togglers.toggleTo('dynamic',true);
  	}  
	}
	
	
	
	
	
	if (typeof pattern_togglers_local != 'undefined') {
		 
		var linkers = $$('.tab_linker');
		
		var thepagenames = {
			'overview':'overview',
			'features':'features',
			'requirements':'system+requirements',
			'pricing':'plans',
			'installation':'installation',
			'public_viewing':'public+viewing',
			'private_office':'private+office',
			'tavern':'tavern',
			'lineup':'channel+lineup',
			'business_viewing':'business+viewing'	
		};
		
		/*var newtab = '';
		if(document.location.href.match(/\#\w/)) {
		  newtab = /\#(\w+)/.exec(document.location.href)[1];
		} else {
		  newtab = 'overview';
		};
		
		if (newtab == 'static' || newtab == 'dynamic') {
			pattern_togglers_local.toggleTo('pricing');
			pattern_togglers.toggleTo(newtab);
			location.hash = '#togglers';		
		} else {
			pattern_togglers_local.toggleTo(newtab);
		}
	  var pg = thepagenames[newtab];
		_hbPageView(pg,hbxContentCategory);*/
		
		
		
		
		var directvholder = null;
		if (hbxContentCategory == 'products/internet/tv/directv') {
				directvholder = $$('.pricing_holder')[0];
		}
		
		linkers.each(function(f) {
			f.addEvent('click',function() {
				var newtab = this.getProperty('href').replace('#','');
				if (newtab == 'static' || newtab == 'dynamic') {
					pattern_togglers_local.toggleTo('pricing');
					pattern_togglers.toggleTo(newtab);
					location.hash = '#togglers';		
				} else {
					pattern_togglers_local.toggleTo(newtab);
				}
			  var pg = thepagenames[newtab];
				_hbPageView(pg,hbxContentCategory);
				return false;
			});
		});
	}
	
});