function go() {
initialize();
getWindowsize();
d = document.getElementById('preload');
s = unescape('<div style="left:'+((document.windowX/2)-230)+'px; top:'+((document.windowY/2)+30)+'px; width:460px; height:116px; text-align:center; color:000000; visibility:inherit;">You are now entering www.kenjitoyooka.com.<br><br>This site requires that javascript be turned on for your browser.  Please choose one of the two options displayed above, based on your computer%27s performance.</div>'); 
s = s+unescape('<div style="left:0px; top:0px; width:1px; height:1px; color:FFFFFF; visibility:hidden;"><img src="images/simple_on.gif"><img src="images/fancy_on.gif"></div>'); 
s = s+unescape('<div style="left:'+((document.windowX/2)-132)+'px; top:'+((document.windowY/2)-120)+'px; width:125px; height:116px; background-image:url(images/simple_off.gif); color:FFFFFF; visibility:inherit; cursor:pointer;" onMouseOver="this.style.backgroundImage = %27url(images/simple_on.gif)%27;" onMouseOut="this.style.backgroundImage = %27url(images/simple_off.gif)%27;" onClick="simple();");"></div>'); 
s = s+unescape('<div style="left:'+((document.windowX/2)+18)+'px; top:'+((document.windowY/2)-120)+'px; width:125px; height:116px; background-image:url(images/fancy_off.gif); color:FFFFFF; visibility:inherit; cursor:pointer;" onMouseOver="this.style.backgroundImage = %27url(images/fancy_on.gif)%27;" onMouseOut="this.style.backgroundImage = %27url(images/fancy_off.gif)%27;" onClick="fancy();");"></div>'); 
d.innerHTML = s;
}



function initialize() {
document.EDIT = 0;
document.EDITbutton = '';
document.windowX = 0;
document.windowY = 0;
document.limx_bottom = -2;
document.limx_top = 2;
document.limy_bottom = -2;
document.limy_top = 2;
document.scrolling = 0;
document.openwindow = 0;
document.big = 0;
document.x = 0;
document.y = 0;
document.oldx = 0;
document.oldy = 0;
document.scrollx = 0;
document.scrolly = 0;
document.scrollmousex = 0;
document.scrollmousey = 0;
document.ondragstart = function () { return false; };  
document.onselectstart = function () { return false; };
document.preloaded = 0;
document.preload_target = 0;
document.preload_image = new Array(40);
document.on_preload_f = '';
document.textpage = 0;

document.shapism_current = '0';

document.popupx = 0;
document.popupy = 0;
document.popup = 0;

document.move_to = 0;
}





function simple() {
d = document.getElementById('main');
d.style.width = "783px";
d.style.height = "551px";
d.style.left = "50%";
d.style.top = "10";
d.style.marginLeft = "-391px";
d.style.backgroundImage = "url(images/window4.jpg)";
document.body.style.overflow = "scroll";

s = '';
s = s + '<div style="left:300; top:0; width:182; height:34; background-image:url(images/kenjitoyooka.gif)"></div>';
s = s + '<div style="left:260; top:240; width:383; height:50;">Sorry, the simple version is still under construction.</div>';
art = document.getElementById('ART');



d.innerHTML = s;

for (ix=document.limx_bottom; ix<=document.limx_top; ix++)
for (iy=document.limy_bottom; iy<=document.limy_top; iy++) {
  if (document.getElementById('T'+ix+','+iy)) {
    document.getElementById('T'+ix+','+iy).innerHTML = '';
  }
}

document.getElementById('preload').style.visibility = "hidden";
}





