document.writeln("<style><!-- a:hover{ color:#FFFFFF } a{ text-decoration:none; } \/\/--><\/style><\/head>");

// globals

var keys  = 'alive,   #, apart, art, baby, bitmap,  paint,   draw,   mark, bliss, bridge, golden,   gate, francisco, burn,      calc, change, city,  new, york,  wtc,  nyc, click, cliff,  half,  dome,   hik, yosemite, close, dam, dawn, day, grass, sun,    dirt,  dea,  die, demon, destroy, do, down, drain,  hole,  plug,  sink, draw, sketch, earth, endeavor,    dream,   polish, enter,    #, fade, black, figure,   poser, fire, fall, autumn, heat,  hot,             fcw,             cash,                 $,           money, game,  fun, play,   gold, morning,    sun,    #,       #, gray, grey,    #,      #, hang, fall, hike,  ear,   heart,   card, hello, help,  hid, hint, clue, home,     #, initial,  letter, inside, ishmael, jack, club, fight, jump, mario, kaboom, kill, murder, know, finally, question, answer, lake, lie,     #,    #, logo,  nin, lost, machine, computer,  drown,   sleep,  mark,  arch,   132, stray, mascot,   dick,   cock,  penis,  dildo, me, bio, about, mental, insane, midi, music,    motivat,  encourage,    optimis, name,          nin, not, nothing, numb, number,   #, opposition, out, golf, overkill, pain, palm, hand, tree, vegas, pattern, peak,  hik, mansfield, mount, peek,  photo, camera,  image,    pic,  polaroid,  shoot, pi,  piece,  peace, pj, pearl, jam,  place, poem, poetry, predict,     esp,  future,     proj,   design,      ece,   report,     work, proposition, question,   answer, rage, rain, remember, ring, metal, rust, say,  scene,  bryce,   cg, graphics, see, sight,   silen, sex, male, man, object, thing, sing, baba, drive,  site, sight,   slave, slide, snack,   eat, orange, throw,   sneak,    pimp,    spin,   sugar, solution,    virus, sound,     sperry, start, station,  father, stats,  user, street,    san,      fran,  cisco,  stor, sunset,    sun, surface, suggestion,       idea,    thought, tattered,    #, think, this,  thought,    think, three,     3, time, tirade, rumination,   rant, thought, tree, branch, try, underneath, undone, vegas, night, view, summit, victim, vision,  earth,  world,     vp, wait, please, want, water, weapon, who, wind, blow, you';
var pages = 'alive, all, apart, art, baby, bitmap, bitmap, bitmap, bitmap, bliss, bridge, bridge, bridge,    bridge, burn, calculate, change, city, city, city, city, city, click, cliff, cliff, cliff, cliff,    cliff, close, dam, dawn, day,   day, day, ../dirt, dead, dead, demon, destroy, do, down, drain, drain, drain, drain, draw,   draw, earth, endeavor, endeavor, endeavor, enter, eyes, fade, fade, figures, figures, fire, fire,   fire, fire, fire, ../freecashworld, ../freecashworld, ../freecashworld, ../freecashworld, game, game, game, golden,  golden, golden, good, goodbye, gray, gray, grid, guests, hang, hang, hang, hear, hearts, hearts, hello, help, hide, hint, hint, home, icons, initial, initial, inside, ishmael, jack, jack,  jack, jump,  jump, kaboom, kill,   kill, know,    know,     know,   know, lake, lie, links, list, logo, logo, lost, machine, machine, machine, machine, marks, marks, marks, marks, mascot, mascot, mascot, mascot, mascot, me,  me,    me, mental, mental, midi,  midi, motivation, motivation, motivation, name, ../ninfiles, not, nothing, numb, number, one, opposition, out,  out, overkill, pain, palm, palm, palm,  palm, pattern, peak, peak,      peak,  peak, peak, photos, photos, photos, photos,    photos, photos, pi, pieces, pieces, pj,    pj,  pj, places, poem,   poem, predict, predict, predict, projects, projects, projects, projects, projects, proposition, question, question, rage, rain, remember, ring,  ring, rust, say, scenes, scenes, scenes, scenes, see,   see, silence, sex,  sex, sex,    sex,   sex, sing, sing,  sing, sites, sites, slavery, slide, snack, snack,  snack, snack, sneaker, sneaker, sneaker, sneaker, solution, solution, sound, ../sperry2, start, station, station, stats, stats, street, street,    street, street, story, sunset, sunset, surface, suggestion, suggestion, suggestion, tattered, test, think, this, thoughts, thoughts, three, three, time, tirade,     tirade, tirade,  tirade, tree,   tree, try, underneath, undone, vegas, vegas, view,   view, victim, vision, vision, vision, ../vp2, wait,   wait, want, water, weapon, who, wind, wind, you';

// head (type, bgcolor){

// [ type ]
// 0: head  - default
// 1: whead - color background
// 2: bhead - tile background
// 3: shead - default margins
// 4: ihead - icon background

// rtd (type, str){

// [ type ]
// 0: rtd - default
// 1: rgt - right
// 2: lft - left
// 3: cnt - center

// boxtop (type){

// [ type ]
// 0: boxtop  - default
// 1: iboxtop - less images
// 2: tile background
// 3: sboxtop - slave
// 4: hboxtop - half width
// 5: vboxtop - no images or space

// boxbottom (type){

// [ type ]
// 0: boxbottom  - default
// 1: iboxbottom - less images
// 2: tile background// 5: vboxbottom - no images or space

// font (type, face, colour){

// [ type ]
// 0: font  - default
// 1: bfont - big font
// 2: sfont - small font
// 3: tfont - tiny font

// tail (type,stuff){

// [ type ]
// 0: tail - default
// 1: stail - stuff
// 2: ntail - stuff no href link

// topper (type,stuff1,stuff2){

// [type]
// 0: default
// 1: rstuff
// 2: lstuff
// 3: both

var ksplit = keys.split(', ');

for (var i = 0; i < ksplit.length; i++)
while (ksplit[i].substring(0,1) == ' ') ksplit[i] = ksplit[i].substring(1);

var psplit = pages.split(', ');

var band;
var bgrand;
var lcolor;
var fcolor;
var bcolor;
var tcolor;

var goinside;
var gocross;
var goeven;
var goboth;
var goplus;
var goclear;
var plusym;

var rb;
var rbh;
var rbtcolor;
var fontline;

var soundwin = null;

function fc(r){
var s="";
var t="";
rcolor="";

var rand = Math.floor(Math.random()*16);

t = ""+rand;

if (rand > 9)
  switch (rand){
    case 10: t = "A"; break
    case 11: t = "B"; break
    case 12: t = "C"; break
    case 13: t = "D"; break
    case 14: t = "E"; break
    case 15: t = "F"; break
  default: 
}

if (r > 9){
  if (r > 15) return fc(r-16); else
  switch (r){
    case 10: s = "A"; break
    case 11: s = "B"; break
    case 12: s = "C"; break
    case 13: s = "D"; break
    case 14: s = "E"; break
    case 15: s = "F"; break
  default: 
}
  rcolor=s+t+s+t+s+t;
} else {
  if (r < 0) return fc(r+16); else
  rcolor=""+r+t+r+t+r+t;
}

return rcolor;
}

function tdhead(r,d){
var rand = Math.floor(Math.random()*d);
if (rand == 0) return "<td align=center valign=middle ";
else return "<td align=center valign=middle bgcolor=#"+r+" ";
}

