/*
    Variable: ftPreloadImagePaths
    .

    Variable: ftPreloadImages
    .
*/


// preload images
var ftPreloadImagePaths = new Array(
                              skinImagePath + 'faithtools/FaithTools_Open_off.jpg',
                              skinImagePath + 'faithtools/FaithTools_Scripture_on.jpg',
                              skinImagePath + 'faithtools/FaithTools_Devotional_on.jpg',
                              skinImagePath + 'faithtools/FaithTools_Study_on.jpg',
                              skinImagePath + 'faithtools/FaithTools_Scripture_background.jpg',
                              skinImagePath + 'faithtools/FaithTools_Devotional_background.jpg',
                              skinImagePath + 'faithtools/FaithTools_Study_background.jpg',
                              skinImagePath + 'button_go_on.gif'
                          );
var ftPreloadImages = new Array( ftPreloadImagePaths.length );
for ( var i = 0; i < ftPreloadImagePaths.length; i++ ) {
      ftPreloadImages[i] = new Image();
      ftPreloadImages[i].src = ftPreloadImagePaths[i];
}


/*
    Function: goButtonHover
    Handles the mouse over on an object.

    Parameters:
        button - image name.
        isHovered - boolean.

    Returns:
        nothing.
*/
function goButtonHover(button, isHovered) {
	if (isHovered)
		button.src = skinImagePath + 'button_go_on.gif';
	else
		button.src = skinImagePath + 'button_go.gif';
}


/*
    Function: faithToolsFeatureChange
    Handles showing and hiding the panels on the home default page.

    Parameters:
        panelId - panel index.

    Returns:
        false.
*/
function faithToolsFeatureChange(panelId) {
	document.getElementById('openBible').style.display = (panelId == 0 ? 'block' : 'none');
	document.getElementById('readScripture').style.display = (panelId == 1 ? 'block' : 'none');
	document.getElementById('readDevo').style.display = (panelId == 2 ? 'block' : 'none');
	document.getElementById('studyBible').style.display = (panelId == 3 ? 'block' : 'none');

	document.getElementById('openBibleNav').className = (panelId == 0 ? 'openBibleNav_on' : 'openBibleNav_off');
	document.getElementById('readScriptureNav').className = (panelId == 1 ? 'readScriptureNav_on' : 'readScriptureNav_off');
	document.getElementById('readDevoNav').className = (panelId == 2 ? 'readDevoNav_on' : 'readDevoNav_off');
	document.getElementById('studyBibleNav').className = (panelId == 3 ? 'studyBibleNav_on' : 'studyBibleNav_off');

	return false;
}


/*
    Function: faithToolsRandom
    Gets the random verses displayed in my-bst default page.

    Parameters:
        no-params.

    Returns:
        false.

    See Also:
        <faithToolsFindVerse()>
        <faithToolsSearchBible()>
*/
function faithToolsRandom() {
	window.location.href  = 'mybst/?type=bible';
	return false;

}


/*
    Function: faithToolsFindVerse
    Exceutes the reference search.

    Parameters:
        no-params.

    Returns:
        false.

    See Also:
        <faithToolsSearchBible()>
        <faithToolsRandom()>
*/
function faithToolsFindVerse() {
    var verse = document.getElementById('faithToolsFindVerseText').value;
	window.location.href  = 'mybst/?reference=' + verse + '&type=bible&translation=' + translationId;
	return false;
}


/*
    Function: faithToolsRandom
    Exceutes the keyword search..

    Parameters:
        no-params.

    Returns:
        false.

    See Also:
        <faithToolsFindVerse()>
        <faithToolsRandom()>
*/
function faithToolsSearchBible()
{
	var keywords = document.getElementById('faithToolsKeywords').value;
	window.location.href  = 'search/?keyword=' + keywords +  '&type=bible&translation='+ translationId;
	return false;
}
