<!--

    function checkandsave () 
    {
    var ShortForm = 1;
    if (typeof Abbreviated=="undefined") {ShortForm = 0;}

    if (ShortForm != 1)
    {
    MySkillLevel = "None Chosen";
    if (document.Realform.SkillLevel[0].checked) {MySkillLevel = "Beginner";}
    if (document.Realform.SkillLevel[1].checked) {MySkillLevel = "Intermediate";}
    if (document.Realform.SkillLevel[2].checked) {MySkillLevel = "Advanced";}
    if (document.Realform.SkillLevel[3].checked) {MySkillLevel = "Ultra Advanced";}
    }
    else
    {MySkillLevel = MySkillLevelTemp;}

   
    // skill level is required;
    if (MySkillLevel == "None Chosen") 
      {
       alert("Please choose your PPC skill level so we can custom tailor the training to your particular needs");

       document.Realform.SkillLevel[0].focus();
       return false;
      }

    if (document.Realform.from.value == "") 
      {alert("Please enter your EMAIL before continuing");
       document.Realform.from.focus();
       return false;
      }
   
         
    // set up ONE variable to store all values in aweber tracking field so we can pass back via the query string to websites AND set defaults;
    TrackMe = "";


       // new vs. existing markets;
       NextI = "n"; // default for new vs existing is new market; 
     if (ShortForm != 1)
     {
       if (document.Realform.NewVsExistingMarket2[0].checked==true) {NextI = "n";}
       if (document.Realform.NewVsExistingMarket2[1].checked==true) {NextI = "e";}
     }
     else
     {
     NextI = NewOrExisting;
     }
     if (NextI == "n") {document.Realform['custom NewVsExistingMarket'].value="enter a new market successfully"; }
     if (NextI == "e") {document.Realform['custom NewVsExistingMarket'].value="make an existing business more profitable";}

       TrackMe = TrackMe + NextI;

       // already profitable?;
       NextI = "n"; // default for profitability is NO; 
       if (document.Realform.Profitable2.checked==true) {NextI = "y";}
       if (NextI == "n") {document.Realform['custom Profitable'].value="losing money or just starting out";}
       if (NextI == "y") {document.Realform['custom Profitable'].value="already profitable";}
       TrackMe = TrackMe + NextI;


       // b2b?;
        NextI = "n"; // default for B2B is NO; 
       if (document.Realform.B2BvsB2C2.checked==true) {NextI = "y";}
       if (NextI == "n") {document.Realform['custom B2BvsB2C'].value="consumers";}
       if (NextI == "y") {document.Realform['custom B2BvsB2C'].value="other businesses";}
       TrackMe = TrackMe + NextI;



       // brutally competitive market?;
        NextI = "n"; // default for brutally competitive market is NO; 
       if (document.Realform.HowCompetitive2.checked==true) {NextI = "y";}
       if (NextI == "n") {document.Realform['custom HowCompetitive'].value="less competitive markets";}
       if (NextI == "y") {document.Realform['custom HowCompetitive'].value="brutally competitive markets";}


       TrackMe = TrackMe + NextI;


       // own and control vs. affiliate marketing;
        NextI = "o"; // default is own and control; 

       if (ShortForm != 1)
       {
       if (document.Realform.OwnControlVsAffiliate2[0].checked==true) {NextI = "a";}
       if (document.Realform.OwnControlVsAffiliate2[1].checked==true) {NextI = "o";}
       }
       else
       {
       NextI = AffiliateOrOwner;
       }
       if (NextI == "o") {document.Realform['custom OwnControlVsAffiliate'].value="products you own and control yourself";}
       if (NextI == "a") {document.Realform['custom OwnControlVsAffiliate'].value="other people's products";}
       TrackMe = TrackMe + NextI;
  
       

       // ppc skill level;
       NextI = "b"; // default is beginner; 
       if (ShortForm != 1)
       {
       if (document.Realform.SkillLevel[0].checked) {NextI = "b";}
       if (document.Realform.SkillLevel[1].checked) {NextI = "i";}
       if (document.Realform.SkillLevel[2].checked) {NextI = "a";}
       if (document.Realform.SkillLevel[3].checked) {NextI = "u";}
       }
       else
       {
       if (MySkillLevel == "Beginner")       {NextI = "b";}
       if (MySkillLevel == "Intermediate")   {NextI = "i";}
       if (MySkillLevel == "Advanced")       {NextI = "a";}
       if (MySkillLevel == "Ultra Advanced") {NextI = "u";}
       }

       TrackMe = TrackMe + NextI;


       // programming skill;
       NextI = "n"; // default for programming skill is NONE; 
       if (ShortForm != 1)
       {
       if (document.Realform.ProgrammingSkill2[0].checked==true) {NextI = "n";}
       if (document.Realform.ProgrammingSkill2[1].checked==true) {NextI = "b";}
       if (document.Realform.ProgrammingSkill2[2].checked==true) {NextI = "i";}
       if (document.Realform.ProgrammingSkill2[3].checked==true) {NextI = "p";}
       }
       else
       {
       if (document.Realform.GoodHTML.checked==true) {NextI = "i";}
       }
       if (NextI=="n"){document.Realform['custom ProgrammingSkill'].value="absolutely NO";}
       if (NextI=="b"){document.Realform['custom ProgrammingSkill'].value="only basic";}
       if (NextI=="i"){document.Realform['custom ProgrammingSkill'].value="pretty good";}
       if (NextI=="b"){document.Realform['custom ProgrammingSkill'].value="professional level";}
       TrackMe = TrackMe + NextI;

       if (document.Realform['custom ProgrammingSkill'].value=="" || document.Realform['custom ProgrammingSkill'].value==" ")
       {
           document.Realform['custom ProgrammingSkill'].value=="absolutely NO";
       }
       
       // HowDifficult ;
        NextI = "n"; // default for HowDifficult is not at all; 
       if (document.Realform.HowDifficult2[0].checked==true) {NextI = "n";}
       if (document.Realform.HowDifficult2[1].checked==true) {NextI = "s";}
       if (document.Realform.HowDifficult2[2].checked==true) {NextI = "v";}
       if (NextI =="n"){document.Realform['custom HowDifficult'].value="not at all difficult";}
       if (NextI =="s"){document.Realform['custom HowDifficult'].value="only somewhat difficult";}
       if (NextI =="v"){document.Realform['custom HowDifficult'].value="very difficult";}
       TrackMe = TrackMe + NextI;

       // Products Owned Already;


       // definitive guide?;
        NextI = "n"; // default for definitive guide is NO; 
       if (document.Realform.DefinitiveGuideOwn.checked==true) {NextI = "y";}
       TrackMe = TrackMe + NextI;

       // how to choose your market?;
        NextI = "n"; // default for choose your market is NO; 
       if (document.Realform.HowToChooseYourMarketOwn.checked==true) {NextI = "y";}
       TrackMe = TrackMe + NextI;

       // adwords checkmate?;
        NextI = "n"; // default for checkmate is NO; 
       if (document.Realform.AdwordsCheckmate.checked==true) {NextI = "y";}
       TrackMe = TrackMe + NextI;

       // adwords phone group?;
        NextI = "n"; // default for phone group is NO; 
       if (document.Realform.AdwordsPhoneGroup.checked==true) {NextI = "y";}
       TrackMe = TrackMe + NextI;

       // affiliate elite?;
        NextI = "n"; // default for checkmate is NO; 
       if (document.Realform.AffiliateElite.checked==true) {NextI = "y";}
       TrackMe = TrackMe + NextI;



       // COUNTRY;
        NextI = "9"; // default for country is Elsewhere; 
       if (document.Realform['custom Country'].value=="United States") {NextI = "1";}
       if (document.Realform['custom Country'].value=="Canada") {NextI = "2";}
       if (document.Realform['custom Country'].value=="United Kingdom") {NextI = "3";}
       if (document.Realform['custom Country'].value=="Australia") {NextI = "4";}
       if (document.Realform['custom Country'].value=="India") {NextI = "5";}
       if (document.Realform['custom Country'].value=="China") {NextI = "6";}
       if (document.Realform['custom Country'].value=="Western Europe") {NextI = "7";}
       if (document.Realform['custom Country'].value=="Singapore") {NextI = "8";}
       TrackMe = TrackMe + NextI;


       // Network Marketing?;
        NextI = "n"; // default for networkmarketing is NO; 
       if (document.Realform.NetworkMarketing.checked==true) {NextI = "y";}
       TrackMe = TrackMe + NextI;

       // Business Opportunities?;
        NextI = "n"; // default for networkmarketing is NO; 
       if (document.Realform.BizOpp.checked==true) {NextI = "y";}
       TrackMe = TrackMe + NextI;



       // NOW ADD UNIQUE IDENTIFIER IN CASE WE READ ERRONEOUS QUERY STRINGS;
       TrackMe = TrackMe + "xmx";

      
       document.Realform.meta_adtracking.value=TrackMe;
       
       
   // assign browser read variables to their custom aweber fields;
      document.Realform['custom NumberItemsInHistoryCache'].value = historyK;
      document.Realform['custom ReferringURL'].value = referK;
      document.Realform['custom TimeZoneOffsetInMinutes'].value = TimeZoneOffsetK;
      document.Realform['custom DayOfWeek'].value = DayOfWeekK;
      document.Realform['custom LanguageOfBrowser'].value = userlangK;


   // now switch opt in lists depending upon value of skill level choice;

    if (MySkillLevel == "Beginner") {document.Realform.unit.value="adwords-begin";}
    if (MySkillLevel == "Intermediate") {document.Realform.unit.value="adwords-int";}
    if (MySkillLevel == "Advanced") {document.Realform.unit.value="adwords-adv";}
    if (MySkillLevel == "Ultra Advanced") {document.Realform.unit.value="adwords-ult-adv";}

   
   // ----------------- Convert Keyword Theme To Lower Case ------------;
    TheKeywordTheme = document.Realform['custom KeywordTheme'].value;
    TheKeywordTheme = TheKeywordTheme.toLowerCase(); 
    document.Realform['custom KeywordTheme'].value = TheKeywordTheme;

   // ----------------- Choose Delivery Page Here ---------------------- ;


    // default delivery page in case no other conditions are met;
    DeliveryPageTemp = "1033.htm";

    // over-ride with any default delivery page value from the opt in form itself;
    if (document.Realform.redirect.value) {DeliveryPageTemp = document.Realform.redirect.value;}

    // set default delivery pages based upon skill level assuming UNKNOWN keyword theme; 
    if (MySkillLevel == "Beginner") {DeliveryPageTemp = "1033.htm";}
    if (MySkillLevel == "Intermediate") {DeliveryPageTemp = "1001.htm";}
    if (MySkillLevel == "Advanced") {DeliveryPageTemp = "1041.htm";}
    if (MySkillLevel == "Ultra Advanced") {DeliveryPageTemp = "1030.htm";}

    // get name of the file and put in variable;
    var file_name2 = document.location.href; 
    var end = (file_name2.indexOf("?") == -1) ? file_name2.length : file_name2.indexOf("?"); 
    NameOfThisFile2 = file_name2.substring(file_name2.lastIndexOf("/")+1, end);


                       // DELIVERY PAGE OVER-RIDES;
    // Now see if we want to over-ride the default delivery page based on combo of keyword + skill level;
    // for an english explanation of these over-rides, wee WebPageListing.xls - deliver page overrides sheet;


    if (TheKeywordTheme == "affiliate" && MySkillLevel == "Beginner") {DeliveryPageTemp = "1047.htm";}   
    if (TheKeywordTheme == "perry marshall") {DeliveryPageTemp = "1046.htm";}   
    if (TheKeywordTheme == "super affiliate" && MySkillLevel == "Beginner") {DeliveryPageTemp = "1047.htm";}   
    if (TheKeywordTheme == "adwords login") {DeliveryPageTemp = "1048.htm";}



    // here's commented out code to over-ride based upon file name if necessary;
    // if (NameOfThisFile2 == "OptIn.htm") 
    //  {
    //    if (MySkillLevel == "Beginner") {DeliveryPageTemp = "1033.htm";}
    //    if (MySkillLevel == "Intermediate") {DeliveryPageTemp = "1001.htm";}
    //    if (MySkillLevel == "Advanced") {DeliveryPageTemp = "1041.htm";}
    //    if (MySkillLevel == "Ultra Advanced") {DeliveryPageTemp = "1041.htm";}
    //   }



    DeliveryPageTemp = "http://www.ppcx7.com/" + DeliveryPageTemp;
    document.Realform.redirect.value = DeliveryPageTemp;
    document.Realform.meta_redirect_onlist.value = DeliveryPageTemp;
    document.Realform['custom FirstDeliveryPageURL'].value = DeliveryPageTemp;
    

  // ----------------- End Delivery Page Choice  ---------------------- ;



   //   We need to use 'custom reason10' to store the traffic because we ran out of fields in aweber;
   //   note that we COULD be overwriting the last 80 characters of text entered by the user for those with long answers!;

      document.Realform['custom reason10'].value = document.Realform.MyTrafficSource.value;
     

    // set cookies;
   	setCk('ckName', document.Realform.name.value);
	setCk('ckEmail', document.Realform.from.value);
	setCk('ckKeywordTheme', document.Realform['custom KeywordTheme'].value);

      // the content navigation bar script checks for this cookie to print special message;
         setCk('ckJustOptedIn', "1");  

    reason1 = document.Realform['custom reason1'].value;
    reason2 = document.Realform['custom reason2'].value;
    reason3 = document.Realform['custom reason3'].value;
    reason4 = document.Realform['custom reason4'].value;
    reason5 = document.Realform['custom reason5'].value;
    reason6 = document.Realform['custom reason6'].value;
    reason7 = document.Realform['custom reason7'].value;
    reason8 = document.Realform['custom reason8'].value;
    reason9 = document.Realform['custom reason9'].value;
    
    myBigField = reason1 + " " + reason2 + " " + reason3 + " " + reason4 + " " + reason5 + " " + reason6 + " " + reason7 + " " + reason8 + " " + reason9;
    setCk('ckBigText', myBigField);
	setCk('ckEmail', document.Realform.from.value);
    setCk('ckTrackMe', TrackMe);	

    // append Tracking value to the delivery query string so it gets passed to FIRST delivery page;
    // (for some reason the delivery page is NOT reading the cookies on the first load only;
   document.Realform.redirect.value = document.Realform.redirect.value + "?q=" + TrackMe;
   document.Realform.meta_redirect_onlist.value = document.Realform.meta_redirect_onlist.value + "?q=" + TrackMe;

    return true;	

	
    }
//-->