one function after another

I want the onmouseover function in action only after the body is clicked on once. How do I do this?
<script type="text/javascript">

var timer_is_on=0;


function show_coords(event)
{
var x=event.clientX;
var y=event.clientY;
document.getElementById("oo").innerHTML= x+" "+y;
}


function doTimer ()
{
	if(!timer_is_on){ timer_is_on=1; show_coords(event);  }
	
	return true;
	
}





</script>

</head>



<body onmousedown="show_coords(event)" onmouseover="return doTimer()">

<p>Click in the document. An alert box will alert the x and y coordinates of the mouse pointer.</p>

<p id="oo"></p>

Open in new window

charmingduckAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mwochnickCommented:
try this
<html>
<head>
<script type="text/javascript">

var timer_is_on=0;

function flip_hover() {
	if (timer_is_on)
		timer_is_on = 0;
	else
		timer_is_on = 1;
}


function show_coords(event)
{
var x=event.clientX;
var y=event.clientY;
document.getElementById("oo").innerHTML= x+" "+y;
}


function doTimer (event)
{
        if(!timer_is_on){
			show_coords(event);
		}
        return true;
}
</script>

</head>

<body onclick="flip_hover()" onmouseover="return doTimer(event)">
<p>Click in the document. An alert box will alert the x and y coordinates of the mouse pointer.</p>
<p id="oo"></p>
</body>
</html>

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mwochnickCommented:
a couple of things clicking turns it on and off
one correction the hover is on to start with in the code above - need to change line 25 to this to reverse
        if(timer_is_on){
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.