

function searchForText( toFind, frameToSearch ) {
	if( !toFind ) { window.alert( 'You have not entered any text to search for' ); return; }
	
	var testImg = new Image();
	testImg.src = 'http://www.villasupermarketspain.com/_private/links/searchlog.php?searchstring=' +toFind;
	if( frameToSearch.focus ) { frameToSearch.focus(); }
	
	

	if( window.find ) {
		//Netscape compatible browsers provide the window.find method
		if( document.layers ) {
			//Against the JS spec, Netscape 4 will produce errors if too many arguments are given
			var ifFound = frameToSearch.find( toFind, false, false );
		} else {
			var ifFound = frameToSearch.find( toFind, false, false, true, false, true, false );
		}
	} else if( frameToSearch.document.body && frameToSearch.document.body.createTextRange ) {
		//IE or compatible use various TextRange features
		if( frameToSearch.document.selection && frameToSearch.document.selection.type != 'None' ) {
			//If some text is selected already (previous search or if they have selected it)
			//make that the text range. Then move to the end of it to search beyond it
			var theRange = frameToSearch.document.selection.createRange();
			theRange.collapse( false );
		} else {
			//If no text is selected, start from the start of the document
			var theRange = frameToSearch.document.body.createTextRange();
		}
		//find the next occurrence of the chosen string
		var ifFound = theRange.findText( toFind );
		if( ifFound ) { theRange.select();
		"\r";
		}
	} else {
		alert ( 'Please use your browser\'s search facility' );
	}
	if( !ifFound ) { alert ( 'Could not find text:' + toFind + '.' + '\n' + 'Try browsing Ads by Google on this page'); }
}

function pageDown () {
  		if (window.scrollBy)
    		window.scrollBy(0, window.innerHeight ? window.innerHeight : 
		document.body.clientHeight); }