function rword(word,dest,seed){
var r=Math.floor(Math.random()*100)+seed;
if (r>=100) document.writeln("<a href="+dest+".html>"+word+"</a>");
else document.writeln(word);
}


function head(type, bgcolor){

// [ type ]
// 0: head  - default
// 1: whead - color background
// 2: bhead - tile background
// 3: shead - default margins
// 4: ihead - icon background
// 5: nhead - color background by number input (not hex)... could replace 1 ultimately

rb=Math.floor(Math.random()*16);
if (type == 1) { 
document.writeln("<body bgcolor=#"+bgcolor);
bcolor = bgcolor;
} else if (type == 5) {
rb = bgcolor;
bgrand = rb;
bcolor = fc(rb);
document.writeln("<body bgcolor=#"+bcolor);
} else {
bgrand = rb;
bcolor = fc(rb);
document.writeln("<body bgcolor=#"+bcolor);
}


band = 0;

barry = new Array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');

r0 = Math.floor(Math.random()*barry.length);
r1 = Math.floor(Math.random()*barry.length);
r2 = Math.floor(Math.random()*barry.length);

if (type == 2) {
var brand=Math.floor(Math.random()*10)+1
document.writeln(" background=tiles\/" + brand);
}

if (type == 4) {
var brand=Math.floor(Math.random()*images)+1
document.writeln(" background=see\/" + I[brand]);
}

rand = Math.floor(Math.random()*5);
if (rand == 0) lcolor = "#"+barry[r0]+barry[r1]+barry[r0]+barry[r1]+barry[r0]+barry[r1];
else lcolor = "#"+barry[r0]+barry[r0]+barry[r1]+barry[r1]+barry[r2]+barry[r2];

if (type != 3) document.writeln(" leftmargin=0 topmargin=0 marginheight=0 marginwidth=0");
document.writeln(" link=" + lcolor + " vlink=" + lcolor + " alink=" + lcolor + " >");

document.writeln("<table width=100% height=100% border=0 cellpadding=0 cellspacing=0><tr>");

rand = Math.floor(Math.random()*16);
tcolor = fc(rand);

}

function rtd(type, str){

// [ type ]
// 0: rtd - default
// 1: rgt - right
// 2: lft - left
// 3: cnt - center

var rand;

if (type == 1) rand=3;
else if (type == 2) rand=1;
else if (type == 3) rand=2;
else rand=Math.floor(Math.random()*3)+1
b1="<td align=left"
b2="<td align=center"
b3="<td align=right"
document.writeln(eval("b"+rand));

if (band == 1){
rand=Math.floor(Math.random()*16);
document.writeln(" bgcolor="+fc(rb));
band=0;
}

if (str) document.writeln(" "+str);

if (type == 3) rand=2;
else rand=Math.floor(Math.random()*3)+1
b1=" valign=top>"
b2=" valign=center>"
b3=" valign=bottom>"
document.writeln(eval("b"+rand));

}

function lines(type){

var pnum=Math.floor(Math.random()*15)+1
if (type == 1) var bnum=Math.floor(Math.random()*3)
else if (pnum <= 3) var bnum=Math.floor(Math.random()*3)
	else var bnum=Math.floor(Math.random()*2)

if (pnum <= 3) var sz=10;
else var sz=5;

var w1 = Math.floor(Math.random()*100)+1;
var w2 = Math.floor(Math.random()*100)+1;
var w3 = Math.floor(Math.random()*100)+1;
var s1 = Math.floor(Math.random()*sz)+1;
var s2 = Math.floor(Math.random()*sz)+1;
var s3 = Math.floor(Math.random()*sz)+1;
var n1 = Math.floor(Math.random()*10);
var n2 = Math.floor(Math.random()*10);
var n3 = Math.floor(Math.random()*10);

if (n1 >= 5) n1="noshade"; else n1="";
if (n2 >= 5) n2="noshade"; else n2="";
if (n3 >= 5) n3="noshade"; else n3="";

if (pnum <= 1) {
	document.writeln("<hr width="+w1+"% size="+s1+" "+n1+">");
}
if (pnum <= 2) {
	for (i = 1; i <= bnum; i++) document.writeln("<br>");
	document.writeln("<hr width="+w2+"% size="+s2+" "+n2+">");
}
if (pnum <= 3) {
	for (i = 1; i <= bnum; i++) document.writeln("<br>");
	document.writeln("<hr width="+w3+"% size="+s3+" "+n3+">");
}

if (pnum >= 13) {
	document.writeln("<hr width="+w1+"% size="+s1+" "+n1+">");
}
if (pnum >= 14) {
	for (i = 1; i <= bnum; i++) document.writeln("<br>");
	document.writeln("<hr width="+w1+"% size="+s1+" "+n1+">");
}
if (pnum >= 15) {
	for (i = 1; i <= bnum; i++) document.writeln("<br>");
	document.writeln("<hr width="+w1+"% size="+s1+" "+n1+">");
}

if (type == 1) document.writeln("<\/td>");
else document.writeln("<\/td><\/tr><tr><td>");


}

function clickIE4() { if (event.button==2) { return false; } }
function clickNS4(e){ if (document.layers||document.getElementById&&!document.all) { if (e.which==2||e.which==3){ return false; } } }

function frame(){

var crand=Math.floor(Math.random()*80)+0;
band=Math.floor(Math.random()*4);
if (band == 1) document.writeln("<table width=100% border=0 cellpadding=0 cellspacing=" + (crand-10) + "><tr>");
else document.writeln("<table width=100% height=100% border=0 cellpadding=0 cellspacing=" + crand + "><tr>");

// if (document.layers) { document.captureEvents(Event.MOUSEDOWN); document.onmousedown=clickNS4; }
// else if (document.all&&!document.getElementById) { document.onmousedown=clickIE4; }
// document.oncontextmenu=new Function("return false")

}

