// JavaScript Document

//this only for two div/s height setting
function fixHeightGeneral(one,two) {
	if (document.getElementById(one)) 
	{
		var lh=document.getElementById(one).offsetHeight;
		var rh=document.getElementById(two).offsetHeight;
		var nh = Math.max(lh, rh); 
		document.getElementById(one).style.height=nh+"px";
		document.getElementById(two).style.height=nh+"px";
	}
}


//this does it for three or more number options just keep increasing the Array for numbers
//No matter how many div have to be of equal height div=id
function sortNum(a,b) { return b-a} 

function fixHeightSetOne(one,two,three) 
{
	//if (document.getElementById(one))
	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,3); //nh.splice(1,2) splice important for number of divs along with the first one
		//alert(nh1);
		for(var i=0; i<option.length; i++) 
		{
			document.getElementById(option[i]).style.height=nh+"px";
		}
	}
}

function fixHeightSetTwo(one,two)
{
	if (document.getElementById(one))
	{
		var obj1=new Array(2);
		var option=[one,two];
		for(var i=0; i<option.length; i++) 
		{
			document.getElementById(option[i]).style.height="auto";
			obj1[i]=document.getElementById(option[i]).offsetHeight;
			nh=obj1.sort(sortNum);
			//alert(obj1);
		} 
		nh2=nh.splice(1,2); //nh.splice(1,2) splice important for number of divs along with the first one
		//alert(nh2);
		for(var i=0; i<option.length; i++) 
		{
			document.getElementById(option[i]).style.height=nh+"px";
		}
	}
}
//


window.onload=function(){
fixHeightGeneral('PnlOneHfix','contentright'); //for only two blocks accross
//fixHeightSetOne('contentrightbottom','contentleftIndex','LowercontentrightIndex'); /*Set-1*/
//fixHeightSetTwo('c1ContHldr','c2ContHldr'); /*Set-2*/
}