browser_version= parseInt(navigator.appVersion);
platform = navigator.platform;
platform_slice=platform.slice(0, 3);
if (!document.getElementById) {location.replace('sorry.html');}

if (navigator.appName == "Microsoft Internet Explorer" && (navigator.platform.slice(0,3) == "Mac")) {
macHeight = screen.availHeight;
window.resizeTo(720, macHeight);
}

image1 = new Image(); image1.src = "images/loading1.gif";	
image2 = new Image(); image2.src = "images/loading2.gif";
image3 = new Image(); image3.src = "images/loading3.gif";


function openOrangealert() {window.open('orangealert/orangealert.html','orangealert','toolbar=no,status=no,scrollbars=no,resizable=no,width=469,height=169'); return;}
function openGifs() {window.open('gifs/gifs.html','gifs','toolbar=no,status=no,scrollbars=no,resizable=no,width=315,height=241'); return;}
function openCustomvans() {window.open('customvans/customvans.html','customvans','toolbar=no,status=no,scrollbars=yes,resizable=yes,width=1050,height=800'); return;}
function openTrusty() {window.open('trusty/trusty.html','trusty','toolbar=no,width=382px,height=615,status=no,scrollbars=no,resize=no,menubar=no'); return;}
function openRedtrain() {window.open('redtrain/redtrain.html','redtrain','toolbar=no,width=458,height=400,status=no,scrollbars=no,resize=no,menubar=no'); return;}
function openFoundphotogallery() {window.open('found/foundphotos.html','found','toolbar=no,status=no,scrollbars=yes,resizable=yes,width=600,height=550'); return;}
function openTeeth() {window.open('teeth/teeth.html','teeth','toolbar=no,status=no,scrollbars=no,resizable=no,width=510,height=620'); return;}
function openNonlineartheater() {window.open('nonlinear/nt.html','nt','toolbar=no,status=no,scrollbars=no,resizable=no,width=302,height=265'); return;}
function openFleeplanetearth() {window.open('fleeplanetearth/fleeplanetearth.html','fleeplanetearth','toolbar=no,status=no,scrollbars=no,resizable=no,width=514,height=379'); return;}
function openKittenOrSpider() {window.open('ks/kittenOrSpider.html','kittenOrSpider','toolbar=no,status=no,scrollbars=no,resizable=no,width=660,height=530'); return;}
function openIfs() {window.open('ifs/industrialFreight.html','industrialFreight','toolbar=no,status=no,scrollbars=yes,resizable=yes,width=800,height=600'); return;}
function openHowToThink() {window.open('howToThink/howToThink.html','howToThink','toolbar=no,status=no,scrollbars=no,resizable=no,width=425,height=480'); return;}
function openTouchingIsGood() {window.open('touchingIsGood/touchingIsGood.html','touchingIsGood','toolbar=no,status=no,scrollbars=no,resizable=no,width=415,height=325'); return;}
function openChinatownHaircut() {window.open('chinatownHaircut/chinatownHaircut.html','touchingIsGood','toolbar=no,status=no,scrollbars=no,resizable=no,width=360,height=300'); return;}
function openFortunateFunShapes() {window.open('ffs/fortunateFunShapes.html','fortunateFunShapes','toolbar=no,status=no,scrollbars=no,resizable=no,width=520,height=450'); return;}
function openCgexpo() {window.open('cgexpo/index.html','cgexpo','toolbar=no,status=no,scrollbars=no,resizable=no,width=706,height=525'); return;}
function openHarryhausen() {window.open('harryhausen/harryhausen.html','harryhausen','toolbar=no,status=no,scrollbars=yes,resizable=yes,width=1000,height=800'); return;}
function openSpace1982() {window.open('space1982/index.html','space1982','toolbar=no,status=no,scrollbars=no,resizable=no,width=370,height=450'); return;}

