// document created and scripted by tn

var ua=navigator.userAgent.toUpperCase();
var op=(ua.indexOf("OPERA")!=-1);
var w3cdom=(document.getElementById&&document.childNodes&&document.createElement)?true:false;
var onLine=(location.protocol.lastIndexOf("http:")!=-1);
var mframe=(parent.frames.mbarframe)?true:false;
var blog=(onLine&&(document.compatMode||(window.find&&!navigator.savePreferences)||navigator.capDOM2)&&!mframe)?true:false;
var hframe;

if (w3cdom) {parent.document.title=document.title}
if (mframe) {document.ondragstart=new Function("return false")}

function clearMess() {mbar('void'); mess('void')}

function mess(button) {if (hframe)
{parent.frames.helpframe.document.forms[0].helpmsg.value=msg[button]}
}

function mbar(button) {if (mframe)
parent.frames.mbarframe.mbardiv.innerHTML=stb[button]
else if (hframe) {parent.frames.helpframe.setTextOfLayer('mbardiv','<div>'+stb[button]+'<\/div>')}
else window.status=stb[button]
}

function sbar(str, url) {var strU = str+' - '+unescape(url); if (url) {
if (mframe) parent.frames.mbarframe.mbardiv.innerHTML=strU
else if (hframe) {parent.frames.helpframe.setTextOfLayer('mbardiv','<div>'+strU+'<\/div>')}
else self.status=strU}
}

function message(btn, url, str) {str='thumbnail set'; mess(btn); sbar(str, url)}
function message2(btn, url, str) {showAny(); str=(!blog)?'order form':'Shop | '+i; mess(btn); sbar(str, url)}

function marr() {
hframe=(parent.frames.helpframe&&parent.frames.helpframe.hframe)?true:false;
if (mframe&&parent.frames.mbarframe.newurl!=unescape(location.href))
{parent.frames.mbarframe.newurl=unescape(location.href); parent.frames.mbarframe.load()}
else if (hframe) parent.frames.helpframe.setTextOfLayer('mbardiv','<div>'+unescape(location.href)+'<\/div>')
}

iName = new Array()
iName[0]='Home'
iName[1]='The Starcross'
iName[2]='The Watergate'
iName[3]='The Trumpet'
iName[4]='Channel 11'
iName[5]='5 Ballz'
iName[6]='The Ballroom'
iName[7]='Plinth Park'
iName[8]='Reflections'
iName[9]='Vertigo'
iName[10]='Rainbirds'
iName[11]='Blind'
iName[12]='POV-Ray'
iName[13]='Help Desk'
iName[14]='The Card Game'
iName[15]='Money'
iName[16]='C Of E'
iName[17]='TrueSpace'
iName[18]='3-D Trumpet'
iName[19]='3-D Ballz'
iName[20]='Ship Of Souls'
iName[21]='2C 3D'
iName[22]='Animated Icons'

iUrl = new Array()
iUrl[0]='tigpage2.htm'
iUrl[1]='starcro.htm'
iUrl[2]='watgate.htm'
iUrl[3]='trumpet.htm'
iUrl[4]='c11.htm'
iUrl[5]='balz.htm'
iUrl[6]='balrom.htm'
iUrl[7]='plinth.htm'
iUrl[8]='reflect.htm'
iUrl[9]='vertigo.htm'
iUrl[10]='botbatbt.htm'
iUrl[11]='blind.htm'
iUrl[12]='povlog.htm'
iUrl[13]='helpdsk.htm'
iUrl[14]='card.htm'
iUrl[15]='money.htm'
iUrl[16]='coe.htm'
iUrl[17]='trulog.htm'
iUrl[18]='tru3d.htm'
iUrl[19]='balz3d.htm'
iUrl[20]='ship3d.htm'
iUrl[21]='2c3d.htm'
iUrl[22]='tigpage7.htm'

var foreName=iName[i+1]; var backName=iName[i-1];
var forePage=iUrl[i+1]; var backPage=iUrl[i-1];
var lastPage=(i<=6)?'tigpage3':((i<=12)?'tigpage4':((i<=17)?'tigpage5':'tigpage6'));
var bigHtm='bigpix'+i+'.htm';
var str=unescape(location.href.substring(0,location.href.lastIndexOf('/')+1));
var pid=false;
var buyHtm=(!blog)?'buypix'+i+'.htm':(pid)?'pid'+(100+i)+'.htm':'?tigp_id='+(100+i);
buyHtm=str+buyHtm
var buyStr=buyHtm;

