// JavaScript Document


function member_slide(slider,slidee)
{
		var slidex = new Fx.Slide(slider, {
        duration: 1500,
        transition: Fx.Transitions.Bounce.easeOut
});

	
	$(slidee).addEvent('click', function(e){
		e = new Event(e);
		slidex.toggle();
		e.stop();
	});
}





function hovernav(hoverer,hoveree,alignment)
{
	$(hoverer).addEvents({
		'mouseover': function(){
			$(hoveree).setStyle('background', 'url(images/nav-' + alignment + '-selected.gif) no-repeat');
		},
		'mouseout': function(){
			$(hoveree).setStyle('background', 'url(images/nav-' + alignment + '.gif) no-repeat');
		}
	});
}

function show_nav(menunav,subnav)
{
	$(subnav).fade('hide');
	
	$(menunav).addEvents({
		'mouseover': function(){
			$(subnav).setStyle('display', 'inline');
			$(subnav).fade('in');
		},
		'mouseout': function(){
			$(subnav).setStyle('display', 'none');	
			$(subnav).fade('out');
		}
	});

}

function hover_button(subtype,button)
{

	
	$(button).addEvents({
		'mouseover': function(){
			$(button).setStyle('background-color', '#ededed');
		},
		'mouseout': function(){
			$(button).setStyle('background', '#ffffff');
		}
	});

}


window.addEvent('domready', function(){
									 
if ($("credit_card")) {
	$('credit_card').addEvent('click', function(e) {
			$('cc-form').setStyle('display', 'block');
			$('paypal-form').setStyle('display', 'none');
	});
	
	$('paypal').addEvent('click', function(e) {
			$('paypal-form').setStyle('display', 'block');							   
			$('cc-form').setStyle('display', 'none');
	});
}

	if ($("month1")) { 
		if ($("month2")) { 
			$("month2").slide('hide');
		}
		if ($("month3")) {
			$("month3").slide('hide');
		}
		if ($("month4")) {
			$("month4").slide('hide');
		}
		
		member_slide('month1','collapse-month-1');
		
		if ($("month2")) { 
			member_slide('month2','collapse-month-2');
		}
		
		if ($("month2-active")) { 
			member_slide('month2-active','collapse-month-2');
		}
		if ($("month3")) { 
			member_slide('month3','collapse-month-3');
		}
		if ($("month3-active")) { 
			member_slide('month3-active','collapse-month-3');
		}
		if ($("month4")) { 
			member_slide('month4','collapse-month-4');
		}
		if ($("month4-active")) { 
			member_slide('month4-active','collapse-month-4');
		}

	}
	

	
	hovernav('end1','end11','right');
	hovernav('start1','start11','left');
	hovernav('end2','end21','right');
	//hovernav('start2','start21','left');
	//hovernav('end3','end31','right');
	
	if ($("log")) { 
	show_nav('log','subnav1');
	}
	//hover_button('custom-logo-design', 'sub-top');
						 
});