//Lib objects  ********************
function lib_obj(obj,nest){
  if(!bw.bw) return lib_message('Old browser')
  nest=(!nest) ? "":'document.'+nest+'.';
  this.evnt=bw.dom? document.getElementById(obj):
    bw.ie4?document.all[obj]:bw.ns4?eval(nest+"document.layers[obj]"):0;	
  /*if(!this.evnt) return lib_message('The layer does not exist ('+obj+')' 
    +'- \nIf your using Netscape please check the nesting of your tags!')*/
   if(!this.evnt) return -1;

  this.css=bw.dom||bw.ie4?this.evnt.style:this.evnt; 
  this.ref=bw.dom||bw.ie4?document:this.css.document;
  this.x=parseInt(this.css.left)||this.css.pixelLeft||this.evnt.offsetLeft||0;
  this.y=parseInt(this.css.top)||this.css.pixelTop||this.evnt.offsetTop||0;
  this.w=this.evnt.offsetWidth||this.css.clip.width||
    this.ref.width||this.css.pixelWidth||0;
  this.h=this.evnt.offsetHeight||this.css.clip.height||
    this.ref.height||this.css.pixelHeight||0;
  this.c=0; //Clip values
  if((bw.dom || bw.ie4) && this.css.clip) {
  this.c=this.css.clip; this.c=this.c.slice(5,this.c.length-1); 
  this.c=this.c.split(' ');
  for(var i=0;i<4;i++){this.c[i]=parseInt(this.c[i])}
  }
  this.ct=this.css.clip.top||this.c[0]||0; 
  this.cr=this.css.clip.right||this.c[1]||this.w||0;
  this.cb=this.css.clip.bottom||this.c[2]||this.h||0; 
  this.cl=this.css.clip.left||this.c[3]||0;
  this.obj = obj + "Object"; eval(this.obj + "=this");
  return this;
}

//Showing object ************
lib_obj.prototype.showIt = function(){
	this.css.visibility="visible"
}

//Hiding object **********
lib_obj.prototype.hideIt = function(){
	this.css.visibility="hidden"
	}

//preload
initImages(["logo1", "../images/logo.gif"],
			["logo2", "../images/logo_ro.gif"],
			["left1", "../images/left.gif"],
			["left2", "../images/left_ro.gif"],
			["right1", "../images/right.gif"],
			["right2", "../images/right_ro.gif"],
			["works1", "images/navi_works.gif"],
			["works2", "images/navi_works_ro.gif"],
			["texts1", "images/navi_texts.gif"],
			["texts2", "images/navi_texts_ro.gif"],
			["exhibitions1", "images/navi_exhibitions.gif"],
			["exhibitions2", "images/navi_exhibitions_ro.gif"],
			["news1", "images/navi_news.gif"],
			["news2", "images/navi_news_ro.gif"],
			["bio1", "images/navi_bio.gif"],
			["bio2", "images/navi_bio_ro.gif"],
			["contact1", "images/navi_contact.gif"],
			["contact2", "images/navi_contact_ro.gif"],
			["canvas1", "images/navi_canvas.gif"],
			["canvas2", "images/navi_canvas_ro.gif"],
			["paper1", "images/navi_paper.gif"],
			["paper2", "images/navi_paper_ro.gif"],
			["installation1", "images/navi_installation.gif"],
			["installation2", "images/navi_installation_ro.gif"],
			["photo1", "images/navi_photo.gif"],
			["photo2", "images/navi_photo_ro.gif"],
			["toolate1", "images/navi_toolate.gif"],
			["toolate2", "images/navi_toolate_ro.gif"],
			["traces1", "images/navi_traces.gif"],
			["traces2", "images/navi_traces_ro.gif"],
			["sketch1", "images/navi_sketch.gif"],
			["sketch2", "images/navi_sketch_ro.gif"],
			["obstinacies1", "images/navi_obstinacies.gif"],
			["obstinacies2", "images/navi_obstinacies_ro.gif"],
			["dialogue1", "images/navi_dialogue.gif"],
			["dialogue2", "images/navi_dialogue_ro.gif"],
			["magritte1", "images/navi_magritte.gif"],
			["magritte2", "images/navi_magritte_ro.gif"],
			["childhood1", "images/navi_childhood.gif"],
			["childhood2", "images/navi_childhood_ro.gif"]);


//preload
function initImages()
{
	args_images_II = initImages.arguments;

	for (var i = 0; i < args_images_II.length; i++)
	{
		eval (args_images_II[i][0] + '= new Image();')
		eval (args_images_II[i][0] + '.src = "' + args_images_II[i][1] + '";');
	}
}

function showImages()
{
	args_images_SI = showImages.arguments;
	
	eval ('document.images["' + args_images_SI[0] + '"].src = ' + args_images_SI[1] + '.src;');
}

//Slideshow
var layerNumShowing=1;

function showPreviousLayer(){
	var layerNumToShow=layerNumShowing-1;
	if (layerNumToShow < 1)
		{
			layerNumToShow=totalLayersInLoop;
		}
	eval("myLayer" + layerNumShowing+ ".hideIt()");
	eval("myLayer" + layerNumToShow+ ".showIt()");
	layerNumShowing=layerNumToShow;
}
	
function showNextLayer(){
	var layerNumToShow=layerNumShowing+1;
	if (layerNumToShow > totalLayersInLoop)
		{
			layerNumToShow=1;
		}
	
	eval("myLayer" + layerNumShowing+ ".hideIt()");
	eval("myLayer" + layerNumToShow+ ".showIt()");
	layerNumShowing=layerNumToShow;
}

function nix()
   {}
