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/us/en/member_area', 
            {
                asynchronous:true, 
                requestHeaders:['Accept', 'text/html'], 
                method:'get'
            }
        );
	
	var testimonials = new Array(
			"Wow! Was I surprised to win the $500 prize and excited...you bet!! My husband never quite believed I'd get the money. My prize was received in a most timely manner.",
			"I was so grateful to find your survey in my mail box. Thanks ever so much for including me in your research. Would be more than happy to do more surveys anytime in the future.",
			"I received my packet with samples and coupons. I was so excited as was my husband. He couldn't believe that some of the coupons gave us something for free! I will keep doing the surveys.",
			"I want to thank you so very much for the nice samples that you sent me. It was a pleasure to fill out the survey and will be glad to fill out the next one. The coupons came in handy and I certainly do appreciate all of them.",
			"I just want to take a minute and thank you for the coupons, lots of people make promises but few keep them. I'm so glad to learn that not all are just talk and no action. I'm glad you are there and I'm glad I could help; and you really wanted my opinion.",
			"Recently I received your packet of coupons and other interesting material. Thank you. I am writing to tell you they are greatly appreciated. I found it fun to fill out the questionnaire and also to see some of the results. We are not all the same in what we use and value. Coupons are the only way for the manufacturer to get to the customer with his product. Keep them coming! I shall give everyone a try.",
			"I was so grateful to find your survey in my mail box. Thanks ever so much for including me in your research. Would be more than happy to do more surveys anytime in the future.",
			"I want to thank you ever so much for my coupons and samples. I thought I would never receive anything. You made my day by not forgetting me.",
			"I was very surprised to receive a letter stating that I was one of your prize winners! The survey was informative and made me think about the products I buy everyday. Your research has a positive effect on the brands of goods my family uses and could purchase later.",
			"Thank you and the companies who sent the coupons to me. Please convey my thanks to them. The coupons will be a big help, not only to save money but also to learn of new products and try them. The survey results were also very interesting. Thanks again for the coupons and for inviting me to join the survey."
);
	
	right = getElementsByClassName("right")[0];
	
	test = document.createElement("p");
	test.innerHTML = "&#8220;" + testimonials[rand(10) - 1] + "&#8221;";
	test.className = "testimonial";
	right.appendChild(test);
}