<!--
var flag = true 

function showstatus()
{
	window.status = "Risk Expert"
}

if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);

//on mouse click event calling the function showstatus
document.onmousemove=showstatus;
document.onmouseover=showstatus;


function Trims(val)
	{
		var str  = new String(val);
		var newStr = str;
		if (val=="") return val; 
		for (itrim=0;itrim<str.length;itrim++)
          if(str.charCodeAt(itrim)==32)
             newStr = str.substring(itrim+1,str.length)
          else
              break;
		  str = newStr;
		for (itrim=str.length-1;itrim>=0;itrim--)
          if(str.charCodeAt(itrim)==32)
              newStr = str.substring(0,itrim)
          else
              break;
		return newStr;
	}
	
	function chkspchar(obj,msg,words)
	{
	flag = true 
	var obj = eval("document.form1." + obj)
	var objval =  obj.value
		for(i=0;i<objval.length;i++)
		{					
		  if(words=="false")		//also checks for the space char
		  {		
			keycode=objval.charCodeAt(i)
			if (((keycode<65) || (keycode>90)) && ((keycode<97) || (keycode>122)) && ((keycode<48) || (keycode>57)) )   
			{
				alert(msg)
				obj.focus()
				obj.select()
				flag = false
				i = objval.length
			}
		  }
		  else 				//words ="true"	 ignores for the space char
		  {	
			keycode=objval.charCodeAt(i);
			if (((keycode<65) || (keycode>90)) && ((keycode<97) || (keycode>122)) && ((keycode<48) || (keycode>57)) && (keycode !=32))   
			{
				alert(msg)
				obj.focus()
				obj.select()
				flag =  false
				i = objval.length
			}
		  }				 
		}
	}

		
	function emailchk(emailval) 
	{
		var errmsg="";
        temp_email=emailval;
        if (temp_email.indexOf('@')== -1 ) 	
           errmsg="Invalid Email ID.";
        else if (temp_email.substring(temp_email.indexOf('@')+2).indexOf('@')>=0 || temp_email.substring(temp_email.indexOf('@')+2).indexOf('.')< 0) 
           errmsg="Invalid Email ID.";
        else if (temp_email.charAt(temp_email.length-1)=='.') 
           errmsg="Invalid Email ID.";
        return errmsg;
	}

	function isnumberc(obj,msg)
	{
		var o = eval("document.form1." + obj)
		val = o.value
		val =  val.replace(/\s+/g,'')						//trims the spaces  
		if (val!="")
		{
			if((isNaN(val)) || (val.length < 1))	
			{
				alert(msg)
				o.focus()
				o.select()	
				flag = false
			}
		}
		else
			flag = true	
	}

//takes text obj name as a param and msg to display, check for the less than value
function isless(obj,val,msg)
{
	var o = eval("document.form1." + obj)
	if(o.value < val ) 
	{
		alert(msg)
		o.focus()
		o.select()	
		flag = false
	}
	else
	{
		flag = true	
	}
}

function isblank(obj,msg)
{
		var o = eval("document.form1." + obj)
		val = o.value

		val =  val.replace(/\s+/g,'')
		if((val == "") || (val.length < 1)) 	
		{
			flag = false
			alert(msg)
			o.focus()
			o.select()	
		}
		else
		{
			flag = true 
		}
}

//This function accepts the object name and selects the values of that object
function selectobject(obj)
{
	eval("document.form1." + obj  + ".select()")
}

function replaceSubString( originalString , searchForString , replaceWithString ){
	var objRegExp = eval( "/" + searchForString + "/g" );
	return ( originalString.replace( objRegExp , replaceWithString ) );
}

function isselected(obj,msg)
{
	var o = eval("document.form1." + obj)
	if((o.options[o.selectedIndex].value == "0") 	|| (o.options[o.selectedIndex].value == ""))
	{
		alert(msg)
		o.focus()
		flag = false
	}
	else
		flag = true	
}
//Included by hari on 23-Jun-05 to check the selected date is valid
//date function 
function isdate(dd,mm,yyyy) {
	var dat=dd;
	var mon=mm;
	var yer=yyyy;
	
	// *************************************************************************************
	// added by nikhilesh chitnis on 4 dec 2002 for credit note approval / operations review
	// **************************************************************************************
	if (dat == 'X' || mon == 'X' || yer == 'X') 
		return false
	
	if (dat == 0 || mon == 0 || yer == 0) 
	{	return false; }
	else
	{		
	switch (mon) {
		case '2':
			if ((yer%4==0) && (dat > 29)) 
			{   return false; }

			else if ((yer%4>0) && (dat > 28)) 
			{   return false; }
			else
			{   return true; }

			break;
		case '4':
		case '6':
		case '9':
		case '11':
			if (dat>30) 
			   return false; 
			else
				return true;

			break;
		default :
			return true;
	}
	}	
} 

-->

