/**
This Function is used for the single object validation rutine
On succes of this function it calls a custom event handler, often this is page specific.

@@author Nil Ratan
**/
function validate(validateCase,formObj,url)
{	
	$(formObj).request({	
	  action:url,
	  method: 'post',
	  parameters: { VALIDATE:validateCase}, 
	  onSuccess:onValidate, 
	  onException: onValidateError

	});

}
function onValidateError(transport)
{
}
/**
This a common function should be called by the error display rutine unless otherwise some 
more complex or customized requirement.

@@author Satya
**/
function processError(ERR)
{
	try{
		if(ERR.size() <= 0) return;
	}
	catch(e)
	{

	}
	try{
		for (var key in ERR)
		{			
			$("spn"+key).hide();
			$("spn"+key).innerHTML=ERR[key];
			new Effect.Appear($("spn"+key));

		}
	} catch(e) {
		alert(e);
	}
}

/**
This a common function should be called by the message display rutine unless otherwise some 
more complex or customized requirement.

@@author Satya
@@author Nil Ratan (Added the exception catch) 
**/
function processMessage(MSG,GETFORMATTEDVAR)
{
	try{
		if(MSG.size() <= 0) return;
	}
	catch(e)
	{

	}
	try{
		for (var key in MSG)
		{
			$("spn"+key).innerHTML="";
			$("spn"+key).hide();
			if(GETFORMATTEDVAR!="" || GETFORMATTEDVAR!=false)
			{
				$(key).value=GETFORMATTEDVAR;
			}
		}
	} catch(e) {
		alert(e);
	}
}
function showPopupWindow(url)
{
	 window.open (url,"","menubar=0,resizable=0,width=350,height=250"); 
}
