/*
* Created By: nandita
  Purpose: file contain the common javascript function 

*/

/*Summary
clear the value of textbox
object: textbox
 compareText:  compare the textbox text to the compareText string
*/
function ClearData(compareText, object)
{
//Remove the default text

 if(object.value.toUpperCase() == compareText.toUpperCase())
    object.value = ''; 
}
/*Summary
Fill the textbox with the fill text
object: textbox
 fillText:  compare the textbox text to the compareText string
*/
function CheckEmpty(fillText, object)
{

	if(object.value.length == 0)
	{
		object.value = fillText;
	}
}

/*Summary
make two div elemt of same height
div1Id: div  
div2Id div  
 
*/
function EqualHeight(div1Id, div2Id)
{


	var div1 = document.getElementById(div1Id);
	var div2 = document.getElementById(div2Id);
	
	if(div1==null || div2==null )
	{
		return;
	}

	var h1 = getHeight(div1);
	var h2 = getHeight(div2);
	
	if(h1 < h2)
	{
		div1.style.height = h2 + 'px';
	}
	else
	{
		div2.style.height = h1 + 'px';
	}
	
}

/*Summary
get thr height of a div element
d: div
 
*/

function getHeight(d)
{
	var divHeight;
	if(d.offsetHeight)
	{ 
		divHeight=d.offsetHeight; 
	} 
	else if(d.style.pixelHeight)
	{
		divHeight=d.style.pixelHeight; 
	} 
	return divHeight;
}
