// JavaScript Document


/*
var test = ["First", "Second", "Third"];
var total = test.length; //not necessary
var lastelement = test[test.length-1];
var lastelement = test[2]; //same as above
test[test.length] = "Fourth";

alert(test);
alert(test[0]+test[1]);
alert(lastelement);
alert(total);
alert(test[3]);
alert(1+2);
*/


	var x = 3

function square(x)
	{
		return x*x;
	}
	
	var y = square(x) + 3; // y= 9 + 3
	
	alert(y);

/*
var numbers = [1, 2, 3, 4, 5];
for (var i = 0; i < numbers.length; i++)
{
	numbers[i] *= 2;
}

alert(numbers);

*/

/*
function warning();
{
	alert ("This is your Final Warning");
}

warning(); // supposed to call function?
*/




/*
You could create the same effects without Dreamweaver, but you'd need to take a few extra steps: buy a book on JavaScript; read it from cover to cover; learn about concepts like arrays, functions, and the Document Object Model; and spend weeks discovering the eccentric rules governing how different browsers interpret JavaScript code differently.
*/