function fancy() {
preload_clear(0);

preload_image('images/window1.jpg');
preload_image('images/window2.jpg');
preload_image('images/window3.jpg');
preload_image('images/links_on.gif');
preload_image('images/news_on.gif');
preload_image('images/email_on.gif');

d = document.getElementById('main');
s = '';

for (ix=document.limx_bottom; ix<=document.limx_top; ix++)
for (iy=document.limy_bottom; iy<=document.limy_top; iy++) {
  s = s + unescape('<div id="'+ix+','+iy+'" onMouseDown="scroll()" onMouseUp="stopscroll()" unselectable="on" overflow="visible" onClick="document.move_to = 0;" onDblClick="if (document.move_to == 0) { document.move_to = 1; } else { document.move_to = 0; }"');
  s = s + unescape('style="cursor:move; width:500px; height:500px; left:'+((ix*500)+document.screencenterx-250)+'px; top:'+((iy*500)+document.screencentery-250)+'px; visibility:visible;">');

  s = s + unescape('<div id="I'+ix+','+iy+'"');
  s = s + unescape('style="width:500px; height:500px; left:0px; top:0px; backgroundattachment:fixed; visibility:visible; background-Image:url(images/pane_'+ix+'_'+iy+'.jpg);" unselectable="on"></div>');
  preload_image('images/pane_'+ix+'_'+iy+'.jpg');

  if (document.getElementById('T'+ix+','+iy)) {
    s = s + unescape(document.getElementById('T'+ix+','+iy).innerHTML);
    document.getElementById('T'+ix+','+iy).innerHTML = '';
  }

  s = s + unescape('<div id="B'+ix+','+iy+'"');
  s = s + unescape('style="cursor:move; z-index:300; width:500px; height:500px; left:0px; top:0px; visibility:hidden;" unselectable="on" onClick="window_click();"></div>');

  s = s + unescape('</div>');
}

s = s + unescape('<div id="popup" onMouseDown="scroll()" onMouseUp="stopscroll()" unselectable="on" overflow="hidden" style="cursor:move; z-index:200; visibility:hidden;">');
s = s + unescape('<div id="popup_image" onMouseDown="scroll()" onMouseUp="stopscroll()" unselectable="on" overflow="hidden" style="visibility:inherit;"></div>');
s = s + unescape('<div id="popup_buttons" onMouseDown="scroll()" onMouseUp="stopscroll()" unselectable="on" overflow="hidden" style="visibility:inherit;"></div>');
s = s + unescape('<div id="popup_text" onMouseDown="scroll()" onMouseUp="stopscroll()" unselectable="on" overflow="hidden" style="visibility:inherit; height:10;"></div>');
s = s + unescape('</div>');

d.innerHTML = d.innerHTML + s;

for (i=0; i<document.all.length; i++) {
  document.all(i).unselectable = "on";
}
set_opacity(document.getElementById('popup'),0);

initialize_shapism();

preload('');
}








function getWindowsize(){
if (window.innerHeight) {
  document.windowX = window.innerWidth;
  document.windowY = window.innerHeight;
} else
if (document.documentElement.clientHeight) {
  document.windowX = document.documentElement.clientWidth;
  document.windowY = document.documentElement.clientHeight;
} else {
  document.windowX = document.body.clientWidth;
  document.windowY = document.body.clientHeight;
}
document.screencenterx = Math.floor(document.windowX/2);
document.screencentery = Math.floor(document.windowY/2);
}





function getMouseX(e){
posx=0;
var ev=(!e)?window.event:e;//IE:Moz
if (ev.pageX){//Moz
  posx=ev.pageX+window.pageXOffset;
}
else if(ev.clientX){//IE
  if(document.documentElement){ //IE 6+ strict mode
    posx = ev.clientX + document.documentElement.scrollLeft;
  }
  else if(document.body){ //Other IE
    posx = ev.clientX + document.body.scrollLeft;
  }
}

return posx;
}





function getMouseY(e){
posy=0;
var ev=(!e)?window.event:e;//IE:Moz
if (ev.pageX){//Moz
posy=ev.pageY+window.pageYOffset;
}
else if(ev.clientX){//IE

if(document.documentElement){//IE 6+ strict mode
posy = ev.clientY + document.documentElement.scrollTop;
}
else if(document.body){//Other IE
posy = ev.clientY + document.body.scrollTop;
}
}

return posy;
}





function scroll() {
document.scrolling = 1;
document.openwindow = 1;
}




function stopscroll() {
document.scrolling = 0;
if (document.big == 0) { 
  document.getElementById('shapism').style.visibility = "visible";
  document.getElementById('shapism').style.left = document.screencenterx+document.x-1250;
  document.getElementById('shapism').style.top = document.screencentery+document.y+250;
}
}





function pos(n) {
if (n < 0) return -n;
return n;
}




function track(e) {
getWindowsize();

if ((!document.scrolling) && (document.move_to == 0)) {
  document.scrollmousex = getMouseX(e); //window.event.clientX;
  document.scrollmousey = getMouseY(e); //window.event.clientY;
  document.scrollx = document.x;
  document.scrolly = document.y;
} else {
  tempx = (getMouseX(e)-document.scrollmousex);
  tempy = (getMouseY(e)-document.scrollmousey);
  if ((pos(tempx) > 2) || (pos(tempy) > 2)) { document.openwindow = 0; } else { document.getElementById('shapism').style.visibility = "hidden"; }
  document.x = document.scrollx + (tempx*pos(tempx))/400+(tempx/2);
  document.y = document.scrolly + (tempy*pos(tempy))/400+(tempy/2);

  if (document.x > -((document.limx_bottom*500)+document.screencenterx-300)) { document.x = -((document.limx_bottom*500)+document.screencenterx-300) }
  if (document.x < -((document.limx_top*500)-document.screencenterx+300)) { document.x = -((document.limx_top*500)-document.screencenterx+300) }
  if (document.y > -((document.limy_bottom*500)+document.screencentery-300)) { document.y = -((document.limy_bottom*500)+document.screencentery-300) }
  if (document.y < -((document.limy_top*500)-document.screencentery+300)) { document.y = -((document.limy_top*500)-document.screencentery+300) }
  for (itx=document.limx_bottom; itx<=document.limx_top; itx++)
  for (ity=document.limy_bottom; ity<=document.limy_top; ity++) {
    d = document.getElementById(itx+","+ity);
    d.style.left = (itx*500)+document.screencenterx+document.x-250;
    d.style.top = (ity*500)+document.screencentery+document.y-250;
  }

  d = document.getElementById('popup');
  if (get_opacity(d) > 0) {
    winx = document.screencenterx+(document.x*1.4)-250;
    winy = document.screencentery+(document.y*1.4)-250;
    d.style.left = document.popupx + winx;
    d.style.top = document.popupy + winy;
  }

}
}





