
 function init()
 {
 	pagemenu.init();
 	imagebox.init();
 }


 function em(tl, sl, name)
 {
	document.location.href= 'mailto:'+name+'@'+sl+'.'+tl;
 }
 
 
 
 function pagemenu_class()
 {
 	this.opened= -1;
 	
 	this.init= function()
 	{
 		if (bm.element('pagemenu'))
 		{
 			bm.execute(bm.get(bm.element('textcontent'), 'div', 'textblock'), function(e) { e.style.display= 'none'; });
 			this.open(0);
 		}
 	}
 	
 	this.open= function(nr)
 	{
 		if (this.opened == nr) return;
 		
 		if (this.opened != -1)
 		{
 			bm.timer.removework(bm.get(bm.element('textcontent'), 'div', 'textblock')[this.opened]);
 			bm.get(bm.element('pagemenu'), 'a')[this.opened].className= '';
 			bm.get(bm.element('textcontent'), 'div', 'textblock')[this.opened].style.display= 'none';
 		}
 		
 		this.opened= nr;
 		bm.get(bm.element('pagemenu'), 'a')[nr].className= 'active';
 		bm.fadein(bm.get(bm.element('textcontent'), 'div', 'textblock')[nr]);
 	}
 }
 
 pagemenu= new pagemenu_class();




 function imagebox_class()
 {
 	this.images= new Array();
 	
 	this.init= function()
 	{
 		if (bm.element('imagemenu'))
 		{
 			this.images= bm.get(bm.element('imagebox'), 'div', 'image');
 			//this.makemenu(0);
 			this.goto(0);
 		}
 	}
 	
 	this.makemenu= function(nr)
 	{
 		p= (nr - 1 < 0) ? this.images.length - 1 : nr - 1;
 		n= (nr - (-1) >= this.images.length) ? 0 : nr - (-1);
 		
 		bm.element('imagemenu').innerHTML= '<a href="javascript:imagebox.zoom(\''+nr+'\');" class="zoom"><span>Zoom</span></a> <a href="javascript:imagebox.goto(\''+p+'\');" class="prev"><span>Previous</span></a> <a href="javascript:imagebox.goto(\''+n+'\');" class="next"><span>Next</span></a> '+(nr-(-1))+' | '+this.images.length;
 	}
 	
 	this.goto= function(nr)
 	{
 		bm.execute(this.images, function(e) { e.style.display= 'none'; });
 		bm.fadein(this.images[nr]);
 		this.makemenu(nr);
 	}
 	
 	this.zoom= function(nr)
 	{
 		bm.element('imagezoom').innerHTML= '<div style="background-image: '+this.images[nr].style.backgroundImage.replace('w=358', 'w=700').replace('"', '\'')+';"></div>';
 		bm.fadein(bm.element('imagezoom'));
 	}
 }
 
 imagebox= new imagebox_class();


 