var contentArray = new Array(
"The greatest thing to exist ever.",
"Fashionably masculine.",
"A thoughtful gift can prove your selflessness.",
"Instantly know the correct answer.",
"Known to have supernatural healing powers.",
"Handsome and shiny.",
"Precision made.",
"Use in hundreds of activities.",
"Styling is equal to a hundred dollar original.",
"Carry one in your pocket to amaze friends.",
"Almost impossible to lose.",
"Trust your visions to explain reality.",
"It\'s amazing how much money it can bring you.",
"May explain UFO\'s and psychic phenomena.",
"Hundreds of thousands of fans are addicted to it.",
"Take it to parties and use it as a moneymaking icebreaker.",
"Avoids the guilt of living well.",
"Really puts on a show!",
"Amuses everybody.",
"Uses technology developed by NASA.",
"Temper power with sensitivity.",
"Professional style.",
"Trusted everywhere for its problem solving solutions.",
"Experience is no substitute for preparedness.",
"Protects you from danger.",
"Works everytime.",
"Stops all problems and keeps them from coming back.",
"Works like a miracle.",
"Ready to operate.",
"No effort required.",
"Many practical uses.",
"Micro-adjustable.",
"Scientific design.",
"Saves time, avoids errors.",
"Similar to models used by professionals.",
"Don\'t be embarrassed by mistakes.",
"Convenient size.",
"Newest advanced techniques.",
"Shiny finish gives it an expensive appearance.",
"The farther you search for answers, the closer you are to home.",
"Excellent for many novelty and scientific purposes.",
"Relieves the painful, hidden fears that control you.",
"Up-to-date edition.",
"Overwhelms your enemies.",
"Banishes misery.",
"Useful and revealing.",
"Makes you look like an intellectual giant.",
"1 out of every 1000 clicks is a regular winner.",
"What happened yesterday isn\'t nearly as important as what\'s happening right now.",
"To advertisers, your attention is more valuable than your money.",
"Top-notch performance.",
"Innovative features.",
"A solid value.",
"Slick and sturdily built.",
"Fully loaded.",
"Feature-rich.",
"Premium features.",
"You no longer have to worry.",
"Offers superior performance.",
"Produces great-looking results.",
"Sports an attractive interface.",
"Resist the distraction of competition.",
"Rockets to the top in nearly all categories.",
"Easy to use.",
"Takes care of all your needs.",
"Packed with great features.",
"Be a star and impress everyone you know.",
"Find out who you really are.",
"Special emphasis on how you can achieve personal mastery fast.",
"Stand out in a crowd.",
"Make friends fast.",
"Do better in school, business, love.",
"Never confuse success with popularity.",
"Looks real.",
"Can increase your intelligence.",
"Be the envy of your friends.",
"Enjoy the security and prestige of a good income.",
"Accomplish more with a minimum of time & effort."
);

var linkArray = new Array();
linkArray[0] = "javascript:openOrangealert()";
linkArray[1] = "javascript:openGifs();";
linkArray[2] = "javascript:openCustomvans()";
linkArray[3] = "javascript:openTrusty()";
linkArray[4] = "javascript:openRedtrain()";
linkArray[5] = "javascript:openFoundphotogallery()";
linkArray[6] = "javascript:openTeeth()";
linkArray[7] = "javascript:openNonlineartheater();";
linkArray[8] = "javascript:openFleeplanetearth();";
linkArray[9] = "javascript:openKittenOrSpider();";
linkArray[10] = "javascript:openIfs();";
linkArray[11] = "javascript:openHowToThink();";
linkArray[12] = "javascript:openChinatownHaircut();";
linkArray[13] = "javascript:openFortunateFunShapes();";
linkArray[14] = "javascript:openTouchingIsGood();";
linkArray[15] = "javascript:openCgexpo();";
linkArray[16] = "javascript:openHarryhausen();";
linkArray[17] = "javascript:openSpace1982();";

var titleArray = new Array();
titleArray[0] = "Orange Alert";
titleArray[1] = "gifs";
titleArray[2] = "Custom Vans";
titleArray[3] = "Trusty";
titleArray[4] = "Redtrain";
titleArray[5] = "Found Photo Gallery";
titleArray[6] = "Teeth";
titleArray[7] = "Nonlinear Theater";
titleArray[8] = "Flee Planet Earth";
titleArray[9] = "Kitten or Spider?";
titleArray[10] = "Industrial Freight Systems, Inc.";
titleArray[11] = "How to Think";
titleArray[12] = "Chinatown Haircut";
titleArray[13] = "Fortunate Fun Shapes";
titleArray[14] = "Touching is Good";
titleArray[15] = "Classic Gaming Expo";
titleArray[16] = "Ray Harryhausen Creature List";
titleArray[17] = "Space 1982";


var descArray = new Array();
descArray[0] = "I took one to a party and one guy tried to buy it for over $300!";
descArray[1] = "Every website needs them, and they\'re not going away.";
descArray[2] = "Flip-flop and hammer down in your favorite four wheeler.";
descArray[3] = "A man without a car knows no freedom.";
descArray[4] = "Schedules, fares, announcements.";
descArray[5] = "Each one represents a life saved.";
descArray[6] = "Almost everyone has teeth, and everyone\'s teeth are different.";
descArray[7] = "Almost-real video entertainment.";
descArray[8] = "A dire warning for all who ignore the signs.";
descArray[9] = "Random Image Generator.";
descArray[10] = "Life on the Dock.";
descArray[11] = "Narrated by Steve Allen.";
descArray[12] = "It happens every two weeks.";
descArray[13] = "Super 8 Pixillation, circa 1988.";
descArray[14] = "It looks great on you.";
descArray[15] = "What happens in Vegas stays in Vegas.";
descArray[16] = "Tribue to the stop-motion master.";
descArray[17] = "Watch the first mission to Mars.";

