$(document).ready(function(){    // used to highlight paragraphs using jquery
	$("p").on({
    mouseenter: function(){
        $(this).css("background-color", "lightgray");
    },

    mouseleave: function(){
        $(this).css("background-color", "");  // colour may be lightblue
    },

    click: function(){
        $(this).css("background-color", "lightyellow");
	responsiveVoice.speak(getSelectionText(), "Hindi Female");
		    }
		});
	});



// for selecting text and copying to clipboard using header-head.js

﻿document.body.addEventListener('mouseup', function(){
    var selected = getSelectionText() // call <a href="#getselectiontext">getSelectionText()</a> to see what was selected
    if (selected.length > 0){ // if selected text length is greater than 0
        var copysuccess = copySelectionText() // copy user selected text to clipboard
    }
}, false)


createtooltip()
var buddhaquote = document.getElementById('buddhaquote')
buddhaquote.addEventListener('mouseup', function(e){
	var selected = getSelectionText() // call getSelectionText() to see what was selected
	if (selected.length > 0){ // if selected text length is greater than 0
		var copysuccess = copySelectionText() // copy user selected text to clipboard
		showtooltip(e)
	}
}, false)





/*  copy all text on one click - not success

(function() {
    function selectText(element) {
        var doc = document
            , text = element
            , range, selection
        ;
        if (doc.body.createTextRange) { //ms
            range = doc.body.createTextRange();
            range.moveToElementText(text);
            range.select();
        } else if (window.getSelection) { //all others
            selection = window.getSelection();
            range = doc.createRange();
            range.selectNodeContents(text);
            selection.removeAllRanges();
            selection.addRange(range);
        }
    }
    preTags = document.getElementsByTagName('p');
    for(var i=0;i<preTags.length;i++) {
        preTags[i].onclick = function() {selectText(this)};
	
    }
})();


*/



