Q:

javascript find string function

I need to implement a simp^le "find" function which will retrieve the 1st occurence of a given string, then find next occurrences on demand. 
Please no jQuery, only good plain javascript. 

A:

You could use window.find() that the browser offers.   See here for more info. 
window.find(aString, aCaseSensitive, aBackwards, aWrapAround,
        aWholeWord, aSearchInFrames, aShowDialog);

This is supported in Firefox and WebKit.   For IE, there is a work-around here using the findText() method of a TextRange object.