function boxtop(type){

// [ type ]
// 0: boxtop  - default
// 1: iboxtop - less images
// 2: tile background
// 3: sboxtop - slave
// 4: hboxtop - half width
// 5: vboxtop - no images or space

slave = 0;
hwidth = 0;
vbox = 0;

if (type == 3) { type = 1; slave = 1; }
else if (type == 4) { type = 1; hwidth = 1; }
else if (type == 5) { vbox = 1; }

var goleft=Math.floor(Math.random()*2)
var godown=Math.floor(Math.random()*2)

var plusyms = new Array('+','×','·','[ &nbsp; ]','][','<>','><','>>','<<','| &nbsp; |','| | |','||||','|||||','( + )','"','#','«','//','\\\\','[ + ]','[ × ]','[ · ]',']|[','<img src=http://www.beautyinchaos.com/see/30.gif>','<img src=http://www.beautyinchaos.com/see/38.gif>','<img src=http://www.beautyinchaos.com/see/41.gif>','<img src=http://www.beautyinchaos.com/see/42.gif>','<img src=http://www.beautyinchaos.com/see/43.gif>','<img src=http://www.beautyinchaos.com/see/44.gif>','<img src=http://www.beautyinchaos.com/see/57.gif>','<img src=http://www.beautyinchaos.com/see/58.gif>','<img src=http://www.beautyinchaos.com/see/59.gif>','<img src=http://www.beautyinchaos.com/see/91.gif>','<img src=http://www.beautyinchaos.com/see/92.gif>','<img src=http://www.beautyinchaos.com/see/95.gif>','<img src=http://www.beautyinchaos.com/see/97.gif>','<img src=http://www.beautyinchaos.com/see/98.gif>','<img src=http://www.beautyinchaos.com/see/100.gif>','<img src=http://www.beautyinchaos.com/see/101.gif>','<img src=http://www.beautyinchaos.com/see/102.gif>','<img src=http://www.beautyinchaos.com/see/102.gif>','<img src=http://www.beautyinchaos.com/see/103.gif>','<img src=http://www.beautyinchaos.com/see/104.gif>','<img src=http://www.beautyinchaos.com/see/105.gif>','<img src=http://www.beautyinchaos.com/see/106.gif>','<img src=http://www.beautyinchaos.com/see/107.gif>','<img src=http://www.beautyinchaos.com/see/108.gif>','<img src=http://www.beautyinchaos.com/see/109.gif>','<img src=http://www.beautyinchaos.com/see/110.gif>','<img src=http://www.beautyinchaos.com/see/112.gif>','<img src=http://www.beautyinchaos.com/see/114.gif>','<img src=http://www.beautyinchaos.com/see/115.gif>','<img src=http://www.beautyinchaos.com/see/116.gif>','<a href=http://www.beautyinchaos.com/proposition.html>+</a>');
var symnum=Math.floor(Math.random()*plusyms.length*1.25);
if (symnum < plusyms.length) plusym = plusyms[symnum];
else plusym = plusyms[0];

if (type == 1){
goinside=Math.floor(Math.random()*3)
gocross=Math.floor(Math.random()*3);
goeven=Math.floor(Math.random()*3);
goboth=0;
goplus=Math.floor(Math.random()*4);
} else if (type == 5){
type = 0;
goinside=Math.floor(Math.random()*2)
gocross=Math.floor(Math.random()*2);
goeven=Math.floor(Math.random()*2);
goboth=Math.floor(Math.random()*5);
goplus=Math.floor(Math.random()*3);
} else {
goinside=Math.floor(Math.random()*3)
gocross=Math.floor(Math.random()*2);
goeven=Math.floor(Math.random()*2);
goboth=Math.floor(Math.random()*5);
goplus=Math.floor(Math.random()*4);
}
goclear=Math.floor(Math.random()*5);

if (goinside == 1) gocross = 0;

if (slave != 1 && goclear != 1) {
rb=Math.floor(Math.random()*16)
rbt = rb;
} else if (slave != 1) {
rb=bgrand;
rbt = rb;
} 


if (gocross != 1 && slave == 1 && goclear != 1) document.writeln("<table bgcolor=#"+fc(rbt));
else if (gocross != 1 && goclear != 1) document.writeln("<table bgcolor=#"+fc(rb));
else document.writeln("<table ");

if (type == 2) {
var brand=Math.floor(Math.random()*10)+1
document.writeln(" background=tiles\/" + brand);
}

if (type == 1) var rand=Math.floor(Math.random()*8)+1;
else var rand=Math.floor((Math.random()*20)/(Math.random()*6+1));
if (vbox == 1) var rpad = 0;
else var rpad=Math.floor(Math.random()*15)+5;

if (hwidth == 1) {
var rw=Math.floor(Math.random()*50)+50;
document.writeln(" width="+rw+"%");
}

if (goinside == 1) {
document.writeln(" cellpadding="+rand+" cellspacing=0 border=0>");
} else if (gocross == 1){
document.writeln(" cellpadding=0 cellspacing="+rand+" border=0>");
} else document.writeln(" cellpadding="+rpad+" cellspacing=0 border=0>");

document.writeln("<tr>");

if (goinside == 1 && goclear != 1) { 
rb=Math.floor(Math.random()*16)
rbt=rb;
document.writeln("<td align=left><table bgcolor=#"+fc(rb)+" cellpadding="+rpad+" cellspacing=0 border=0><tr>");
} else if (goinside == 1) { 
rb=bgrand;
document.writeln("<td align=left><table bgcolor=#"+bcolor+" cellpadding="+rpad+" cellspacing=0 border=0><tr>");
}

if (gocross == 1){
rb=Math.floor(Math.random()*16)
rbh=Math.floor(Math.random()*30)+5;
if (type == 1) rand=Math.floor(Math.random()*2)+2;
else rand=Math.floor(Math.random()*4)+2;
rbtcolor=fc(rbt);
if (goplus == 1) {
r=Math.floor(Math.random()*16)
while (Math.abs(r-rb)<3) { r = Math.floor(Math.random()*16); }
rand=Math.floor(Math.random()*7)+2;
fontline = "<font color=#"+fc(r)+" size="+rand+">";
document.writeln("<td align=center valign=middle>"+fontline+plusym+"</font></td><td height="+rbh+"></td><td align=center valign=middle>"+fontline+plusym+"</font></td></tr>");
document.writeln("<tr><td width="+rbh+"></td>");
} else if (goboth == 1) {
document.writeln(""+tdhead(rbtcolor,rand)+"<td></td>"+tdhead(rbtcolor,rand)+" height="+rbh+"></td>"+tdhead(rbtcolor,rand)+"></td></tr>");
document.writeln("<tr>"+tdhead(rbtcolor,rand)+" width="+rbh+"></td>");
} else if (goeven == 1) { 
document.writeln("<td></td>"+tdhead(rbtcolor,rand)+" height="+rbh+"></td><td></td></tr>");
document.writeln("<tr>"+tdhead(rbtcolor,rand)+" width="+rbh+"></td>");
} else {
document.writeln(""+tdhead(rbtcolor,rand)+"></td><td height="+rbh+"></td>"+tdhead(rbtcolor,rand)+"></td></tr>");
document.writeln("<tr><td width="+rbh+"></td>");
}
if (goclear != 1) document.writeln("<td align=left><table bgcolor=#"+fc(rb)+" cellpadding="+rpad+" cellspacing=0 border=0><tr>");
else document.writeln("<td align=left><table bgcolor=#"+bcolor+" cellpadding="+rpad+" cellspacing=0 border=0><tr>");
}

rand=Math.floor(Math.random()*3)+1
b1="<td align=left"
b2="<td align=center"
b3="<td align=right"
document.writeln(eval("b"+rand));

rand=Math.floor(Math.random()*3)+1
b1=" valign=top>"
b2=" valign=center>"
b3=" valign=bottom>"
document.writeln(eval("b"+rand));

if (vbox != 1){

var pnum=Math.floor(Math.random()*6)+1
var bnum=Math.floor(Math.random()*5)

if ((pnum <= 3 && type != 1) || (pnum <= 2 && type == 1)){
	for (var i=1; i <= pnum; i++){
		rand=Math.floor(Math.random()*images)+1
		document.writeln("<img src=http://www.beautyinchaos.com/see\/" + I[rand] + " height=70 width=70>")
		if (i != pnum){
			for(var j=0; j<bnum; j++) {
				if ((godown==0 && type != 1) || (goleft == 1 && type == 1)) { document.writeln("<br>"); }
				else { document.writeln(" &nbsp;") }
			}
		}
	}
}

document.writeln("<\/td>");

if (goleft == 0) { document.writeln("<\/tr><tr>"); }

rand=Math.floor(Math.random()*3)+1
b1="<td align=left"
b2="<td align=center"
b3="<td align=right"
document.writeln(eval("b"+rand));

rand=Math.floor(Math.random()*3)+1
b1="valign=top>"
b2="valign=center>"
b3="valign=bottom>"
document.writeln(eval("b"+rand));

srand=Math.floor(Math.random()*4)
if (rand <= 2) for (var i=0; i<srand; i++) document.writeln("<br>");

} // endif (vbox != 1)

}

