function stripeRows (){
	var tables = $ES('table');
		for (var i=0; i < tables.length; i++) {
			if (tables[i].hasClass('data-table')) {
	   		var tableToStripe = tables[i];
	   		var tableRows = tableToStripe.getElementsByTagName('tr');
	   		for (var e=0; e < tableRows.length; e++) {
				if (e !=0) {
					tableRows[e].className = "shaded";
		   			e++;	
				}
	   			
	   		}
		}
	}

}

function stripeParagraph (){
	var para = $('all-results').getElements('p');
	for (var i=0; i < para.length; i++) {
		if (i !=0) {
			para[i].className = "alt-stripe";
		   	i++;	
		}
	}
}

// old default values
//var default_email_subject = "Price Pfister product information";
//var default_email_body = "Hello, \n\nI was browsing on www.pricepfister.com and came across a product I think you would be interested in.";

// more generic default values
var default_email_subject = "Price Pfister information";
var default_email_body = "Hello, \n\nI was browsing on www.pricepfister.com and came across a page I think you would be interested in.";

function do_email(email_subject, email_body){
	if (email_subject == null || email_subject.length == 0) {
		email_subject = default_email_subject;
	}
	if (email_body == null || email_body.length == 0) {
		email_body = default_email_body;
	}
	var url = "mailto:?subject=" + escape(email_subject);
	url = url + "&body=" + escape(email_body) + escape("\n") + escape(window.location) + escape("\n\nThank you.");
	window.location = url;
}

function do_print(){
	window.print();
}

var HeroTabs = new Class ({

	initialize: function (activeLI, activeContent) {
		this.activeLI = activeLI;
		this.activeContent = activeContent;
		
		this.activeLI.addEvent('mouseenter', function(){
			var allContent = $$('#hero-tabs li div');
			for ( i = 0 ; i < allContent.length; i++ ) {
				allContent[i].addClass('inactive');
			}
		});
		this.activeLI.addEvent('mouseenter', this.showContent.bind(this));
	},
	
	showContent: function() {
		this.activeContent.removeClass('inactive');
	}
});

window.onload = function() { 
	stripeRows();
	
	heroArr = new Array();
	heroUL = $('hero-tabs');
	heroLI = $$('#hero-tabs li');
	LIContent = $$('#hero-tabs li div');
	
	for (var i = 0; i < heroLI.length; i++) {
		if (i < heroLI.length / 2) {
			heroArr.include(new HeroTabs(heroLI[i], LIContent[i]));
		}
		else {
			heroArr.include(new HeroTabs(heroLI[i], LIContent[i]));
		}
	}
	
	
}

