Select your Bible translation
New International Version
New American Standard Bible
King James Version
New Living Translation
Bible Study Tools Home
|
About Us
|
Help
|
Feedback
Simply copy and paste the code below into your blog, profile, or other web page:
Back to Bible Search
Fill out the information below and click send:
Personal message...
Back to Bible Search
Your email has been sent. Would you like to
send another
?
Be sure to check out our
Devotionals
!
Back to Bible Search
'; var imgRoot = 'http://media.salemwebnetwork.com/BibleStudyTools/Gadgets/ccom/'; // vars for sending Share It email (ajax) var shareItPostUrl = 'http://bible.christianity.com/gadgets/CcomShareIt.aspx'; // GLOBAL VARS var prefs; // user pref vars that we can store on google function init() { prefs = new _IG_Prefs(); // init this guy $('lnkBstHome').href = bstHomeLink; $('lnkAboutUs').href = aboutUsLink; $('lnkHelp').href = helpLink; $('lnkFeedback').href = feedbackLink; // (not needed) $('lnkPlusGoogle').href = plusGoogleLink; $('lnkDevotionals').href = devotionalsLink; $('txtEmbedCode').value = embedCode; // load default translation selectDefaultTranslation(prefs.getString('defaultTranslation')); } // setup() function clearShareIt() { _IG_Analytics("UA-796752-4", "/ccom/clearClick"); $('txtYourName').value = 'Your name'; $('txtYourEmail').value = 'Your e-mail address'; $('txtFriendsName').value = 'Friend\'s name'; $('txtFriendsEmail').value = 'Friend\'s e-mail address'; $('taPersonalMsg').value = 'Personal message...'; show($('lnkShareIt')); hide($('imgSending')); } function shareIt() { _IG_Analytics("UA-796752-4", "/ccom/sendItClick"); var shareItRequest, formData, action; var fromName, fromEmail, toName, toEmail, personalMsg; // get post variables from user-populated form fromName = $('txtYourName'); fromEmail = $('txtYourEmail'); toName = $('txtFriendsName'); toEmail = $('txtFriendsEmail'); personalMsg = $('taPersonalMsg'); if (emailIsValid(stripHtml(fromEmail.value)) && emailIsValid(stripHtml(toEmail.value))) { // display sending... image hide($('lnkShareIt')); show($('imgSending')); // set form data formData = 'fromName=' + stripHtml(fromName.value) + '&fromEmail=' + stripHtml(fromEmail.value) + '&toName=' + stripHtml(toName.value) + '&toEmail=' + stripHtml(toEmail.value) + '&personalMsg=' + stripHtml(personalMsg.value); action = shareItPostUrl + '?' + escape(formData + '&' + Math.floor(Math.random()*101)); // after 2 seconds, switch view to share it sent screen setTimeout("switchView('shareItSent');_IG_Analytics('UA-796752-4', '/ccom/sendItClickSuccess');",1500) _IG_FetchContent(action, function (responseText) { if (responseText.toLowerCase().indexOf('error') != -1) { alert('Error, please try again.'); clearShareIt(); _IG_Analytics("UA-796752-4", "/ccom/sendItClickError"); } else { // success // above setTimeout will handle this, since send email tends to lag // switchView('shareItSent'); // _IG_Analytics("UA-796752-4", "/ccom/sendItClickSuccess"); } // success or error }); } else { alert('Please use valid email addresses.'); _IG_Analytics("UA-796752-4", "/ccom/sendItClickInvalidInput"); } } // shareIt() function findIt() { _IG_Analytics("UA-796752-4", "/ccom/findItClick"); var url; // final destination var keywords; var translation; var urlTemplate; keywords = $('txtSearch').value; translation = getTranslation(); if (!isEmpty($('txtSearch')) && keywords != 'Enter keywords here...') { _IG_Analytics("UA-796752-4", "/ccom/findItClickSuccess"); urlTemplate = 'http://bible.christianity.com/search/default.aspx?keyword={K}&type=bible&p=0&translation={T}'; url = urlTemplate.replace('{K}',keywords).replace('{T}',translation); window.open(url); } else { _IG_Analytics("UA-796752-4", "/ccom/findItClickInvalidInput"); $('txtSearch').value = ''; $('txtSearch').focus(); } } // findIt() function getTranslation() { for (var i=0; i < ccom.optTranslation.length; i++) { if (ccom.optTranslation[i].checked) { return ccom.optTranslation[i].value; } } } // getTranslation() function selectDefaultTranslation(translationValue) { for (var i=0; i < ccom.optTranslation.length; i++) { if (ccom.optTranslation[i].value.toLowerCase() == translationValue.toLowerCase()) ccom.optTranslation[i].checked = true; else ccom.optTranslation[i].checked = false; } } // getTranslation() function isEmpty(txtBox) { if ((txtBox.value.length==0) || (txtBox.value==null)) { return true; } else { return false; } } // isEmpty(...) function switchView(view) { switch (view.toLowerCase()) { case 'findit': // standard view of selected list and items show($('findIt')); hide($('getIt')); hide($('shareIt')); hide($('shareItSent')); break; case 'getit': // global view of all lists and items hide($('findIt')); show($('getIt')); hide($('shareIt')); hide($('shareItSent')); $('txtEmbedCode').select(); break; case 'shareit': // no lists hide($('findIt')); hide($('getIt')); show($('shareIt')); hide($('shareItSent')); clearShareIt(); break; case 'shareitsent': // no items hide($('findIt')); hide($('getIt')); hide($('shareIt')); show($('shareItSent')); break; // default: } // switch } // switchView(...) // COMMON function stripHtml(str){return str.replace(/(<([^>]+)>)/ig,'');} function emailIsValid(str) { var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$"; var regex = new RegExp(emailReg); return regex.test(str); } function $(id){return document.getElementById(id);} function hide(ctl){if(ctl){ctl.style.display='none';}} function show(ctl){if(ctl){ctl.style.display='inline';}} function stringIsNullOrEmpty(str){return (str=='' || str==' ' || str==null || str.toLowerCase()=='null');}