var isExtended = 0;
var height = 250;
var width = 400;
var slideDuration = 1000;
var opacityDuration = 1500;

function extendContract(){


	if(isExtended == 0){

		sideBarSlide(0, height, 0, width);

		sideBarOpacity(0, 1);

		isExtended = 1;

		// make expand tab arrow image face left (inwards)


	}
	else{

		sideBarSlide(height, 0, width, 0);

		sideBarOpacity(1, 0);

		isExtended = 0;

		// make expand tab arrow image face right (outwards)


	}

}

function sideBarSlide(fromHeight, toHeight, fromWidth, toWidth){
		var myEffects = new Fx.Styles('sideBarContents', {duration: slideDuration, transition: Fx.Transitions.linear});
		myEffects.custom({
			 'height': [fromHeight, toHeight],
			 'width': [fromWidth, toWidth]
		});
}

function sideBarOpacity(from, to){
		var myEffects = new Fx.Styles('sideBarContents', {duration: opacityDuration, transition: Fx.Transitions.linear});
		myEffects.custom({
			 'opacity': [from, to]
		});
}

function init(){


	$('sideBarTab').addEvent('click', function(){extendContract()});
}







/*LANGUAGE*/

var isExtended2 = 0;
var height2 = 450;
var width2 = 258;
var slideDuration2 = 1000;
var opacityDuration2 = 1500;

function extendContract2(){


	if(isExtended2 == 0){

		sideBarSlide2(0, height2, 0, width2);

		sideBarOpacity2(0, 1);

		isExtended2 = 1;

		// make expand tab arrow image face left (inwards)


	}
	else{

		sideBarSlide2(height2, 0, width2, 0);

		sideBarOpacity2(1, 0);

		isExtended2 = 0;

		// make expand tab arrow image face right (outwards)


	}

}

function sideBarSlide2(fromHeight, toHeight, fromWidth, toWidth){
		var myEffects = new Fx.Styles('sideBarContents2', {duration: slideDuration2, transition: Fx.Transitions.linear});
		myEffects.custom({
			 'height': [fromHeight, toHeight],
			 'width': [fromWidth, toWidth]
		});
}

function sideBarOpacity2(from, to){
		var myEffects = new Fx.Styles('sideBarContents2', {duration: opacityDuration2, transition: Fx.Transitions.linear});
		myEffects.custom({
			 'opacity': [from, to]
		});
}

function init2(){


	$('sideBarTab2').addEvent('click', function(){extendContract2()});
}






