function op(this_form,name,val)
{
eval("this_form."+name+".value=" +val );
this_form.submit();
}
function getObj(name)
{
if (document.getElementById)
{
this.obj = document.getElementById(name);
this.style = document.getElementById(name).style;
}
else if (document.all)
{
this.obj = document.all[name];
this.style = document.all[name].style;
}
else if (document.layers)
{
this.obj = getObjNN4(document,name);
this.style = this.obj;
}
}
function getObjNN4(obj,name)
{
var x = obj.layers;
var foundLayer;
for (var i=0;i<x.length;i++)
{
if (x[i].id == name)
foundLayer = x[i];
else if (x[i].layers.length)
var tmp = getObjNN4(x[i],name);
if (tmp) foundLayer = tmp;
}
return foundLayer;
}

function hideSpec(checkboxtocheck,name,offname)
{
var x = new getObj(name);
if(x.style.visibility!='hidden')
{
x.style.visibility = 'hidden';
x.style.className = offname;
checkboxtocheck.checked=true;
}
else
{
x.style.visibility = 'visible';
x.style.className = name;
checkboxtocheck.checked=false;
}
return true;
}
function check_exceptions(email_address)
{
var MAX_ITEMS=7;
var exceptions_list=new Array;

exceptions_list[0]="guest";
exceptions_list[1]="adm";
exceptions_list[2]="fx";
exceptions_list[2]="swaps";
exceptions_list[2]="vanilla";
exceptions_list[2]="arb";
exceptions_list[3]="fi";
exceptions_list[4]="equity";
exceptions_list[5]="commodity";
exceptions_list[6]="exotics";
for(i=0;i<MAX_ITEMS;i++)
{
var pos=email_address.indexOf(exceptions_list[i]);
if(pos >=0 && pos < email_address.length) found=true;
return true;
}
return false;
}
function valid_email(email_address)
{
var hasErrors=false;
if (email_address.length < 5)
    return false;
at_location = email_address.indexOf("@")
dot_location = email_address.lastIndexOf(".")
if(at_location == -1 || dot_location == -1 || at_location > dot_location )
  return false;
if(at_location == 0)
  return false;  
if(dot_location - at_location < 2 )
  return false;
if(email_address.length - dot_location < 2)
  return false;
if(check_exceptions(email_address)==true)
 return true;
else
return false;
}
function valid(this_form)
{
if(this_form.email.value=="" || this_form.email.value==null)
{
alert("You must enter your E-Mail or Login Id");return false;
}
if(!valid_email(this_form.email.value))
{
alert("You must enter a Valid e-mail Address");
return false;
}
if(this_form.pwd1.value=="" || this_form.pwd1.value==null)
{
alert("You must enter a Password");
return false;
}
return true;
}
function op(this_form,name,val)
{
 eval("this_form."+name+".value=" +val );
 this_form.submit();
 return true;
}

function ecode12(this_form)
{
var hasError=false;
if(!valid_email(this_form.email.value))
{
alert("You must enter a Valid e-mail Address");
 return false;
}
if(!this_form.dummy.checked)
{
 if(valid(this_form))
{
if(this_form.pwd1.length < 6)
{
alert('Password Must be at least 6 charachetrs!');
this_form.pwd1.value=' ';
this_form.pwd2.value=' ';
return false;
}
if(this_form.pwd1.value!=this_form.pwd2.value)
{
alert('Password Confirmation should match precisely your Password, Please Try again!');
this_form.pwd1.value=' ';
this_form.pwd2.value=' ';
hasError=true;
}
else{
this_form.udpwd.value=0;
}
this_form.epwd1.value=SHA256(this_form.pwd1.value);
this_form.epwd2.value=SHA256(this_form.pwd2.value);
}
else hasError=true;
}
else{
this_form.pwd1.value='';
this_form.pwd2.value='';
this_form.pwd1.value='';
this_form.pwd2.value='';
}
if(hasError==true)
{ 
  return false;
}
else
{
var tmp=new Date(); this_form.utz.value=tmp.getTimezoneOffset();
this_form.pwd1.value=' ';
this_form.pwd2.value=' ';
this_form.op.value='3';
var protocol=location.protocol;
var loc='www.risksvr.com';
var ha='/usr/users.svr';
if(protocol='file:')
protocol='http:';
this_form.action=protocol+"//"+loc+ha;
this_form.submit();
alert(this_form.action);
}
return true;
}