function boxbottom(type){

// [ type ]
// 0: boxbottom  - default
// 1: iboxbottom - less images
// 2: tile background
// 5: vboxbottom - no images or space

vbox = 0;

if (type == 5) { type = 1; vbox = 1; }

var goright=Math.floor(Math.random()*2)
var godown=Math.floor(Math.random()*2)
if (type == 1) goboth = 0;

if (vbox != 1){

if (srand <= 2) for (var i=0; i<srand; i++) document.writeln("<br>");

document.writeln("<\/td>");

if (goright == 0) { document.writeln("<\/tr><tr>"); }

rand=Math.floor(Math.random()*3)+1
b1="<td align=left"
b2="<td align=center"
b3="<td align=right"
document.writeln(eval("b"+rand));

rand=Math.floor(Math.random()*3)+1
b1="valign=top>"
b2="valign=center>"
b3="valign=bottom>"
document.writeln(eval("b"+rand));

var pnum=Math.floor(Math.random()*6)+1
var bnum=Math.floor(Math.random()*5)

if ((pnum <= 3 && type != 1) || (pnum <= 2 && type == 1)){
	for (var i=1; i <= pnum; i++){
		rand=Math.floor(Math.random()*images)+1
		document.writeln("<img src=http://www.beautyinchaos.com/see\/" + I[rand] + " height=70 width=70>")
		if (i != pnum){
			for(var j=0; j<bnum-1; j++) {
				if ((godown==0 && type != 1) || (goright == 1 && type==1)) { document.writeln("<br>"); }
				else { document.writeln(" &nbsp;") }
			}
		}
	}
}

} // endif (vbox != 1)

document.write("<\/td><\/tr><\/table>");

if (goinside == 1) { document.write("<\/td><\/tr><\/table>"); }

if (gocross == 1){
if (type == 1) rand=Math.floor(Math.random()*2)+2;
else rand=Math.floor(Math.random()*4)+2;
if (goplus == 1){
document.write("</td><td width="+rbh+"></td></tr>");
document.write("<tr><td align=center valign=middle>"+fontline+plusym+"</font></td><td height="+rbh+"></td><td align=center valign=middle>"+fontline+plusym+"</font></td></tr></table>");
} else if (goboth == 1){
document.write("</td>"+tdhead(rbtcolor,rand)+" width="+rbh+"></td></tr>");
document.write("<tr>"+tdhead(rbtcolor,rand)+"></td>"+tdhead(rbtcolor,rand)+" height="+rbh+"></td>"+tdhead(rbtcolor,rand)+"</td></tr></table>");
} else if (goeven == 1) {
document.write("</td>"+tdhead(rbtcolor,rand)+" width="+rbh+"></td></tr>");
document.write("<tr><td></td>"+tdhead(rbtcolor,rand)+" height="+rbh+"></td><td></td></tr></table>");
} else {
document.write("</td><td width="+rbh+"></td></tr>");
document.write("<tr>"+tdhead(rbtcolor,rand)+"></td><td height="+rbh+"></td>"+tdhead(rbtcolor,rand)+"></td></tr></table>");
}
}

}

function font(type, face, colour){

// [ type ]
// 0: font  - default
// 1: bfont - big font
// 2: sfont - small font
// 3: tfont - tiny font

var rand=Math.floor(Math.random()*5)+1
ff1="<font face=arial"
ff2="<font face=times"
ff3="<font face=courier"
ff4="<font face=verdana"
ff5="<font face=helvetica"
if (face) document.writeln(eval("ff"+face));else document.writeln(eval("ff"+rand));

var r=Math.floor(Math.random()*16)
while (Math.abs(r-rb)<4) { r = Math.floor(Math.random()*16); }
if (colour) r = colour;
document.writeln(" color=#"+fc(r));
fcolor=fc(r);

if (type == 1) {
rand2=Math.floor(Math.random()*8)+5;
} else if (type == 2) {
rand2=Math.floor(Math.random()*2)+1;
if (rand == 2) rand2 = 2;
} else if (type == 3) {
rand2=1;
} else {
rand2=Math.floor(Math.random()*7)+2;
}

document.writeln(" size=" + rand2 + ">");

if (!(type >= 2)){
r = Math.floor(Math.random()*35);
if (r == 1) document.write("<strike>");
r = Math.floor(Math.random()*30);
if (r == 1) document.write("<i>");
r = Math.floor(Math.random()*30);
if (r == 1) document.write("<u>");
r = Math.floor(Math.random()*10);
if (r == 1) document.write("<b>");
}

}

function tail(type,stuff){

// [ type ]
// 0: tail - default
// 1: stail - stuff
// 2: ntail - stuff no href link

var r;

document.writeln("<tr><td height=20><table width=100% cellpadding=0 cellspacing=0 border=0><tr>");

if (type == 1) document.writeln("<td align=left valign=top height=20><font face=arial color=#"+tcolor+" size=1><div id=\""+stuff+"\"> &nbsp; [ "+stuff+" ] </div></font></td>");
else if (type == 2) document.writeln("<td align=left valign=top height=20><font face=arial color=#"+tcolor+" size=1> &nbsp; [ "+stuff+" ] </font></td>");

document.writeln("<td align=right valign=top height=20><font face=arial color=#"+tcolor+" size=1>");

document.writeln("[ www.beautyinchaos.com · &copy; 2008 · <a href=http://www.paulogy.com>paul grzymkowski<\/a> ] &nbsp; <\/font>");

document.writeln("</td></tr></table></td></tr></table>");


}

function fktail(type,stuff){

// [ type ]
// 0: tail - default
// 1: stail - stuff
// 2: ntail - stuff no href link

var r;

document.writeln("<tr><td height=20><table width=100% cellpadding=0 cellspacing=0 border=0><tr>");

if (type == 1) document.writeln("<td align=left valign=top height=20><font face=arial color=#"+tcolor+" size=1><div id=\""+stuff+"\"> &nbsp; [ "+stuff+" ] </div></font></td>");
else if (type == 2) document.writeln("<td align=left valign=top height=20><font face=arial color=#"+tcolor+" size=1> &nbsp; [ "+stuff+" ] </font></td>");

document.writeln("<td align=right valign=top height=20><font face=arial color=#"+tcolor+" size=1>");

document.writeln("[ www.finallyknow.com · &copy; 2008 · <a href=http://www.paulogy.com>paul grzymkowski<\/a> ] &nbsp; <\/font>");

document.writeln("</td></tr></table></td></tr></table>");


}

function track(){

// currently, google analytics...
//document.writeln('<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>');
//document.writeln('<script type="text/javascript">_uacct = "UA-935759-1";urchinTracker();</script>');

document.write('<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>');
document.write('<script type="text/javascript">_uacct = "UA-935759-1";urchinTracker();</script>');
document.write('<script>document.write("did this work?");</script>');

}


