var acURL = location.href;

window.addEvent('domready', function(){

//MENU ACCORDION------------------------------//
var myAccordion = new Accordion(
'h3.navi_toggle', 
'ul.navi_element', 
{
opacity: 'false', 
alwaysHide : 'true',
start : 'all-closed',
onActive: function(toggler, element){toggler.setStyle('opacity', '0.6');},
onBackground: function(toggler, element){toggler.setStyle('opacity', '1');}
}, 
$('navi_contents'));

//default
    
	if (acURL.indexOf('artists') > 0) {
		   myAccordion.showThisHideOpen([0]);
	} 
	else if  (acURL.indexOf('exhibitions') >0) {
	   myAccordion.showThisHideOpen([1]);

	} 
	else if  (acURL.indexOf('information') > 0) {
	   myAccordion.showThisHideOpen([2]);

	} 
	else if  (acURL.indexOf('publications') > 0) {
	   myAccordion.showThisHideOpen([3]);

	} 
	else if  (acURL.indexOf('about') > 0) {
	   myAccordion.showThisHideOpen([4]);
	} else {

	}




//TIPS------------------------------//
var tips = new Tips($$('.tips_a'), {
initialize:function(){
this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 500, wait: false}).set(0);
},
onShow: function(toolTip) {
this.fx.start(0.9);
},
onHide: function(toolTip) {
this.fx.start(0);
}
});

});

//Language------------------------------//
var thisURL = location.href;

function jp() { 

var jpURL = thisURL.replace('_en.php','.php');
window.location = jpURL;

}

function en() { 

var enURL;

    if (thisURL.indexOf('.php') > 0) {
        enURL = thisURL.replace('.php','') + '_en.php';
        window.location = enURL; 
     } else {
        enURL = thisURL + 'index_en.php';
        window.location = enURL; 
     }
}

