/* variable used if thumbnail frame is scrolling */
var thscrollnow = 0;

/* variables storing page names for use in folio comment links */
var aliendesignCG = "aliendesign.htm";
var anatomyCG = "anatomy.htm";
var animalsCG = "animals.htm";
var awipCG = "awip.htm";
var bigalCG = "bigal.htm";
var biggeststepCG = "biggeststep.htm";
var bodiesCG = "bodies.htm";
var cartoondesignCG = "cartoondesign.htm";
var charlieCG = "charlie.htm";
var creaturedesignCG = "creaturedesign.htm";
var dragonCG = "dragon.htm";
var dreddCG = "dredd.htm";
var flintstonesCG = "flintstones.htm";
var fredclausCG = "fredclaus.htm";
var funnybonesCG = "funnybones.htm";
var giantclawCG = "giantclaw.htm";
var goldencompassCG = "goldencompass.htm";
var hellboyCG = "hellboy.htm";
var hitchhikersCG = "hitchhikers.htm";
var hobbitCG = "hobbit.htm";
var houndCG = "hound.htm";
var lostworldCG = "lostworld.htm";
var makeupCG = "makeup.htm";
var maquettesCG = "maquettes.htm";
var mythdesignCG = "mythdesign.htm";
var oxfordCG = "oxford.htm";
var prehistoricparkCG = "prehistoricpark.htm";
var primevalCG = "primeval.htm";
var sculptCG = "sculpt.htm";
var seamonstersCG = "seamonsters.htm";
var sweeneytoddCG = "sweeneytodd.htm";
var tamworthCG = "tamworth.htm";
var turtlesCG = "turtles.htm";
var uhwebdesignCG = "uhwebdesign.htm";
var walkbeastCG = "walkbeast.htm";
var walkdinoCG = "walkdino.htm";
var walkmonstersCG = "walkmonsters.htm";
var westmeadhawkCG = "westmeadhawk.htm";



function plviewIMG() {
/* preload the thumbnail nav images */
tup_norm = new Image();
tup_norm.src = "ui/th_up1.png";
tup_hov = new Image();
tup_hov.src = "ui/th_up2.png";
tdown_norm = new Image();
tdown_norm.src = "ui/th_down1.png";
tdown_hov = new Image();
tdown_hov.src = "ui/th_down2.png";

tprev_norm = new Image();
tprev_norm.src = "ui/th_prev1.png";
tprev_hov = new Image();
tprev_hov.src = "ui/th_prev2.png";
tnext_norm = new Image();
tnext_norm.src = "ui/th_next1.png";
tnext_hov = new Image();
tnext_hov.src = "ui/th_next2.png";
}


