/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Sandeep Gangadharan | http://www.sivamdesign.com/scripts/ */
function printDetails() {
txt = "Title: " + this.title + " "; // change the text data here. You can have as many
txt += "Location: " + this.location + " "; // lines of data as required. to add more
txt += "State: " + this.state + " "; // lines do it as shown on the left
txt += "Cost: " + this.cost + " "; // links can be added as shown
img = this.photo;
theDetails = txt;
document.changeImg.avatars.src = img;
document.getElementById('theData').innerHTML = theDetails; }
function place(title, location, state, cost, photo) {
this.title = title;
this.location = location;
this.state = state;
this.cost = cost;
this.photo = photo;
this.printDetails = printDetails; }
// each user or product details should be added as shown below.
Mountains = new place("Mountains", "Black Hills", "Colorado", "$1,250", "pix1-sm.gif");
Lake = new place("Lake", "Taragon Lake", "Oregon", "$1,680", "pix2-sm.gif");
Barren = new place("Barren", "Dimas Desert", "New Mexico", "1,375", "pix3-sm.gif");
Paste this code into the HEAD section of your HTML document.
Paste this code into the BODY section of your HTML document