var colorArray = new Array();
colorArray[0] = "#ffffff";
colorArray[1] = "#fff5d6";
colorArray[2] = "#e0f5ff";
colorArray[3] = "#ebf5e0";

var numberOfImages = 18;

var artworkArray = new Array(descArray.length - 1);
for (i=0; i < descArray.length; i++) {
	artworkArray[i] = i;
	}
for (i=0; i < descArray.length; i++) {
	register2 = Math.floor(Math.random() * descArray.length);
	register1 = artworkArray[i];
	artworkArray[i] = artworkArray[register2];
	artworkArray[register2] = register1;
	}

var imageArray = new Array(numberOfImages - 1);
for (j=0; j < numberOfImages; j++) {
	imageArray[j] = j;
	}
for (j=0; j < numberOfImages; j++) {
	register2 = Math.floor(Math.random() * numberOfImages);
	register1 = imageArray[j];
	imageArray[j] = imageArray[register2];
	imageArray[register2] = register1;
	}

var contentMixerArray = new Array(contentArray.length -1);
for (k=0; k < contentArray.length; k++) {
	contentMixerArray[k] = k;
	}
for (k=0; k < contentArray.length; k++) {
	register2 = Math.floor(Math.random() * contentArray.length);
	register1 = contentMixerArray[k];
	contentMixerArray[k] = contentMixerArray[register2];
	contentMixerArray[register2] = register1;
	}	

var macArtworkNumber = 0;
var macImageNumber = 0;	
var macContentNumber = 0;

function createCell(cellId) {

contentVar = "";

cellId = "cell_"+cellId;

contentTotal = (Math.floor(Math.random() * 3)+1);
for (z = 0; z < contentTotal; z++) {

if (navigator.appName == "Microsoft Internet Explorer" && (platform_slice == "Mac") && (browser_version <= 5)) {
macContentNumber = Math.floor(Math.random() * contentArray.length);
contentNumber = contentMixerArray[macContentNumber];
contentMixerArray[macContentNumber] = contentMixerArray[contentMixerArray.length - 1];
contentMixerArray.length -=1;
}
else {contentNumber = contentMixerArray.shift();}

var contentSentence = contentArray[contentNumber];

boldNumber = Math.floor(Math.random() * 10);
if (boldNumber <=4) {contentVar += "<b>"+contentSentence+"</b> ";} 
else {contentVar += contentSentence +" ";}
}

if (navigator.appName == "Microsoft Internet Explorer" && (platform_slice == "Mac") && (browser_version <= 5)) {
macArtworkNumber = Math.floor(Math.random() * artworkArray.length);
artworkNumber = artworkArray[macArtworkNumber];

artworkArray[macArtworkNumber] = artworkArray[artworkArray.length - 1];
artworkArray.length -=1;

macImageNumber = Math.floor(Math.random() * imageArray.length);
imageNumber = imageArray[macImageNumber];
imageArray[macImageNumber] = imageArray[imageArray.length - 1];
imageArray.length -=1;
} else {
artworkNumber = artworkArray.shift();
imageNumber = imageArray.shift();
}

colorNumber = Math.floor(Math.random() * colorArray.length);
imageAlign = Math.floor(Math.random() * 2);
document.getElementById(cellId+"Title").innerHTML = titleArray[artworkNumber];	
document.getElementById(cellId+"Desc").innerHTML = descArray[artworkNumber] + " " + contentVar;
document.getElementById(cellId+"HrefTitle").href = linkArray[artworkNumber];
document.getElementById(cellId+"HrefImage").href = linkArray[artworkNumber];
document.getElementById(cellId+"Color").style.backgroundColor = colorArray[colorNumber];
document.images[cellId+"Image"].src = "images/hp"+imageNumber+".gif";
if (imageAlign == 0) {document.images[cellId+"Image"].align = "left"; document.images[cellId+"Image"].style.paddingRight = "10px";}
else {document.images[cellId+"Image"].align = "right"; document.images[cellId+"Image"].style.paddingLeft = "10px";}
}

function pageHeight() {
column1Height = document.getElementById("column1").offsetHeight;
column2Height = document.getElementById("column2").offsetHeight;
column3Height = document.getElementById("column3").offsetHeight;

compare1_1 = column1Height + column2Height;
compare1_2 = column3Height + column2Height;

if (compare1_1 > compare1_2) {
	if (column1Height > column2Height) {tallestColumn = column1Height}
	else {tallestColumn = column2Height}
} else {
	if (column3Height > column2Height) {tallestColumn = column3Height}
	else {tallestColumn = column2Height}
	}
document.getElementById("column1").style.height = tallestColumn +"px";
document.getElementById("column2").style.height = tallestColumn +"px";
document.getElementById("column3").style.height = tallestColumn +"px";
}




function init() {

for (i=1; i < (descArray.length+1); i++) {
	createCell(i);
	}
pageHeight();
document.getElementById('loadingLayer').style.display = "none";
}	