/*   THUMBNAIL BUTTONS ARE LISTED HERE BELOW  */
if (document.images) {

	bg2on = new Image(52,52);
	bg2on.src = "images/gameart/buttons/bg2_ov.jpg";
	bg2off = new Image(52,52);
	bg2off.src = "images/gameart/buttons/bg2_up.jpg";
	
	bg2autorunon = new Image(52,52);
	bg2autorunon.src = "images/gameart/buttons/bg2autorun_ov.jpg";
	bg2autorunoff = new Image(52,52);
	bg2autorunoff.src = "images/gameart/buttons/bg2autorun_up.jpg";
	
	bg2charactergenon = new Image(52,52);
	bg2charactergenon.src = "images/gameart/buttons/bg2charactergen_ov.jpg";
	bg2charactergenoff = new Image(52,52);
	bg2charactergenoff.src = "images/gameart/buttons/bg2charactergen_up.jpg";
	
	bg2loadbaron = new Image(52,52);
	bg2loadbaron.src = "images/gameart/buttons/bg2loadbar_ov.jpg";
	bg2loadbaroff = new Image(52,52);
	bg2loadbaroff.src = "images/gameart/buttons/bg2loadbar_up.jpg";
	
	bg2magebookon = new Image(52,52);
	bg2magebookon.src = "images/gameart/buttons/bg2magebook_ov.jpg";
	bg2magebookoff = new Image(52,52);
	bg2magebookoff.src = "images/gameart/buttons/bg2magebook_up.jpg";
	
	bg2main2on = new Image(52,52);
	bg2main2on.src = "images/gameart/buttons/bg2main2_ov.jpg";
	bg2main2off = new Image(52,52);
	bg2main2off.src = "images/gameart/buttons/bg2main2_up.jpg";
	
	bg2mainon = new Image(52,52);
	bg2mainon.src = "images/gameart/buttons/bg2main_ov.jpg";
	bg2mainoff = new Image(52,52);
	bg2mainoff.src = "images/gameart/buttons/bg2main_up.jpg";
	
	bg2mainworldon = new Image(52,52);
	bg2mainworldon.src = "images/gameart/buttons/bg2mainworld_ov.jpg";
	bg2mainworldoff = new Image(52,52);
	bg2mainworldoff.src = "images/gameart/buttons/bg2mainworld_up.jpg";
	
	bg2optionspageon = new Image(52,52);
	bg2optionspageon.src = "images/gameart/buttons/bg2optionspage_ov.jpg";
	bg2optionspageoff = new Image(52,52);
	bg2optionspageoff.src = "images/gameart/buttons/bg2optionspage_up.jpg";
	
	chudon = new Image(52,52);
	chudon.src = "images/gameart/buttons/chud_ov.jpg";
	chudoff = new Image(52,52);
	chudoff.src = "images/gameart/buttons/chud_up.jpg";
	
	jadeevilchar1on = new Image(52,52);
	jadeevilchar1on.src = "images/gameart/buttons/jadeevilchar1_ov.jpg";
	jadeevilchar1off = new Image(52,52);
	jadeevilchar1off.src = "images/gameart/buttons/jadeevilchar1_up.jpg";
	
	jadeevilchar2on = new Image(52,52);
	jadeevilchar2on.src = "images/gameart/buttons/jadeevilchar2_ov.jpg";
	jadeevilchar2off = new Image(52,52);
	jadeevilchar2off.src = "images/gameart/buttons/jadeevilchar2_up.jpg";
	
	jadegoodchar2on = new Image(52,52);
	jadegoodchar2on.src = "images/gameart/buttons/jadegoodchar2_ov.jpg";
	jadegoodchar2off = new Image(52,52);
	jadegoodchar2off.src = "images/gameart/buttons/jadegoodchar2_up.jpg";
	
	jadegoodcharon = new Image(52,52);
	jadegoodcharon.src = "images/gameart/buttons/jadegoodchar_ov.jpg";
	jadegoodcharoff = new Image(52,52);
	jadegoodcharoff.src = "images/gameart/buttons/jadegoodchar_up.jpg";
	
	script1on = new Image(52,52);
	script1on.src = "images/gameart/buttons/script1_ov.jpg";
	script1off = new Image(52,52);
	script1off.src = "images/gameart/buttons/script1_up.jpg";

	
}
/*   CODE FOR BUTTON ROLLOVERS  */
function rollOver(imgName) {
	if (document.images) {
	
		imgOn = eval(imgName + "on.src"); 
	document[imgName].src = imgOn;
	}
	
}
	function rollOff(imgName) {
	if (document.images) {
	imgOff = eval(imgName + "off.src");
		document[imgName].src = imgOff;
		}
		}
	
		/* PHOTOGALLERY CODE*/
	
/* ARRAYS TO STORE THE LARGE THUMBNAIL PICTURES;
   MAKE SURE THAT THEY ARE SPELT EXACTLY, AND 
   IN THE ORDER IN WHICH THEY APPEAR ON THE PAGE */
largeArr = new Array("bg2.jpg", 
"bg2loadbar.jpg", 
"bg2magebook.jpg", 
"bg2charactergen.jpg",
"bg2mainworld.jpg",
"bg2optionspage.jpg", 
"chud.jpg", 
"jadeevilchar1.jpg",
"jadeevilchar2.jpg",  
"jadegoodchar2.jpg",
"jadegoodchar.jpg");


/* ARRAYS TO STORE THE DESCRIPTIONS OF EACH PICTURE;
   MAKE SURE THEY ARE IN THE ORDER IN WHICH THEY 
   APPEAR ON THE PAGE; OTHERWISE THEY WON'T CORRESPOND 
   CORRECTLY WITH THE PICTURES (ABOVE) */
textArray1 = new Array(" ", 
" ", 
" ", 
" ", 
" ",
" ",
 " ", 
 " ",
 " ",
 " ",
 " ",
 " ",
 " ",
 " ",
 " ");



/* CODE FOR PREVIOUS AND NEXT BUTTONS; DON'T HAVE TO TOUCH */
var currPic = 0;
//function to swap pics
function swapMainPic(p_num) {
	document.mainpic.src = "images/gameart/enlarged/"+largeArr[p_num];
	currPic = p_num;
	myDivID.innerHTML = textArray1[p_num];
	
	//alert("Current Pic "+currPic);
	
}

function prevPic() {
	currPic--;
	if (currPic>=0) {
		document.mainpic.src = "images/gameart/enlarged/"+largeArr[currPic];
		myDivID.innerHTML = textArray1[currPic];
	} else {
		currPic = largeArr.length-1;
		document.mainpic.src = "images/gameart/enlarged/"+largeArr[currPic];
		myDivID.innerHTML = textArray1[currPic];
		
	}
}

function nextPic() {
	currPic++;
	if (currPic<=largeArr.length-1) {
		document.mainpic.src = "images/gameart/enlarged/"+largeArr[currPic];
		myDivID.innerHTML = textArray1[currPic];
	} else {
		currPic = 0;
		document.mainpic.src = "images/gameart/enlarged/"+largeArr[currPic];
		myDivID.innerHTML = textArray1[currPic];
	}
	  
}

/* CODE FOR POP-UP WINDOWS; DON'T HAVE TO TOUCH */
function viewLarge(p_pic) {



	var width = screen.width;
	var height = screen.height;
	var largePic = "images/gameart/popup_pics/gameart1/show.htm?id="+p_pic;
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(largePic, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=760,height=420,left = 0,top = 0');");
}
