function simpleHash(str)
{
var i,hash=0;
for(i=0;
i<str.length;
i++)
{
hash+=(str[i].charCodeAt()*(i+1))
}
return Math.abs(hash)%31337
}
function ascii_one(foo)
{
foo=foo.charAt(0);
var i;
for(i=0;
i<256;
++i)
{
var hex_i=i.toString(16);
if(hex_i.length==1)hex_i="0"+hex_i;
hex_i="%"+hex_i;
hex_i=unescape(hex_i);
if(hex_i==foo)break
}
return i
}
function numerical_value(str)
{
var i,a=0,b;
for(i=0;
i<str.length;
++i)
{
b=ascii_one(str.charAt(i));
a+=b*(i+1)
}
return a
}
function encrypt(form)
{
var res;
res=numerical_value(form.password.value);
res=res*(3+1+3+3+7);
res=res>>>6;
res=res/4;
res=res^4153;
if(res!=0)
{
alert('Invalid password!')
}
else
{
alert('Correct password :)')
}
form.key.value=numerical_value(form.password.value);
form.verification.value="yes"+simpleHash(form.password.value);
return true
}