//================================================================================================
	/*     * FileName             : MicroplateImages.js
		   * ClassName            : -
		   * Description          : This javascript file contains javascript functions that
									will:
									1) set a border on mouse over
									2) set a border on selected item
									3) remove the border on mouse out
									4) clear previous borders when a different image is selected
									on the ParametricSearch template when operating in Microplate
									mode.
		   * Author               : Kiran Bhaskara
	*/
//================================================================================================
//************************************************************************************************
		// Function name   : setBorder
		// Description     : sets a border to an image on mouse over
		// Return type     : 
		// Argument        : var tdID
//************************************************************************************************
function setBorder(tdID)
{
	var e = document.getElementById(tdID);
	e.style.borderWidth="1px";
	e.style.borderStyle="solid";
	e.style.borderColor="#b5c6d6";
}
//************************************************************************************************
		// Function name   : removeBorder
		// Description     : removes a border to on image on mouse out
		// Return type     : 
		// Argument        : var tdID
//************************************************************************************************
function removeBorder(tdID)
{
	var c = document.getElementById('hdnClickedItem');
	//Logic not to remove the border when the image is clicked upon.
	if(c.value != tdID)
	{
		var e = document.getElementById(tdID);
		e.style.borderWidth="0px";
	}
}
//************************************************************************************************
		// Function name   : clearPreviousBorders
		// Description     : clears all the borders, on the images (if any) 
		// Return type     : 
		// Argument        : 
//************************************************************************************************
function clearPreviousBorder()
{
	var c = document.getElementById('hdnClickedItem').value;
	if(c != '')
	{
		var img = document.getElementById(c);
		img.style.borderWidth="0px";
	}
}
//************************************************************************************************
		// Function name   : itemSelected
		// Description     : set the selected image on the screen and raise an event on the page
		//					 notifying the same. 
		// Return type     : 
		// Argument        : 
//************************************************************************************************
function itemSelected(paraType, tdID)
{
	var hdnPtype = document.getElementById('hdnParaType');
	var c = document.getElementById('hdnClickedItem');
	if(c.value != tdID)
	{
		document.getElementById('hdnIsFirstTime').value = 'true';
		document.getElementById('hdnSelItemChanged').value = 'true';
		clearPreviousBorder();
	}
	else
	{
		document.getElementById('hdnSelItemChanged').value = 'false';
	}
	c.value = tdID;
	hdnPtype.value = paraType;
	setBorder(tdID);
	var b = document.getElementById('hdnBtn');
	b.click();	
}
//************************************************************************************************
		// Function name   : ChangeFirstTimeStatus
		// Description     : On page load, user's parametric first time status is true. Once he 
		//					 selects an image, this status becomes false. Invoked on Anthem 
		//					 call back from ParametricSearchControl.ascx.cs 
		// Return type     : 
		// Argument        : 
//************************************************************************************************
function ChangeFirstTimeStatus()
{
	document.getElementById('hdnIsFirstTime').value = 'false';
	document.getElementById('hdnSelItemChanged').value = 'false';
}