function topper(type,stuff1,stuff2){

// [type]
// 0: default
// 1: rstuff
// 2: lstuff
// 3: both
// 4: both - right is bare

document.writeln("<td height=20><table width=100% cellpadding=0 cellspacing=0 border=0><tr>");

if (type == 2 || type == 3 || type == 4) document.writeln("<td align=left valign=bottom height=20><font face=arial color=#"+tcolor+" size=1><div id=\""+stuff1+"\"> &nbsp; [ "+stuff1+" ]</div></font></td>");

if (type == 1) document.writeln("<td align=right valign=bottom height=20><font face=arial color=#"+tcolor+" size=1><div id=\""+stuff1+"\">[ "+stuff1+" ] &nbsp; </div><\/font>");
else if (type == 3) document.writeln("<td align=right valign=bottom height=20><font face=arial color=#"+tcolor+" size=1><div id=\""+stuff2+"\">[ "+stuff2+" ] &nbsp; </div><\/font>");
else if (type == 4) document.writeln("<td align=right valign=bottom height=20><font face=arial color=#"+tcolor+" size=1><div id=\""+stuff2+"\">"+stuff2+" &nbsp; </div><\/font>");

document.writeln("</td></tr></table></td></tr><tr>");

}

function doit(dest){

// special actions
var closer = 'exit, leave, away, close, quit';
closer = closer.split(', ');

var key;
var offset = Math.floor(Math.random()*ksplit.length);
var forward = Math.floor(Math.random()*2);
var desward = Math.floor(Math.random()*2);

dest = dest.toLowerCase();

for (var i = 0; i < closer.length; i++)
if (dest.indexOf(closer[i]) != -1) { window.location.href='goodbye.html'; return false; }

for (var j = 0; j < dest.length && desward == 1; j++){
for (var i = 0; i < ksplit.length && forward == 1; i++){

if (i+offset >= ksplit.length) k = i+offset-ksplit.length;
else k = i+offset;

key = ksplit[k];

if (key.length-1 >= j && key != '#' && dest.indexOf(key) != -1) { 
window.location.href=psplit[k]+".html";
return false;
}

}

for (var i = ksplit.length-1; i >= 0 && forward != 1; i--){

if (i-offset < 0) k = i-offset+ksplit.length;
else k = i-offset;

key = ksplit[k];

if (key.length-1 >= j && key != '#' && dest.indexOf(key) != -1) { 
window.location.href=psplit[k]+".html";
return false;
}

}

}

for (var j = dest.length-1; j >= 0 && desward != 1; j--){
for (var i = 0; i < ksplit.length && forward == 1; i++){

if (i+offset >= ksplit.length) k = i+offset-ksplit.length;
else k = i+offset;

key = ksplit[k];

if (key.length-1 >= j && key != '#' && dest.indexOf(key) != -1) { 
window.location.href=psplit[k]+".html";
return false;
}

}

for (var i = ksplit.length-1; i >= 0 && forward != 1; i--){

if (i-offset < 0) k = i-offset+ksplit.length;
else k = i-offset;

key = ksplit[k];

if (key.length-1 >= j && key != '#' && dest.indexOf(key) != -1) { 
window.location.href=psplit[k]+".html";
return false;
}

}

}

window.location.href='pain.html';

return false;
}

function chatbot(dest, bottalk, usertalk){

// special actions

var closer = 'exit, leave, away, close, quit';
closer = closer.split(', ');

var greet2 = new Array("how's it going?", "what's up?", "what have you been up to?");

if (bottalk == 1) {
rand = Math.floor(Math.random()*greet2.length);
return greet2[rand];
}

var key;

dest = dest.toLowerCase();

for (var i = 0; i < closer.length; i++)
if (dest.indexOf(closer[i]) != -1) { return 'goodbye.html'; }

for (var j = dest.length-1; j >= 0; j--)
for (var i = 0; i < ksplit.length; i++){

key = ksplit[i];

if (key.length-1 >= j && key != '#' && dest.indexOf(key) != -1) { 
return psplit[i]+".html?";
}

}

return 'pain.html?';

}


function writeall(w,type){

// [ type ]
// 0: letter - default
// 1: list

var lindex = new Array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
var pprev;

if (!type) document.writeln("<td align=left valign=top>");
else document.writeln("<td align=center valign=top>");

if (!type){
var rand=Math.floor(Math.random()*5)+1
ff1="<font face=arial"
ff2="<font face=times"
ff3="<font face=courier"
ff4="<font face=verdana"
ff5="<font face=helvetica"
document.writeln(eval("ff"+rand));

var r=Math.floor(Math.random()*16)
while (Math.abs(r-rb)<3) { r = Math.floor(Math.random()*16); }
document.writeln("color=#"+fc(r));
fcolor=fc(r);

rand=Math.floor(Math.random()*5)+2
document.writeln("size=" + rand + ">");

document.writeln(""+lindex[w].toUpperCase()+"</font><br>");
}

pprev = '';

for (var i = 0; i < ksplit.length; i++){
if (psplit[i].substring(0,1) == lindex[w] && psplit[i] != pprev){
if (type) document.writeln("<font size=2><a href="+psplit[i]+".html target=main>"+psplit[i]+"</a></font><br>");
else document.writeln("<font size=2><a href="+psplit[i]+".html>"+psplit[i]+"</a></font><br>");
pprev = psplit[i];
}
}

document.writeln("</td>");

}


function writename(w){

var lindex = new Array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
var warray = new Array();
var pprev;
var lnum = 0;
var lstart;

/*
var rand=Math.floor(Math.random()*5)+1
ff1="<font face=arial"
ff2="<font face=times"
ff3="<font face=courier"
ff4="<font face=verdana"
ff5="<font face=helvetica"
document.writeln(eval("ff"+rand));

var r=Math.floor(Math.random()*16)
while (Math.abs(r-rb)<3) { r = Math.floor(Math.random()*16); }
document.writeln("color=#"+fc(r));
fcolor=fc(r);

rand=Math.floor(Math.random()*5)+2
document.writeln("size=" + rand + ">");

document.writeln(""+lindex[w].toUpperCase()+"</font><br>");
*/

pprev = '';

for (var i = 0; i < ksplit.length; i++){
if (psplit[i].substring(0,1) == lindex[w] && psplit[i] != pprev && ksplit[i].indexOf('#') == -1){
warray[lnum] = psplit[i];
lnum++;
pprev = psplit[i];
}
}

if (lnum > 0){
rand = Math.floor(Math.random()*lnum);
document.write("<a href="+warray[rand]+".html class='bigtext'>"+lindex[w].toUpperCase()+"</a>");
} else document.write(""+lindex[w].toUpperCase());


}

function clink(str){

var strsplit = str.split(' ');
var word = "";
var windex;
var retstr = "";
var addstr = "";
var offset = Math.floor(Math.random()*ksplit.length);
var divisor = Math.floor(Math.random()*100)+1;
var saturation = (strsplit.length/divisor)+3;

for (var i = 0; i < strsplit.length; i++){

addstr = "" + strsplit[i] + " ";

/*
windex = keys.indexOf(strsplit[i].toLowerCase());

if (windex != -1){

word = "";
for (var j = windex; pages.charAt(j) != ','; j++)
word += "" + pages.charAt(j);

addstr = " <a href='"+word+".html'>"+strsplit[i]+"</a>";

}
*/

word = strsplit[i].toLowerCase();
rand = Math.floor(Math.random()*saturation);
forward = Math.floor(Math.random()*2);

for (var j = 0; j < ksplit.length && rand == 1 && forward == 1; j++){

if (j+offset >= ksplit.length) k = j+offset-ksplit.length;
else k = j+offset;

key = ksplit[k];

if (key != '#' && word.indexOf(key) != -1) addstr = "<a href='"+psplit[k]+".html'>"+strsplit[i]+"</a> ";


}
for (var j = ksplit.length-1; j >= 0 && rand == 1 && forward != 1; j--){

if (j-offset < 0) k = j-offset+ksplit.length;
else k = j-offset;

key = ksplit[k];

if (key != '#' && word.indexOf(key) != -1) addstr = "<a href='"+psplit[k]+".html'>"+strsplit[i]+"</a> ";


}


retstr += ""+addstr;

}

return retstr;

}


