//
// Dynamic Page Generation Objects
//
function DynamicPage(name, style, content, targetframe) {
this.name = name;
this.style = style;
this.content = content;
this.targetframe = targetframe;
return this;
}
// Declare methods
new DynamicPage();
DynamicPage.prototype.show = showDP;
DynamicPage.prototype.display = displayDP;
DynamicPage.prototype.setContent = setContent;
function showDP(fo) {
this.setContent(fo);
this.display();
}
function displayDP() {
this.targetframe.document.write(this.content);
this.targetframe.document.close();
}
function setContent(fo) {
M = "
You ";
if (fo.type.indexOf("select") >= 0) {
M += "picked " +
setcolor(fo[fo.selectedIndex].text,'#60ffb2') +
" in the " +
setcolor("select box", "#e1ac84") +
".";
}
else if (fo.type.indexOf("text") >= 0) {
M += "changed the value to " +
setcolor(fo.value,'#60ffb2') +
" in the " +
setcolor("text box", "#e1ac84") +
".";
}
else if (fo.type.indexOf("checkbox") >= 0) {
if (!fo.checked)
M += "un";
M += "checked " +
setcolor(fo.value, '#60ffb2') +
" in the " +
setcolor("radio box", "#e1ac84") +
".";
}
M += "
\n";
if (this.style == "fancy") {
M =
"";
}
H =
"" +
"" +
"" +
M +
"" +
"" +
"";
this.content = H;
}
// Function
function setcolor(what, whatcolor) {
return "" +
what +
"";
}