//-----------------------------------
// Web Page Access Form Script v.1.0
// File name: form_en.js
// OWNER: pmato@excite.com
// AUTHOR: Miraculous Fotos Milagrosas
// Copyright: ©2000-2004 Miraculous Fotos Milagrosas
// Permission given to use this script on your page.  
// A link to our Homepage would be appreciated in return.
// http://miraculousphotos.com/
// $Revision: 1 $
// $Date: 03/06/2004 01:02p $
// Free for all users, but leave in this header.
//---------------------------------------------------

//alert('js');

function fillForm()
{ 
var minor = "";
var fullname = "";
var pswNumber = "";
var pswNumber2 = "";
cookieCreater2 ();
testCookie();

                        if ( (fullname == "" || fullname == null) && ( GetCookie('BibleForm_parent_en') != "waitAproval" ))   {
                        fullname = prompt("Please enter your FULL NAME. You can only enter [ letters, spaces, accents ], like [ John Smäth ]. No numbers or special characters, enter FULL NAME now:", "");
                        while (fullname == "" || fullname == null ) { fullname = prompt("You forgot to enter your FULL NAME, No numbers allowed. Please enter [ letters, spaces, accents ] ONLY. Enter your FULL NAME, like [John Smäth] now:",fullname); }
                        while ((fullname.indexOf("0") > -1 || fullname.indexOf("1") > -1 || fullname.indexOf("2") > -1 || fullname.indexOf("3") > -1 || fullname.indexOf("4") > -1 || fullname.indexOf("5") > -1 || fullname.indexOf("6") > -1 || fullname.indexOf("7") > -1 || fullname.indexOf("8") > -1 || fullname.indexOf("9") > -1 || fullname.indexOf("!") > -1 || fullname.indexOf("¡") > -1 || fullname.indexOf("¿") > -1 || fullname.indexOf("?") > -1 || fullname.indexOf("/") > -1 || fullname.indexOf("+") > -1 || fullname.indexOf("|") > -1 || fullname.indexOf("@") > -1 || fullname.indexOf("#") > -1 || fullname.indexOf("$") > -1 || fullname.indexOf("%") > -1 || fullname.indexOf("^") > -1 || fullname.indexOf("&") > -1 || fullname.indexOf("*") > -1 || fullname.indexOf("-") > -1 || fullname.indexOf("_") > -1 || fullname.indexOf("\"") > -1 || fullname.indexOf("'") > -1 || fullname.indexOf("\\") > -1 || fullname.indexOf(".") > -1 || fullname.indexOf(",") > -1 || fullname.indexOf("<") > -1 || fullname.indexOf(">") > -1 || fullname.indexOf("(") > -1 || fullname.indexOf(")") > -1 || fullname.indexOf("[") > -1 || fullname.indexOf("]") > -1 || fullname.indexOf("{") > -1 || fullname.indexOf("}") > -1 || fullname.indexOf(";") > -1 || fullname.indexOf(":") > -1 || fullname.indexOf("=") > -1 || fullname.indexOf("~") > -1 || fullname.indexOf("`") > -1) && (fullname != "" && fullname != null)) {
                        fullname = prompt("All accents allowed [ àáäãâå ÀÃÁ Æ§¥ß Þçøµðæ ]. Characters not allowed are [ !¡¿?/+|[@#$%^&*-_\"\(\'\)\\.=,\{\}~\:]\;>`< ]. Please re-enter your FULL NAME, now:",fullname); }
                        var chk = "";
                        if (fullname.length > 3 && fullname != "" && fullname != null) { chk = prompt("You entered [  " + fullname + "  ] as your FULL NAME, if name is correct enter [yes or no] to correct:","no");
                          if ( chk == "yes" || chk == "Yes" || chk == "YES" || chk == "y" || chk == "Y") { cookieCreater (); alert("Your FULL NAME has been recorded as\n\n      [  " + fullname + "  ]."); }
                          if ( chk == "no" || chk == "No" || chk == "NO" || chk == "n" || chk == "N") { fullname = prompt("You entered [  " + fullname + "  ]. If Your FULL NAME is incorrect, re-enter your FULL NAME, now:",fullname);
                          cookieCreater (); 
                          alert ("Your FULL NAME has been recorded as\n\n      [ " + fullname + " ]."); 
                          }
                        }
                        }

                        if (pswNumber == "" || pswNumber == null)  
                        {
                        pswNumber = prompt("Please choose a combination of [10 or more letters or numbers] or both, for your secret PASSWORD Code to access web page, enter your PASSWORD now:", ""); 
                           while ( pswNumber.length < 10 ) 
                           { 
                           pswNumber = prompt("[ " + pswNumber + " ] password is too short, Minimum 10 digits. Choose a combination of [10 letters or numbers] or both, enter now;",pswNumber); 
                           }
                           var chk = "";
                           if (pswNumber.length >= 10 && pswNumber != "" && pswNumber != null) 
                           { 
                           chk = prompt("You entered [  " + pswNumber + "  ] as your secret PASSWORD Code, if Code is correct enter [yes or no] to correct:","yes");
                             if ( chk == "yes" || chk == "Yes" || chk == "YES" || chk == "y" || chk == "Y") 
                             { 
                             cookieCreater1 (); 
                             alert("Your secret PASSWORD Code has been recorded as\n\n      [  " + pswNumber + "  ]\n\nwrite it down and don\'t share it with anyone else."); 
                             }
                                if ( chk == "no" || chk == "No" || chk == "NO" || chk == "n" || chk == "N") 
                                { 
                                pswNumber = prompt("You entered [  " + pswNumber + "  ]. If Your secret PASSWORD Code is incorrect, re-enter PASSWORD Code, write it down so as not to forget it:",pswNumber);
                                cookieCreater1 (); 
                                alert ("Your secret PASSWORD Code has been recorded as\n\n      [ " + pswNumber + " ],\n\nwrite it down and don\'t share it with anyone else."); 
                                }
                           }
                        }
                        if (GetCookie ('BibleForm_psw_en') == "" || GetCookie ('BibleForm_psw_en') == null) 
                        {
                        cookieCreater1 (); 
                           if (GetCookie ('BibleForm_psw_en') == "" || GetCookie ('BibleForm_psw_en') == null) 
                           {
                           window.location.replace("bibleform_en.htm#Begin");
                           }
                        }
                        var retry = parseInt(1);
                        var sucess = "1";
                        if ( sucess == "1") 
                        {
                        pswNumber2 = prompt("Please re-enter your PASSWORD to confirm, remmember this is your secret PASSWORD, don\'t share it with anyone else, re-enter PASSWORD:", ""); 
                           if (pswNumber == pswNumber2) 
                           {
                           cookieCreater5 ();
                           alert("Sucess " + fullname + ", you entered the correct PASSWORD and it\'s a match. Write it down someplace so as not to forget it.\n\n          [  " + pswNumber + "  ]");
                           sucess = "0";
                           } 
                           if (pswNumber != pswNumber2) 
                           { 
                           pswNumber = prompt("Wrong " + fullname + ", your PASSWORD doesn\'t match, please enter again your PASSWORD and write it down next time, re-enter PASSWORD:",pswNumber); 
                           retry = retry+1;          
                           sucess = "1";
                              if (retry >= parseInt(4)) 
                              {
                              window.location.replace("bibleform_en.htm#Begin");
                              }
                                 if (GetCookie ('BibleForm_psw_en') == "" || GetCookie ('BibleForm_psw_en') == null) 
                                 {
                                 window.location.replace("bibleform_en.htm#Begin");
                                 }
                           }

                        }

                        while (minor == "" || minor == null)  {
                        if (GetCookie ('BibleForm_minor_en') == "yes") { window.location.replace("parentform_en.htm#Begin"); }
                        if (GetCookie ('BibleForm_minor_en') == "no" || GetCookie ('BibleForm_minor_en') == "" || GetCookie ('BibleForm_minor_en') == null ) 
                        {
                        var chk = "";
                        chk = prompt("Are you 18 years of age and older? Please answer [yes or no] to being 18 years of age and older:", "yes");
                        if ( chk == "no" || chk == "No" || chk == "NO" || chk == "n" || chk == "N" ) { 
                        var minor = "yes";
                        window.location.replace("parentform_en.htm#Begin"); 
                        cookieCreater4 ();

                        }
                        if ( chk == "yes" || chk == "Yes" || chk == "YES" || chk == "y" || chk == "Y" ) { 
                        var minor = "no";
                        cookieCreater3 ();
                        }
                        }
                        }


function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name)  {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen)  {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break; 
}
return null;
}
function SetCookie (name, value)  {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}