var dictionary = new Array();
var wordsbytype = new Array();
var wordstructs = new Array();
var currplur = -1; // plurality/tense
var article = 0; // an article (a/an) is desired

function Word(tag, types, num, vum, art, bias, link, like)
{
	this.tag = tag;		// the word itself

	this.type = new Array();

	var typesplit = types.split(',');

	var numsplit = num.split('+');
	var vumsplit = vum.split('+');

	tsplit = "";

	for (var i = 0; i < typesplit.length; i++){

		tsubsplit = typesplit[i].split('+');
		tsplit = ""; asplit = "";
		for (var j = 0; j < tsubsplit.length; j++){

			// partners: verb+inf+des => verb, verb+inf, verb+des

			if (j == 0) tsplit = tsubsplit[0];
			else tsplit = tsubsplit[0] + "+" + tsubsplit[j];

			if (tsplit.substring(0,1) == " ") tsplit = tsplit.substring(1,tsplit.length);
 
			this.type[tsplit] = 1;
                	wtpush(tsplit,this);

			if (tsplit.indexOf("verb") != -1)
				for (var k = 0; k < vumsplit.length; k++) { wtpush(tsplit+"+"+vumsplit[k],this); }
			else
				for (var k = 0; k < numsplit.length; k++) { wtpush(tsplit+"+"+numsplit[k],this); }
			

			// accumulate: verb+inf+des => verb, verb+inf, verb+inf+des

			if (j == 0) asplit = tsubsplit[0];
			else asplit = asplit + "+" + tsubsplit[j];

			if (asplit.substring(0,1) == " ") asplit = asplit.substring(1,asplit.length);
 
			this.type[asplit] = 1;
                	wtpush(asplit,this);

			if (tsplit.indexOf("verb") != -1)
				for (var k = 0; k < vumsplit.length; k++) { wtpush(asplit+"+"+vumsplit[k],this); }
			else 
				for (var k = 0; k < numsplit.length; k++) { wtpush(asplit+"+"+numsplit[k],this); }
			

		}


	}

	this.num = num;		
	this.vum = vum;	
	this.art = art;		// 0: a, 1: an
	this.bias = bias;	// 1: bad, 5: good, 3&0: neutral
	this.link = link;	// 1: link, 0: no link

	this.like = like;	// other words this word is like

	this.letter = tag.substring(0,1);
	this.size = tag.length;

	dictionary[this.tag] = this;
}

function Wstruct(tag, type, end)
{
	this.tag = tag;	
	this.type = type;
        this.end = end;	
        if (wordstructs[type] == undefined) { wordstructs[type] = new Array(); wordstructs[type][0] = this; } 
	else { wordstructs[type][wordstructs[type].length] = this; }
}

function wtpush(wtype,word){

     if (wordsbytype[wtype] == undefined) { wordsbytype[wtype] = new Array(); wordsbytype[wtype][0] = word; }
     else { wordsbytype[wtype][wordsbytype[wtype].length] = word; }

}

function w(wtype,opt,flag){

   art = "";

   x = Math.floor(Math.random()*(opt+1));

   if (wordsbytype[wtype] == undefined || x) return "";
   else { 

        x = wordsbytype[wtype].length;
        y = Math.floor(Math.random()*x);
        z = Math.floor(Math.random()*2); // 50%

        if (wtype == "noun")
           if (flag == 3 && wordsbytype[wtype][y].num == 1) { art = "the "; }
           else if (flag == 3 && wordsbytype[wtype][y].num != 1 && z) { art = "the "; }
                else if (flag == 4 && wordsbytype[wtype][y].num == 1) 
                     if (wordsbytype[wtype][y].art) { art = "an "; }
                     else { art = "a ";}


        return " " + wordsbytype[wtype][y].tag;
   }   
}


// word type selection with plurality
function wp(wtype,opt){

  if (wtype == "a" || wtype == "an") { article = 1; currplur = 3; return ""; }

  if (wtype.indexOf("adj") != -1 || wtype.indexOf("adv") != -1 || (wtype.indexOf("inf") != -1) ||
     wtype.indexOf("prep") != -1 || wtype.indexOf("prob") != -1 ) { theplur = currplur; currplur = 0; }

  front = "";

   if (currplur <= 0) {		// set it

	if (wtype == "noun") wtype = "noun+2";

	if (wordsbytype[wtype] == undefined) { oldplur = currplur; currplur = -1; return "["+wtype+oldplur+"]"; }
	x = Math.floor(Math.random()*wordsbytype[wtype].length);

	if (wtype.indexOf("verb") != -1) nsplit = wordsbytype[wtype][x].vum.split('+');
	else nsplit = wordsbytype[wtype][x].num.split('+');

	y = Math.floor(Math.random()*nsplit.length);
	currplur = nsplit[y];

	link = wordsbytype[wtype][x].link;
	art = wordsbytype[wtype][x].art;
	tag = "" + wordsbytype[wtype][x].tag; // + currplur;

   } else {			// seek it

	ntype = wtype+"+"+currplur;
	if (wordsbytype[ntype] == undefined) {
		ntype = wtype+"+0";
		if (wordsbytype[ntype] == undefined) { oldplur = currplur; currplur = -1; return "["+wtype+oldplur+"]"; }
	}
	x = Math.floor(Math.random()*wordsbytype[ntype].length);

	if (ntype.indexOf("noun") != -1) {
		nsplit = wordsbytype[ntype][x].num.split('+');
		y = Math.floor(Math.random()*nsplit.length);
		currplur = nsplit[y];
	} else currplur = 0;

	link = wordsbytype[ntype][x].link;
	art = wordsbytype[ntype][x].art;
	tag = "" + wordsbytype[ntype][x].tag; // + currplur;
   }   

  if (wtype.indexOf("adj") != -1 || wtype.indexOf("adv") != -1 || (wtype.indexOf("inf") != -1) ||
     wtype.indexOf("prep") != -1 || wtype.indexOf("prob") != -1 ) { currplur = theplur; }

  // add article
  if (article == 1){
     if (art == 1) front = " an";
     else front = " a";
     article = 0;
  }

  // link it
  if (link == 1){
     x = Math.floor(Math.random()*4)+2;
     y = Math.floor(Math.random()*x);

     if (y == 1) {
        return front + " <a href="+tag+".html>"+tag+"</a>";
     }
  }

//   return front + " " + tag + currplur;
     return front + " " + tag;

}

punct = ".,?!:;-][()}{";

// word search by struct
function ws(phrasein,opt,clear){

   var phraseout = "";

   if (phrasein == "") return phraseout;

   var wphrase = phrasein.split(' ');
   var frontchar = wphrase[0].charAt(0);
   var backchar = wphrase[0].charAt(wphrase[0].length-1);

   if (frontchar == "<") phraseout = phraseout + ws(wphrase[0].substring(1,wphrase[0].length),1,0);
   else if (punct.indexOf(backchar) != -1) phraseout = phraseout + ws(wphrase[0].substring(0,wphrase[0].length-1),opt) + backchar;
   else phraseout = phraseout + wp(wphrase[0],opt);
   
   return phraseout + ws(phrasein.substring(wphrase[0].length+1,phrasein.length),0);
}

