  function expand_bg(){
	arg1 = 'take_a_stand_bottom';
  	arg2 = 'on_the_radar_bottom';
	arg3 = 'take_a_stand_more';
	arg4 = 'on_the_radar_more';
	
	arg5 ='did_you_know_box';
	arg6 ='teaser_box_dark_bottom_eah';
	arg7 ='teaser_box_light_bottom_wac';
  	
  	// expand the bg of the main content area
  	// based on the height of the grandchildren
		if (document.getElementById) {
			tb = document.getElementById(arg1);
			ob = document.getElementById(arg2);
			tm = document.getElementById(arg3);
			om = document.getElementById(arg4);
			
			
		//z begin debugging for js conflict resolution
			th =0;
			oh =0;
			if (tb != null){
				th = tb.offsetHeight;
			}
			if (ob != null){
				oh = ob.offsetHeight;
			}
			
			if(th > oh){
				//alert('th is ' + th + ' and oh is ' + oh);
				if (ob != null){
				ob.style.height = th + 'px';
				if (document.all){
				om.style.marginTop = th-oh +10 + 'px';
				tm.style.marginTop = 10 + 'px';
				}
				else{
				//om.style.marginTop = 100 + 'px';
				om.style.marginTop = th-oh -59 + 'px';
				}
				}
			}
			else {		
			if (tb != null) {
				if (document.all){
				tb.style.height = oh + 'px';
				}
				else {
				tb.style.height = oh + 'px';
				}
				if (document.all){
				tm.style.marginTop = oh-th +10 + 'px';
				om.style.marginTop = oh-th +7 + 'px';
				}
				else{
				tm.style.marginTop = oh-th -1 + 'px';
				}
			}
			}
				
		//z end debugging for js conflict resolution
			

		}
		
		
  	// expansion of boxed on cost_of_consumption page
		if (document.getElementById) {
			dykb = document.getElementById(arg5);
			tbdbeah = document.getElementById(arg6);
			tblbwac = document.getElementById(arg7);
			
		//z begin debugging for js conflict resolution
			dykbh =0;
			tbdbeahh =0;
			tblbwach=0;
			if (dykb != null){
				dykbh = dykb.offsetHeight;
			}
			if (tbdbeah != null){
				tbdbeahh = tbdbeah.offsetHeight;
			}
			if (tblbwac != null){
				tblbwach = tblbwac.offsetHeight;
			}
			//
//					//alert('teaser box bottom '+ (tblbwach + (document.getElementById('block-block-10').offsetTop + document.getElementById('cost_of_consumpt_areas').offsetTop) +36));
//					//alert('did you know bottom '+ (document.getElementById('did_you_know_box').offsetTop +dykbh));
//					// if teaserbox is further than did you know
//					if (document.getElementById('block-block-10') != null) {
//			if((tblbwach + (document.getElementById('block-block-10').offsetTop + document.getElementById('cost_of_consumpt_areas').offsetTop) +36) > (document.getElementById('did_you_know_box').offsetTop +dykbh)){ //need to check based on posBottom
//				if (dykb != null){
//					posBottom = tblbwach + (document.getElementById('block-block-10').offsetTop + document.getElementById('cost_of_consumpt_areas').offsetTop) +36;
//					newHeight = posBottom - dykb.offsetTop;
//					//alert('tblbwach is  '+ tblbwach);
//					//alert('tblbwac top is '+ tblbwac.offsetTop);
//					//alert('tblbwac top is '+ (document.getElementById('block-block-10').offsetTop + document.getElementById('cost_of_consumpt_areas').offsetTop));
//					//alert('posBottom is  '+ posBottom);
//					//alert('dykb top is  '+ dykb.offsetTop);
//					//alert('new height is '+ newHeight);
//				dykb.style.height = (newHeight -24) +'px';  //height of box plus the difference in top pos
//				//adjust more link
//				document.getElementById('did_you_know_box_more').style.marginTop = (newHeight-54) +'px';
//				if (document.all){ // style for more buttons here
//					posBottom = tblbwach + (document.getElementById('block-block-10').offsetTop + document.getElementById('cost_of_consumpt_areas').offsetTop) +36;
//					
//					newHeight = posBottom - 426;
//					//alert('in document all');
//					//alert('tblbwach is  '+ tblbwach);
//					//alert('tblbwac top is '+ tblbwac.offsetTop);
//					//alert('tblbwac top is '+ (document.getElementById('block-block-10').offsetTop + document.getElementById('cost_of_consumpt_areas').offsetTop));
//					//alert('posBottom is  '+ posBottom);
//					//alert('dykb top is  '+ dykb.offsetTop);
//					//alert('new height is '+ newHeight);
//					
//				dykb.style.height = (newHeight) +'px'; 
//				//adjust more link
//				document.getElementById('did_you_know_box_more').style.marginTop = (newHeight-27) +'px';
//				dykb.style.marginBottom = (-14) +'px'; 
//				}
//				else{
//				//om.style.marginTop = 100 + 'px';
//				}
//				}
//			}
//			else {	// if dyykb is greater than tblbwach 
//			//need to fill in
//			}
//				
//					} // end check for block-block-10
				
				//for pages with did you know box
				if (document.getElementById('did_you_know_box') != null){
					// if howmuch box is further than did you know
			if((document.getElementById('main_content').offsetTop + document.getElementById('main_content').offsetHeight) > (document.getElementById('did_you_know_box').offsetTop +dykbh)){ //need to check based on posBottom
				if (dykb != null){
					posBottom = (document.getElementById('main_content').offsetTop + document.getElementById('main_content').offsetHeight);
					newHeight = posBottom - dykb.offsetTop;
					//alert('tblbwach is  '+ tblbwach);
					//alert('tblbwac top is '+ tblbwac.offsetTop);
					//alert('tblbwac top is '+ (document.getElementById('block-block-10').offsetTop + document.getElementById('cost_of_consumpt_areas').offsetTop));
					//alert('posBottom is  '+ posBottom);
					//alert('dykb top is  '+ dykb.offsetTop);
					//alert('new height is '+ newHeight);
				dykb.style.height = (newHeight -24-8) +'px';  //height of box plus the difference in top pos
				//adjust more link
				document.getElementById('did_you_know_box_more').style.marginTop = (newHeight-54-8) +'px';
				if (document.all){ // style for more buttons here
					posBottom = (document.getElementById('main_content').offsetTop + document.getElementById('main_content').offsetHeight);
					
					newHeight = posBottom - 426-395 -34;
					//alert('in document all');
					//alert('tblbwach is  '+ tblbwach);
					//alert('tblbwac top is '+ tblbwac.offsetTop);
					//alert('tblbwac top is '+ (document.getElementById('block-block-10').offsetTop + document.getElementById('cost_of_consumpt_areas').offsetTop));
					//alert('maincontent top is  '+ document.getElementById('main_content').offsetTop);
					//alert('maincontent height is  '+ document.getElementById('main_content').offsetHeight);
					//alert('posBottom is  '+ posBottom);
					//alert('dykb top is  '+ dykb.offsetTop);
					//alert('new height is '+ newHeight);
					
				dykb.style.height = (newHeight) +'px'; 
				//adjust more link
				document.getElementById('did_you_know_box_more').style.marginTop = (newHeight-27) +'px';
				dykb.style.marginBottom = (-14) +'px'; 
				}
				else{
				//om.style.marginTop = 100 + 'px';
				}
				}
			}
			else {	// if dyykb is greater than tblbwach 
			//need to fill in
			}
		//z end debugging for js conflict resolution
				} // end if for pages with did you know box

		}
  }
  
  function disable_vote(){
	if (document.getElementById('advpoll_view_voting') != null){
	document.advpoll_view_voting.op.disabled = true;  
	}
  }
  function enable_vote(nid){
	  //alert('enabling ' + nid);	
//	  var newHTML = '<a href ="node/' + nid + '/votes">(see results)</a>';
//	  document.getElementById('see_results_link').innerHTML = newHTML;
// see results link is now taken care of by checking if user has already voted...uncomment this and have fun debugging IE
  }
  if (isJsEnabled()) {
    // addLoadEvent(expand_bg);
	if (document.getElementsByName('advpoll_view_voting') != null){
		addLoadEvent(disable_vote);
		}
	}
 