function move_to() {
close_popup();

}





function set_opacity(i,n) {

css3 = false;
moz = false;
ie = false;
if (!(typeof(i.style.opacity) == "undefined")) css3 = true; 
if (!(typeof(i.style.MozOpacity) == "undefined")) moz = true; 
if (!(typeof(i.filters) == "undefined")) if (!(typeof(i.filters.alpha) == "undefined")) if (!(typeof(i.filters.alpha.opacity) == "undefined")) ie = true;
if (css3 && !ie) i.style.opacity = n/100;
if (moz) i.style.MozOpacity = n/100;
if (ie) i.filters.alpha.opacity = n;
}





function get_opacity(i) {

css3 = false;
moz = false;
ie = false;

if (!(typeof(i.style.opacity) == "undefined")) css3 = true; 
if (!(typeof(i.style.MozOpacity) == "undefined")) moz = true; 
if (!(typeof(i.filters) == "undefined")) if (!(typeof(i.filters.alpha) == "undefined")) if (!(typeof(i.filters.alpha.opacity) == "undefined")) ie = true;
if (css3 && !ie) return (i.style.opacity*100);
if (moz) return (i.style.MozOpacity*100);
if (ie) return (i.filters.alpha.opacity);
}






function fade_in(n,x1,y1,x2,y2,divname) {
n = n + 15;
if (n > 100) { n = 100; }

if (divname != '') {
  d = document.getElementById(divname);
  set_opacity(d,n);
  d.style.visibility = 'visible';
} else {
  for (ix=x1; ix<=x2; ix++)
  for (iy=y1; iy<=y2; iy++) {
    d = document.getElementById("B"+ix+","+iy);
    set_opacity(d,n);
  }
}
if (n < 100) setTimeout("fade_in("+n+","+x1+","+x2+","+y1+","+y2+",'"+divname+"')", 40);
}





function fade_out(n,x1,y1,x2,y2,divname) {
n = n - 20;
if (n < 0) { n = 0; }
if (divname != '') {
  d = document.getElementById(divname);
  set_opacity(d,n);
  if (n == 0) d.style.visibility = "hidden";
} else {
  for (ix=x1; ix<=x2; ix++)
  for (iy=y1; iy<=y2; iy++) {
    d = document.getElementById("B"+ix+","+iy);
    set_opacity(d,n);
    if (n == 0) d.style.visibility = "hidden";
  }
}
if (n > 0) setTimeout("fade_out("+n+","+x1+","+x2+","+y1+","+y2+",'"+divname+"')", 40);
}





function open_window(name,x1,y1,x2,y2) {
if (document.openwindow) {
  preload_clear(1);
  for (ix=x1; ix<=x2; ix++)
  for (iy=y1; iy<=y2; iy++) {
    d = document.getElementById("B"+ix+","+iy);
    set_opacity(d,0);
    preload_image("images/"+name+"/pane_"+ix+"_"+iy+".jpg");
    d.style.backgroundImage = "url(images/"+name+"/pane_"+ix+"_"+iy+".jpg)";
    d.style.visibility = "visible";
  }
  preload('close_popup(); fade_in(0,'+x1+','+y1+','+x2+','+y2+',"");');
}
}




function open_window_switch(name,x1,y1,x2,y2,type) {
if (get_opacity(document.getElementById('popup')) == 100) { close_popup(); }

if (get_opacity(document.getElementById('popup')) == 0) {
  if (document.openwindow) {
    preload_clear(type);

    for (ix=x1; ix<=x2; ix++)
    for (iy=y1; iy<=y2; iy++) {
      d = document.getElementById("B"+ix+","+iy);
      d.style.backgroundImage = document.getElementById("I"+ix+","+iy).style.backgroundImage;
      d.style.visibility = "visible";
      set_opacity(d,100);
      preload_image(name+"/pane_"+ix+"_"+iy+".jpg");
      document.getElementById('I'+ix+','+iy).style.backgroundImage = 'url('+name+'/pane_'+ix+'_'+iy+'.jpg)';
    }

    preload('close_window('+x1+','+y1+','+x2+','+y2+')');
  }
} else {
  setTimeout('open_window_switch("'+name+'",'+x1+','+y1+','+x2+','+y2+')',200);
}
}






