
document.write('<input type="hidden" name="ie5" value="false">');
document.write('<input type="hidden" name="ie4" value="false">');
document.write('<input type="hidden" name="notIE" value="true">');

var isNav4=false,isIE4=false,isIE5=false;
if (parseInt(navigator.appVersion.charAt(0)) >= 4){
  isNav4 = (navigator.appName == "Netscape") ? true : false;
  if(navigator.appName.indexOf("Microsoft")!=-1){
     isIE4=true;
     document.trialform.notIE.value="false";
     if(navigator.appVersion.indexOf("5.")!=-1)isIE5=true;
     if(navigator.appVersion.indexOf("6.")!=-1)isIE5=true;
     }
  else{
     isIE4=false;isIE5=false;
     }
  if(navigator.platform.indexOf("Win")!=-1){
     if(isIE4)
        document.trialform.ie4.value="true";
     if(isIE5)
        document.trialform.ie5.value="true";
     }
  else{
     document.trialform.notIE.value="true";
     }

}
document.cookie="hack=1";
if(document.cookie.indexOf("hack")<0)
   alert("You do not have cookies enabled. You must have cookies enabled to login or create sites. \n\nCookies are not used to collect personal information or to track your movements on the site.");
if(isNav4==false && isIE4==false)
   alert("To use the  editing environment, you need at least Netscape 4.X or greater, or Microsoft Internet Explorer 4.X or greater");

var sitenameerr=false;

var vala="a".charCodeAt(0);
var valz="z".charCodeAt(0);
var val0="0".charCodeAt(0);
var val9="9".charCodeAt(0);
function checksitename()
{
var stest=true;
var sn=document.trialform.SITENAME.value;
sn=sn.toLowerCase();
for(x=0;x<sn.length;x++)
   {
   var c=sn.charCodeAt(x);
   if(!(c>=vala && c<=valz) && !(c>=val0 && c<=val9))
      {
      document.getElementById("errsitename").style.display="block";
      sitenameerr=true;
      stest=false;
      break;
      }
   }
if(stest==true && sitenameerr==true)
   {
   sitenameerr=false;
   document.getElementById("errsitename").style.display="none";
   }
}
function dosubmit()
{

   checksitename();
   if(sitenameerr==true)
      {
      alert("Signup error: Check your account name.  The account name can only contain numbers and letters");
      return;
      }

   //check password match
   p0=document.trialform.password.value;
   p1=document.trialform.passwordconfirm.value;
   if(p0!=p1)
      {
      alert("Signup error: Check your passwords.  Your password and password confirmation do not match.");
      document.getElementById("errpassword").style.display="block";
      return;
      }

   var t=document.trialform.EMAIL_ADDR.value;
   if(t.length==0)
      {
      alert("Signup error: To create your trial account you need to enter your email address.");
      return;
      }

   if(signuptype!="short")
      {
      t=document.trialform.FIRSTNAME.value;
      if(t.length==0)
         {
         alert("Signup error: To create your trial account you need to enter your first name.");
         return;
         }

      t=document.trialform.LASTNAME.value;
      if(t.length==0)
         {
         alert("Signup error: To create your trial account you need to enter your last name.");
         return;
         }

      //Add " " to all the fields
      var t=document.trialform.S_ADDRESS.value;
      if(t.length>0)
         document.trialform.ADDRESS1.value=t;

      t=document.trialform.S_PHONE.value;
      if(t.length>0)
         document.trialform.PHONE.value=t;

      t=document.trialform.S_CITY.value;
      if(t.length>0)
         document.trialform.CITY.value=t;

      t=document.trialform.S_STATE.value;
      if(t.length>0)
         document.trialform.STATE.value=t;

      t=document.trialform.S_ZIP.value;
      if(t.length>0)
         document.trialform.ZIP.value=t;

      t=document.trialform.S_SITETITLE.value;
      if(t.length>0)
         document.trialform.SITETITLE.value=t;
      else
         document.trialform.SITETITLE.value=document.trialform.SITENAME.value;
   }

   document.trialform.submit();return false;
}

function viewterms()
{
   window.open(siteurl+"inc/license","newwin","scrollbars=yes,resizable=yes,menubar=no,titlebar=no,status=no,toolbar=no,width=650,height=540");
}
function viewterms2()
{
   window.open(siteurl+"privacypolicy.html","newwin","scrollbars=yes,resizable=yes,menubar=no,titlebar=no,status=no,toolbar=no,width=650,height=540");
}

