// JavaScript Document
Event.observe(window, 'load', initWraps, false);

function initWraps(event){
	// code for browser
	// var wraps = $$('div.sel_wrap'); var titleA = $$('#'+wraps[1].id +' .sel_unit a').first(); var other = $$('#'+wraps[1].id +' .sel_more').first(); if (other!=null) var otherA = $$('#'+other.id + ' div a'); 
	var current;
	var wraps = $$('div.sel_wrap');
	wraps.each(function(element){
		var titleA = $$('#'+element.id +' .sel_unit a').first();
		var other = $$('#'+element.id +' .sel_more').first(); 
		
		if (other!=null)
		{
			var otherA = $$('#'+other.id + ' div a');
			
			otherA.each(function(hlink){
				if((document.URL == hlink.href) || (document.URL == hlink.href+'#'))
				{
					other.setStyle({'display': 'block'});
					hlink.setStyle({'color': '#FF8F34'});
					titleA.setStyle({'color': '#FF8F34'});
					current = other;
				}
				Event.observe(hlink, 'mouseover',function(){
					hlink.setStyle({'color': '#FF8F34'});
				});
				Event.observe(hlink, 'mouseout',function(){
					if(!(document.URL == hlink.href) && !(document.URL == hlink.href+'#'))
					{									 
						hlink.setStyle({'color': '#000000'}); // #006600
					}
				}); 
			});

			titleA.observe('click',function(){
				if(current==null || current==other)
					new Effect.toggle(other, 'blind');
				else {
					new Effect.BlindUp(current);
					new Effect.BlindDown(other);
				}
				current = other;
			});
			//#navbar .sel_more a:active {color:#FF8F34}
			
		}
		else{
			if((document.URL == titleA.href) || (document.URL == titleA.href+'#'))
			{
				titleA.setStyle({'color': '#FF8F34'});
			}
			
		}
	});
}