function close_window(x1,y1,x2,y2) {
if (document.openwindow) {
    fade_out(100,x1,y1,x2,y2,'');
}
}






function close_popup() {
  fade_out(100,0,0,0,0,'popup');
}








function create_popup(type,str1,str2) {
if (document.openwindow) {
document.move_to = 0;

d = document.getElementById('popup');
  x = 250-(document.screencenterx+(document.x*1.4)) + (document.EDIT*350);
  y = 250-(document.screencentery+(document.y*1.4));
  fadetemp = 0;
  if (get_opacity(d) == 0) {
  } else if (get_opacity(d) == 100) {
    if (!((parseInt(d.style.left) < (200-parseInt(d.style.width))) || (parseInt(d.style.left) > (document.windowX-200)) || (parseInt(d.style.top) < (80-parseInt(d.style.height))) || (parseInt(d.style.top) > (document.windowY-80)))) {
      x = document.popupx - ((document.windowX-parseInt(d.style.width))/2);
      y = document.popupy - ((document.windowY-parseInt(d.style.height))/2);
      fadetemp = 100;
    } else {
      set_opacity(d,0);
    }
  } else {
    return false;
  }
  
preload_clear(1);

  if (type == 'text1') {
     create_popup_window(x,y,1);
     create_popup_element(344,383,'close',str1,str2);
     if (document.getElementById(str1)) { create_popup_element(60,60,'text',str1,str2); }
     preload("fade_in("+fadetemp+",0,0,0,0,'popup');");
  }
  if (type == 'text3') {
     create_popup_window(x,y,3);
     create_popup_element(342,476,'close',str1,str2);
     if (document.getElementById(str1)) { create_popup_element(67,60,'text',str1,str2); }
     preload("fade_in("+fadetemp+",0,0,0,0,'popup');");
  }
  if (type == 'website') {
     create_popup_window(x,y,2);
     create_popup_element(661,353,'close',str1,str2);
     create_popup_element(33,353,'visit',str1,str2);
     if (document.getElementById(str1)) { create_popup_element(150,340,'text',str1,str2); }
     create_popup_element(0,50,'image',str1,'');
     preload("fade_in("+fadetemp+",0,0,0,0,'popup');");
  }

  if (type == 'image1') {
     create_popup_window(x,y,1);
     create_popup_element(344,383,'close',str1,str2);
     if (document.getElementById(str1)) { create_popup_element(120,360,'text',str1,str2); }
     create_popup_element(233,423,'arrows',str1,str2);
     create_popup_element(0,50,'image',str1,str2);
     preload(" fade_in("+fadetemp+",0,0,0,0,'popup');");
  }
  if (type == 'image2') {
     create_popup_window(x,y,2);
     create_popup_element(661,353,'close',str1,str2);
     if (document.getElementById(str1)) { create_popup_element(150,360,'text',str1,str2); }
     create_popup_element(391,393,'arrows',str1,str2);
     create_popup_element(0,50,'image',str1,str2);
     preload("fade_in("+fadetemp+",0,0,0,0,'popup');");
  }
  if (type == 'image3') {
     create_popup_window(x,y,3);
     create_popup_element(342,476,'close',str1,str2);
     if (document.getElementById(str1)) { create_popup_element(120,460,'text',str1,str2); }
     create_popup_element(232,515,'arrows',str1,str2);
     create_popup_element(0,50,'image',str1,str2);
     preload("fade_in("+fadetemp+",0,0,0,0,'popup');");
  }
  if (type == 'image1_big') {
     create_popup_window(x,y,1);
     create_popup_element(344,383,'close',str1,str2);
     create_popup_element(33,383,'detail',str1,str2);
     if (document.getElementById(str1)) { create_popup_element(120,360,'text',str1,str2); }
     create_popup_element(233,423,'arrows',str1,str2);
     create_popup_element(0,50,'image',str1,str2);
     preload("fade_in("+fadetemp+",0,0,0,0,'popup');");
  }
  if (type == 'image2_big') {
     create_popup_window(x,y,2);
     create_popup_element(661,353,'close',str1,str2);
     create_popup_element(33,353,'detail',str1,str2);
     if (document.getElementById(str1)) { create_popup_element(150,360,'text',str1,str2); }
     create_popup_element(391,393,'arrows',str1,str2);
     create_popup_element(0,50,'image',str1,str2);
     preload("fade_in("+fadetemp+",0,0,0,0,'popup');");
  }
  if (type == 'image3_big') {
     create_popup_window(x,y,3);
     create_popup_element(342,476,'close',str1,str2);
     create_popup_element(33,476,'detail',str1,str2);
     if (document.getElementById(str1)) { create_popup_element(120,460,'text',str1,str2); }
     create_popup_element(232,515,'arrows',str1,str2);
     create_popup_element(0,50,'image',str1,str2);
     preload("fade_in("+fadetemp+",0,0,0,0,'popup');");
  }
  if (type == 'image4_big') {
     create_popup_window(x,y,4);
     create_popup_element(661,440,'close',str1,str2);
     create_popup_element(33,440,'detail',str1,str2);
     if (document.getElementById(str1)) { create_popup_element(140,445,'text',str1,str2); }
     create_popup_element(391,481,'arrows',str1,str2);
     create_popup_element(0,50,'image',str1,str2);
     preload("fade_in("+fadetemp+",0,0,0,0,'popup');");
  }
  if (type == 'map') {
     create_popup_window(x,y,5);
     create_popup_element(0,0,'transparent_close',str1,str2);
     preload("fade_in("+fadetemp+",0,0,0,0,'popup');");
  }
  if (type == 'links') {
     open_window('links',document.limx_bottom,document.limy_bottom,document.limx_top,document.limy_top);
  }
  if (type == 'shapism') {
     open_window('shapism_old',document.limx_bottom,document.limy_bottom,document.limx_top,document.limy_top);
  }

  if (document.EDIT == 1) {
     create_popup_element(0,0,'edit',str1,str2);
  }
}
}





