// JavaScript Document
function registerchecking(Myform)
{

   if(Myform.username.value=="")
   {
      alert("User name cannot be empty")
      Myform.username.focus();
      return false;
      
   }
   else
   {
      if(!isValidStr(Myform.username.value))
      {
         alert("User name contain space or special character: < >  \ / | * $ ' * # % ( ) @ \" ");
         Myform.username.select();
         return false;
      }
   }
   if(Myform.password.value=="")
   {
      alert("Password cannot be empty")
      Myform.password.focus();
      return false;

   }
   else
   {
      if(!isValidStr(Myform.password.value))
      {
         alert("Password contain space or special character: < >  \ / | * $ ' * # % ( ) @ \" ");
         Myform.password.select();
         return false;
      }
   }
   if(Myform.email.value=="")
   {
      alert("Email cannot be empty")
      Myform.email.focus();
      return false;

   }
   else{
      if(!checkMail(Myform.email.value)){
         alert("Please insert valid email")
         Myform.email.select();
          return false;
      }
   }
}
function checkMail(str)
{
   var x = str
   var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
   if (filter.test(x)) return true;
   else return false;

}
function isValidStr(str)
{
   var invalidChar = /[<>"'|*#%* ()@$]/
   var found = invalidChar.test(str);
   return !found;
}
function open_window(win_name,the_url, args)
{
  if (args == null)
     window.open(the_url,win_name,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=500,height=300')
  else
     window.open(the_url,win_name,args)
}
function alertmsg(str)
{
   var temp = document.createElement('div')
   temp.innerHTML =str;
   alert(temp.innerHTML)
}
function hideads(sec)
{
  setTimeout("hidenow()",sec);
}
function hidenow()
{
   ads1.style.display="none";
   ads2.style.display="block";
}


function stopError() {
  return true;
}
window.onerror = stopError;
var click_url2 = "";

rindex = Math.floor(Math.random() * 28);
rstart = 0;

function getrandbutton( size ) {
var mylink;           
var outlink;

if( size == 1 )
  rout = Math.floor(Math.random() * 3);
else
  rout = Math.floor(Math.random() * 3);

outlink = "http://www.arcadew.com/outlink100x100.php";

if( size == 1 ) {
   mylink = "<a target='_blank' href = '" + outlink + "' class='sborderit'><img src='http://www.arcadew.com/buttons/70x70/but" + rindex + ".gif' alt='HOT GAMES' width=70 height=70 border=0></a>";
}
else
{
   mylink = "<a target='_blank' href = '" + outlink + "' class='borderit'><img src='http://www.arcadew.com/buttons/but" + rindex + ".gif' alt='HOT GAMES' width=100 height=100 border=0></a>";
  rstart = rstart + 1;
}
if( rindex < 29 )
   rindex = rindex + Math.floor((Math.random() * 2) + 1);
else
   rindex = rindex + 1;
document.write(mylink);
}
function getrandmiddlebutton( size ) {
var mylink;
index = Math.floor(Math.random() * 5);
if( size == 1 )
    mylink = "<a target='_blank' href = 'http://www.arcadew.com/outlink100x100.php'><img src='http://www.arcadew.com/buttons/70x70/butmiddle" + index + ".png' alt='HOT GAMES' width=70 height=70 border=0></a>";
else
    mylink = "<a target='_blank' href = 'http://www.arcadew.com/outlink100x100.php'><img src='http://www.arcadew.com/buttons/butmiddle" + index + ".png' alt='HOT GAMES' width=100 height=100 border=0></a>";
document.write(mylink);
}