function goTIG(tig1,tig2) {
if(blog) {parent.location.href=tig2} else {location.href=tig1}}

function goTIG() {var arg=goTIG.arguments;
if(blog) {if(arg[2]) {document.getElementById(arg[2]).onmouseout=function() {}};
parent.location.href=arg[1]} else {location.href=arg[0]}}

function buyIMG() {goTIG(buyHtm,buyHtm,'G6'); clearMess()}
function goFore() {location.href=forePage}
function goBack() {location.href=backPage}
function getIMG() {location.href=bigHtm; clearMess()}
function goSHOP() {goTIG('shop.htm',buyHtm,'G2'); clearMess()}
function goStart() {goTIG('index.htm',str,'G5'); clearMess()}
function goThumbs() {location.href=lastPage+'.htm'; clearMess()}

function unFocus() {window.focus()}
function ddReset() {document.forms.F1.reset()}

function selectURL(nexturl) {
 if (nexturl != "") {
 ddReset(); unFocus();
 location.href = nexturl;
 }
}

function getRandom(output) {var rand=Math.floor(Math.random()*output);return rand+1}
var newnum=getRandom(7)

function showAny()
{
 var num=newnum;
 textArray = new Array();
 textArray[1] = "One of my favorites.";
 textArray[2] = "Try again, I don't like this choice.";
 textArray[3] = "Ok ... now what?";
 textArray[4] = "A nice choice, if I do say so myself.";
 textArray[5] = "Only one more to go ...";
 textArray[6] = "That's it!";
 textArray[7] = "Keep on trying.";
 while (num==newnum) {newnum=getRandom(7)}
 msg['shop']=textArray[newnum];
 return msg['shop']
}

msg = new Array();
msg['void'] = ''
msg['tigpage3'] = 'POV-Ray - page 1'
msg['tigpage4'] = 'POV-Ray - page 2'
msg['tigpage5'] = 'TrueSpace page'
msg['tigpage6'] = 'Stereogram page'
msg['1024'] = 'Open hi-res image'
msg['scheme'] = 'Change colors'
msg['TIGshop'] = 'You can add more than one image to the shopping cart';
msg['here'] = 'Start Here';
msg['pov'] = 'It\'s fun and it\'s free.'
msg['prev'] = 'previous: '+backName
msg['next'] = 'next: '+foreName
msg[lastPage] = msg[lastPage]

stb = new Array();
stb['void'] = '';
stb['scheme'] = 'there are 7';
stb['TIGshop'] = 'if you want';
stb['here'] = 'Hello, world!';

function getRandom(output) {var rand=Math.floor(Math.random()*output);return rand+1}
var PageScheme = getRandom(7)

rando = new Array();
rando[1] = "#CFCF5F";
rando[2] = "#E0E0A9";
rando[3] = "#EBEBCF";
rando[4] = "#B7BAAC";
rando[5] = "#F7F7DA";
rando[6] = "#BFBF90";
rando[7] = "#B8B87D";

randi = new Array();
randi[1] = "#EFEEC7";
randi[2] = "#F5F4BD";
randi[3] = "#D7D792";
randi[4] = "#DAE0B1";
randi[5] = "#D1D178";
randi[6] = "#E0E0A9";
randi[7] = "#E3E360";

function changeScheme() {if (w3cdom) {
if (PageScheme<7) {PageScheme = PageScheme+1} else {PageScheme = 1}
randout=rando[PageScheme]
randin=randi[PageScheme]
document.getElementById('tout').style.backgroundColor=randout
document.getElementById('tin').style.backgroundColor=randin
if (i==11) {
document.getElementById('t2out').style.backgroundColor=randout
document.getElementById('t2in').style.backgroundColor=randin}
}}

if (w3cdom) document.write("<link rel=\"stylesheet\" type=\"text\/css\" href=\"css\/outin" + PageScheme + ".css\">")

if (op&&!document.childNodes) document.write('<style type="text\/css">input{border-style:none;}input.wide{border-style:none;}<\/style>')
