/*
var ImageMenu = new Class({
	getOptions: function(){
		return {
			onOpen: false,
			onClose: Class.empty,
			openWidth: 200,
			transition: Fx.Transitions.quadOut,
			duration: 400,
		open: null,
			border: 0
		};
	},
	initialize: function(elements, options){
		this.setOptions(this.getOptions(), options);
this.elements = $$(elements);
this.widths = {};
		this.widths.closed = this.elements[0].getStyle('width').toInt();
		this.widths.openSelected = this.options.openWidth;
		this.widths.openOthers = Math.round(((this.widths.closed*this.elements.length) - (this.widths.openSelected+this.options.border)) / (this.elements.length-1))
this.fx = new Fx.Elements(this.elements, {wait: false, duration: this.options.duration, transition: this.options.transition});
		this.elements.each(function(el,i){
			el.addEvent('mouseenter', function(e){
			new Event(e).stop();
				this.reset(i);
			}.bind(this));
			el.addEvent('mouseleave', function(e){
				new Event(e).stop();
				this.reset(this.options.open);
			}.bind(this));
			var obj = this;
			el.addEvent('click', function(e){
				if(obj.options.onOpen){


('mylink').addEvent('click', function(e) {
	e = new Event(e).stop(); // will stop the current page going to test.html for JS enabled browsers
	// we can then get the href of 'mylink'
	// And add some other layers of functionality 
	// (eg. opening it in a popup window, retreiving it's content via an Ajax request etc)
});

					new Event(e).stop();
					if(obj.options.open == i){
						obj.options.open = null;
						obj.options.onClose(this.href, i);
					}else{
						obj.options.open = i;
						obj.options.onOpen(this.href, i);
					}
					}
				})
					}.bind(this));
		if(this.options.open){
		if($type(this.options.open) == 'number'){
				this.reset(this.options.open);
		}else{
		this.elements.each(function(el,i){
					if(el.id == this.options.open){
						this.reset(i);
				}
			},this);
		}
	}
	},
reset: function(num){
	if($type(num) == 'number'){
		var width = this.widths.openOthers;
		if(num+1 == this.elements.length){
			width += this.options.border;
		}
	}else{
	var width = this.widths.closed;
		}
	var obj = {};
	this.elements.each(function(el,i){
		var w = width;
	if(i == this.elements.length-1){
				w = width+5
	}
	obj[i] = {'width': w};
	}.bind(this));
		if($type(num) == 'number'){
		obj[num] = {'width': this.widths.openSelected};
	}
				this.fx.start(obj);
	}
	});
ImageMenu.implement(new Options);
ImageMenu.implement(new Events);
/*************************************************************/

            
/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Konstantin Jagello | http://javascript-array.com/ */

var TimeOut         = 300;
var currentLayer    = null;
var currentitem     = null;
var currentLayerNum = 0;
var noClose         = 0;
var closeTimer      = null;

function mopen(n) {
  var l  = document.getElementById("menu"+n);
  var mm = document.getElementById("mmenu"+n);
	
  if(l) {
    mcancelclosetime();
    l.style.visibility='visible';
    if(currentLayer && (currentLayerNum != n))
      currentLayer.style.visibility='hidden';
    currentLayer = l;
    currentitem = mm;
    currentLayerNum = n;			
  } else if(currentLayer) {
    currentLayer.style.visibility='hidden';
    currentLayerNum = 0;
    currentitem = null;
    currentLayer = null;
 	}
}

function mclosetime() {
  closeTimer = window.setTimeout(mclose, TimeOut);
}

function mcancelclosetime() {
  if(closeTimer) {
    window.clearTimeout(closeTimer);
    closeTimer = null;
  }
}

function mclose() {
  if(currentLayer && noClose!=1)   {
    currentLayer.style.visibility='hidden';
    currentLayerNum = 0;
    currentLayer = null;
    currentitem = null;
  } else {
    noClose = 0;
  }
  currentLayer = null;
  currentitem = null;
}

document.onclick = mclose; 

img = new Array("../imagecl/tab1.gif","../imagecl/tav1.gif","../imagecl/tab2.gif","../imagecl/tav2.gif",../imagecl/tab3.gif","../imagecl/tav3.gif","../imagecl/tab4.gif","../imagecl/tav4.gif",
"../imagecl/west.jpg","../imagecl/west2.jpg","../imagecl/east.jpg","../imagecl/east2.jpg",
"../imagecl/smn1.gif","../imagecl/smn2.gif,"../imagecl/smn3.gif","../imagecl/smn4.gif","../imagecl/smn5.gif","../imagecl/smn6.gif","../imagecl/smn7.gif","../imagecl/smn8.gif",
"../imagecl/smn11.gif","../imagecl/smn21.gif","../imagecl/smn31.gif","../imagecl/smn41.gif","../imagecl/smn51.gif","../imagecl/smn61.gif","../imagecl/smn71.gif","../imagecl/smn81.gif",
"../imagecl/omiyabn1.gif","../imagecl/100bn1.gif","../imagecl/sekkubn1.gif","../imagecl/birthbn1.gif","../imagecl/entbn1.gif","../imagecl/753bn1.gif","../imagecl/cerbn1.gif","../imagecl/mn8.gif","../imagecl/mn9.gif",
"../imagecl/omiyabn2.gif","../imagecl/100bn2.gif","../imagecl/sekkubn2.gif","../imagecl/birthbn2.gif","../imagecl/entbn2.gif","../imagecl/753bn2.gif","../imagecl/cerbn2.gif","../imagecl/mn81.gif","../imagecl/mn91.gif",
"../imagecl/cam1.gif","../imagecl/cam2.gif","../imagecl/cam3.gif","../imagecl/cam4.gif","../imagecl/cam5.gif","../imagecl/cam6.gif",
"../imagecl/can1.gif","../imagecl/can2.gif","../imagecl/can3.gif","../imagecl/can4.gif","../imagecl/can5.gif","../imagecl/can6.gif",
"../imagecl/lista1.gif","../imagecl/lista2.gif","../imagecl/listb1.gif","../imagecl/listb2.gif","../imagecl/listc1.gif","../imagecl/listc2.gif",
"../imagecl/listd1.gif","../imagecl/listd2.gif","../imagecl/liste1.gif","../imagecl/liste2.gif","../imagecl/listf1.gif","../imagecl/listf2.gif",
"../imagecl/m1a1.gif","../imagecl/m1b1.gif","../imagecl/m1c1.gif","../imagecl/m1d1.gif",
"../imagecl/m1a2.gif","../imagecl/m1b2.gif","../imagecl/m1c2.gif","../imagecl/m1d2.gif",
"../imagecl/k-pricebn.gif","../imagecl/k-gallerybn.gif","../imagecl/k-presentbn.gif",
"../imagecl/k2-pricebn.gif","../imagecl/k2-gallerybn.gif","../imagecl/k2-presentbn.gif",
"../imagecl/1cointopbn_02.jpg","../imagecl/1cointopbn_03.jpg","../imagecl/1cointopbn_04.jpg","../imagecl/1cointopbn_05.jpg",
"../imagecl/1cointopbn2_02.jpg","../imagecl/1cointopbn2_03.jpg","../imagecl/1cointopbn2_04.jpg","../imagecl/1cointopbn2_05.jpg",);
bfImg = new Array();
for(i=0; i<img.length; i++) {
  bfImg[i] = new Image();
  bfImg[i].src = img[i];
}