function createMenu() {
/* first preload category images */
prod_norm = new Image();
prod_norm.src = "ui/menu_prod1.png";
prod_hov = new Image();
prod_hov.src = "ui/menu_prod2.png";
des_norm = new Image();
des_norm.src = "ui/menu_des1.png";
des_hov = new Image();
des_hov.src = "ui/menu_des2.png";
sculpt_norm = new Image();
sculpt_norm.src = "ui/menu_sculpt1.png";
sculpt_hov = new Image();
sculpt_hov.src = "ui/menu_sculpt2.png";
makeup_norm = new Image();
makeup_norm.src = "ui/menu_makeup1.png";
makeup_hov = new Image();
makeup_hov.src = "ui/menu_makeup2.png";
bod_norm = new Image();
bod_norm.src = "ui/menu_bod1.png";
bod_hov = new Image();
bod_hov.src = "ui/menu_bod2.png";
maq_norm = new Image();
maq_norm.src = "ui/menu_maq1.png";
maq_hov = new Image();
maq_hov.src = "ui/menu_maq2.png";
anim_norm = new Image();
anim_norm.src = "ui/menu_anim1.png";
anim_hov = new Image();
anim_hov.src = "ui/menu_anim2.png";

/* and preload the thumbnail nav images */
plviewIMG();

/* now build the productions menu */
pfix = "<tr class=\"dmenula\" onmouseover=\"className='dmenulb';\" onmouseout=\"className='dmenula';\" onmouseup=\"className='dmenula';\"><td class=\"dmenulistpad\"></td><td ";
sfix = "</td><td class=\"dmenulistpad\"></td></tr>";

tmenu = "<table id='prodmenu' cellpadding='0' cellspacing='0' style='display: none;' class='prodlist'>";

tmenu += pfix+ "onclick=\"menuGo('clash.htm');\">Clash of the Titans" +sfix;
tmenu += pfix+ "onclick=\"menuGo('wolfman.htm');\">The Wolfman" +sfix;
tmenu += pfix+ "onclick=\"menuGo('hellboy.htm');\">Hellboy 2 - The Golden Army" +sfix;
tmenu += pfix+ "onclick=\"menuGo('sweeneytodd.htm');\">Sweeney Todd" +sfix;
tmenu += pfix+ "onclick=\"menuGo('goldencompass.htm');\">The Dark Materials - The Golden Compass" +sfix;
tmenu += pfix+ "onclick=\"menuGo('fredclaus.htm');\">Fred Claus" +sfix;
tmenu += pfix+ "onclick=\"menuGo('charlie.htm');\">Charlie & the Chocolate Factory" +sfix;
tmenu += pfix+ "onclick=\"menuGo('hitchhikers.htm');\">The Hitchhiker’s Guide to the Galaxy" +sfix;
tmenu += pfix+ "onclick=\"menuGo('flintstones.htm');\">The Flintstones" +sfix;
tmenu += pfix+ "onclick=\"menuGo('dredd.htm');\">Judge Dredd" +sfix;
tmenu += pfix+ "onclick=\"menuGo('awip.htm');\">An American Werewolf in Paris" +sfix;
tmenu += pfix+ "onclick=\"menuGo('anatomy.htm');\">Anatomy" +sfix;
tmenu += pfix+ "onclick=\"menuGo('turtles.htm');\">Teenage Mutant Ninja Turtles (2002)" +sfix;
tmenu += pfix+ "onclick=\"menuGo('funnybones.htm');\">Funny Bones" +sfix;
tmenu += pfix+ "onclick=\"menuGo('lostworld.htm');\">The Lost World" +sfix;
tmenu += pfix+ "onclick=\"menuGo('hound.htm');\">The Hound of the Baskervilles" +sfix;
tmenu += pfix+ "onclick=\"menuGo('tamworth.htm');\">The Legend of the Tamworth Two" +sfix;
tmenu += pfix+ "onclick=\"menuGo('walkdino.htm');\">Walking with Dinosaurs" +sfix;
tmenu += pfix+ "onclick=\"menuGo('walkbeast.htm');\">Walking with Beasts" +sfix;
tmenu += pfix+ "onclick=\"menuGo('bigal.htm');\">The Ballad of Big Al" +sfix;
tmenu += pfix+ "onclick=\"menuGo('giantclaw.htm');\">The Giant Claw" +sfix;
tmenu += pfix+ "onclick=\"menuGo('seamonsters.htm');\">Sea Monsters" +sfix;
tmenu += pfix+ "onclick=\"menuGo('walkmonsters.htm');\">Walking with Monsters" +sfix;
tmenu += pfix+ "onclick=\"menuGo('hobbit.htm');\">Horizon - The Mystery of the Human Hobbit" +sfix;
tmenu += pfix+ "onclick=\"menuGo('oxford.htm');\">Oxford University Museum" +sfix;
tmenu += pfix+ "onclick=\"menuGo('biggeststep.htm');\">The Biggest Step of All" +sfix;
tmenu += pfix+ "onclick=\"menuGo('dragon.htm');\">Unearthly History" +sfix;
tmenu += pfix+ "onclick=\"menuGo('prehistoricpark.htm');\">Prehistoric Park" +sfix;
tmenu += pfix+ "onclick=\"menuGo('primeval.htm');\">Primeval" +sfix;
tmenu += pfix+ "onclick=\"menuGo('westmeadhawk.htm');\">Madame Tussauds - Westmead Hawk" +sfix;

tmenu += "</table>";

/* and build the design menu */
tmenu += "<table id='designmenu' cellpadding='0' cellspacing='0' style='display: none;' class='designlist'>";
tmenu += pfix+ "onclick=\"menuGo('clashdesign.htm');\">Clash of the titans" +sfix;
tmenu += pfix+ "onclick=\"menuGo('creaturedesign.htm');\">Creatures" +sfix;
tmenu += pfix+ "onclick=\"menuGo('mythdesign.htm');\">Mythology" +sfix;
tmenu += pfix+ "onclick=\"menuGo('aliendesign.htm');\">Aliens" +sfix;
tmenu += pfix+ "onclick=\"menuGo('cartoondesign.htm');\">Cartoon" +sfix;
tmenu += pfix+ "onclick=\"menuGo('illustrationdesign.htm');\">Illustration" +sfix;
tmenu += pfix+ "onclick=\"menuGo('uhwebdesign.htm');\">Unearthly History (website)" +sfix;
tmenu += "</table>";

/* place the menu in the page */
document.getElementById('menuarea').innerHTML = tmenu;

/* get the thumbnail page to view */
if (document.getElementById('pview').innerHTML == "pview") {
	av = getCookieval("autoview");
	if (av !== "") {
		avt = av.split("_");
		avpage = avt[0];
		desth.location.href = "folio/"+ avpage;
		}
	else if (!navigator.cookieEnabled) document.getElementById('viewcomment').innerHTML = "Cookies not enabled<br>Enable Cookies or select from menu";
	else window.location.href = "portfolio.htm";
	}

}