function DeleteCookie () { 
var exp = new Date();
exp.setTime (exp.getTime() - 1000000000);  // This cookie is history
var cval = GetCookie ('BibleForm_name_en');
document.cookie ='BibleForm_name_en' + "=" + cval + "; expires=" + exp.toGMTString();    
}

function cookieCreater () {
if(GetCookie('BibleForm_name_en') == null) {
var BForm_name_en = fullname;
if (BForm_name_en != null && BForm_name_en != "") {
var expdate = new Date (); 
expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365)); 
SetCookie('BibleForm_name_en', BForm_name_en, expdate);

   }
}
else {
DeleteCookie ()
cookieCreater ()
}
}
function DeleteCookie1 () { 
var exp = new Date();
exp.setTime (exp.getTime() - 1000000000);  // This cookie is history
var cval = GetCookie ('BibleForm_psw_en');
document.cookie ='BibleForm_psw_en' + "=" + cval + "; expires=" + exp.toGMTString();    
}
function cookieCreater1 () {
if(GetCookie('BibleForm_psw_en') == null) {
var BForm_psw_en =  pswNumber;
if (BForm_psw_en != null && BForm_psw_en != "") {
var expdate = new Date (); 
expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365)); 
SetCookie('BibleForm_psw_en', BForm_psw_en, expdate);
   }
}
else {
DeleteCookie1 ()
cookieCreater1 ()
}
}
function DeleteCookie2 () { 
var exp = new Date();
exp.setTime (exp.getTime() - 1000000000);  // This cookie is history
var cval = GetCookie ('BibleForm_Dummy1_en');
document.cookie ='BibleForm_Dummy1_en' + "=" + cval + "; expires=" + exp.toGMTString();    
}
function cookieCreater2 () {
if(GetCookie('BibleForm_Dummy1_en') == null) {
var BForm_Dummy1_en =  "Dummy1";
if (BForm_Dummy1_en != null && BForm_Dummy1_en != "") {
var expdate = new Date (); 
expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365)); 
SetCookie('BibleForm_Dummy1_en', BForm_Dummy1_en, expdate);

   }
}
else {
DeleteCookie2 ()
cookieCreater2 ()
}
}

