//===========================================================================================================

// triming blank spaces

//===========================================================================================================

function trim(strText) { 
   // this will get rid of leading spaces 
   while (strText.substring(0,1) == ' ') 
       strText = strText.substring(1, strText.length); 

   // this will get rid of trailing spaces 
   while (strText.substring(strText.length-1,strText.length) == ' ') 
       strText = strText.substring(0, strText.length-1); 

  return strText; 
} 
//===========================================================================================================

// Limiting text

//===========================================================================================================

function LimitText(field) 
{ 
	
	if (field.value.length > 10)
	{ 
//		field.value = field.value.substring(0, 6000); 
//		alert("Sorry, Maximum 6000 characters allowed to enter.");
		return false; 
	} 
	else
	{
		return true;
	}
} 



//===========================================================================================================

// Validations for Website URL form
	
//===========================================================================================================

function fncheck(frmName)
{
	var formName = frmName;
		
	var b = formName.value;
	
	
	var v = new RegExp(); 
	//v.compile("^[A-Za-z]+://[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&\?\/.=]+$"); 
	//v.compile("^(http)+://[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&\?\/.=]+$"); 
	v.compile("^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&\?\/.=]+$"); 
	//v.compile("^(http)+://[w]{3}[.]{1})");
	
	if (!v.test(b)) 
	{ 
		//alert("URL must be in the form http://www.website.com"); 
		return false; 
	}


}
//===========================================================================================================

// Validations for Model Registration form
	
//===========================================================================================================

