function getElementsByClassName(strClass, strTag, objContElm) {
  strTag = strTag || "*";
  objContElm = objContElm || document;    
  var objColl = objContElm.getElementsByTagName(strTag);
  if (!objColl.length &&  strTag == "*" &&  objContElm.all) objColl = objContElm.all;
  var arr = new Array();                              
  var delim = strClass.indexOf('|') != -1  ? '|' : ' ';   
  var arrClass = strClass.split(delim);    
  for (var i = 0, j = objColl.length; i < j; i++) {                         
    var arrObjClass = objColl[i].className.split(' ');   
    if (delim == ' ' && arrClass.length > arrObjClass.length) continue;
    var c = 0;
    comparisonLoop:
    for (var k = 0, l = arrObjClass.length; k < l; k++) {
      for (var m = 0, n = arrClass.length; m < n; m++) {
        if (arrClass[m] == arrObjClass[k]) c++;
        if ((delim == '|' && c == 1) || (delim == ' ' && c == arrClass.length)) {
          arr.push(objColl[i]); 
          break comparisonLoop;
        }
      }
    }
  }
  return arr; 
}

function rand(max) {
	return 1 + Math.floor(Math.random() * max);
}

window.onload = function() {
	document.getElementById("sidebar_banner").src = "images/banner/s" + rand(7) + ".jpg";
        new Ajax.Updater('member_area', '/info/ca/en/member_area', {asynchronous:true, requestHeaders:['Accept', 'text/html'], method:'get'});
	
	var testimonials = new Array(
			"Thanks so much for the coupons and samples sent to me. Those I can't use, I pass on to my family. Keep up the good work!",
			"Thank you for giving me the privilege to participate in your Consumers Product survey and thank you for all the useful coupons that I have received. They all came in very handy and saved me a few dollars." ,
			"Thank you so very much for the coupons, I used every one of them. Thank you also for the samples, now I really like & use those products.",
			"I am delighted to take part in the Consumer Survey again. I enjoy doing it. It gives me great discounts and introduces me to new products. Thank you for the coupons that I have received over the last few years.",
			"I was surprised when I received your letter advising me about winning. I will keep filling out the survey that you send me. I will tell all my friends and family to fill out the questionnaire. Maybe one day they will win.",
			"I am so very thankful for including me in your surveys. I enjoy doing them and love exploring new products. I would love to continue doing the surveys and I do appreciate all the coupons I have received. It's been fantastic!"
		);
	
	right = getElementsByClassName("right")[0];
	
	test = document.createElement("p");
	test.innerHTML = "&#8220;" + testimonials[rand(6) - 1] + "&#8221;";
	test.className = "testimonial";
	
	right.appendChild(test);
}