function create_popup_window(x,y,type) {
d = document.getElementById('popup');
di = document.getElementById('popup_image'); di.innerHTML = '';
dt = document.getElementById('popup_text'); dt.innerHTML = '';
db = document.getElementById('popup_buttons'); db.innerHTML = '';

  if (type == 1) {
    d.style.width = '466px';
    d.style.height = '494px';
    di.style.width = '466px';
    di.style.height = '494px';
    di.style.backgroundImage = 'url(images/window1.jpg)';
    preload_image('images/window1.jpg');
    db.style.width = '466px';
    db.style.height = '494px';
    dt.style.left = '43px';
    dt.style.top = '42px';
    dt.style.width = '380px';
    dt.style.height = '400px';
  }
  if (type == 2) {
    d.style.width = '783px';
    d.style.height = '464px';
    di.style.width = '783px';
    di.style.height = '464px';
    di.style.backgroundImage = 'url(images/window2.jpg)';
    preload_image('images/window2.jpg');
    db.style.width = '783px';
    db.style.height = '464px';
    dt.style.width = '783px';
    dt.style.height = '464px';
    dt.style.left = '43px';
    dt.style.top = '42px';
    dt.style.width = '700px';
    dt.style.height = '400px';
  }
  if (type == 3) {
    d.style.width = '464px';
    d.style.height = '587px';
    di.style.width = '464px';
    di.style.height = '587px';
    di.style.backgroundImage = 'url(images/window3.jpg)';
    preload_image('images/window3.jpg');
    db.style.width = '464px';
    db.style.height = '587px';
    dt.style.width = '464px';
    dt.style.height = '587px';
    dt.style.left = '43px';
    dt.style.top = '42px';
    dt.style.width = '380px';
    dt.style.height = '520px';
  }
  if (type == 4) {
    d.style.width = '783px';
    d.style.height = '551px';
    di.style.width = '783px';
    di.style.height = '551px';
    di.style.backgroundImage = 'url(images/window4.jpg)';
    preload_image('images/window4.jpg');
    db.style.width = '783px';
    db.style.height = '551px';
    dt.style.width = '783px';
    dt.style.height = '551px';
    dt.style.left = '43px';
    dt.style.top = '42px';
    dt.style.width = '700px';
    dt.style.height = '480px';
  }
  if (type == 5) {
    d.style.width = '586px';
    d.style.height = '583px';
    di.style.width = '586px';
    di.style.height = '583px';
    di.style.backgroundImage = 'url(images/map.jpg)';
    preload_image('images/map.jpg');
    db.style.width = '586px';
    db.style.height = '583px';
    dt.style.left = '0px';
    dt.style.top = '0px';
    dt.style.width = '0px';
    dt.style.height = '0px';
  }

getWindowsize();
document.popupx = x+((document.windowX-parseInt(d.style.width))/2);
document.popupy = y+((document.windowY-parseInt(d.style.height))/2);
document.popup = type;
d.style.left = (document.popupx + (document.screencenterx+(document.x*1.4)-250));
d.style.top = (document.popupy + (document.screencentery+(document.y*1.4)-250));
}






