/*
  ***********************************************************************************
  * Copyright Notice																*	
  * (c) Blue Star InfoTech Limited													*
  * All rights reserved. The software and associated documentation					*
  * supplied hereunder are the confidential and proprietary information				*
  * of Blue Star Infotech Limited, India and are supplied							*
  * subject to licence terms. In no event may the Licensee reverse					*
  * engineer, decompile, or otherwise attempt to discover the						*
  * underlying source code or confidential information herein.						*
  *																					*
  ***********************************************************************************
-------------------------------------------------------------------------------------
 File Name         : DVCMN_Error.js

 Description       : This script files is used by all aspx pages to display DHTML 
 					 error messages. 

 Author            : BSIL

 Date Created      : 14 September 2003               
-------------------------------------------------------------------------------------
 Version   Date Modified     Modified By     Brief Description
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
*/

	var counter = 0;
	var ErrMsg = "";
	var arrCtl = new Array();

	function CtlError(CtlNum, CtlRepeat, Msg)
	{
		var STE = "";
		counter += CtlRepeat;
		arrCtl[counter] = CtlNum;
		var strControlId = 'divErr' + CtlNum;
		var objControl = document.getElementById(strControlId);
		objControl.style.visibility = "visible";
		
		strControlId = 'MsgErr' + CtlNum;
		objControl = document.getElementById(strControlId);
		objControl.innerHTML = counter;
		ErrMsg += "<b>"+counter+":</b> "+Msg+"<br/><br/>";
	}
	
	function ShowError(ErrMsg)
	{	
		var strControlId = 'divErrMaster';
		var objControl = document.getElementById(strControlId);
		objControl.style.visibility = "visible";
		strControlId = 'MsgErrMaster';
		objControl = document.getElementById(strControlId);
		objControl.innerHTML = ErrMsg;
		
		ResetError();
		//if (ErrMsg == '') return false;
		//return true; // Will submit form when this executed...
	}
	
	function ResetError()
	{
		counter = 0;
		ErrMsg = "";
	}

	function InitializeDisplay()
	{
		var intCounter;
		var objControl = "";
		var strControlId = '';
		for (intCounter=1;intCounter<=arrCtl.length;intCounter++)
		{
			strControlId = 'divErr' + intCounter;
			objControl = document.getElementById(strControlId);
			if (objControl != null)
			{
				objControl.style.visibility = "hidden";
			}
		}
		var strMasterId = 'divErrMaster';
		var objMaster = document.getElementById(strMasterId);
		if (objMaster != null)
		{
			objMaster.style.visibility = "hidden";
		}
	}
