// JavaScript Document

//this does it for three
function sortNum(a,b) { return b-a}

/*function fixH2(one,two,three) 
{
	if (document.getElementById(one)) 
	{
		var obj=new Array(3);
		var option=[one,two,three];
		for(var i=0; i<option.length; i++) 
		{
			document.getElementById(option[i]).style.height="auto";
			obj[i]=document.getElementById(option[i]).offsetHeight;
			nh=obj.sort(sortNum);
		}
		nh1=nh.splice(1,2);
		for(var i=0; i<option.length; i++) 
		{
			document.getElementById(option[i]).style.height=nh+"px";
		}
	}
}*/
//
function fixH1(one,two) 
{
	if (document.getElementById(one)) 
	{
		var obj=new Array(2);
		var option=[one,two];
		for(var i=0; i<option.length; i++) 
		{
			document.getElementById(option[i]).style.height="auto";
			obj[i]=document.getElementById(option[i]).offsetHeight;
			nh=obj.sort(sortNum);
		}
		nh1=nh.splice(1,2);
		for(var i=0; i<option.length; i++) 
		{
			document.getElementById(option[i]).style.height=nh-456+"px";
		}
	}
}


function fixHeight()
{
    // Declare and initialize variables
     var divs,contDivs,maxHeight,divHeight,d;
      maxHeight=0;
      contDivs=[];
	  divs = $$('div[rel=fixheight]');
      //divs=document.getElementsByTagName('div');              // get all <div> elements in the document
      for(var i=0;i<divs.length;i++){                         // for all divs…
	 
		 d=divs[i];
		 contDivs[contDivs.length]=d;
		 // determine their height, defined as either offsetHeight or pixelHeight
		 if(d.offsetHeight){ divHeight=d.offsetHeight; }
		 else if(d.style.pixelHeight){ divHeight=d.style.pixelHeight; }
		// Keep track of the largest div height
		  maxHeight=Math.max(maxHeight,divHeight);
         
	  }
 	 // assign all divs the height of the tallest div

      for(var i=0;i<contDivs.length;i++){
         contDivs[i].style.minHeight=maxHeight + "px";
      }
}