function create_popup_element(x,y,type,str1,str2) {
s = '';
d = document.getElementById('popup');
di = document.getElementById('popup_image');
dt = document.getElementById('popup_text');
db = document.getElementById('popup_buttons');

if (type == "image") {
  di.style.textAlign = 'center';
  temp = 0;
  if (str2 != '') { temp = parseInt(str2); }
  s = '<img id="popup_art" src="images/'+str1+'/'+str1+'.jpg" onMouseDown="scroll()" onMouseUp="stopscroll()" unselectable="on" style="cursor:move; margin-left:'+x+'px; margin-top:'+(y+temp)+'px; ">';
  di.innerHTML = di.innerHTML + s;
  preload_image('images/'+str1+'/'+str1+'.jpg');
}
if (type == "text") {
  dt.style.fontSize = '11px';
  dt.style.lineHeight = '12px';
  dt.style.textAlign = 'left';
  dt.style.width = (parseInt(d.style.width)-x-x);
  dt.style.height = (parseInt(d.style.height)-y-67);
  dt.style.left = x;
  dt.style.top = y;
  s = document.getElementById(str1).innerHTML;
  if (document.EDIT == 1) { s = str1; }
  dt.innerHTML = dt.innerHTML + s;
}

if (type == "close") {
  s = unescape('<div id="popup_close" onMouseDown="scroll()" onMouseUp="stopscroll()" unselectable="on" style="left:'+x+'px; top:'+y+'px; width:87px; height:79px; background-image:url(images/close_off.gif); color:FFFFFF; visibility:inherit; cursor:pointer;" onMouseOver="this.style.backgroundImage = %27url(images/close_on.gif)%27;" onMouseOut="this.style.backgroundImage = %27url(images/close_off.gif)%27;" onClick="if (document.openwindow) {close_popup();}"></div>');
  db.innerHTML = db.innerHTML + s;
  preload_image('images/close_on.gif');
  preload_image('images/close_off.gif');
}
if (type == "detail") {
  s = unescape('<div id="popup_detail" onMouseDown="scroll()" onMouseUp="stopscroll()" unselectable="on" style="left:'+x+'px; top:'+y+'px; width:87px; height:79px; background-image:url(images/detail_off.gif); color:FFFFFF; visibility:inherit; cursor:pointer;" onMouseOver="this.style.backgroundImage = %27url(images/detail_on.gif)%27;" onMouseOut="this.style.backgroundImage = %27url(images/detail_off.gif)%27;" onClick="if (document.openwindow) {if (document.big == 0) { document.oldx = document.x; document.oldy = document.y; document.getElementById(%27shapism%27).style.visibility = %27hidden%27; open_window(%27'+str1+'%27,'+document.limx_bottom+','+document.limy_bottom+','+document.limx_top+','+document.limy_top+',%27%27); document.big = 1; }}"></div>');
  db.innerHTML = db.innerHTML + s;
  preload_image('images/detail_on.gif');
  preload_image('images/detail_off.gif');
}
if (type == "visit") {
  s = unescape('<div id="popup_visit" onMouseDown="scroll()" onMouseUp="stopscroll()" unselectable="on" style="left:'+x+'px; top:'+y+'px; width:87px; height:79px; background-image:url(images/visit_off.gif); color:FFFFFF; visibility:inherit; cursor:pointer;" onMouseOver="this.style.backgroundImage = %27url(images/visit_on.gif)%27;" onMouseOut="this.style.backgroundImage = %27url(images/visit_off.gif)%27;" onClick="if (document.openwindow) { goto_URL(%27'+str2+'%27,%27_blank%27); }"></div>');
  db.innerHTML = db.innerHTML + s;
  preload_image('images/visit_on.gif');
  preload_image('images/visit_off.gif');
}
if (type == "transparent_close") {
  s = unescape('<div id="popup_tclose" onMouseDown="scroll()" onMouseUp="stopscroll()" unselectable="on" style="left:'+x+'px; top:'+y+'px; width:100%; height:100%; background-image:url(images/blank.gif); color:FFFFFF; visibility:inherit; cursor:pointer;" onClick="if (document.openwindow) {close_popup();}"></div>');
  db.innerHTML = db.innerHTML + s;
}
if (type == "arrows") {
  s = unescape('<div id="popup_arrow_r" onMouseDown="scroll()" onMouseUp="stopscroll()" unselectable="on" style="left:'+(x+3)+'px; top:'+y+'px; width:95px; height:37px; background-image:url(images/arrow_r_off.gif); color:FFFFFF; visibility:inherit; cursor:pointer;" onMouseOver="this.style.backgroundImage = %27url(images/arrow_r_on.gif)%27;" onMouseOut="this.style.backgroundImage = %27url(images/arrow_r_off.gif)%27;" onClick="document.textpage++; page_turn(%27'+str1+'%27);"></div>');
  s = s + unescape('<div id="popup_arrow_l" onMouseDown="scroll()" onMouseUp="stopscroll()" unselectable="on" style="left:'+(x-97)+'px; top:'+y+'px; width:95px; height:37px; background-image:url(images/arrow_l_off.gif); color:FFFFFF; visibility:hidden; cursor:pointer;" onMouseOver="this.style.backgroundImage = %27url(images/arrow_l_on.gif)%27;" onMouseOut="this.style.backgroundImage = %27url(images/arrow_l_off.gif)%27;" onClick="document.textpage--; page_turn(%27'+str1+'%27);"></div>');
  db.innerHTML = db.innerHTML + s;
  document.textpage = 0;
  page_turn(str1);
  preload_image('images/arrow_r_on.gif');
  preload_image('images/arrow_r_off.gif');
  preload_image('images/arrow_l_on.gif');
  preload_image('images/arrow_l_off.gif');
}
if (type == "edit") {
  s = '<div style="left:70px; top:10px; width:50px; height:50px;"><button style="width:50px; height:20px;" onClick="document.EDITbutton.style.top = parseInt(document.EDITbutton.style.top)-20; updateEDIT();">+</button><button style="width:50px; height:30px;" onClick="document.EDITbutton.style.top = parseInt(document.EDITbutton.style.top)-1; updateEDIT();">U</button></div>';
  s = s + '<div style="left:20px; top:60px; width:50px; height:50px;"><button style="width:20px; height:50px;" onClick="document.EDITbutton.style.left = parseInt(document.EDITbutton.style.left)-20; updateEDIT();">+</button><button style="width:30px; height:50px;" onClick="document.EDITbutton.style.left = parseInt(document.EDITbutton.style.left)-1; updateEDIT();">L</button></div>';
  s = s + '<div style="left:120px; top:60px; width:50px; height:50px;"><button style="width:30px; height:50px;" onClick="document.EDITbutton.style.left = parseInt(document.EDITbutton.style.left)+1; updateEDIT();">R</button><button style="width:20px; height:50px;" onClick="document.EDITbutton.style.left = parseInt(document.EDITbutton.style.left)+20; updateEDIT();">+</button></div>';
  s = s + '<div style="left:70px; top:110px; width:50px; height:50px;"><button style="width:50px; height:30px;" onClick="document.EDITbutton.style.top = parseInt(document.EDITbutton.style.top)+1; updateEDIT();">D</button><button style="width:50px; height:20px;" onClick="document.EDITbutton.style.top = parseInt(document.EDITbutton.style.top)+20; updateEDIT();">+</button></div>';

  s = s + '<div style="left:70px; top:170px; width:50px; height:50px;"><button style="width:50px; height:20px;" onClick="document.EDITbutton.style.height = parseInt(document.EDITbutton.style.height)-20; updateEDIT();">+</button><button style="width:50px; height:30px;" onClick="document.EDITbutton.style.height = parseInt(document.EDITbutton.style.height)-1; updateEDIT();">H</button></div>';
  s = s + '<div style="left:20px; top:220px; width:50px; height:50px;"><button style="width:20px; height:50px;" onClick="document.EDITbutton.style.width = parseInt(document.EDITbutton.style.width)-20; updateEDIT();">+</button><button style="width:30px; height:50px;" onClick="document.EDITbutton.style.width = parseInt(document.EDITbutton.style.width)-1; updateEDIT();">W</button></div>';
  s = s + '<div style="left:120px; top:220px; width:50px; height:50px;"><button style="width:30px; height:50px;" onClick="document.EDITbutton.style.width = parseInt(document.EDITbutton.style.width)+1; updateEDIT();">W</button><button style="width:20px; height:50px;" onClick="document.EDITbutton.style.width = parseInt(document.EDITbutton.style.width)+20; updateEDIT();">+</button></div>';
  s = s + '<div style="left:70px; top:270px; width:50px; height:50px;"><button style="width:50px; height:30px;" onClick="document.EDITbutton.style.height = parseInt(document.EDITbutton.style.height)+1; updateEDIT();">H</button><button style="width:50px; height:20px;" onClick="document.EDITbutton.style.height = parseInt(document.EDITbutton.style.height)+20; updateEDIT();">+</button></div>';

  s = s + '<div id="edit" unselectable="off" style="left:30px; top:330px; width:200px; height:40px; color:FFFFFF; background-color:000000;"></div>';
  db.innerHTML = db.innerHTML + s;
}
}

