var isExtended = 0;
var height = 230;
var width = 190;
var slideDuration = 500;
var opacityDuration = 700;
function extendContract(){
if(isExtended == 0){
logBarSlide(230, height, 0, width);
logBarOpacity(0, 0.9);
isExtended = 1;
// make expand tab arrow image face left (inwards)
$('logBarTab').childNodes[0].src = $('logBarTab').childNodes[0].src.replace(/(\.[^.]+)$/, '-active$1');
}
else{
logBarSlide(height, 230, width, 0);
logBarOpacity(1, 0);
isExtended = 0;
// make expand tab arrow image face right (outwards)
$('logBarTab').childNodes[0].src = $('logBarTab').childNodes[0].src.replace(/-active(\.[^.]+)$/, '$1');
}
}
function logBarSlide(fromHeight, toHeight, fromWidth, toWidth){
var myEffects = new Fx.Styles('logBarContents', {duration: slideDuration, transition: Fx.Transitions.linear});
myEffects.custom({
'height': [fromHeight, toHeight],
'width': [fromWidth, toWidth]
});
}
function logBarOpacity(from, to){
var myEffects = new Fx.Styles('logBarContents', {duration: opacityDuration, transition: Fx.Transitions.linear});
myEffects.custom({
'opacity': [from, to]
});
}
function init(){
$('logBarTab').addEvent('click', function(){extendContract()});
}
window.addEvent('load', function(){init()});
