window.onload = function() {
    //navigation visible
    document.getElementById('navi_local').style.display = 'block' ;
    
    //tooltip for projects category
    var myTips = new Tips($S('.tooltip'), { fxDuration: 400,maxOpacity: .8 });

	var acTogglers = document.getElementsByClassName('navigation_title');
	var acContents = document.getElementsByClassName('navigation_local');
	var accordion = new Fx.Accordion(acTogglers, acContents,{
        alwaysHide:true, duration: 0,
	   //Active
		onActive: function(acTogglers){
			acTogglers.setStyles({color: '#000', background: '#fff'});
		},
		//nonActive
		onBackground: function(acTogglers){
			acTogglers.setStyles({color: '#fff', background: '#000'});
		}
	});
	
	//get URL and setting onload open
    var thisURL = location.href;
    
	if (thisURL.indexOf('index') == 32 ) {
	   document.getElementById('navi_top').style.color = '#ffffff' ;
	   document.getElementById('navi_top').style.backgroundColor = '#000000' ;
	   accordion.showThisHideOpen(0);
	} 
	else if  (thisURL.indexOf('gallery') == 32 ) {
	   accordion.showThisHideOpen(1);
	} 
	else if  (thisURL.indexOf('atelier') == 32 ) {
	   accordion.showThisHideOpen(2);
	} 
	else if  (thisURL.indexOf('contact') == 32 ) {
	   accordion.showThisHideOpen(3);
	} 

    //get URL and setting active:gallery
	if (thisURL.indexOf('exhibition') == 40 ) {
	   document.getElementById('navi_exhibition').style.color = '#000' ;
	   document.getElementById('navi_exhibition').style.backgroundColor = '#fff' ;
	}
	else if (thisURL.indexOf('collection') == 40 ) {
	   document.getElementById('navi_collection').style.color = '#000' ;
	   document.getElementById('navi_collection').style.backgroundColor = '#fff' ;
	}
	else if (thisURL.indexOf('gallery_rental') == 40 ) {
	   document.getElementById('navi_gallery_rental').style.color = '#000' ;
	   document.getElementById('navi_gallery_rental').style.backgroundColor = '#fff' ;
	}

    //get URL and setting active:atelier
	if (thisURL.indexOf('member') == 40 ) {
	   document.getElementById('navi_member').style.color = '#000' ;
	   document.getElementById('navi_member').style.backgroundColor = '#fff' ;
	}
	else if (thisURL.indexOf('atelier_rental') == 40 ) {
	   document.getElementById('navi_atelier_rental').style.color = '#000' ;
	   document.getElementById('navi_atelier_rental').style.backgroundColor = '#fff' ;
	}

    //get URL and setting active:contact
	if (thisURL.indexOf('access') == 40 ) {
	   document.getElementById('navi_access').style.color = '#000' ;
	   document.getElementById('navi_access').style.backgroundColor = '#fff' ;
	}
	else if (thisURL.indexOf('newsletter') == 40 ) {
	   document.getElementById('navi_newsletter').style.color = '#000' ;
	   document.getElementById('navi_newsletter').style.backgroundColor = '#fff' ;
	}

}
