var isExtended1 = 0;
var height1 = 460;
var width1 = 170;
var slideDuration1 = 1000;
var opacityDuration1 =100;

function extendContract1(){
	
	if(isExtended1 == 0){
		
		sideBarSlide1(460, height1, 0, width1);
		
	//	alert("First Menu :" + isExtended + "   Second Menu :" + isExtended1)
	//	    alert('First Menu ' + height + ' , ' + width)
		if(isExtended == 1)
		{
		    extendContract();
		}
		
		sideBarOpacity1(0, 1);
	
		isExtended1 = 1;
		
		// make expand tab arrow image face left (inwards)
		$('sideBarTab1').childNodes[0].src = $('sideBarTab1').childNodes[0].src.replace(/(\.[^.]+)$/, '-active$1');
		
	}
	else{
		
		sideBarSlide1(height1, 460, 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');
	}

}

function sideBarSlide1(fromHeight, toHeight, fromWidth, toWidth){
		var myEffects = new Fx.Styles('sideBarContents1', {duration: slideDuration1, transition: Fx.Transitions.linear});
		myEffects.custom({
			 'height': [fromHeight, toHeight],
			 'width': [fromWidth, toWidth]
		});
}

function sideBarOpacity1(from, to){
		var myEffects = new Fx.Styles('sideBarContents1', {duration: opacityDuration1, transition: Fx.Transitions.linear});
		myEffects.custom({
			 'opacity': [from, to]
		});
}

//function init(){
//	$('sideBarTab').addEvent('click', function(){extendContract()});
//}

//window.addEvent('load', function(){init()});