 <pre><code>function combined(curtext, curimage){ if(curtext == "View large image"){ document.getElementById("boldStuff").innerHTML = "View small image"; curtext="View small image"; } else{ document.getElementById("boldStuff").innerHTML= "View small image"; curtext="View large image"; } if(curimage == "cottage_small.jpg"){ document.getElementById("myImage").src="cottage_large.jpg"; curimage="cottage_large.jpg"; } else{ document.getElementById("myImage").src="cottage_large.jpg"; curimage="cottage_small.jpg"; } } </code></pre>