I want to call the function like I did in the following HTML code:
<html>
<head>
<script>
var reg1 = new Image
var red1 = new Image
reg1.src="1.gif"
red1.src="1R.gif"
var reg1s = new Image
var red1s = new Image
reg1s.src="1s.gif"
red1s.src="1sR.gif"
var reg3s = new Image
var red3s = new Image
reg3s.src="3s.gif"
red3s.src="3sR.gif"
</script>
</head>
<body>
<script LANGUAGE="JavaScript" src="script.js">
NavigationBar();
</script>
<h1 align="center">Welcome to Drexel!</h1>
<center> <img src="DrexelDragons.png"> </center>
These images are public domain clip art obtained from
<a href="http://www.clipart.co.uk/"><img src="cwbutton.gif"></a>
</body>
</html>
I am calling it from a separate .js file. Here is the code.
function NavigationBar()
{
document.write("<a href=\"Home page2.html\" onMouseOver=\"document.thereg1.src=red1.src\" onMouseOut=\"document.thereg1.src=reg1.src\"><img src=\"1.gif\" Name=\"thereg1\"></a>")
return ""
}
My problem is that this will run but it wont display the image or do what I want it to do while it is declared as a Function. If I just put it as a document.write statement it works just fine but I need it as a function.