function DeleteCookie3 () { 
var exp = new Date();
exp.setTime (exp.getTime() - 1000000000);  // This cookie is history
var cval = GetCookie ('BibleForm_minor_en');
document.cookie ='BibleForm_minor_en' + "=" + cval + "; expires=" + exp.toGMTString();    
}
function cookieCreater3 () {
if(GetCookie('BibleForm_minor_en') == null) {
var BForm_minor_en =  "no";
if (BForm_minor_en != null && BForm_minor_en != "") {
var expdate = new Date (); 
expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365)); 
SetCookie('BibleForm_minor_en', BForm_minor_en, expdate);

   }
}
else {
DeleteCookie3 ()
cookieCreater3 ()
}
}

function DeleteCookie4 () { 
var exp = new Date();
exp.setTime (exp.getTime() - 1000000000);  // This cookie is history
var cval = GetCookie ('BibleForm_minor_en');
document.cookie ='BibleForm_minor_en' + "=" + cval + "; expires=" + exp.toGMTString();    
}
function cookieCreater4 () {
if(GetCookie('BibleForm_minor_en') == null) {
var BForm_minor_en =  "yes";
if (BForm_minor_en != null && BForm_minor_en != "") {
var expdate = new Date (); 
expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365)); 
SetCookie('BibleForm_minor_en', BForm_minor_en, expdate);

   }
}
else {
DeleteCookie4 ()
cookieCreater4 ()
}
}

function DeleteCookie5 () { 
var exp = new Date();
exp.setTime (exp.getTime() - 1000000000);  // This cookie is history
var cval = GetCookie ('BibleForm_once_en');
document.cookie ='BibleForm_once_en' + "=" + cval + "; expires=" + exp.toGMTString();    
}

function cookieCreater5 () {
if(GetCookie('BibleForm_once_en') == null) {
var once = parseInt(1);
var BForm_once_en = "once";
if (BForm_once_en != null && BForm_once_en != "") {
var expdate = new Date (); 
expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365)); 
SetCookie('BibleForm_once_en', BForm_once_en, expdate);

   }
}
else {
DeleteCookie5 ()
cookieCreater5 ()
}
}

function testCookie() {
if(GetCookie('BibleForm_Dummy1_en') == null) {
window.open("../utils/browserInfo_en.htm#Begin","","top=0,left=0,width=350,height=260,toolbar=1,directories=no,status=no,scrollbars=1,resize=no,menubar=1");
alert("Unable to create cookie on your system.\nCookies are used to store your answers to the questions we ask. This way you do not have to answer the questions again on the form, it's automatically entered when you mouse over the boxes.\n\nSo, to continue, please set your Browser to, Always Accept Cookies or Prompt Before Accepting Cookie.\n\nTo set Browser, click Tools, Internet Options, Advanced Tab, scroll down to Cookies, sel Always Accept Cookies or Prompt Before Accepting Cookie. Then test your cookie option with the popup window that just opened, press get your cookies checked. Then click OK, in this window, to continue.");
cookieCreater2 ()
}
}


}
