var isExtended1 = 0;
var height1 = 450;
var width1 = 255;
var slideDuration1 = 1000;
var opacityDuration1 = 1500;

function extendContract1(){
	
	if(isExtended1 == 0){
		
		sideBarSlide1(0, height1, 0, width1);
		
		sideBarOpacity1(0, 1);
	
		isExtended1 = 1;
		
		// make expand tab arrow image face left (inwards)
		$('sideBarTab1').childNodes[0].src = $('sideBarTab1').childNodes[0].src.replace(/(\.[^.]+)$/, '-active$1');
		document.getElementById('sideBarContents1').style.display='block';
		hidenews();
		
	}
	else{
		
		sideBarSlide1(height1, 0, width1, 0);
		
		sideBarOpacity1(1, 0);
		
		isExtended1 = 0;
		
		// make expand tab arrow image face right (outwards)
		
		$('sideBarTab1').childNodes[0].src = $('sideBarTab1').childNodes[0].src.replace(/-active(\.[^.]+)$/, '$1');
		document.getElementById('sideBarContents1').style.display='block';
		showboth();
	}

}

function sideBarSlide1(fromHeight1, toHeight1, fromWidth1, toWidth1){
		var myEffects = new Fx.Styles('sideBarContents1', {duration: slideDuration1, transition: Fx.Transitions.linear});
		myEffects.custom({
			 'height': [fromHeight1, toHeight1],
			 'width': [fromWidth1, toWidth1]
		});
}

function sideBarOpacity1(from1, to1){
		var myEffects = new Fx.Styles('sideBarContents1', {duration: opacityDuration1, transition: Fx.Transitions.linear});
		myEffects.custom({
			 'opacity': [from1, to1]
		});
}

function init1(){
	$('sideBarTab1').addEvent('click', function(){extendContract1()});
}

window.addEvent('load', function(){init1()});
function hidenews(){
	document.getElementById('sideBarContents').style.display='none';
	document.getElementById('sideBar').style.display='none';
	}
function showboth(){
	document.getElementById('sideBarContents').style.display='none';
	document.getElementById('sideBarContents1').style.display='none';
	document.getElementById('sideBar').style.display='block';
	document.getElementById('sideBar1').style.display='block';
	}
