// ******************************************************************************
// Title          LivingWord Bible Reading Plan Component for Joomla
// Author         Mike Leeper
// Version        1.0
// Copyright      © by Mike Leeper
// License        This is free software and you may redistribute it under the GPL.
//                LivingWord Bible Reading Plan comes with absolutely no warranty. 
//                For details, see the license at http://www.gnu.org/licenses/gpl.txt
//                YOU ARE NOT REQUIRED TO KEEP COPYRIGHT NOTICES IN
//                THE HTML OUTPUT OF THIS SCRIPT. YOU ARE NOT ALLOWED
//                TO REMOVE COPYRIGHT NOTICES FROM THE SOURCE CODE.
// *******************************************************************************

function validatep1() { 
valid = true;

if( document.settingspage.selectplan.selectedIndex == 0 )
{
alert(selectbp);
valid = false;
return valid;
}

if( document.settingspage.selectplan.selectedIndex < 6 && document.settingspage.selectversion.selectedIndex == 0 )
{
alert(selectbv);
valid = false;
return valid;
}

if( document.settingspage.selectplan.selectedIndex > 5 && document.settingspage.selectaudio.selectedIndex == 0 )
{
alert(selectav);
valid = false;
return valid;
}
}

function clearText(field) {
var inp = document.getElementById(field);
if(inp.value == selectkw)
inp.value = '';
}

function showDictLink(letter){
var dictsource = document.toolspage.selectdict.selectedIndex;
if(dictsource == 0){
alert(selectdict);
}else{
window.open('http://www.biblegateway.com/resources/dictionaries/dict_letter.php?source='+dictsource+'&letter='+letter);
}
}

function showComLink(book){
var comsource = document.toolspagecom.selectcomment.value;
if(book == 'songofsongs') book = 'song';
if(comsource == 0){
alert(selectcom);
}else{
window.open('http://eword.gospelcom.net/comments/'+book+'/'+comsource+'/'+book+'intro.htm');
}
}

function submitDictLookup(){
var lookupText = document.toolspage.sentry.value;
var criteria = document.toolspage.selectcrit.selectedIndex;
var dictsource = document.toolspage.selectdict.selectedIndex;
if(dictsource == 0){
alert(selectdict);
return false;
}
if(criteria == 0) {
alert(selectcrit);
return false;
}
if(lookupText == "" || lookupText == selectkw){
alert(selectkws);
return false;
}
window.open('http://www.biblegateway.com/resources/dictionaries/dict_searchresults.php?search='+lookupText+'&searchtype='+criteria);return false;
}