// sentence maker
function rs(type,num){

   var outtext = "";
   var x = 0;

   for (i = 0; i < num; i++) {
   	x = Math.floor(Math.random()*wordstructs[type].length);
	currplur = -1;
        if (num == 1 && wordstructs[type][x].end == ".") outtext = outtext + "  " + ws(wordstructs[type][x].tag,0);
        else outtext = outtext + "  " + ws(wordstructs[type][x].tag,0) + wordstructs[type][x].end;
   }

   return outtext;

}


// WORDS IN CHAOS //

// var human;  noun = human + computer + "words, etc."?
// var nouns

// themes
var nounhuman = "ankle, arm, artery, body, brain, breast, cheek, chest, chin, ear, eardrum, earlobe, elbow, eye, eyebrow, eyelash, eyelid, finger, fingernail, foot, hair, hand, head, heart, intestine, jaw, kidney, knee, kneecap, leg, lip, lung, mouth, neck, nipple, nose, nostril, organ, penis, pupil, rib, ribcage, skull, spine, spinal chord, shoulder, shoulderblade, spleen, stomach, testicle, throat, toe, toenail, tooth, tongue, urine, uterus, vagina, vein, vertebrae";

 var adjcolor = "black, blue, brown, gray, green, orange, pink, purple, red, white, yellow";

 var noun = "blanket, couch, fire, lamp, light, pillow, spatula, television, table, water, " + nounhuman;

 var verb = "beat, destroy, eviscerate, hurt, kill, lacerate, maime, murder, puncture, rape, rupture, shoot, stab, torture";

 var adj = "abnoxious, angelic, annoying, bad, beautiful, bizarre, bouncy, boring, charred, chilled, cold, comfortable, damp, dark, diagonal, dirty, eternal, external, fake, filthy, fluffy, fuzzy, ghostly, glowing, good, grainy, greasy, grimy, groggy, heavy, horizontal, horrible, indeterminate, intangible, internal, luminous, loud, moist, numb, outstretched, plastic, quiet, sharp, silent, slimy, slippery, smart, smelly, smooth, soft, strange, stupid, supple, swirling, tangential, tangible, terrible, vast, velvet, vertical, warm, weird, wet, " + adjcolor;

 var adv = "absurdly, badly, beautifully, boldly, keenly, poorly";

nounhuman = nounhuman.split(', ');
adjcolor = adjcolor.split(', ');

noun = noun.split(', ');
verb = verb.split(', ');
adj = adj.split(', ');
adv = adv.split(', ');

function proppart(){

// produces propositional present participle phrase prefixes
// ... seeing what i've been working on?"

// do you want to hear a poem now, Paul?
// [ prefix ] [ action ] [ obj ] [ time ], [ Target ]

//do you

//feel like

x = 0;

}

function propinf(){

// produces propositional infinitive phrase prefixes
// "... see what i've been working on?"

var str = "";
var r = 0;

// prefix
r = Math.floor(Math.random()*6);

switch(r){
case 0: { str += "want to "; break; }
case 1: { str += "do you want to "; break; }
case 2: { str += "think you want to "; break; }
case 3: { str += "would you like to "; break; }
case 4: { str += "wanna "; break; }
case 5: { str += "care to "; break; }
default:
}

// infinitive splitter
r = adv.length;

if (r < adv.length) str += adv[r] + " ";

return str;
}

function soundbox(target){ 

var myCookie = new Cookie(document,"song",1);
if (!myCookie.read() || myCookie.song != target){
myCookie.song = target; myCookie.write();
soundwin = window.open(target,'soundwin','width=200,height=200,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no, resizable=no');
} 
}

