function a(t){status=t;return true;} function b(){status='';return true;}

function doQuotes() {
	var quotes = new Array ();
	var authors = new Array ();
	quotes[0] = "I just wanted to say how great this site is. Thanks to whoever put it together! And that its free! <br><br>The Macro-Nutrient and Daily Calorie Needs calculators I use all the time.";authors[0] = "Anon";
	quotes[1] = "your web site is awesome... You should be congratulated, and justifiably proud of a job well done. <br><br> :)";authors[1] = "Terry C.";
	quotes[2] = "I would like to thank you for making this web site easy to understand. I have had great success and the plan works. Other calorie counting sites are so complicated and confusing";authors[2] = "Nicole K.";
	quotes[3] = "I just wanted to say thanks for the site. I have lost 75 lbs in the last 9 months.";authors[3] = "Garry Evans";
	quotes[4] = "By using this calculator, and increasing my daily activity, I have safely lost 40 lbs, and still going strong!";authors[4] = "Sue H";
	quotes[5] = "I weighed 374. I now weigh 317. I want to say thank you for insight, good tips and being here...";authors[5] = "Cheri";
	quotes[6] = "I just love your website, it is so informative and extremely helpful. I especially love the calculators and meal plans.";authors[6] = "Yasmin";
	var i = Math.floor(quotes.length*Math.random());
	document.getElementById('quotetext').innerHTML = "“" + quotes[i] + "”" + " <br><br><a href=\"/help/awards.htm\">FEEDBACK...</a>";
	document.getElementById('quoteauthor').innerHTML = authors[i] ;
}

function alternateRowColors() {
	var className = 'default';
	var rowcolor = '#efefef'; //'#F7F5EE';
	var rows, arow;
	var tables = document.getElementsByTagName("table");
	var rowCount = 0;
	for(var i=0;i<tables.length;i++) {
		if(tables.item(i).className == className) {
			atable = tables.item(i);
			rows = atable.getElementsByTagName("tr");
			for(var j=0;j<rows.length;j++) {
				arow = rows.item(j);
				if(arow.nodeName == "TR") {
					if(rowCount % 2) {
						arow.style.backgroundColor = rowcolor;
					} else {
						// default case
					}
					rowCount++;
				}
			}
			rowCount = 0;
		}
	}
}

function printThis(elementPrint)  {
	var printDiv = Get(elementPrint);
	//alert (elementPrint.name);

	if (document.getElementsByTagName) {
		linkEl = document.getElementsByTagName('link');
		styleEl= document.getElementsByTagName('style');
		}
	printWindow = window.open("","printWindow","left=50,top=50,width=500,height=500,scrollbars=yes,"+"status=yes,resizable=yes");
    printWindow.opener = self;
    d = printWindow.document;
	//Write the printed contents
    d.open();
	d.writeln("<html><head><title>" + document.title + "</title>");
	if (linkEl) {
	  	d.writeln ("<link rel='stylesheet' type='text/css' href='" +linkEl[0].getAttribute('href') + "'/>");
	}
	
	if (styleEl && styleEl.length > 0 ) {
		d.writeln ("<style type='text/css'>" + styleEl[0].innerHTML + "</style>");
	}
	d.writeln("</head><body>");
	d.writeln(printDiv.innerHTML);
	d.writeln("</body></html>");
	
	d.close();
	printWindow.print();
	printWindow.close();
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

addLoadEvent (alternateRowColors);
addLoadEvent (doQuotes);
