
	var nStars = 5;
	var bgImage = "curtains"
	var iPicCtr = 0;
	var iMAXPIC = 2;
	var bIsStar = true;

	if (document.all && (navigator.userAgent.indexOf("Opera") != 0)) {
		document.body.onmouseover=msover;
		document.body.onmouseout=msout;
		document.body.onclick=msclicked;
		window.onload=init;
	}

	function preload(pic) {
		picID = pic.substr(0, pic.indexOf("."));
		scratchpad.innerHTML += "<p style=\"display:none\">" +
		   "<img id=\"" + picID + "\" src=\"images/" + pic + "\"><\/p>";
	}

	function init() {
		scratchpad.innerHTML = "";
		for(i=1; i<=nStars; i++) {
		  scratchpad.innerHTML += "<div class=\"aStar\" id=\"Star" + i +
		    "\"></div>";
		  eval("Star" + i +
		    ".style.backgroundImage = \"url(images/star.gif)\"");
		}
		preload("vx10.gif");
		preload("uchu.gif");
		preload("cloudtile.jpg");
		preload("flame.gif");
		preload("jimeyes.gif");
		preload("shakes3.gif");
		//preload("spurt.gif");
	}

	function hideStars() {
		bgImage = "curtains";
		document.body.style.background = "url(images/blue_gradient.gif)";
		Tbl.style.background = "url(images/JazzyGray.gif)";
		part3.style.background = "transparent";
		for(i = 1; i <= nStars; i++) {
			eval("Star" + i + ".style.visibility = \"hidden\"");
		}
		replacePic("vx10.gif", 88, 31, "");
		iPicCtr = 0;
		hint.innerHTML = "";
	}

	function showStars() {
		bgImage = "stars";
		document.body.style.background = "url(images/uchu.gif)";
		Tbl.style.background = "url(images/cloudtile.jpg)";
		for(i = 1; i <= nStars; i++) {
			eval("Star" + i + ".style.visibility = \"visible\"");
		}
	}

	function showPicture(pageName, target, height, width) {
		features = "height=" + height + ",width=" + width +
		   ",status=no,toolbar=no,menubar=no,location=no";
		window.open(pageName, target, features, true);
	}

	function replacePic(pic, width, height, title) {
		// get cached image by ID:
		picID = pic.substr(0, pic.indexOf("."));
		w3Icon.src = eval(picID + ".src");
		w3Icon.width = width;
		w3Icon.height = height;
		w3Icon.title = title;
		if (w3Icon.filters[0].Status == 0) {
			// apply filter:
			w3Icon.style.visibility = "hidden"
			w3Icon.filters[0].transition = 12
			w3Icon.filters[0].apply()
			w3Icon.style.visibility = "visible"
			w3Icon.filters[0].play()
		}
		hint.innerHTML = "[Click \"Wild\" when you've had enough.]";
	}

	function rockMe() {
		for (i = 0; i < 25; i++) {
			window.moveBy(15,0);
			window.moveBy(-15,0);
		}
	}

	function msclicked() {
		var src = event.srcElement;
		var sid = src.id
		if (sid == "part3") {
			if (bgImage == "curtains") {
				showStars();
				part3.innerHTML = "Wild";
			}
			else {  // stars background, so back to "normal"
				hideStars();
				part3.innerHTML = "Weird";
			}
		}
		else if (sid == "Star1")
			showPicture("osiris.html", "osiris", 303, 156);
		else if (sid == "Star2")
			showPicture("mona.html", "mona", 210, 222);
		else if (sid == "Star3") {
        		   if (iPicCtr == 0)
        		      replacePic("shakes3.gif", 97, 120, "Hark!");
        		   else if (iPicCtr == 1)
        		      replacePic("jimeyes.gif", 123, 130, "nYeahhhh");
        		   else if (iPicCtr == iMAXPIC)
        		      replacePic("vx10.gif", 88, 31, "");
			   if (++iPicCtr > iMAXPIC) { iPicCtr = 0 };
		}
		else if (sid == "Star4") {
			if (bIsStar) {
				eval(sid + ".style.background = \"url(images/flame.gif)\"");
				eval(sid + ".style.height = 60");
				eval(sid + ".style.pixelTop = 80")
			}
			else {
				eval(sid + ".style.background = \"url(images/star.gif)\"");
				eval(sid + ".style.height = 29");
				eval(sid + ".style.pixelTop = 122")
			}
			bIsStar = !(bIsStar);
		}
		else if (sid == "Star5") {
			//document.body.style.background = "url(images/spurt.gif)"
			hint.innerHTML = "[Click \"Wild\" when you've had enough.]";
			rockMe();
/*
			Tbl.style.background = "url(images/uchu.gif)";
			for (i=1; i <= nStars; i++)
				eval("Star" + i + ".style.visibility = \"hidden\"");
			document.body.style.background = "url(images/cloudtile.jpg)"
			part3.style.background = "url(images/flame.gif)";
*/

		}
	}

	function msover() {
		src = event.srcElement;
		if (src.id == "part3") {
			part1.style.color = "red";
			part2.style.color = "limegreen";
			part3.style.color = "blue";
		}
	}

	function msout() {
		src=event.srcElement;
		if (src.id == "part3") {
			part1.style.color = "maroon";
			part2.style.color = "#006400";
			part3.style.color = "navy";
		}
	}