function pbox(target,name,wid,hei){ 
if (!name) name="box";
if (!wid) wid=200;
if (!hei) hei=200;
window.open(target,name,'width='+wid+',height='+hei+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no, resizable=no');
}

function sbox(target,name,wid,hei){ 
if (!name) name="box";
if (!wid) wid=200;
if (!hei) hei=200;
window.open(target,name,'width='+wid+',height='+hei+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no, resizable=yes');
}

function swapentry(A, B, count){
var s1 = Math.floor(Math.random()*A.length);
var s2 = Math.floor(Math.random()*A.length);

var tswap = A[s1];
A[s1] = A[s2];
A[s2] = tswap;

tswap = B[s1];
B[s1] = B[s2];
B[s2] = tswap;

count--;

if (count > 0) swapentry(A, B, count);
}

function tablentry(tdline, id, dest, img1, img2, fcolor, txt){

document.write(tdline);
document.write('<a href="'+dest+'" target="new" class="xlink"');
document.write('onmouseover="document.'+id+'.src=\'see/'+I[img2]+'\'" onmouseout="document.'+id+'.src=\'see/'+I[img1]+'\'"');
document.write('><img src=see/'+I[img1]+' border=0 name="'+id+'" height=70 width=70></a><br>');
document.writeln('<font color=#'+fcolor+'>');
document.writeln(txt+'<br></font></td>');
}

function innerwrite(place, stuff){

if(document.all){
     document.getElementById(place).innerHTML = stuff;
} else{
     document.getElementById(place).innerHTML = stuff;
}

}

function decwrite(place, dec, sel, typ){

var respwidth = Math.floor(Math.random()*200)+300;
var respheight = Math.floor(Math.random()*500)+100;

respwidth = 325; //290 min
respheight = 325;

stuff = "";

stuff = stuff + '<iframe name="dectalkbox" src="http://www.beautyinchaos.com/cgi-bin/dectalk.cgi?title='+dec+'&backcolor='+fc(rbt)+'&typ='+typ+'" width="'+respwidth+'" height="'+respheight+'" align="center" border=0></iframe>';

stuff = stuff + '<form onSubmit="user.read(); user.dectalk++; user.write();" method=POST action="http://www.beautyinchaos.com/cgi-bin/know.cgi">';
stuff = stuff + '<table border=0 cellspacing=3><tr><td align=left><font color=#'+fcolor+'><input name="name" size=13><br>name</td>';
stuff = stuff + '<td align=left><font color=#'+fcolor+'><input name="mail" size=20><br>email</td></tr>';
stuff = stuff + '<tr><td colspan=2 align=left><font color=#'+fcolor+'><textarea wrap=virtual name="comments" cols=30 rows=5></textarea><input name="title" type=hidden value="'+dec+'"><input name="location" type=hidden value="know.html"><input name="typ" type=hidden value='+typ+'><input name="sel" type=hidden value="'+sel+'"></td></tr>';
stuff = stuff + '<tr><td align=left valign=top><font color=#'+fcolor+'>comment</td><td align=right><input type="reset" value="clear"><input type="submit" value="submit" onclick="page.read(); page.decpath=num+\'.\'+page.decpath; page.write();"></td></tr></table></form>';


if(document.all){
     document.getElementById(place).innerHTML = stuff;
} else{
     document.getElementById(place).innerHTML = stuff;
}

}

function decbar(){
  
  retstring = ' &nbsp; [ ';
  retstring += '<a href=http://www.finallyknow.com target=_top onmouseover="window.status=\'[ finally know ]\';return true" onMouseOut="window.status=\'\';return true">home</a> · ';
  retstring += '<a href=http://www.beautyinchaos.com/know-about.html OnClick="sbox(\'http://www.beautyinchaos.com/know-about.html\',\'about\',450,625); return false;" onmouseover="window.status=\'[ about ]\';return true" onMouseOut="window.status=\'\';return true">about</a> · ';
  retstring += '<a href=http://www.beautyinchaos.com/cgi-bin/knowsearch.cgi onmouseover="window.status=\'[ search questions ]\';return true" onMouseOut="window.status=\'\';return true">search</a> · ';

  retstring += '<a href=http://www.beautyinchaos.com/cgi-bin/knowbrowse.cgi  onmouseover="window.status=\'[ browse comments ]\';return true" onMouseOut="window.status=\'\';return true">browse</a> · ';

  retstring += '<a href=http://www.beautyinchaos.com/know-recent.html onmouseover="window.status=\'[ recent updates ]\';return true" onMouseOut="window.status=\'\';return true"><u>recent</u></a> · ';

  retstring += '<a href=http://www.beautyinchaos.com/know-suggest.html  onmouseover="window.status=\'[ suggest ]\';return true" onMouseOut="window.status=\'\';return true">suggest</a> · ';
  retstring += '<a href=http://www.beautyinchaos.com/know-respond.html  onmouseover="window.status=\'[ respond ]\';return true" onMouseOut="window.status=\'\';return true">respond</a> · ';
//retstring += '<a href=http://www.beautyinchaos.com/cgi-bin/decision-all.cgi>all</a> · ';
  retstring += '<a href=http://www.beautyinchaos.com target=_chaos  onmouseover="window.status=\'[ there can be great beauty in chaos ]\';return true" onMouseOut="window.status=\'\';return true">chaos</a>';
  retstring += ' ]';

  return retstring;

}


function fklinkbar(){

  retstring = '';

//  retstring += '<a href=http://digg.com/submit?phase=2&url=http%3A//www.finallyknow.com&title=Finally%20know%20the%20answer%20to%20all%20of%20life%27s%20questions...%20well%2C%20almost.&bodytext=Hundreds%20of%20questions%2C%20from%20the%20profound%20to%20the%20absurd%2C%20have%20heretofore%20gone%20unanswered.%20That%20is%2C%20until%20now.%20The%20site%20finallyknow.com%20is%20one%20engineer%27s%20approach%20to%20better%20understanding%20life%2C%20love%2C%20faith%2C%20sex%2C%20psychology%2C%20sociology%2C%20and%20grilled%20cheese%20sandwiches%2C%20through%20a%20series%20of%20multiple-choice%20questions.&topic=offbeat_news target=_digg>';
  retstring += '<a href=http://www.digg.com/offbeat_news/Finally_know_the_answer_to_all_of_life_s_questions_well_almost target=_digg>';
  retstring += '<img src="http://digg.com/img/badges/16x16-digg-guy.gif" width="16" height="16" border="0" alt="Digg This!">';
  retstring += '</a> &nbsp; ';


  retstring += ' <a href="http://del.icio.us/post" onclick="window.open(\'http://del.icio.us/post?v=4&noui&jump=close&url=http://www.finallyknow.com&title=Finally%20know%20the%20answer%20to%20all%20of%20life%27s%20questions...%20well%2C%20almost.&notes=Hundreds%20of%20questions%2C%20from%20the%20profound%20to%20the%20absurd%2C%20have%20heretofore%20gone%20unanswered.%20That%20is%2C%20until%20now.%20The%20site%20finallyknow.com%20is%20one%20engineer%27s%20approach%20to%20better%20understanding%20life%2C%20love%2C%20faith%2C%20sex%2C%20psychology%2C%20sociology%2C%20and%20grilled%20cheese%20sandwiches%2C%20through%20a%20series%20of%20multiple-choice%20questions.\', \'delicious\',\'toolbar=no,width=700,height=400\'); return false;">';
  retstring += '<img src=http://www.beautyinchaos.com/know/ad/delicious.gif height=14 width=14 border=0 alt="add to del.icio.us"></a> &nbsp; ';

  retstring += ' <a href="http://www.stumbleupon.com/submit?url=http://www.beautyinchaos.com/cgi-bin/know.cgi" target=_su><img src=http://www.stumbleupon.com/images/stumbleit.gif border=0 height=14 width=14 alt="StumbleUpon"></a> &nbsp; ';

  return retstring;

}

function bragbar(){

  retstring = '';

  retstring += '<a href=http://www.digg.com/submit target=_digg>';
  retstring += '<img src="http://digg.com/img/badges/16x16-digg-guy.gif" width="16" height="16" border="0" alt="Digg This!">';
  retstring += '</a> &nbsp; ';


  retstring += ' <a href="http://del.icio.us/post" target=_delicious>';
  retstring += '<img src=http://www.beautyinchaos.com/know/ad/delicious.gif height=14 width=14 border=0 alt="add to del.icio.us"></a> &nbsp; ';

  return retstring;

}

function bragbar2(){

  retstring = '';
  retstring += '<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>';
  return retstring;

}


function bsearch(terms){

  respwidth = 325;
  respheight = 325;

  stuff = "";

  stuff = stuff + '<iframe name="sboxframe" id="sboxframe" src="http://www.beautyinchaos.com/cgi-bin/knowsbox.cgi?searchterms='+terms+'&backcolor='+rbt+'" width="'+respwidth+'" height="'+respheight+'" align="center" frameborder=0></iframe>';

  document.getElementById('sbox').innerHTML = stuff;

  return false;

}

function bcomm(dec,typ,terms,qstring){

  respwidth = 325;
  respheight = 325;

  stuff = "";

  stuff = stuff + '<iframe name="dectalkbox" id="dectalkbox" src="http://www.beautyinchaos.com/cgi-bin/dectalk.cgi?title='+dec+'&backcolor='+fc(rbt)+'&typ='+typ+'" width="'+respwidth+'" height="'+respheight+'" align="center" frameborder=0></iframe>';

  cstuff = "";

  cstuff = cstuff + '<form onSubmit="user.read(); user.dectalk++; user.write();" method=POST action="http://www.beautyinchaos.com/cgi-bin/knowbrowse.cgi">';
  cstuff = cstuff + '<table border=0 cellspacing=3><tr><td align=left><font color=#'+fcolor+'><input name="name" size=13><br>name</td>';
  cstuff = cstuff + '<td align=left><font color=#'+fcolor+'><input name="mail" size=20><br>email</td></tr>';
  cstuff = cstuff + '<tr><td colspan=2 align=left><font color=#'+fcolor+'><textarea wrap=virtual name="comments" cols=30 rows=5></textarea><input name="title" type=hidden value="'+dec+'"><input name="location" type=hidden value="cgi-bin/knowbrowse.cgi"><input name="typ" type=hidden value='+typ+'></td><input name="terms" type=hidden value="'+terms+'"></td></tr>';
  cstuff = cstuff + '<tr><td align=left valign=top><font color=#'+fcolor+'>comment</td><td align=right><input type="reset" value="clear"><input type="submit" value="submit" ></td></tr></table></form>';

  if (typ == 4) linkstuff = '<a href=http://www.beautyinchaos.com/cgi-bin/know.cgi?o='+dec+' target=_fkvote><b>+</b></a>';
  else linkstuff = '<a href=http://www.beautyinchaos.com/cgi-bin/know.cgi?d='+dec+' target=_fkvote><b>+</b></a>';

  parent.document.getElementById('bquest').innerHTML = unescape(qstring) + " " + linkstuff;
  parent.document.getElementById('cbox').innerHTML = stuff;
  parent.document.getElementById('badd').innerHTML = cstuff;

  return false;

}