function fnregister()
{
		var emailPat = /^(\".+\"|[a-z]\w*(\.[a-z]\w*)*)@(\[\d{1,3}(\.\d{1,3}){3}]|[a-z]\w*(\.[a-z]\w*)+)$/i;
		var matchArray = document.getElementById('txtOffEmail').value.match(emailPat)
		
		
		
		
		var strOutput;
		strOutput="";
		document.getElementById('tsum').value="";

		if (document.getElementById('drplstTitle').value=="0")
		{
		strOutput=strOutput+"a";
			
		document.getElementById('tsum').value=strOutput;
		}
		if (trim(document.getElementById('txtFName').value)=="")
		{
		strOutput=strOutput+"b";
		document.getElementById('tsum').value=strOutput;
		}
		if (trim(document.getElementById('txtLName').value)=="")
		{
		strOutput=strOutput+"c";
		document.getElementById('tsum').value=strOutput;
		}
		
		//if (trim(document.getElementById('txtDesignation').value)=="")
		//{
		//strOutput=strOutput+"d";
		//document.getElementById('tsum').value=strOutput;
		//}
		
		//if (trim(document.getElementById('txtComapany').value)=="")
		//{
		//strOutput=strOutput+"e";
		//document.getElementById('tsum').value=strOutput;
		//}
		
		if (trim(document.getElementById('txtAddress').value)=="")
		{
		strOutput=strOutput+"f";
		document.getElementById('tsum').value=strOutput;
		}
		else
		{
			if ( LimitText(document.getElementById('txtAddress')) == false )
			{
				strOutput=strOutput+"z";
				document.getElementById('tsum').value=strOutput;
			}
		
		}
		
		//var retType;
		//retType = fncheck(document.getElementById('txtWebsite'))
		//if (retType == false)
		//{
		//strOutput=strOutput+"g"
		//document.getElementById('tsum').value=strOutput;
		//}
		
		if (trim(document.getElementById('txtPhone').value)=="")
		{
		strOutput=strOutput+"h";
		document.getElementById('tsum').value=strOutput;
		}
		
		if (trim(document.getElementById('txtOffEmail').value)=="")
		{
		strOutput=strOutput+"i";
		document.getElementById('tsum').value=strOutput;
		}
		if ( matchArray == null )
		{
		strOutput=strOutput+"j";
		document.getElementById('tsum').value=strOutput;
		}
		
		
		
		if (document.getElementById('txtPassword').value =="")
		{
		strOutput=strOutput+"k";
		document.getElementById('tsum').value=strOutput;
		}
		else
		{
			if (document.getElementById('txtConfPassword').value =="")
			{
			strOutput=strOutput+"l";
			document.getElementById('tsum').value=strOutput;
			}
			else if(document.getElementById('txtPassword').value != document.getElementById('txtConfPassword').value)
			{
			strOutput=strOutput+"m";
			document.getElementById('tsum').value=strOutput;
			}
		}
		
		if (trim(document.getElementById('txtProductServices').value) != "")
		{
			if ( LimitText(document.getElementById('txtProductServices')) == false )
			{
				strOutput=strOutput+"y";
				document.getElementById('tsum').value=strOutput;
			}
		}
	
		if (document.getElementById('chkothers').checked == true)	
		{
			if (trim(document.getElementById('txtOtherRadios').value) == "" )
			{
				strOutput=strOutput+"v";
				document.getElementById('tsum').value=strOutput;
			}
		}
		if (document.getElementById('chkOtherMicro').checked == true)	
		{
			if (trim(document.getElementById('txtMicrOthers').value) == "" )
			{
				strOutput=strOutput+"u";
				document.getElementById('tsum').value=strOutput;
			}
		}
		
		//if (trim(document.getElementById('txtProductServices').value)=="")
		//{
		//strOutput=strOutput+"n";
		//document.getElementById('tsum').value=strOutput;
		//}
		
		//if (trim(document.getElementById('txtProjectDesc').value)=="")
		//{
		//strOutput=strOutput+"o";
		//document.getElementById('tsum').value=strOutput;
		//}
		
		//if (document.getElementById('drplstTI4').value=="0")
		//{
		//strOutput=strOutput+"p";
		//document.getElementById('tsum').value=strOutput;
		//}
		
		if (trim(document.getElementById('txtProjectDesc').value) != "")
		{
			if ( LimitText(document.getElementById('txtProjectDesc')) == false )
			{
				strOutput=strOutput+"x";
				document.getElementById('tsum').value=strOutput;
			}
		}
		
		if (trim(document.getElementById('txtOtherComments').value) != "")
		{
			if ( LimitText(document.getElementById('txtOtherComments')) == false )
			{
				strOutput=strOutput+"w";
				document.getElementById('tsum').value=strOutput;
			}
		}
		
		if (document.getElementById('chkTOU').checked==false)
		{
		strOutput=strOutput+"q";
		document.getElementById('tsum').value=strOutput;
		}
		
		//if ((document.getElementById('chkChipcon').checked==false) && (document.getElementById('chkFreescale').checked==false) && (document.getElementById('chkothers').checked==false) )
		//{
		//strOutput=strOutput+"r";
		//document.getElementById('tsum').value=strOutput;
		//}
		
		
		
		if (document.getElementById('tsum').value!="")
		{		
				var gg,len,cnt,al;
				gg=document.getElementById('tsum').value
				len=gg.length
				al=""
				al="Please Correct the Following."+"\n"
				al=al+"_______________________________________"+"\n"
				al=al+"\n"+"\n"
				for(cnt=0;cnt<len;cnt++)
				{
						if (gg.charAt(cnt)=='a')
						{
						al=al+"- Please select title. "+"\n"
						}
						if (gg.charAt(cnt)=='b')
						{
						al=al+"- Please enter first name. "+"\n"
						}
						if (gg.charAt(cnt)=='c')
						{
						al=al+"- Please enter last name. "+"\n"
						}
						//if (gg.charAt(cnt)=='d')
						//{
						//al=al+"- Please enter designation "+"\n"
						//}
						//if (gg.charAt(cnt)=='e')
						//{
						//al=al+"- Please enter company "+"\n"
						//}
						if (gg.charAt(cnt)=='f')
						{
						al=al+"- Please enter address. "+"\n"
						}
						if (gg.charAt(cnt)=='z')
						{
						al=al+"- Sorry, Maximum 6000 characters allowed to enter. "+"\n"
						}
						//if (gg.charAt(cnt)=='g')
						//{
						//al=al+"- URL must be in the form http://www.website.com "+"\n"
						//}
						
						if (gg.charAt(cnt)=='h')
						{
						al=al+"- Please enter phone number. "+"\n"
						}
						if (gg.charAt(cnt)=='i' || gg.charAt(cnt)=='j')
						{
						al=al+"- Please enter valid email address."+"\n"
						if ( gg.charAt(cnt)=='i' ) { cnt++; }
						}
						if (gg.charAt(cnt)=='k')
						{
						al=al+"- Please enter password. "+"\n"
						}
						if (gg.charAt(cnt)=='l')
						{
						al=al+"- Please enter confirm password. "+"\n"
						}
						if (gg.charAt(cnt) == 'm')
						{
						al=al+"- Passwords do not match. "+"\n"
						}
						
						if (gg.charAt(cnt)=='y')
						{
						al=al+"- Sorry, Maximum 6000 characters allowed to enter. "+"\n"
						}
						if (gg.charAt(cnt)=='v')
						{
						al=al+"- Please enter preferred radio for others. "+"\n"
						}
						if (gg.charAt(cnt)=='u')
						{
						al=al+"- Please enter preferred microcontrollers for others. "+"\n"
						}
						if (gg.charAt(cnt)=='x')
						{
						al=al+"- Sorry, Maximum 6000 characters allowed to enter. "+"\n"
						}
						if (gg.charAt(cnt)=='w')
						{
						al=al+"- Sorry, Maximum 6000 characters allowed to enter. "+"\n"
						}
						
						//if (gg.charAt(cnt)=='n')
						//{
						//al=al+"- Please enter product/services offered "+"\n"
						//}
						//if (gg.charAt(cnt)=='o')
						//{
						//al=al+"- Please enter project description "+"\n"
						//}
						//if (gg.charAt(cnt)=='p')
						//{
						//al=al+"- Please select TI 4-node demo application "+"\n"
						//}
						if (gg.charAt(cnt)=='q')
						{
						al=al+"- You must agree to terms of use. "+"\n"
						}
						//if (gg.charAt(cnt)=='r')
						//{
						//al=al+"- Please select Preferred Radios "+"\n"
						//}
						
						
										
				}
				alert(al)
				for(cnt=0;cnt<len;cnt++)
				{
						if (gg.charAt(cnt)=='a')
						{
						document.getElementById('drplstTitle').focus(); break;
						}
						if (gg.charAt(cnt)=='b')
						{
						document.getElementById('txtFName').focus(); break;
						}
						if (gg.charAt(cnt)=='c')
						{
						document.getElementById('txtLName').focus(); break;
						}
						//if (gg.charAt(cnt)=='d')
						//{
						//document.getElementById('txtDesignation').focus(); break;
						//}
						//if (gg.charAt(cnt)=='e')
						//{
						//document.getElementById('txtComapany').focus(); break;
						//}
						if (gg.charAt(cnt)=='f')
						{
						document.getElementById('txtAddress').focus(); break;
						}
						if (gg.charAt(cnt)=='z')
						{
						document.getElementById('txtAddress').focus(); break;
						}
						//if (gg.charAt(cnt)=='g')
						//{
						//document.getElementById('txtWebsite').focus(); break;
						//}
						
						if (gg.charAt(cnt)=='h')
						{
						document.getElementById('txtPhone').focus(); break;
						}
						if (gg.charAt(cnt)=='i' || gg.charAt(cnt)=='j')
						{
						document.getElementById('txtOffEmail').focus(); break;
						}
						
						if (gg.charAt(cnt)=='k')
						{
						document.getElementById('txtPassword').focus(); break;
						}
						if (gg.charAt(cnt)=='l')
						{
						document.getElementById('txtConfPassword').focus(); break;
						}
						if (gg.charAt(cnt)=='m')
						{
						document.getElementById('txtConfPassword').focus(); break;
						}
							
						//if (gg.charAt(cnt)=='n')
						//{
						//document.getElementById('txtProductServices').focus(); break;
						//}
						//if (gg.charAt(cnt)=='o')
						//{
						//document.getElementById('txtProjectDesc').focus(); break;
						//}
						//if (gg.charAt(cnt)=='p')
						//{
						//document.getElementById('drplstTI4').focus(); break;
						//}
						
						if (gg.charAt(cnt)=='y')
						{
						document.getElementById('txtProductServices').focus(); break;
						}
						if (gg.charAt(cnt)=='v')
						{
						document.getElementById('txtOtherRadios').focus(); break;
						}
						if (gg.charAt(cnt)=='u')
						{
						document.getElementById('txtMicrOthers').focus(); break;
						}
						if (gg.charAt(cnt)=='x')
						{
						document.getElementById('txtProjectDesc').focus(); break;
						}
						if (gg.charAt(cnt)=='w')
						{
						document.getElementById('txtOtherComments').focus(); break;
						}
						
						
						if (gg.charAt(cnt)=='q')
						{
						document.getElementById('chkTOU').focus(); break;
						}
				}
		return false;
		}

return true;
}
//===========================================================================================================


//===========================================================================================================

function fnUpdateregister()
{
		var emailPat = /^(\".+\"|[a-z]\w*(\.[a-z]\w*)*)@(\[\d{1,3}(\.\d{1,3}){3}]|[a-z]\w*(\.[a-z]\w*)+)$/i;
		var matchArray = document.getElementById('txtOffEmail').value.match(emailPat)
		
		
		
		
		var strOutput;
		strOutput="";
		document.getElementById('tsum').value="";

		if (document.getElementById('drplstTitle').value=="0")
		{
		strOutput=strOutput+"a";
			
		document.getElementById('tsum').value=strOutput;
		}
		if (trim(document.getElementById('txtFName').value)=="")
		{
		strOutput=strOutput+"b";
		document.getElementById('tsum').value=strOutput;
		}
		if (trim(document.getElementById('txtLName').value)=="")
		{
		strOutput=strOutput+"c";
		document.getElementById('tsum').value=strOutput;
		}
		
		//if (trim(document.getElementById('txtDesignation').value)=="")
		//{
		//strOutput=strOutput+"d";
		//document.getElementById('tsum').value=strOutput;
		//}
		
		//if (trim(document.getElementById('txtComapany').value)=="")
		//{
		//strOutput=strOutput+"e";
		//document.getElementById('tsum').value=strOutput;
		//}
		
		if (trim(document.getElementById('txtAddress').value)=="")
		{
		strOutput=strOutput+"f";
		document.getElementById('tsum').value=strOutput;
		}
		else
		{
			if ( LimitText(document.getElementById('txtAddress')) == false )
			{
				strOutput=strOutput+"z";
				document.getElementById('tsum').value=strOutput;
			}
		
		}
		
		//var retType;
		//retType = fncheck(document.getElementById('txtWebsite'))
		//if (retType == false)
		//{
		//strOutput=strOutput+"g"
		//document.getElementById('tsum').value=strOutput;
		//}
		
		if (trim(document.getElementById('txtPhone').value)=="")
		{
		strOutput=strOutput+"h";
		document.getElementById('tsum').value=strOutput;
		}
		
		if (trim(document.getElementById('txtOffEmail').value)=="")
		{
		strOutput=strOutput+"i";
		document.getElementById('tsum').value=strOutput;
		}
		if ( matchArray == null )
		{
		strOutput=strOutput+"j";
		document.getElementById('tsum').value=strOutput;
		}
		
		if (trim(document.getElementById('txtProductServices').value) != "")
		{
			if ( LimitText(document.getElementById('txtProductServices')) == false )
			{
				strOutput=strOutput+"y";
				document.getElementById('tsum').value=strOutput;
			}
		}
	
		if (document.getElementById('chkothers').checked == true)	
		{
			if (trim(document.getElementById('txtOtherRadios').value) == "" )
			{
				strOutput=strOutput+"v";
				document.getElementById('tsum').value=strOutput;
			}
		}
		if (document.getElementById('chkOtherMicro').checked == true)	
		{
			if (trim(document.getElementById('txtMicrOthers').value) == "" )
			{
				strOutput=strOutput+"u";
				document.getElementById('tsum').value=strOutput;
			}
		}
		/*if (document.getElementById('txtPassword').value =="")
		{
		strOutput=strOutput+"k";
		document.getElementById('tsum').value=strOutput;
		}
		else
		{
			if (document.getElementById('txtConfPassword').value =="")
			{
			strOutput=strOutput+"l";
			document.getElementById('tsum').value=strOutput;
			}
			else if(document.getElementById('txtPassword').value != document.getElementById('txtConfPassword').value)
			{
			strOutput=strOutput+"m";
			document.getElementById('tsum').value=strOutput;
			}
		}
		*/
		
		//if (trim(document.getElementById('txtProductServices').value)=="")
		//{
		//strOutput=strOutput+"n";
		//document.getElementById('tsum').value=strOutput;
		//}
		
		//if (trim(document.getElementById('txtProjectDesc').value)=="")
		//{
		//strOutput=strOutput+"o";
		//document.getElementById('tsum').value=strOutput;
		//}
		if (trim(document.getElementById('txtProjectDesc').value) != "")
		{
			if ( LimitText(document.getElementById('txtProjectDesc')) == false )
			{
				strOutput=strOutput+"x";
				document.getElementById('tsum').value=strOutput;
			}
		}
		
		if (trim(document.getElementById('txtOtherComments').value) != "")
		{
			if ( LimitText(document.getElementById('txtOtherComments')) == false )
			{
				strOutput=strOutput+"w";
				document.getElementById('tsum').value=strOutput;
			}
		}
		//if (document.getElementById('drplstTI4').value=="0")
		//{
		//strOutput=strOutput+"p";
		//document.getElementById('tsum').value=strOutput;
		//}
		
		/*if (document.getElementById('chkTOU').checked==false)
		{
		strOutput=strOutput+"q";
		document.getElementById('tsum').value=strOutput;
		}*/
		
		//if ((document.getElementById('chkChipcon').checked==false) && (document.getElementById('chkFreescale').checked==false) && (document.getElementById('chkothers').checked==false) )
		//{
		//strOutput=strOutput+"r";
		//document.getElementById('tsum').value=strOutput;
		//}
		
		
		
		if (document.getElementById('tsum').value!="")
		{		
				var gg,len,cnt,al;
				gg=document.getElementById('tsum').value
				len=gg.length
				al=""
				al="Please Correct the Following."+"\n"
				al=al+"_______________________________________"+"\n"
				al=al+"\n"+"\n"
				for(cnt=0;cnt<len;cnt++)
				{
						if (gg.charAt(cnt)=='a')
						{
						al=al+"- Please select title "+"\n"
						}
						if (gg.charAt(cnt)=='b')
						{
						al=al+"- Please enter first name "+"\n"
						}
						if (gg.charAt(cnt)=='c')
						{
						al=al+"- Please enter last name "+"\n"
						}
						//if (gg.charAt(cnt)=='d')
						//{
						//al=al+"- Please enter designation "+"\n"
						//}
						//if (gg.charAt(cnt)=='e')
						//{
						//al=al+"- Please enter company "+"\n"
						//}
						if (gg.charAt(cnt)=='f')
						{
						al=al+"- Please enter address "+"\n"
						}
						if (gg.charAt(cnt)=='z')
						{
						al=al+"- Sorry, Maximum 6000 characters allowed to enter "+"\n"
						}
						
						//if (gg.charAt(cnt)=='g')
						//{
						//al=al+"- URL must be in the form http://www.website.com "+"\n"
						//}
						
						if (gg.charAt(cnt)=='h')
						{
						al=al+"- Please enter phone number "+"\n"
						}
						if (gg.charAt(cnt)=='i' || gg.charAt(cnt)=='j')
						{
						al=al+"- Please enter valid email address"+"\n"
						if ( gg.charAt(cnt)=='i' ) { cnt++; }
						}
						if (gg.charAt(cnt)=='y')
						{
						al=al+"- Sorry, Maximum 6000 characters allowed to enter "+"\n"
						}
						if (gg.charAt(cnt)=='v')
						{
						al=al+"- Please enter preferred radio for others "+"\n"
						}
						if (gg.charAt(cnt)=='u')
						{
						al=al+"- Please enter preferred microcontrollers for others "+"\n"
						}
						if (gg.charAt(cnt)=='x')
						{
						al=al+"- Sorry, Maximum 6000 characters allowed to enter "+"\n"
						}
						if (gg.charAt(cnt)=='w')
						{
						al=al+"- Sorry, Maximum 6000 characters allowed to enter "+"\n"
						}
						
						/*if (gg.charAt(cnt) == 'm')
						{
						al=al+"- Passwords do not match "+"\n"
						}
						*/
						//if (gg.charAt(cnt)=='n')
						//{
						//al=al+"- Please enter product/services offered "+"\n"
						//}
						//if (gg.charAt(cnt)=='o')
						//{
						//al=al+"- Please enter project description "+"\n"
						//}
						//if (gg.charAt(cnt)=='p')
						//{
						//al=al+"- Please select TI 4-node demo application "+"\n"
						//}
						if (gg.charAt(cnt)=='q')
						{
						al=al+"- Please accept terms of use "+"\n"
						}
						//if (gg.charAt(cnt)=='r')
						//{
						//al=al+"- Please select Preferred Radios "+"\n"
						//}
						
						
										
				}
				alert(al)
				for(cnt=0;cnt<len;cnt++)
				{
						if (gg.charAt(cnt)=='a')
						{
						document.getElementById('drplstTitle').focus(); break;
						}
						if (gg.charAt(cnt)=='b')
						{
						document.getElementById('txtFName').focus(); break;
						}
						if (gg.charAt(cnt)=='c')
						{
						document.getElementById('txtLName').focus(); break;
						}
						//if (gg.charAt(cnt)=='d')
						//{
						//document.getElementById('txtDesignation').focus(); break;
						//}
						//if (gg.charAt(cnt)=='e')
						//{
						//document.getElementById('txtComapany').focus(); break;
						//}
						if (gg.charAt(cnt)=='f')
						{
						document.getElementById('txtAddress').focus(); break;
						}
						if (gg.charAt(cnt)=='z')
						{
						document.getElementById('txtAddress').focus(); break;
						}
						//if (gg.charAt(cnt)=='g')
						//{
						//document.getElementById('txtWebsite').focus(); break;
						//}
						
						if (gg.charAt(cnt)=='h')
						{
						document.getElementById('txtPhone').focus(); break;
						}
						if (gg.charAt(cnt)=='i' || gg.charAt(cnt)=='j')
						{
						document.getElementById('txtOffEmail').focus(); break;
						}
						if (gg.charAt(cnt)=='y')
						{
						document.getElementById('txtProductServices').focus(); break;
						}
						if (gg.charAt(cnt)=='v')
						{
						document.getElementById('txtOtherRadios').focus(); break;
						}
						if (gg.charAt(cnt)=='u')
						{
						document.getElementById('txtMicrOthers').focus(); break;
						}
						if (gg.charAt(cnt)=='x')
						{
						document.getElementById('txtProjectDesc').focus(); break;
						}
						if (gg.charAt(cnt)=='w')
						{
						document.getElementById('txtOtherComments').focus(); break;
						}
						/*if (gg.charAt(cnt)=='l')
						{
						document.getElementById('txtConfPassword').focus(); break;
						}
						if (gg.charAt(cnt)=='m')
						{
						document.getElementById('txtConfPassword').focus(); break;
						}*/
							
						//if (gg.charAt(cnt)=='n')
						//{
						//document.getElementById('txtProductServices').focus(); break;
						//}
						//if (gg.charAt(cnt)=='o')
						//{
						//document.getElementById('txtProjectDesc').focus(); break;
						//}
						//if (gg.charAt(cnt)=='p')
						//{
						//document.getElementById('drplstTI4').focus(); break;
						//}
						if (gg.charAt(cnt)=='q')
						{
						document.getElementById('chkTOU').focus(); break;
						}
				}
		return false;
		}

return true;
}


//===========================================================================================================

// Validations for User Registration & User Profile form
	
//===========================================================================================================
function fnMessEntry()
{
		var strOutput;
		strOutput="";
		document.getElementById('tsum').value="";

		
		if (trim(document.getElementById('txtDescription').value)=="")
		{
		strOutput=strOutput+"a";
		document.getElementById('tsum').value=strOutput;
		}

		if (document.getElementById('tsum').value!="")
		{		
				var gg,len,cnt,al;
				gg=document.getElementById('tsum').value
				len=gg.length
				al=""
				al="Please Correct the Following."+"\n"
				al=al+"_______________________________________"+"\n"
				al=al+"\n"+"\n"
		
				if (document.getElementById('tsum').value=='a')
				{
				al=al+"- Please enter description "+"\n"
				document.getElementById('txtDescription').focus();
				alert(al);
				
				}
		return false;
		}
return true;
}	

function fnMessListNo()
{
		var strOutput;
		strOutput="";
		document.getElementById('tsum').value="";
		
		//document.getElementById('HidNewId').value = "a"
		
		if (trim(document.getElementById('txtMsgNo').value)=="")
		{
		strOutput=strOutput+"a";
		document.getElementById('tsum').value=strOutput;
		}
		else if (isNaN(document.getElementById('txtMsgNo').value) == true)
		{
		strOutput=strOutput+"b";
		document.getElementById('tsum').value=strOutput;
		}
		

		if (document.getElementById('tsum').value!="")
		{		
				var gg,len,cnt,al;
				gg=document.getElementById('tsum').value
				len=gg.length
				al=""
				al="Please Correct the Following."+"\n"
				al=al+"_______________________________________"+"\n"
				al=al+"\n"+"\n"
		
				if (document.getElementById('tsum').value=='a')
				{
				al=al+"- Please enter message number "+"\n"
				document.getElementById('txtMsgNo').focus();
				alert(al);
				
				}
				if (document.getElementById('tsum').value=='b')
				{
				al=al+"- Please enter valid message number "+"\n"
				document.getElementById('txtMsgNo').focus();
				alert(al);
				
				}
		return false;
		}
return true;
}			
//===========================================================================================================

// 
	
//===========================================================================================================

function validMessEntry()
		{
			if (fnMessEntry() == false)
			{
				return false;
			}
			else
			{
				return true;
			}
		}		
//===========================================================================================================

// 
	
//===========================================================================================================

function validMessListNo()
		{
			
				if (fnMessListNo() == false)
				{
					return false;
				}
				else
				{
					return true;
				}
			
		}	
//===========================================================================================================

// 
	
//===========================================================================================================
//Function for search buttons enter button by sg


function defaultbutton(e,btnid)
{
var bt = document.getElementById(btnid);
if (typeof(bt=='object'))
{
if (navigator.appName.indexOf("Netscape")>(-1))
{
if(e.keyCode == 13)
{
bt.click();
return false;
}
}
if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1))
{
if(event.keyCode == 13)
{
bt.click()
return false;
}
}
} 
} 