function updateEDIT() {
  d = document.getElementById('edit');
  d.innerHTML = 'left:'+document.EDITbutton.style.left+'; top:'+document.EDITbutton.style.top+'; width:'+document.EDITbutton.style.width+'; height:'+document.EDITbutton.style.height+';';
}


function editor(e) {
if (document.EDIT == 1) {
  if (document.EDITbutton.style) { set_opacity(document.EDITbutton,0); }
  document.EDITbutton = e;
  e.style.backgroundColor = 'AAAAFF';
  set_opacity(e,70);
}
}

function button_on(e) {
e.style.backgroundColor = 'FFFFFF';
set_opacity(e,30);
}

function button_off(e) {
if ((document.EDIT == 0) || (document.getElementById('popup').style.visibility == "hidden")) {
  e.style.backgroundColor = 'transparent';
  set_opacity(e,100);
}
}



function window_click() {
if (document.openwindow) {
  if (document.big == 1) {
    document.big = 0;
    document.getElementById('shapism').style.visibility = 'visible';
    document.getElementById('shapism').style.left = document.screencenterx+document.x-1250;
    document.getElementById('shapism').style.top = document.screencentery+document.y+250;
    close_window(-2,-2,2,2);
  }
}
}


function page_turn(str1) {
if (document.textpage == 0) { document.getElementById('popup_arrow_l').style.visibility = "hidden"; } else { document.getElementById('popup_arrow_l').style.visibility = "visible"; }
temp_str = document.textpage+1;
if (!(document.getElementById(str1+temp_str))) { document.getElementById('popup_arrow_r').style.visibility = "hidden"; } else { document.getElementById('popup_arrow_r').style.visibility = "visible"; }

if (document.textpage == 0) { tempstr = ''; } else { tempstr = document.textpage; }
d = document.getElementById(str1+tempstr);
document.getElementById('popup_text').innerHTML = d.innerHTML;
}