function menuGo(arg1) {
/* go to a folio page from the menu */
arg2 = arg1 +"_pic1";
setCookieval("autoview", arg2);

if (document.getElementById('pview').innerHTML == "pview") {
	desth.location.href = "folio/"+ arg1;
	hidemenu();
	}
else window.location.href = "folioview.htm";
}


function commentGo(arg1, arg2) {
/* set page and image to view from a comments link */
arg3 = arg1 +"_pic"+ arg2;
setCookieval("autoview", arg3);
}


function showmenu() {
/* toggle showing the productions menu */
if (document.getElementById('prodmenu').style.display == "none") document.getElementById('prodmenu').style.display="inline";
else document.getElementById('prodmenu').style.display="none";
document.getElementById('designmenu').style.display="none";
}

function showdmenu() {
/* toggle showing the concept art menu */
if (document.getElementById('designmenu').style.display == "none") document.getElementById('designmenu').style.display="inline";
else document.getElementById('designmenu').style.display="none";
document.getElementById('prodmenu').style.display="none";
}

function hidemenu() {
/* hide both the menus */
document.getElementById('prodmenu').style.display="none";
document.getElementById('designmenu').style.display="none";
}


function porthov(arg1) {
/* set folio category text image to white */
document.getElementById('port'+arg1).src = ("ui/menu_"+ arg1 +"2.png");
}

function porthovend(arg1) {
/* set folio category text image to normal */
thismenu = document.getElementById('currentmenu').innerHTML;
if (thismenu !== ("port"+arg1) ) document.getElementById('port'+arg1).src = ("ui/menu_"+ arg1 +"1.png");
}


function htdown() {
/* start scrolling the folio thumbnails up */
desth.scrollBy(0,-10);
htd = setTimeout("htdown()", 50);
thscrollnow = 1;
}

function htup() {
/* stop scrolling the folio thumbnails up */
if (thscrollnow == 1) {
	clearTimeout(htd);
	thscrollnow = 0;
	}
}

function hbdown() {
/* start scrolling the folio thumbnails down */
desth.scrollBy(0,10);
hbd = setTimeout("hbdown()", 50);
thscrollnow = 1;
}

function hbup() {
/* stop scrolling the folio thumbnails down */
if (thscrollnow == 1) {
	clearTimeout(hbd);
	thscrollnow = 0;
	}
}


function skipviewpic(arg1) {
/* step back or forward through the folio images */
picnum = parseInt(document.getElementById('currentpic').innerHTML);
picmax = parseInt(desth.document.getElementById('numpics').innerHTML);

if (arg1 == 1) {
	--picnum;
	if (picnum < 1) picnum = picmax;
	}
else if (arg1 == 2) {
	++picnum;
	if (picnum > picmax) picnum = 1;
	}

apicnum = "pic"+ picnum;

if (navigator.appName.indexOf("Microsoft") >= 0) eval("desth.document.all."+apicnum+".click();");
else	{
	ip = desth.document.getElementById(apicnum);
	sp = ip.getAttribute("onclick", 2);
	sp = sp.replace("(id,", "('"+apicnum+"',");
	eval("skip"+sp);
	}
}


function skipsetpic(picnum, pic, comment, title) {
/* set the folio image when stepping back or forward in non ie browser */
picnum = picnum.replace("pic", "");
document.getElementById('currentpic').innerHTML = picnum;
document.getElementById('viewpic').src = "folio/"+ pic;
document.getElementById('viewcomment').innerHTML = comment;
if (title !== "") document.getElementById('viewlabel').innerHTML = title;
}

