/*******************************************************************************
' Function Name		fnValidate				
'
' Description		This function validates whether the From Date is less than
'					To Date or not. If not, then it shows an alert
'
' Modification Log
'
'       Date                Author                           Modification 
' 	11-Nov-2006      Archana Amaragandhi [Infosys]          Initial Version
'*******************************************************************************/

function fnValidate(obj,sErrorMessage)
{
	var IsInValidFlag = 0;
	var AlertMsg = "";
	var FromDate = document.getElementById(obj+"cboFromDateMonth").value + '/01/' +  + document.getElementById(obj+"cboFromDateYear").value;
	var ToDate   = document.getElementById(obj+"cboToDateMonth").value + '/01/' + document.getElementById(obj+"cboToDateYear").value;

	var dtFromDate = new Date(FromDate);
	var dtToDate = new Date(ToDate);
	
	if(dtFromDate > dtToDate)
	{
		AlertMsg = sErrorMessage;
		IsInValidFlag = 1;
	}
	
	if(IsInValidFlag == 1)
	{
		window.alert(AlertMsg);
		event.returnValue=false;
	}
	else
	{
		event.returnValue=true;
	}
}

/*******************************************************************************
' Function Name		fnSetEnterClick				
'
' Description		This function handles the enter key press. If enter key is 
'					pressed, it calls the click event of the control passed to it
'
' Modification Log
'
'       Date                Author                           Modification 
' 	11-Nov-2006    Archana Amaragandhi [Infosys]             Initial Version
'*******************************************************************************/

function fnSetEnterClick(obj,ControlToHandle)
{
	var ctl = ControlToHandle;
    if(event.keyCode == 13)
    {
          document.getElementById(obj + ctl).click();
          event.returnValue=false;
    }
}

/*******************************************************************************
' Function Name		fnChangeMouseCursor				
'
' Description		This function is used to change mouse cursor to hour glass
'
' Modification Log
'
'       Date                Author                           Modification 
' 	11-Nov-2006    Archana Amaragandhi [Infosys]             Initial Version
'*******************************************************************************/

function fnChangeMouseCursor()
{
	document.body.style.cursor = 'wait';
	document.getElementById('NewsReleaseSearch_UA1_btnSearch').style.cursor = 'wait';
	document.getElementById('NewsReleaseSearch_UA1_btnReset').style.cursor = 'wait';
}
