function special()
	{
		var s
		s=document.formx.a.value
		if ((s.charCodeAt(0)<65) || ((s.charCodeAt(0)>90) && (s.charCodeAt(0)<97)) || (s.charCodeAt(0)>122))
		
 	    {
 	    alert("Name can contain only English Alphabets!")
		return true;
		} 		 
return false;
}
function alpnum()
	{
		var s
		s=document.formx.a.value
		var l1;
		l1=s.length;
		for( var i=1;i<l1;i++)
		{
		if (((s.charCodeAt(i)<32) || ((s.charCodeAt(i)>32) && (s.charCodeAt(i)<65))) || ((s.charCodeAt(i)>90) && (s.charCodeAt(i)<97)) || (s.charCodeAt(i)>122))
		
 	    { alert("Name can contain only  English Alphabets!")
		return true;
		} 
		  }

return false;
}

function a_plus_b()
{
if (document.formx.a.value=="")
{
alert(" Please Enter Your Name in English Alphabets (A-Z) Or                         Use English Alphabets as per the sound of Your Name!                               - to get the correct readings.");
document.formx.a.focus();
return false;
}

if (!isNaN(document.formx.a.value))
{
alert("Please Enter Your Name!");
document.formx.a.focus();
return false;
}

if(special(document.formx.a.value))
{
document.formx.a.focus();
document.formx.a.select();
return false;
}

if(alpnum(document.formx.a.value))
{
document.formx.a.focus();
document.formx.a.select();
return false;
}

function mod(num)
{
var cnn=0,res=0;

while(num>0)
{
cnn=num%10;
res=res+cnn;
num=parseInt(num/10);
}
if (res>=10)
{
res=mod(res);
}
return res;
}

function count(ch)
{
var cnt=0;
if ((ch=='a')||(ch=='A')||(ch=='i')||(ch=='I')||(ch=='j')||(ch=='J')||(ch=='q')||(ch=='Q')||(ch=='y')||(ch=='Y'))
{
cnt=1;
}
if ((ch=='b')|| (ch=='B')|| (ch=='k')||(ch=='K')||(ch=='r')||(ch=='R'))
{
cnt=2;
}
if ((ch=='c')||(ch=='C')||(ch=='g')||(ch=='G')||(ch=='l')||(ch=='L')||(ch=='s')||(ch=='S'))
{
cnt=3;
}
if ((ch=='d')|| (ch=='D')|| (ch=='m')||(ch=='M')||(ch=='t')||(ch=='T'))
{
cnt=4;
}
if ((ch=='e')||(ch=='E')||(ch=='h')||(ch=='H')||(ch=='n')||(ch=='N')||(ch=='x')||(ch=='X'))
{
cnt=5;
}
if ((ch=='u')|| (ch=='U')|| (ch=='v')||(ch=='V')||(ch=='w')||(ch=='W'))
{
cnt=6;
}
if ((ch=='o')|| (ch=='O')|| (ch=='z')||(ch=='Z'))
{
cnt=7;
}
if ((ch=='f')|| (ch=='F')|| (ch=='p')||(ch=='P'))
{
cnt=8;
}
return cnt;
}

var c;
var l=0,cntr=0,result=0;

name = document.formx.a.value;
l=name.length;

for(i=0;i<=l;i++)
{
c=name.charAt(i);
cntr=cntr+count(c);
}
result=mod(cntr);

document.formx.ans.value = cntr;
}


function namedma()
{
document.write('<form name="formx" method="POST" action="http://www.aghilham.com/namedma/callingnamedma.asp" id="formx" target="matchframe"><div align="center"><center><table border="0" width="80%" cellspacing="0" cellpadding="0"><tr><td width="100%"><p align="center"><font face="Arial" size="2" color="#999966"><b>Enter your Calling Name & Know your <br>Develop, Maintain and Avoid - Tips </b></font></td></tr><tr><td width="100%"><center><input type="text" name="a" size="10" style="background-color: #F2F2F2; color: #828257; font-weight: bold; border: 1 solid #666666">&nbsp;<input type="submit" value="Click ! " name="sub" id="sub" onClick="return a_plus_b(this)" style="background-color: #F2F2F2; color: #808000; font-weight: bold; border: 1 solid #666666">&nbsp;<input type="reset" Value="Reset !" style="background-color: #F2F2F2; color: #808000; font-weight: bold; border: 1 solid #666666"></center></td></tr><tr><td width="100%"><font color="#666666" face="arial" size="2">&nbsp; </font><input type="hidden" name="ans" id="ans" ></td></tr></table></center></div><center><iframe width="325" name="matchframe" frameborder=no scrolling=yes framespacing=0 noresize></iframe></center></form>');
}
namedma();

