
//======================== Functions ============================


/* Function which loads the top-bar images */

function loadImages(myImageDir) {

	thisTopLeft = new Image(146, 91);

	//soon... (CAN DELETE THIS SECTION ONCE SITE GOES LIVE! (well, duh) )
	soonTopBar = new Image(85, 32);
	soonTopBar.src = myImageDir + "topbar_home.gif";
	soonTopBaron = new Image(85, 32);
	soonTopBaron.src = myImageDir + "topbar_home_on.gif";
	soonTopLefton = new Image(146, 91);
	soonTopLefton.src = myImageDir + "topleft_soon_preview.jpg";
	soontext= new String("soon");


	//error
	errorTopLefton = new Image(146, 91);
	errorTopLefton.src = myImageDir + "topleft_error_preview.jpg";
	errortext= new String("error");


	//home
	homeTopBar = new Image(85, 32);
	homeTopBar.src = myImageDir + "topbar_home.gif";
	homeTopBaron = new Image(85, 32);
	homeTopBaron.src = myImageDir + "topbar_home_on.gif";
	homeTopLefton = new Image(146, 91);
	homeTopLefton.src = myImageDir + "topleft_home_preview.jpg";
	hometext= new String("home");


	//author
	authorTopBar = new Image(85, 32);
	authorTopBar.src = myImageDir + "topbar_author.gif";
	authorTopBaron = new Image(85, 32);
	authorTopBaron.src = myImageDir + "topbar_author_on.gif";
	authorTopLefton = new Image(146, 91);
	authorTopLefton.src = myImageDir + "topleft_author_preview.jpg";
	authortext= new String("author - who is the freak behind all this?");


	//blog
	blogTopBar = new Image(85, 32);
	blogTopBar.src = myImageDir + "topbar_blog.gif";
	blogTopBaron = new Image(85, 32);
	blogTopBaron.src = myImageDir + "topbar_blog_on.gif";
	blogTopLefton = new Image(146, 91);
	blogTopLefton.src = myImageDir + "topleft_blog_preview.jpg";
	blogtext= new String("blog");


	//camera
	cameraTopBar = new Image(85, 32);
	cameraTopBar.src = myImageDir + "topbar_camera.gif";
	cameraTopBaron = new Image(85, 32);
	cameraTopBaron.src = myImageDir + "topbar_camera_on.gif";
	cameraTopLefton = new Image(146, 91);
	cameraTopLefton.src = myImageDir + "topleft_camera_preview.jpg";
	cameratext= new String("camera");


	//noise
	noiseTopBar = new Image(85, 32);
	noiseTopBar.src = myImageDir + "topbar_noise.gif";
	noiseTopBaron = new Image(85, 32);
	noiseTopBaron.src = myImageDir + "topbar_noise_on.gif";
	noiseTopLefton = new Image(146, 91);
	noiseTopLefton.src = myImageDir + "topleft_noise_preview.jpg";
	noisetext= new String("noise - music, bootlegs, remixes, jingles...");


	//code
	codeTopBar = new Image(85, 32);
	codeTopBar.src = myImageDir + "topbar_code.gif";
	codeTopBaron = new Image(85, 32);
	codeTopBaron.src = myImageDir + "topbar_code_on.gif";
	codeTopLefton = new Image(146, 91);
	codeTopLefton.src = myImageDir + "topleft_code_preview.jpg";
	codetext= new String("code");


	//links
	linksTopBar = new Image(85, 32);
	linksTopBar.src = myImageDir + "topbar_links.gif";
	linksTopBaron = new Image(85, 32);
	linksTopBaron.src = myImageDir + "topbar_links_on.gif";
	linksTopLefton = new Image(146, 91);
	linksTopLefton.src = myImageDir + "topleft_links_preview.jpg";
	linkstext= new String("links");

}


/*
Function which sets the default top-left image for this page
*/

function setTopLeftImage(myImageFile) {

	thisTopLeft.src = myImageFile;

}



/*
Function which actually does the swapping over of the images and
displays appropriate text on the status bar.

PRE:	"source" must be one of the above
	"isOn" must be either true or false.
*/

function flipTitleImages(source, isOn) { 
	if (isOn==true) {
		document ["topleftimage"].src = eval(source + "TopLefton.src"); 
		document ["topbar" + source].src = eval(source + "TopBaron.src"); 
		window.status = eval(source + "text");
	} else {
		document ["topleftimage"].src = thisTopLeft.src; 
		document ["topbar" + source].src = eval(source + "TopBar.src"); 
		window.status = "";
	}
}