function preload_clear(n) {
d = document.getElementById('preload');
d.innerHTML = '';
if (n) { d.style.backgroundColor = 'transparent'; }
getWindowsize();
d.style.top = '0px';
d.style.left = '0px';
d.style.width = document.windowX;
d.style.height = document.windowY;
if (n == 2) {
  d.style.width = (document.screencenterx+document.x-750)*2+536;
  d.style.height = (document.screencentery+document.y+250)*2+805;
}
d.style.visibility = 'visible';
document.preloaded = 0;
document.preload_target = 0;
for (i=0; i<40; i++) {
  document.preload_image[i] = '';
}
}


function preload_image(str) {
document.preload_image[document.preload_target] = str;
document.preload_target++;
}


function preload(str) {
document.on_preload_f = str;
d = document.getElementById('preload');

s = '<div id="loadbar" style="left:'+((parseInt(d.style.width)/2)-130)+'px; top:'+((parseInt(d.style.height)/2)-24)+'px; width:260px; height:65px; visibility:inherit; background-image:url(images/loadbar2.gif);">'; 
s = s + '<div id="loadbar_images" style="left:10px; top:32px; width:240px; height:24px; background-color:f5f5ed; visibility:inherit;">';
s = s + unescape('<img src="'+document.preload_image[0]+'" style="width:2px; height:20px;" onLoad="preloaded_image(0)">');
s = s + '</div>';
s = s + '<div id="loadbar_bar" style="left:10px; top:32px; width:240px; height:24px; color:000000; background-color:f5f5ed; visibility:inherit;"></div>';
s = s + '</div>';

d.innerHTML = s;
on_preload();
}


function preloaded_image(n) {
if (n == document.preloaded) {
d = document.getElementById('loadbar_bar');
s = '';
document.preloaded++;
temp = (document.preloaded / document.preload_target)*20;
for (i=0; i<Math.floor(temp); i++) {
  s = s + '<img src="images/loadbar.gif">';
}
d.innerHTML = s;

if (document.preloaded < document.preload_target) {
  d = document.getElementById('loadbar_images');
  s = unescape('<img src="'+document.preload_image[document.preloaded]+'" style="width:2px; height:20px;" onLoad="preloaded_image('+document.preloaded+')">');
  d.innerHTML = d.innerHTML + s;
}
}
}


function on_preload() {
if (document.preloaded >= document.preload_target) {
  document.getElementById('preload').style.visibility = 'hidden';
  if (document.on_preload_f != '') { setTimeout(document.on_preload_f,200); }
} else {
  setTimeout('on_preload();',200);
}
}




function goto_URL(URL,n) {

window.open(URL,n);
}




function shapism(n) {
if (document.openwindow) {
  document.getElementById('shapism_'+document.shapism_current).style.visibility = 'hidden';
  document.shapism_current = n;
  if (document.shapism_current == 0) {
    open_window_switch('images',-2,1,-1,2,2);
  } else {
    open_window_switch('images/shapism/'+document.shapism_current,-2,1,-1,2,2);
  }
  document.getElementById('shapism_'+document.shapism_current).style.visibility = 'visible';
}
}





function initialize_shapism() {

d = document.getElementById('shapism');
d.style.width = "1000px";
d.style.height = "1000px";
d.style.left = (document.screencenterx-1250)+'px';
d.style.top = (document.screencentery+250)+'px';
d.style.visibility = "visible";
d.style.zIndex = "100";
}




function mail() {

return email = 'craw'+String.fromCharCode(64)+'magma'+'.'+'ca';
}