function valid()
{ 
  var dotests=true
  if (qrsidel.indexOf("certflaw")>-1)
  {  dotests=false
     qsplit=qrside.split("&")
     var cname=qsplit[1]
     var cphone=qsplit[2]
     var cemail=qsplit[3]
     var ccty=qsplit[4]
     var cbudget=qsplit[5]
     var ccert=qsplit[6]
     var ccarat=qsplit[7]
     var cclarity=qsplit[8]
     var ccolor=qsplit[9]
     var ccut=qsplit[10]
     document.topform.myname.value=cname
     document.topform.myphone.value=cphone
     document.topform.myemail.value=cemail
     document.topform.mycountry.value=ccty
     document.topform.myinterest.value="CERTFLAW"
     var longdet="My budget is "+cbudget+"\n"
     longdet=longdet+"Min cert is "+ccert+"\n"
     longdet=longdet+"Min carat is "+ccarat+"\n"
     longdet=longdet+"Min clarity is "+cclarity+"\n"
     longdet=longdet+"Min color is "+ccolor+"\n"
     longdet=longdet+"Min cut is "+ccut+"\n"
     document.topform.mydetails.value="CERTFLAW - "+longdet
     document.topform.mytext.value=document.topform.mydetails.value
     var agreed=true

     document.topform.mycell.value=""
     document.topform.myfax.value=""
     document.topform.mystreet.value=""
     document.topform.mycity.value=""
     document.topform.mystate.value=""
     document.topform.myprov.value=""
     document.topform.myzip.value=""
     var av=document.topform.autoveri.value
     document.topform.vericode.value=av

  }



  if (dotests)
  {  var test1=document.topform.myname.value
     var test2=document.topform.myemail.value
     var test3=document.topform.myphone.value
     var test4=document.topform.mycell.value
     var test5=document.topform.myfax.value
     var test6=document.topform.mystreet.value
     var test7=document.topform.mycity.value
     var test8=document.topform.mystate.value
     var test9=document.topform.myprov.value
     var test10=document.topform.myzip.value
     var test11=document.topform.mycountry.value
     var test12=document.topform.myinterest.value
     var test13=document.topform.mytext.value
     var test14=document.topform.mydetails.value
     var test15=document.topform.autoveri.value
     var test16=document.topform.vericode.value
     if (test1.length<3)
     {  alert("Enter a valid first and last name")
        document.topform.myname.focus()
        return
     }
     if (!ckemail(test2))
     {  alert("Enter a valid email address")
        document.topform.myemail.focus()
        return
     }
     var fixafone=test3
     if (fixafone.length<10)
     {  var fixafone=test4
     }
     var retest=fixfone(fixafone)
     test3=retest
     
   
     if (test3.length<10)
     {  alert("Enter a valid phone number\n\nNormally 10 digits - no other characters")
        document.topform.myphone.focus()
        return
     }
     document.topform.myphone.value=test3
   
     if (test8 !="0" && test8!="Female" && test8!="Male")
     {  document.topform.mycountry.value="U.S.A."
        test11="U.S.A."
        if (test10.length!=5)
        {  alert("Enter a valid zipcode or postal code\n\nNormally 5 digits")
           document.topform.myzip.focus()
           return
        }    
     }  else
     {  if (test9=="")     
        {  alert("Enter a valid state or province")
           document.topform.mystate.focus()
           return
        }    
     }
   
     if (test11 == "0")
     {  alert("Select your country")
        document.topform.mycountry.focus()
        return
     }
   
     if (test12 =="0" && myref.indexOf("usedgear")<0)
     {  alert("Select a primary interest")
        document.topform.myinterest.focus()
        return
     }
     
     if (test13.length<5)
     {  if (qrsidel!="usedgear")
        {  alert("Please tell us details about your interests")
        }  else
        {  alert("Please describe any terms (payment, expiration of offer etc.)")
        }
        document.topform.mytext.focus()
        return
     }
     var temp=test13.toLowerCase()
     if (test12.indexOf("Employment")>-1 && temp.indexOf("www")<0 && myref.indexOf("usedgear")<0)
     {  alert("To apply for Employment\n\n1. Post your resume on the web\n2. Include the www URL webpage address in your comments\ni.e. www.geocities.com/joeparker/resume.html\n3. Resumes must be in TEXT (notepad) or MS-WORD format.\n\nPlease correct your comments and include the www website URL of your resume")
        document.topform.mytext.focus()
        return
     }
   
     if (temp.length>998)
     {  alert("Your Comments exceed the maximum length of 1000 characters.\n\nPlease correct this and shorten it.")
        var t=temp.substr(0,998)
        document.topform.mytext.value=t
        document.topform.mytext.focus()
        return
     }
     var agreed=document.topform.agree.checked
     if (qrsidel=="typhoon" || (qrsidel=="cnmi" && myref.indexOf("eduhosting")<0))
     {  diddetails=true
        test14="TAWP "+test14
     }
     if (qrsidel=="usedgear")
     {  diddetails=true
        test14="GPPINV: "+test14
     }
     if (qrsidel=="lawyerstd")
     {  diddetails=true
        test14="LAWYERSTD: "+test14
     }
   
     if (qrsidel=="nwgande")
     {  diddetails=true
        test14="NWGandE: "+test14
     }
     if (qrsidel=="earnamil")
     {  diddetails=true
        test14="GPJOB: "+test14
     }
     if (qrsidel=="gpppf")
     {  diddetails=true
        test14="GPPPF: "+test14
        dosent=true
     }
     if (qrsidel=="gpput")
     {  diddetails=true
        test14="GPPUT: "+test14
        dosent=true
     }
     if (qrsidel=="fpfs" || qrsidel=="gppfp")
     {  diddetails=true
        test14="GPPFP: "+test14
        dosent=true
     }
     if (qrsidel=="sppfc")
     {  diddetails=true
        test14="GPPSP: "+test14
     }
     if (qrsidel=="btuworld" || qrsidel=="gppbl")
     {  diddetails=true
        test14="BTUWorld: "+test14
     }  else
     {  if (qrsidel.indexOf("btu")>-1)
        {  diddetails=true
           test14="BTUBank: "+test14
        }
     }
   
     if (qrsidel=="gpped")
     {  diddetails=true
        test14="GPPEM: "+test14
        dosent=true
     }
     if (qrsidel=="gppfi")
     {  diddetails=true
        test14="GPPINV: "+test14
        dosent=true
     }
     if (qrsidel=="rentamil")
     {  diddetails=true
        test14="GPNYRENT: "+test14
     }
     if (qrsidel=="ssabout")
     {  diddetails=true
        test14="SHELTER: "+test14
     }
   
     if (qrsidel=="rtpost")
     {  diddetails=true
        test14="RUSSIAN TECH POST: "+test14
     }
   

     if (qrsidel=="rtap")
     {  diddetails=true
        test14="RUSSIAN TECH APPLY: "+test14
     }
   
     if (qrsidel=="lawyer")
     {  diddetails=true
        test14="GPPLawyer: "+test14
        dosent=true
     }
   
     if (qrsidel=="mtn")
     {  diddetails=true
        test14="GPPMTN: "+test14
        dosent=true
     }
   
     if (qrsidel.indexOf("hoffman")>-1)
     {  diddetails=true
        test14="HOFFMANCLEANTECH: "+qrsidel
     }
   
     if (qrsidel.indexOf("kwhx")>-1)
     {  diddetails=true
        test14="KWHX: "+qrsidel
     }
   
     if (qrsidel.indexOf("gwt")>-1)
     {  diddetails=true
        test14=test12
     }
   
     if (qrside=="career")
     {  diddetails=true
        test14="GPPcareer: "+test14
     }
   
     if (qrside=="gppgo")
     {  diddetails=true
        test14="GPPGoogle: "+test14
     }
   
     if (!agreed)
     {  alert("Please review the PRIVACY POLICY and click AGREE if you agree to the terms.")
        document.topform.agree.focus()
        return
     }

     if (test15!=test16)
     {  alert("Verification codes do not match")
        document.topform.vericode.focus()
        return
     }
   
     if (test12.indexOf("Education")>-1 && diddetails==false)
     {  document.topform.mydetails.focus()
        return
     }
     if (test12.indexOf("Investing")>-1 && diddetails==false)
     {  document.topform.mydetails.focus()
        return
     }
     if (test12.indexOf("Celebrity")>-1 && diddetails==false)
     {  document.topform.mydetails.focus()
        return
     }
     if (test12.indexOf("WindGenZen")>-1 && diddetails==false)
     {  document.topform.mydetails.focus()
        return
     }
     if ((test12.indexOf("Scout")>-1 || test12.indexOf("Team")>-1 || test12.indexOf("Broker")>-1) && diddetails==false)
     {  document.topform.mydetails.focus()
        return
     }
     if (test12.indexOf("RegRep")>-1 || test12.indexOf("NewRep")>-1)
     {  document.topform.myfirm.value=""
        if (diddetails==false)
        {  document.topform.mydetails.focus()
           return
        }
     }
     if ((test12.indexOf("Giga")>-1 || test12.indexOf("Mega")>-1 || test12.indexOf("Kilo")>-1 || test12.indexOf("Solar")>-1 || test12.indexOf("Geo")>-1 || test12.indexOf("Hydro")>-1 || test12.indexOf("Ocean")>-1) && diddetails==false)
     {  document.topform.mydetails.focus()
        return
     }
     var retest=fixtext(test12)
     test12=retest
     document.topform.myinterest.value=test12
   
     var retest=fixtext(test13)
     test13=retest
     document.topform.mytext.value=test13
     
     var retest=fixtext(test14)
     test14=retest
     document.topform.mydetails.value=test14
   
     if (qrsidel=="gold")
     {  document.detailpic.src="http://goldpactpower.com/pics/wgzcoup.jpg"
        alert("Please cvmplete your registration with our affiliate to receive your free gram of Swiss Gold Bullion.\n\nNote: after registering, funding your account and making your first purchase of Gold Bullion, you may be eligible to receive a coupon for a either a free Gorgeous Mohogany Wind Generator Blade or a discount from our affiliate at WindGenZen.com.\n\nThese are known as the most Beautiful Airfoils on Earth, as shown in the image.")
        window.open("http://www.bullionvault.com/from/GOLDPACT")
     }
   
     if (dosent)
     {  window.open("http://goldpactpower.com/sent.html")
     }

  }
  if (qrsidel=="cd")
  {  window.open("freewgcd.html?reg")
  }
  if (qrsidel=="invest")
  {  var ok=confirm("Are you an accredited investor or investment firm with:\n\n1. At least one million in assets, and\n\n2. $200,000 or more in revenue in the past two years?\n\nClick OK if this is true\n\nClick CANCEL if not")
     if (ok)
     {  window.open("bbb.html")
        window.open("bbbnew.html")
     }
  }
  document.topform.submit()
}