﻿/////////////////fix the "two <div>fixH('mainData','rightMenuData'); in the same height" problam.
window.onload=function()
{
	fixH('mainData', 'rightMenuData');	
}

function fixH(one, two) 
{
	if (document.getElementById(one)) 
	{
		var leftHeight=document.getElementById(one).offsetHeight;
		var rightHeight=document.getElementById(two).offsetHeight;
		var newHeight = Math.max(leftHeight, rightHeight);
		document.getElementById(one).style.height=newHeight + "px";
		document.getElementById(two).style.height=newHeight + "px";		
	}
}

function fixHArticle(one, two, high) 
{
	if (document.getElementById(one)) 
	{	
		var leftHeight=document.getElementById(one).offsetHeight;
		var rightHeight=document.getElementById(two).offsetHeight;
		var newHeight = Math.max(leftHeight, rightHeight) + high;
		document.getElementById(one).style.height=newHeight + "px";
		document.getElementById(two).style.height=newHeight + "px";		
	}	
}
/////////////////////////////////////////////////////////////////

///////////////////run throw all the labels that are Hidden and show them.
function hideLabelsERP(Content)
{	
	var TotalHeight = 0;
	for(i=1; i < 15; i++)
	{		
		if(document.getElementById(Content + '_lblArticle_ERP_Full' + i).style.display == "none")
		{
			document.getElementById(Content + '_lblArticle_ERP_Full' + i).style.display = "";
			TotalHeight += parseInt(document.getElementById(Content + '_lblArticle_ERP_Full' + i).offsetHeight);
		}
		else
		{
			TotalHeight = parseInt(document.getElementById(Content + '_lblArticle_ERP_Full' + i).offsetHeight);
			document.getElementById(Content + '_lblArticle_ERP_Full' + i).style.display = "none";
			fixHArticle('mainData', 'rightMenuData', TotalHeight * -1);
		}		
	}		
	fixHArticle('mainData', 'rightMenuData', TotalHeight);
}
