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

// fades and window slide	
	$$('.over').each(function(el){
		
	var myFx = new Fx.Style(el, 'opacity', {duration:300, wait: false});
	var myFx2 = new Fx.Style('over_'+el.id, 'opacity', {duration:300, wait: false});
	var fx = new Fx.Styles('over_'+el.id, {duration:200, wait:false});
	
	el.addEvent('mouseenter', function() {
		myFx.start(0, 1); 

		fx.start({
			'margin-top': -15
		});
		myFx2.start(0, 1);
		
		});
	el.addEvent('mouseleave', function() {
		myFx.start(1, .6);

		fx.start({
			'margin-top': -100
		});
		myFx2.start(1, 0);
		});
	});

// fades	
	$$('.fade').each(function(el){
		
	var myFx = new Fx.Style(el, 'opacity', {duration:300, wait: false});

	el.addEvent('mouseenter', function() {
		myFx.start(0, 1); 
		});
	el.addEvent('mouseleave', function() {
		myFx.start(1, .6);
		});
	});
	
// slides

	var myFx2 = new Fx.Style('sitemap', 'opacity', {duration:800, wait: false});
	var fx = new Fx.Styles('sitemap', {duration:800, wait:false});
	$('toggle').addEvent('click', function(e) {
		if(document.getElementById('sitemap_hold').style.zIndex != "50000") {
			document.getElementById('sitemap_hold').style.zIndex = '50000';
			document.getElementById('sitemap_hold').style.display = 'block';
			myFx2.start(0, .9);
			fx.start({ 'margin-top': 0 });
			} else {
			fx.start({ 'margin-top': 300 });
			myFx2.start(1, 0);
			setTimeout("document.getElementById('sitemap_hold').style.zIndex = '-10'",800);	
			}
		});
	$('toggleoff').addEvent('click', function() {
		fx.start({ 'margin-top': 300 });
		myFx2.start(1, 0);
		setTimeout("document.getElementById('sitemap_hold').style.zIndex = '-10'",800);
		});


// rounded corners
	$$('.rounded').each(function(el){

	var ela = document.createElement('div');
		ela.style.background = ' url("/img/rounded.gif") center bottom no-repeat';
		ela.style.height = '12px';
		el.appendChild(ela);
		});

// sub menu hover
	var list = $$('.sub_menu li');
	
	list.each(function(element) {
	var txt = element.innerHTML;
	//alert(txt);
	if (!txt.match(/class/g)) {
		var fx = new Fx.Styles(element, {
			duration: 200,
			wait: false
		});
		
		element.addEvent('mouseenter', function(){
			fx.start({
				'padding-left': 15,
				'background-color': '#666'
			});
		});
		
		element.addEvent('mouseleave', function(){
			fx.start({
				'padding-left': 10,
				'background-color': '#999'
			});
		});
		
		}
		
	});

	
});
